/* css/main.css — Orion Emargement — Design "Atelier" */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  /* — Palette chaleureuse — */
  --olive-clair: #8B9A6B;
  --olive-soutenu: #5a6e3a;
  --indigo-clair: #6C7BD4;
  --indigo-soutenu: #4255B7;
  --orange: #E8891A;
  --rouge-terre: #C05A3A;
  --ambre: #D4A24C;
  --foret: #2E5E4E;

  /* — Surfaces — */
  --bg: #F7F3EE;
  --bg-warm: #F2EDE5;
  --surface: #FFFFFF;
  --surface-warm: #FFFCF8;
  --text: #2C2C2C;
  --text-light: #757575;
  --text-muted: #A0998F;
  --border: #E3DDD4;
  --border-light: #EDE8E0;

  /* — Etats — */
  --valid-bg: #E6F2E1;
  --valid-border: #5DAE54;
  --danger: #D43B34;
  --danger-light: #FFF0EF;
  --danger-subtle: #FFD9D7;

  /* — Design tokens — */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(44,44,44,0.06);
  --shadow-md: 0 4px 12px rgba(44,44,44,0.08);
  --shadow-lg: 0 8px 30px rgba(44,44,44,0.12);
  --shadow-glow: 0 2px 12px rgba(66,85,183,0.15);

  /* — Typo — */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* — Transitions — */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  /* Degrade leger violet → orange */
  background: linear-gradient(160deg, #EDE7F6 0%, var(--bg) 35%, var(--bg) 65%, #FFF3E0 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ═══════════════ HEADER ═══════════════ */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-warm) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(44,44,44,0.04);
}

.header-left { display: flex; align-items: center; gap: 0.6rem; }
.logo { height: 36px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08)); }
.app-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--foret);
  letter-spacing: -0.01em;
}

#app-nav { display: flex; gap: 0.25rem; }
#app-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s var(--ease-out);
}
#app-nav a:hover {
  background: var(--bg-warm);
  color: var(--text);
}
#app-nav a.active {
  background: var(--indigo-soutenu);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* ═══════════════ BUTTONS ═══════════════ */

.btn {
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo-soutenu) 0%, var(--indigo-clair) 100%);
  color: white;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-light);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--indigo-clair); color: var(--indigo-soutenu); }
.btn-success {
  background: linear-gradient(135deg, var(--olive-soutenu) 0%, var(--olive-clair) 100%);
  color: white;
}
.btn-danger { background: var(--danger); color: white; }

/* ═══════════════ VIEW ═══════════════ */

.view { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }

/* ═══════════════ TOAST ═══════════════ */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  animation: toastSlide 0.4s var(--ease-spring);
}
@keyframes toastSlide {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.toast-info { background: var(--indigo-soutenu); }
.toast-success { background: var(--valid-border); }
.toast-error { background: var(--danger); }

/* ═══════════════ CARD ═══════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-out);
}

/* ═══════════════ LOGIN ═══════════════ */

.login-box {
  max-width: 380px;
  margin: 5rem auto;
  text-align: center;
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.login-logo { height: 64px; margin-bottom: 1.25rem; }
.login-box h1 {
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--foret);
}
.form-group { margin-bottom: 1.1rem; text-align: left; }
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface-warm);
  transition: all 0.2s var(--ease-out);
}
.form-group input:focus {
  outline: none;
  border-color: var(--indigo-clair);
  box-shadow: 0 0 0 3px rgba(108,123,212,0.15);
  background: var(--surface);
}
.btn-block { width: 100%; margin-top: 0.5rem; }
.error-text { color: var(--danger); font-size: 0.8rem; margin-top: 0.75rem; font-weight: 500; }

/* ═══════════════ SELECTION PARCOURS ═══════════════ */

/* — Header selection — */
.selection-header {
  margin-bottom: 1.25rem;
}
.selection-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.selection-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--foret);
}
.selection-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-warm);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* — Recherche — */
.selection-search-wrap {
  position: relative;
  max-width: 480px;
}
.selection-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.4;
  pointer-events: none;
}
.selection-search {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
  transition: all 0.25s var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.selection-search:focus {
  outline: none;
  border-color: var(--indigo-clair);
  box-shadow: 0 0 0 3px rgba(108,123,212,0.12), var(--shadow-sm);
}
.selection-search::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
.selection-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.selection-search-clear:hover {
  background: var(--text-muted);
  color: white;
}

/* — Info filtre — */
.selection-filter-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* — Etat vide — */
.selection-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.selection-empty p { font-size: 0.95rem; }

/* — Grille parcours — */
.parcours-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.85rem;
}

/* — Carte parcours — */
.parcours-card {
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  border-left: 5px solid var(--olive-clair);
  padding: 1rem 1.15rem !important;
}
.parcours-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.parcours-card.status-actif { border-left-color: var(--olive-clair); }
.parcours-card.status-actif:hover { border-left-color: var(--olive-soutenu); }
.parcours-card.status-termine { border-left-color: var(--text-muted); }
.parcours-card.status-avenir { border-left-color: var(--indigo-clair); }

.parcours-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.parcours-card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--text);
}
.parcours-card-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status-actif .parcours-card-status {
  background: var(--valid-bg);
  color: var(--valid-border);
}
.status-termine .parcours-card-status {
  background: var(--bg-warm);
  color: var(--text-muted);
}
.status-avenir .parcours-card-status {
  background: #e8eaf6;
  color: var(--indigo-soutenu);
}

.parcours-card-poste {
  color: var(--text-light);
  font-size: 0.82rem;
  margin-top: 0.2rem;
  font-style: italic;
}

.parcours-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.65rem;
}
.parcours-detail {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.detail-icon {
  font-size: 0.82rem;
  opacity: 0.6;
}
.parcours-heures strong {
  font-weight: 700;
}
.heures-vide {
  color: var(--orange);
}
.heures-vide strong {
  color: var(--orange);
  opacity: 0.85;
}

/* ═══════════════ GRILLE SAISIE ═══════════════ */

.grille-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.grille-info {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--foret);
  margin-bottom: 0.75rem;
}
.grille-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.grille-nav .btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}
.grille-semaine {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.35rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

/* — Wrapper table — */
.grille-table-wrapper {
  overflow-x: auto;
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  background: var(--surface);
}

/* — Table — */
.grille-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}
.grille-table th, .grille-table td {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0.45rem;
  text-align: center;
  vertical-align: middle;
}
.grille-table th:last-child, .grille-table td:last-child { border-right: none; }
.grille-table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.grille-table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }

.grille-table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
}

/* — Colonne Module — */
.col-module {
  text-align: left;
  font-weight: 600;
  min-width: 150px;
  font-size: 0.82rem;
  padding-left: 12px !important;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* — Colonne Demi-journee — */
.col-dj {
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 36px;
  width: 36px;
}
.dj-icon { font-size: 0.85rem; opacity: 0.6; }

/* — En-tetes jours — */
.col-jour {
  min-width: 72px;
  background: linear-gradient(180deg, #EBF0FA 0%, #E1E7F6 100%) !important;
  color: var(--indigo-soutenu);
  padding: 0.5rem 0.3rem !important;
  position: relative;
}
.col-jour .jour-nom {
  font-weight: 700;
  font-size: 0.82rem;
  display: block;
  letter-spacing: 0.02em;
}
.col-jour .jour-num {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--indigo-clair);
  display: block;
  margin-top: 1px;
}

/* — Bande couleur module — */
.module-color-bar {
  border-left: 5px solid var(--module-color) !important;
  position: relative;
}

/* — Zebrures modules — */
.grille-table tbody tr.module-pair td {
  background: var(--bg-warm);
}
.grille-table tbody tr.module-pair td.cellule.validated {
  background: #d6eccc;
}

/* — Separation matin/aprem — */
.grille-table tbody tr.row-aprem td {
  border-top: 1.5px dashed var(--border);
}

/* — Bordures jours — */
.grille-table th.col-jour { border-left: 1.5px solid #C8D0E8; }
.grille-table td.cellule { border-left: 1.5px solid var(--border-light); }

/* ═══════════════ CELLULE COMPACTE ═══════════════ */

.cellule {
  padding: 5px !important;
  cursor: pointer;
  position: relative;
  height: 42px;
  min-width: 64px;
  transition: all 0.2s var(--ease-out);
}
.cellule:hover:not(.validated):not([data-readonly]) {
  background: rgba(108,123,212,0.06);
}
.cellule:hover:not(.validated):not([data-readonly])::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  color: var(--indigo-clair);
  opacity: 0.4;
  font-weight: 300;
  pointer-events: none;
}
/* Cacher le + quand il y a deja une valeur */
.cellule:has(.cell-value):hover::after { display: none; }

.cellule.validated {
  background: var(--valid-bg);
  cursor: default;
}
.cellule.validated::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: var(--valid-border);
  border-radius: 50%;
  opacity: 0.5;
}

.cellule.depassement {
  background: var(--danger-light) !important;
}
.grille-table tbody tr.module-pair td.cellule.depassement {
  background: var(--danger-subtle) !important;
}

/* — Valeur affichee (pastille) — */
.cell-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: var(--pastille-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease-spring);
  animation: pastillePop 0.25s var(--ease-spring);
}
@keyframes pastillePop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.cellule:hover .cell-value { transform: scale(1.08); }

/* — Indicateur AFEST — */
.cell-afest {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.5rem;
  font-weight: 800;
  color: #2e7d32;
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ═══════════════ POPOVER ═══════════════ */

.popover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  background: rgba(44,44,44,0.05);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.popover {
  position: absolute;
  z-index: 501;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 32px rgba(44,44,44,0.16),
    0 2px 8px rgba(44,44,44,0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
  padding: 12px;
  min-width: 180px;
  border: 1px solid rgba(255,255,255,0.6);
  animation: popoverIn 0.3s var(--ease-spring);
}

@keyframes popoverIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popover-arrow {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 7px;
  overflow: hidden;
}
.popover-arrow::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.6);
  transform: rotate(45deg) translate(2px, 2px);
  box-shadow: -1px -1px 3px rgba(44,44,44,0.06);
}

/* — Grille pastilles popover — */
.popover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.popover-pastille {
  padding: 8px 4px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-warm);
  transition: all 0.2s var(--ease-out);
  position: relative;
}
.popover-pastille:hover {
  color: white;
  background: var(--pastille-bg);
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  border-color: transparent;
}
.popover-pastille.active {
  color: white;
  background: var(--pastille-bg);
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.02);
}
.popover-pastille.active::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* — AFEST toggle — */
.popover-afest {
  display: block;
  width: 100%;
  padding: 6px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.popover-afest:hover {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}
.popover-afest.active {
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
  color: #1b5e20;
  border-color: #81c784;
  box-shadow: 0 2px 6px rgba(46,125,50,0.15);
}

/* — Footer popover (AFEST + Effacer) — */
.popover-footer {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.popover-footer .popover-afest {
  flex: 1;
}

/* — Bouton Effacer — */
.popover-effacer {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.popover-effacer:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* — Avertissement depassement — */
.popover-warning {
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  color: #e65100;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ═══════════════ TOTAUX ═══════════════ */

.totaux-row td {
  font-weight: 700;
  background: var(--bg-warm) !important;
  color: var(--text);
  font-size: 0.82rem;
  border-top: 2px solid var(--border) !important;
}
.total-jour { font-size: 0.85rem; }

/* ═══════════════ ACTIONS ═══════════════ */

.grille-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ═══════════════ RECAP CUMUL — BADGES ═══════════════ */

.grille-cumul {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  transition: transform 0.15s var(--ease-out);
}
.module-badge:hover { transform: translateY(-1px); }

.module-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.module-badge-total { font-weight: 700; color: var(--text); }

.cumul-total {
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--foret);
  font-family: var(--font-display);
}

.cumul-progress {
  width: 140px;
  height: 10px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.cumul-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--olive-clair), var(--olive-soutenu));
  border-radius: var(--radius-pill);
  transition: width 0.5s var(--ease-out);
  position: relative;
}
.cumul-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: var(--radius-pill);
}

/* — Totaux modules en bas de grille — */
.totaux-modules td { padding: 10px !important; }
.totaux-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.totaux-grand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: 10px;
  color: var(--foret);
}

/* ═══════════════ RESPONSIVE ═══════════════ */

@media (max-width: 768px) {
  header { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.75rem; }
  #app-nav { order: 3; width: 100%; justify-content: center; gap: 0.15rem; }
  #app-nav a { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
  .view { padding: 0.6rem; }
  .grille-info { font-size: 1rem; }
  .grille-nav { flex-wrap: wrap; }
  .col-module { min-width: 90px; font-size: 0.72rem; }
  .col-jour { min-width: 56px; }
  .cellule { min-width: 52px; height: 36px; }
  .cellule:hover::after { display: none; }
  .cell-value { font-size: 0.65rem; padding: 3px 8px; }
  .popover { min-width: 160px; }
  .grille-cumul { padding: 0.75rem; }
  .cumul-total { margin-left: 0; width: 100%; justify-content: center; margin-top: 0.5rem; }
}

/* ═══════════════ TABS ═══════════════ */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.tab {
  padding: 0.55rem 1.15rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--indigo-soutenu);
  border-bottom-color: var(--indigo-soutenu);
  font-weight: 600;
}

/* ═══════════════ IMPORT ZONES ═══════════════ */

.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  transition: all 0.25s var(--ease-out);
  background: var(--surface-warm);
}
.import-zone.drag-over {
  border-color: var(--indigo-clair);
  background: rgba(108,123,212,0.05);
  transform: scale(1.005);
}
.import-zone p { margin: 0.5rem 0; color: var(--text-light); }

/* ═══════════════ SIGNATURE ═══════════════ */

.signature-recap {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.signature-recap th, .signature-recap td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
  font-size: 0.85rem;
}
.signature-recap th { background: var(--bg-warm); font-weight: 600; }
.signature-zones { display: flex; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.signature-zone { flex: 1; min-width: 250px; }
.signature-zone h3 {
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}
.signature-zone canvas {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
  background: var(--surface-warm);
}
.btn-sm { font-size: 0.72rem; padding: 0.25rem 0.5rem; margin-top: 0.25rem; border-radius: var(--radius-sm); }
.signature-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ═══════════════ RECAP ═══════════════ */

.recap-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.recap-nav { display: flex; align-items: center; gap: 0.75rem; }
.recap-mois {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--foret);
}
.recap-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.recap-table th, .recap-table td {
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
}
.recap-table th { background: var(--bg-warm); font-weight: 600; }
.recap-jour { text-align: left; font-weight: 500; }
.recap-dj { font-size: 0.75rem; color: var(--text-muted); }
.recap-total { font-weight: 700; color: var(--foret); }
