/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #1f2937;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* === LAYOUT GLOBAL === */
body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: 300px;
    background: #111827;
    color: #f3f4f6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 10px;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

/* === MAIN CONTENT === */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    overflow-y: auto;
    margin-left: 300px;
    width: calc(100% - 300px);
}

/* === LOGO === */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 600;
    color: #f9fafb;
}

/* === NAVIGATION === */
.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: #e5e7eb;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #2563eb;
    color: white;
}

/* === FOOTER (USER) === */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-footer .user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #2563eb;
}

.sidebar-footer .user-info strong {
    display: block;
    font-size: 0.95rem;
}

.sidebar-footer .user-info small {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* === BOUTON DÉCONNEXION === */
.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #dc2626;
}

/* === BOUTONS GÉNÉRAUX === */
.btn-primary {
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* === CARTES === */
.card, .dashboard-card, .planning-wrapper, .project-column {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.project-column {

    max-width: 1340px;

}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: #4b5563;
}

/* === CALENDRIER === */
.calendar-container {
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.calendar-header h1 {
    font-size: 1.8rem;
}

.calendar-header p {
    color: #6b7280;
    margin-top: 4px;
}

/* === PLANNING === */
.planning-week-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.week-nav {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #374151;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.week-nav:hover {
    color: #2563eb;
    background: #f3f4f6;
    transform: scale(1.1);
}

/* === GRILLE PLANNING === */
.planning-grid {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
}

.time-column {
    width: 70px;
    border-right: 1px solid #e5e7eb;
    text-align: right;
    padding-right: 10px;
}

.time-slot {
    height: 30px;
    font-size: 0.8rem;
    color: #6b7280;
}

.time-slot.half {
    border-bottom: 1px dashed #e5e7eb;
}

.day-column {
    border-right: 1px solid #f3f4f6;
    position: relative;
    height: 1050px;
}

.event {
    position: absolute;
    left: 8px;
    right: 8px;
    background: #f9fafb;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.event strong { color: #111827; }
.event small { color: #6b7280; font-size: 0.75rem; }

.event.blue { border-color: #2563eb; }
.event.green { border-color: #16a34a; }
.event.orange { border-color: #f97316; }

/* === TASKS BOARD === */
.tasks-board {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.project-column {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tasks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.task-card {
    width: 250px;
    height: 125px;
    background: #f9fafb;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.task-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

.task-card.add-task {
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    color: #6b7280;
    cursor: pointer;
}

.task-card.add-task:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: scale(1.03);
}

.task-card.green { border-color: #16a34a; }
.task-card.orange { border-color: #f97316; }
.task-card.red { border-color: #dc2626; }

/* === DASHBOARD === */
.dashboard-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 140px);
}

.dashboard-left {
    flex: 1;
}

.dashboard-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.daily-events {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.event-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.event-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.event-card.orange::before { background: #f97316; }
.event-card.green::before { background: #16a34a; }
.event-card.red::before { background: #dc2626; }

.event-card strong {
    display: block;
    color: #111827;
    font-weight: 600;
    margin-bottom: 2px;
}

.event-card small { color: #6b7280; }

/* === DONNÉES CLÉS === */
.key-metrics {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-metrics li {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.key-metrics span {
    color: #6b7280;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* === CALENDRIER MENSUEL === */
.calendar-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 20px;
}

.calendar-month {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-month h2 {
    font-size: 1.2rem;
    color: #111827;
}

.month-nav {
    background: none;
    border: none;
    color: #374151;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.month-nav:hover {
    background: #f3f4f6;
    color: #2563eb;
    transform: scale(1.1);
}

/* Grille des jours */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

/* En-têtes jours */
.day-name {
  text-align: center;
  font-weight: 600;
  color: #374151;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 6px 6px 0 0;
}

/* Case de jour */
.day-box {
  min-height: 145px; /* un peu plus haut pour lisibilité */
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
  font-size: 0.9rem;
  overflow: hidden; /* évite que le contenu déborde */
  transition: all 0.2s ease;
}

.day-box:hover {
  background: #f9fafb;
  transform: scale(1.02);
}

.day-box.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb33;
}

.day-box span {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Événements */
.event-badge {
  background: #f9fafb;
  border-left: 4px solid;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.75rem;
  color: #111827;
  margin-top: 20px;
  margin-bottom: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Couleurs */
.event-badge.green { border-color: #16a34a; }
.event-badge.orange { border-color: #f97316; }
.event-badge.red { border-color: #dc2626; }

/* Lien “+X autres” */
.more-events {
  font-size: 0.75rem;
  color: #2563eb;
  margin-top: auto;
  text-align: center;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 2px 0;
}

/* === PLANNING HEBDOMADAIRE === */
.planning-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 20px;
}

.planning-week-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.planning-week-nav h2 {
    font-size: 1.1rem;
    color: #111827;
}

.week-nav {
    background: none;
    border: none;
    color: #374151;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.week-nav:hover {
    background: #f3f4f6;
    color: #2563eb;
    transform: scale(1.1);
}

/* Grille principale */
.planning-grid {
    display: flex;
    overflow-x: auto;
    border-top: 1px solid #e5e7eb;
}

/* Colonne heures */
.time-column {
    width: 80px;
    border-right: 1px solid #e5e7eb;
    text-align: right;
    padding-right: 10px;
}

.time-slot {
    height: 30px;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 30px;
}

.time-slot.half {
    border-bottom: 1px dashed #e5e7eb;
}

/* Grille jours */
.days-grid {
    flex: 1;
    overflow: hidden;
}

.days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.day-header {
    text-align: center;
    font-weight: 600;
    padding: 8px 0;
    color: #374151;
}

.days-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative;
    height: 1050px; /* 05:00 → 22:00 */
}

.day-column {
    border-right: 1px solid #f3f4f6;
    position: relative;
}

/* Événements */
.event {
    position: absolute;
    left: 8px;
    right: 8px;
    background: #f9fafb;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.event strong {
    display: block;
    color: #111827;
    font-weight: 600;
}

.event small {
    color: #6b7280;
    font-size: 0.75rem;
}

.event.blue { border-color: #2563eb; }
.event.green { border-color: #16a34a; }
.event.orange { border-color: #f97316; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-content label {
  font-weight: 600;
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancel {
  background: #e5e7eb;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* === MODAL ÉVÉNEMENT === */
.event-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-form label {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.event-form input[type="text"],
.event-form input[type="datetime-local"],
.event-form input[type="date"],
.event-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 0.9rem;
  color: #111827;
  transition: border-color 0.2s ease;
}

.event-form input:focus {
  border-color: #2563eb;
  outline: none;
  background: #fff;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker-wrapper input[type="color"] {
  width: 60px;
  height: 34px;
  border: none;
  cursor: pointer;
  background: none;
}

.color-preview {
  display: inline-block;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  pointer-events: none;
}

/* === FIX alignement "Événement récurrent" === */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 500;
  color: #1f2937;
}

.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb; /* pour que la case ait la couleur principale */
  cursor: pointer;
}


.weekdays-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.weekdays-select label {
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

.weekdays-select label:hover {
  background: #2563eb;
  color: white;
}

.weekdays-select input {
  margin-right: 4px;
}
