
:root {
  --bg:          #f7f5f0;
  --bg-2:        #eeebe3;
  --surface:     #ffffff;
  --border:      #ddd8cc;
  --border-2:    #e8e4da;
  --text:        #1c1a15;
  --text-2:      #4a4540;
  --muted:       #8a8075;
  --marine:      #1b4f72;
  --marine-2:    #2980b9;
  --marine-soft: #e8f1f8;
  --emerald:     #1a6b4a;
  --emerald-soft:#e4f4ed;
  --amber:       #b45309;
  --amber-soft:  #fef3c7;
  --danger:      #b91c1c;
  --danger-soft: #fde8e8;
  --slate:       #475569;
  --sans:        'DM Sans', sans-serif;
  --serif:       'Fraunces', serif;
  --mono:        'DM Mono', monospace;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08);
  --radius:      10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.env-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.env-prod {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.env-dev {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.env-local {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}

.env-test-prod {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── LAYOUT ── */
.shell {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  grid-column: 1 / -1;
  background: var(--marine);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.brand-logo {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -.01em;
}

.brand-sep { color: rgba(255,255,255,.3); margin: 0 4px; }

.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  font-weight: 300;
}

.topbar-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,.6);
  font-family: var(--mono);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.topbar-time {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,255,255,.5);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.user-name {
  font-size: 12px;
  color: rgba(255,255,255,.75);
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-section {
  padding: 10px 14px 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .1s;
  cursor: pointer;
}

.nav-link:hover { background: var(--bg-2); color: var(--text); }

.nav-link.active {
  background: var(--marine-soft);
  border-left-color: var(--marine);
  color: var(--marine);
  font-weight: 500;
}

.nav-ico { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
}

.badge-red    { background: var(--danger-soft);  color: var(--danger);  }
.badge-amber  { background: var(--amber-soft);   color: var(--amber);   }
.badge-green  { background: var(--emerald-soft); color: var(--emerald); }
.badge-marine { background: var(--marine-soft);  color: var(--marine);  }

/* ── MAIN ── */
.main {
  background: var(--bg);
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.page-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.tab {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all .12s;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--marine);
  color: #fff;
}

.btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
  transition: all .12s;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}

.btn:hover { border-color: var(--marine); color: var(--marine); }
.btn.primary { background: var(--marine); color: #fff; border-color: var(--marine); }
.btn.primary:hover { background: #1a4570; }

/* ── KPI STRIP ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}

.kpi:hover { box-shadow: var(--shadow-md); }

.kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-value span { font-size: 14px; color: var(--muted); font-weight: 400; }

.kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
}

.delta-up   { background: var(--emerald-soft); color: var(--emerald); }
.delta-down { background: var(--danger-soft);  color: var(--danger);  }
.delta-warn { background: var(--amber-soft);   color: var(--amber);   }

.kpi.accent-marine { border-top: 3px solid var(--marine); }
.kpi.accent-danger { border-top: 3px solid var(--danger); }
.kpi.accent-amber  { border-top: 3px solid var(--amber);  }
.kpi.accent-green  { border-top: 3px solid var(--emerald);}

/* ── SECTION ANNULATIONS TARDIVES ── */
.late-cancel-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 3px solid var(--danger);
}

.section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-2);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.late-cancel-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.lc-col {
  padding: 16px 18px;
  border-right: 1px solid var(--border-2);
}

.lc-col:last-child { border-right: none; }

.lc-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Timeline d'impact */
.impact-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.impact-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.impact-label {
  color: var(--text-2);
  font-size: 11px;
}

.impact-bar-wrap {
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}

.impact-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.bar-danger  { background: var(--danger); }
.bar-amber   { background: #f59e0b; }
.bar-marine  { background: var(--marine-2); }

.impact-val {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

/* Tableau annulations récentes */
.lc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.lc-table th {
  text-align: left;
  padding: 0 0 6px 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-2);
}

.lc-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
  color: var(--text-2);
}

.lc-table tr:last-child td { border-bottom: none; }

.delay-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
}

.dp-red    { background: var(--danger-soft); color: var(--danger); }
.dp-amber  { background: var(--amber-soft);  color: var(--amber);  }
.dp-green  { background: var(--emerald-soft); color: var(--emerald); }

/* Stats accessibilité */
.access-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.access-card {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
}

.access-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.access-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.access-val small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.access-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── GRILLES ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }

/* ── CARTE GÉNÉRIQUE ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.card-meta {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

.card-body { padding: 14px 16px; }

/* ── HORAIRE ── */
.schedule-row {
  display: grid;
  grid-template-columns: 46px 20px 1fr 90px 66px 72px;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 12px;
}

.schedule-row:last-child { border-bottom: none; }

.sch-time {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--marine);
}

.sch-dir { font-size: 11px; text-align: center; }

.sch-client {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.cap-cell { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.cap-num  { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.cap-bar-wrap { width: 100%; height: 5px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.cap-bar-fill { height: 100%; border-radius: 3px; }
.fill-green { background: var(--emerald); }
.fill-amber { background: #f59e0b; }
.fill-red   { background: var(--danger); }

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sp-done  { background: var(--emerald-soft); color: var(--emerald); }
.sp-live  { background: var(--marine-soft);  color: var(--marine);  }
.sp-next  { background: var(--bg-2);         color: var(--muted);   }
.sp-full  { background: var(--danger-soft);  color: var(--danger);  }

/* ── ACTIVITÉ CAISSE ── */
.act-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 12px;
}

.act-row:last-child { border-bottom: none; }

.act-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  min-width: 36px;
}

.act-type {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 64px;
  text-align: center;
}

.at-nouv  { background: var(--emerald-soft); color: var(--emerald); }
.at-annul { background: var(--danger-soft);  color: var(--danger);  }
.at-modif { background: var(--amber-soft);   color: var(--amber);   }
.at-resid { background: var(--marine-soft);  color: var(--marine);  }

.act-client { flex: 1; color: var(--text-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-prep   { font-size: 10px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }

.act-amount {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  min-width: 64px;
  text-align: right;
}

.pos  { color: var(--emerald); }
.neg  { color: var(--danger); }
.zero { color: var(--muted); }

/* ── PRÉPOSÉES ── */
.prep-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
}

.prep-row:last-child { border-bottom: none; }

.prep-name { width: 110px; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prep-bar-bg { flex: 1; height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.prep-bar-fill { height: 100%; background: var(--marine); border-radius: 3px; }
.prep-n   { font-family: var(--mono); font-size: 10px; color: var(--muted); min-width: 20px; text-align: right; }
.prep-amt { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--marine); min-width: 70px; text-align: right; }

/* ── MINI CHART ── */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 72px;
  padding: 0 2px;
}

.mc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mc-bars { display: flex; flex-direction: column-reverse; gap: 1px; width: 100%; border-radius: 3px 3px 0 0; overflow: hidden; }
.mc-seg { width: 100%; }
.mc-marine { background: var(--marine); }
.mc-green  { background: var(--emerald); }
.mc-label  { font-size: 9px; color: var(--muted); font-family: var(--mono); }
.mc-label.today { color: var(--marine); font-weight: 500; }

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ── ALERTES ── */
.alert-list { display: flex; flex-direction: column; gap: 6px; }

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid transparent;
}

.al-danger { background: var(--danger-soft);  border-color: #fca5a5; color: #7f1d1d; }
.al-amber  { background: var(--amber-soft);   border-color: #fcd34d; color: #78350f; }
.al-info   { background: var(--marine-soft);  border-color: #bfdbfe; color: #1e3a5f; }

.al-ico  { font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.al-text { flex: 1; }
.al-time { font-family: var(--mono); font-size: 9px; color: var(--muted); flex-shrink: 0; }


/* ── TABLEAU PRÉPOSÉES ── */
.tab-mini {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: all .1s;
}
.tab-mini:hover { color: var(--marine); border-color: var(--marine); }
.tab-mini.active-mini { background: var(--marine); color: #fff; border-color: var(--marine); }

.prep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.prep-table thead tr {
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-2);
}

.prep-table th {
  padding: 7px 10px;
  text-align: right;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  cursor: help;
  white-space: nowrap;
}

.prep-table th:first-child { text-align: left; }

.prep-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}

.prep-table tr:last-child td { border-bottom: none; }

.prep-table tr:hover td { background: var(--bg); }

.prep-total-row td {
  border-top: 2px solid var(--border) !important;
  background: var(--bg-2);
}

.prep-total-row:hover td { background: var(--bg-2) !important; }

.prep-cell-name {
  font-size: 11px;
  color: var(--text-2);
  text-align: left;
  white-space: nowrap;
}

.prep-cell-n {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.prep-cell-amt {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.err-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  float: right;
}

.err-none { background: var(--emerald-soft); color: var(--emerald); }
.err-warn { background: var(--amber-soft);   color: var(--amber);   }
.err-crit { background: var(--danger-soft);  color: var(--danger);  }

.ecart-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  float: right;
}

.ecart-ok   { background: var(--emerald-soft); color: var(--emerald); }
.ecart-warn { background: var(--amber-soft);   color: var(--amber);   }
.ecart-crit { background: var(--danger-soft);  color: var(--danger);  }


/* ── CARTE HORAIRE ENRICHIE ── */
.sch-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-2);
}
.sch-row:last-child { border-bottom: none; }

.sch-row-main {
  display: grid;
  grid-template-columns: 46px 20px 1fr 80px;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.sch-row-capacity {
  display: grid;
  grid-template-columns: 46px 20px 1fr;
  gap: 8px;
  align-items: start;
}

.sch-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 48px 40px;
  gap: 6px;
  align-items: start;
}

.cap-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cap-block-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

.cap-block-uea {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}

.cap-block-uea .used { color: var(--text); font-weight: 600; }
.cap-block-uea .total { color: var(--muted); font-size: 9px; }

.cap-block-bar {
  height: 5px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-2);
}

.cap-block-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}

.fill-renf { background: #7c3aed; }   /* violet — voie renforcée */
.fill-reg  { background: var(--marine-2); }
.fill-spec { background: var(--slate); }
.fill-pass { background: var(--emerald); }
.fill-velo { background: #0891b2; }   /* cyan — vélos */

.cap-full  { color: var(--danger) !important; }
.cap-warn  { color: var(--amber)  !important; }

.remorque-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
}

.rem-ok   { background: var(--bg-2);         color: var(--muted);   border: 1px solid var(--border); }
.rem-warn { background: var(--amber-soft);   color: var(--amber);   border: 1px solid #fcd34d; }
.rem-crit { background: var(--danger-soft);  color: var(--danger);  border: 1px solid #fca5a5; }

.velo-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--mono);
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
  white-space: nowrap;
}

.sch-alert-strip {
  margin-top: 4px;
  padding: 3px 8px;
  background: var(--danger-soft);
  border-radius: 4px;
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
  border: 1px solid #fca5a5;
}

.legend-navire {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 0 0;
  border-top: 1px solid var(--border-2);
  margin-top: 8px;
}

.legend-navire-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--muted);
}

.legend-navire-dot {
  width: 10px;
  height: 6px;
  border-radius: 2px;
}


/* ── FILTRES ── */
.filter-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  font-family: var(--sans);
  transition: all .12s;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--marine); background: var(--marine-soft); }
.filter-btn.active { background: var(--marine); color: #fff; }

/* ── MARÉES ── */
.maree-block {
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: hidden;
  transition: opacity .2s;
}
.maree-block.dimmed { opacity: .35; }

.maree-1 { border-top: 3px solid #0891b2; }
.maree-2 { border-top: 3px solid #7c3aed; }

.maree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-2);
}

.maree-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.maree-badge.m1 { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.maree-badge.m2 { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

.maree-hours {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.maree-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-2);
  font-family: var(--mono);
}

/* Timeline horizontale dans la carte marée */
.maree-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 10px;
  overflow-x: auto;
  min-height: 48px;
}

.tl-dep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: transform .1s;
}

.tl-dep:hover { transform: translateY(-2px); }

.tl-dep::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  right: -50%;
  height: 1px;
  background: var(--border-2);
  z-index: 0;
}
.tl-dep:last-child::after { display: none; }

.tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid;
  background: #fff;
  position: relative;
  z-index: 1;
  transition: all .12s;
}

.tl-dot.ile     { border-color: #0891b2; color: #0e7490; }
.tl-dot.village { border-color: var(--marine-2); color: var(--marine); }
.tl-dot.done    { background: var(--bg-2); }
.tl-dot.live    { background: var(--marine-soft); box-shadow: 0 0 0 3px var(--marine-soft); }
.tl-dot.full    { border-color: var(--danger); color: var(--danger); }
.tl-dot.alert   { border-color: var(--danger); animation: alertPulse 1.5s ease infinite; }

@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185,28,28,.3); }
  50%       { box-shadow: 0 0 0 5px rgba(185,28,28,.0); }
}

.tl-time {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-2);
}

.tl-cap-bar {
  width: 28px;
  height: 3px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
}

.tl-cap-fill {
  height: 100%;
  border-radius: 2px;
}

/* ── COLONNES EN-TÊTES HORAIRE ── */
.sch-col-headers {
  display: grid;
  grid-template-columns: 66px 20px 1fr 1fr 1fr 56px 56px 48px 72px;
  gap: 6px;
  align-items: end;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 2px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ── RANGÉE HORAIRE ── */
.sch-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-2);
  transition: background .1s;
}
.sch-row:last-child { border-bottom: none; }
.sch-row:hover { background: var(--bg); border-radius: 6px; }
.sch-row.hidden { display: none; }

.sch-row-inner {
  display: grid;
  grid-template-columns: 66px 20px 1fr 1fr 1fr 56px 56px 48px 72px;
  gap: 6px;
  align-items: start;
}

.sch-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sch-time-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.sch-maree-tag {
  display: inline-block;
  padding: 0px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 600;
}
.tag-m1 { background: #ecfeff; color: #0e7490; }
.tag-m2 { background: #f5f3ff; color: #6d28d9; }

.sch-alert-strip {
  margin: 4px 0 0 0;
  padding: 3px 8px;
  background: var(--danger-soft);
  border-radius: 4px;
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
  border: 1px solid #fca5a5;
}


/* ── TOAST ── */
.dir-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--sans);
  z-index: 9999;
  animation: rise .2s ease;
  box-shadow: var(--shadow-md);
}
.dir-toast-info    { background: var(--marine-soft); color: var(--marine); border: 1px solid #bfdbfe; }
.dir-toast-danger  { background: var(--danger-soft);  color: var(--danger); border: 1px solid #fca5a5; }
.dir-toast-warn    { background: var(--amber-soft);   color: var(--amber);  border: 1px solid #fcd34d; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── ANIMATIONS ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kpi       { animation: rise .3s ease both; }
.kpi:nth-child(1) { animation-delay:.04s }
.kpi:nth-child(2) { animation-delay:.08s }
.kpi:nth-child(3) { animation-delay:.12s }
.kpi:nth-child(4) { animation-delay:.16s }
.kpi:nth-child(5) { animation-delay:.20s }

.late-cancel-section { animation: rise .35s ease .22s both; }


/* ================================================================
   direction.css — Styles du tableau de bord Direction SIRIV
   Généré depuis direction.html — ne pas modifier inline
   ================================================================ */

/* ── Topbar éléments ─────────────────────────────────────────── */
#loadingIndicator {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  opacity: 0;
  transition: opacity .3s;
}

#lastRefresh {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  font-family: var(--mono);
}

.topbar-date-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

#dirDateInput {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-family: var(--mono);
}

/* ── Typographie utilitaire ─────────────────────────────────── */
.mono    { font-family: var(--mono); }
.mono-8  { font-family: var(--mono); font-size: 8px; }
.mono-9  { font-family: var(--mono); font-size: 9px; }
.mono-10 { font-family: var(--mono); font-size: 10px; }
.mono-11 { font-family: var(--mono); font-size: 11px; }
.mono-12 { font-family: var(--mono); font-size: 12px; }
.mono-13 { font-family: var(--mono); font-size: 13px; }
.mono-14 { font-family: var(--mono); font-size: 14px; }

.text-8  { font-size: 8px; }
.text-9  { font-size: 9px; }
.text-10 { font-size: 10px; }
.text-11 { font-size: 11px; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Couleurs sémantiques ────────────────────────────────────── */
.text-danger   { color: var(--danger); }
.text-amber    { color: var(--amber); }
.text-emerald  { color: var(--emerald); }
.text-marine   { color: var(--marine); }
.text-marine-2 { color: var(--marine-2); }
.text-muted    { color: var(--muted); }
.text-default  { color: var(--text); }
.text-violet   { color: #7c3aed; }
.text-slate    { color: var(--slate); }
.text-cyan     { color: #0e7490; }
.text-white    { color: #fff; }

.bg-danger-soft  { background: var(--danger-soft); }
.bg-amber-soft   { background: var(--amber-soft); }
.bg-emerald-soft { background: var(--emerald-soft); }
.bg-marine-soft  { background: var(--marine-soft); }

.border-danger  { border-color: #fca5a5; }
.border-amber   { border-color: #fcd34d; }

.danger-bold { color: var(--danger); font-weight: 700; }

/* ── Flexbox utilitaires ─────────────────────────────────────── */
.flex-col        { display: flex; flex-direction: column; }
.flex-gap-3      { display: flex; align-items: center; gap: 3px; }
.flex-gap-4      { display: flex; align-items: center; gap: 4px; }
.flex-gap-6      { display: flex; align-items: center; gap: 6px; }
.flex-gap-8      { display: flex; align-items: center; gap: 8px; }
.flex-gap-10     { display: flex; align-items: center; gap: 10px; }
.flex-gap-12     { display: flex; align-items: center; gap: 12px; }
.flex-wrap-8     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-flex-3   { display: inline-flex; align-items: center; gap: 3px; }
.inline-flex-4   { display: inline-flex; align-items: center; gap: 4px; }
.align-center    { align-items: center; }
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.ml-auto         { margin-left: auto; }
.ml-auto-gap     { margin-left: auto; gap: 6px; }

/* ── Espacement utilitaires ─────────────────────────────────── */
.center-pt14 { display: flex; justify-content: center; padding-top: 14px; }
.right-pt14  { text-align: right; padding-top: 14px; }
.p0-overflow { padding: 0; overflow-x: auto; }
.mt-2        { margin-top: 2px; }
.mt-4        { margin-top: 4px; }
.mt-6        { margin-top: 6px; }
.mt-8        { margin-top: 8px; }
.mt-10       { margin-top: 10px; }

/* ── Dimensions ─────────────────────────────────────────────── */
.h-6  { height: 6px; }
.h-8  { height: 8px; }
.h-10 { height: 10px; }
.h-12 { height: 12px; }
.h-14 { height: 14px; }
.w-14 { width: 14px; }

/* ── Horaire — colonnes en-têtes ────────────────────────────── */
.sch-col-header-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.sch-col-header-sub {
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
}

/* ── Voie renforcée / spéciaux ──────────────────────────────── */
.spec-emplacement-note {
  font-size: 8px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}

.danger-note {
  font-size: 10px;
  color: var(--danger);
  margin-top: 2px;
}

.danger-note-sm {
  font-size: 11px;
  color: var(--danger);
  line-height: 1.4;
}

/* ── Labels voie dans en-tête ───────────────────────────────── */
.col-renf-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #7c3aed;
}

.col-reg-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--marine-2);
}

.col-spec-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate);
}

.col-pass-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--emerald);
  text-align: center;
}

.col-velo-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #0e7490;
  text-align: center;
}

.col-rem-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--amber);
  text-align: center;
}

/* ── Emplacements spéciaux pills ────────────────────────────── */
.spec-pill {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--mono);
}

.spec-pill-free {
  background: var(--bg-2);
  color: var(--muted);
}

.spec-pill-used {
  background: var(--slate);
  color: #fff;
}

/* ── Filtres ──────────────────────────────────────────────────── */
.filter-group {
  display: flex;
  gap: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}

.filtre-resume {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── Timeline marées ─────────────────────────────────────────── */
.mono-10-muted {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* ── Tableau préposées ───────────────────────────────────────── */
.text-fw-500  { color: var(--text); font-weight: 500; }
.text-fw-600  { font-weight: 600; color: var(--text); }
.emerald-fw6  { font-weight: 600; color: var(--emerald); }
.amber-fw6    { font-weight: 600; color: var(--amber); }
.danger-fw6   { font-weight: 600; color: var(--danger); }
.marine-fw6   { font-weight: 600; color: var(--marine); }

/* ── Alertes inline ─────────────────────────────────────────── */
.al-danger-strip {
  margin-top: 4px;
  padding: 3px 8px;
  background: var(--danger-soft);
  border-radius: 4px;
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
  border: 1px solid #fca5a5;
}

/* ── KPI badges ──────────────────────────────────────────────── */
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-warn   .kpi-value { color: var(--amber); }

/* ── Légende navire ──────────────────────────────────────────── */
.legend-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ── Padding / wrappers generics ─────────────────────────────── */
.pb-0-overflow { padding: 0; overflow-x: auto; }
.pb-4 { padding-bottom: 4px; }

/* ── Annulations tardives — colonnes ─────────────────────────── */
.lc-col-danger {
  border-top: 1px solid #fca5a5;
  background: var(--danger-soft);
}

.annul-piste {
  padding: 8px 10px;
  background: var(--amber-soft);
  border-radius: 6px;
  font-size: 11px;
  color: var(--amber);
  line-height: 1.4;
  border: 1px solid #fcd34d;
  margin-top: 10px;
}

/* ── Revenus chart ───────────────────────────────────────────── */
#revenus7jChart .mini-chart { height: 72px; }

/* ── Stat accès cards ────────────────────────────────────────── */
.access-card-danger {
  border-color: #fca5a5;
}

.access-title-danger {
  font-size: 10px;
  font-weight: 600;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.access-val-danger {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--danger);
}

/* ── Utilitaires générés depuis nettoyage HTML ─────────────────────────────── */
.h-48 { height: 48px; }
.h-38 { height: 38px; }
.flex-gap-6 { display: flex; align-items: center; gap: 6px; }
.bg-violet  { background: #7c3aed; }
.bg-marine-2 { background: var(--marine-2); }
.bg-slate    { background: var(--slate); }
.bg-cyan     { background: #0891b2; }
.bg-emerald  { background: var(--emerald); }
.svg-icon-cyan   { width: 14px; height: 14px; display: flex; color: #0e7490; }
.svg-icon-marine { width: 14px; height: 14px; display: flex; color: var(--marine); }
.maree-timeline-wrapper { padding: 10px 16px 0; border-bottom: 1px solid var(--border-2); }
.card-body-alt  { padding: 8px 14px; }
.d-none         { display: none !important; }
.d-block        { display: block !important; }

.gap-14      { gap: 14px; }
.annul-piste-slim { margin-top: 10px; padding: 8px 10px; border-radius: 6px; }
.bg-marine { background: var(--marine); }

/* ── Tableau annulations — fix double class ─────────────────── */
.neg.mono { font-family: var(--mono); color: var(--danger); }
.text-left { text-align: left; }

/* ── Écart caisse warning strip ─────────────────────────────── */
.ecart-warn-strip {
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--amber-soft);
  border-radius: 6px;
  font-size: 11px;
  color: var(--amber);
  border: 1px solid #fcd34d;
}

/* ── Navigation — états et interactions ────────────────────────────── */
.nav-link {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.nav-link.nav-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: auto; /* garder pour le toast */
}

.nav-link.nav-disabled:hover {
  background: transparent;
  color: var(--text-2);
}

/* Transition d'état actif plus douce */
.nav-link {
  transition: background .1s, color .1s, border-left-color .1s;
}

/* Indicateur de section ciblée par le scroll spy */
.nav-link[data-nav].scroll-target-active {
  background: var(--marine-soft);
  color: var(--marine);
  border-left-color: var(--marine-2);
}

/* ── Classes utilitaires manquantes ──────────────────────────── */
.icon-wrap-16 { display:flex; align-items:center; justify-content:center; width:16px; height:16px; }
.ml-2  { margin-left: 2px; }
.op-7  { opacity: .7; }
.text-11 { font-size: 11px; }
.flex-gap-4 { display: flex; align-items: center; gap: 4px; }
.pt-2 { padding-top: 2px; }
