/* ── Variables ────────────────────────────────── */
:root {
  --primary: #1a56db;
  --primary-light: #e1effe;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

/* ── Sidebar (desktop: always visible / mobile: drawer) ── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
}
.drawer-overlay.active { display: block; opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100dvh;
  background: var(--gray-900);
  color: #fff;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.drawer-brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.drawer-close {
  width: 30px;
  height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  transition: background 0.15s, color 0.15s;
}
.drawer-close:hover { background: rgba(255,255,255,.18); color: #fff; }

.drawer-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.drawer-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.drawer-user-name { font-weight: 600; font-size: 0.92rem; color: #fff; }
.drawer-user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,.45);
  text-transform: capitalize;
}

.drawer-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}
.drawer-nav-label {
  padding: 0.5rem 1.25rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,.3);
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  margin: 2px 0.6rem;
  color: rgba(255,255,255,.65);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.drawer-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.drawer-link--active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,86,219,.35);
}
.drawer-link-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; flex-shrink: 0; }
.drawer-link--danger { color: rgba(220,38,38,.8); }
.drawer-link--danger:hover { background: rgba(220,38,38,.15); color: #ef4444; }

.drawer-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 0.5rem 0;
}


/* ── Nav bar (top) ────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1.15rem; color: var(--gray-900); display: none; }
.nav-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin: 0; white-space: nowrap; }
.nav-breadcrumb { color: var(--gray-400); margin: 0 0.35rem; font-size: 1.1rem; }
.nav-station { font-weight: 600; font-size: 0.95rem; color: var(--primary); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.nav-register-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.nav-user { font-size: 0.9rem; color: var(--gray-500); }

/* ── Hamburger button ─────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.nav-hamburger:hover { background: var(--gray-100); }
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Desktop layout: sidebar always visible ───── */
@media (min-width: 769px) {
  .drawer { transform: translateX(0); box-shadow: none; border-right: 1px solid rgba(255,255,255,.06); transition: transform 0.25s ease, width 0.25s ease; }
  .main-content { margin-left: 260px; transition: margin-left 0.25s ease; }
  .nav-hamburger { display: flex; }
  /* Collapsed state */
  body.drawer-collapsed .drawer { transform: translateX(-260px); }
  body.drawer-collapsed .main-content { margin-left: 0; }
}

/* ── Mobile layout: drawer overlay mode ───────── */
@media (max-width: 768px) {
  .drawer { transform: translateX(-100%); box-shadow: var(--shadow-lg); transition: transform 0.25s ease; }
  .drawer.open { transform: translateX(0); }
  .drawer-close { display: flex; }
  .nav-hamburger { display: flex; }
  .nav-brand { display: block; }
  .nav-logout-btn { display: none; }
  .nav-user { display: none; }
}
@media (max-width: 560px) {
  .nav-breadcrumb, .nav-station { display: none; }
  .nav-title { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
  .nav-brand { display: none; }
}

/* ── Container ────────────────────────────────── */
.container { max-width: 100%; margin: 0 auto; padding: 1.25rem 1.5rem; }
@media (max-width: 768px) { .container { padding: 1rem; } }

/* ── Typography ───────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; }
.text-muted { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 0.8rem; }
.text-center { text-align: center; }

/* ── Page header ──────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ── Side panel (right drawer) ────────────────── */
.sidepanel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 900;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sidepanel-overlay.open { opacity: 1; pointer-events: auto; }
.sidepanel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 90vw;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 910;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.sidepanel.open { transform: translateX(0); }
.sidepanel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.sidepanel-header h2 { margin: 0; font-size: 1.1rem; }
.sidepanel-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--gray-500); line-height: 1;
}
.sidepanel-close:hover { color: var(--gray-900); }
.sidepanel-body {
  padding: 1.5rem;
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 1rem;
}
.sidepanel-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: #fff;
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: .5rem;
}
.sidepanel > form {
  display: flex; flex-direction: column; flex: 1; overflow: hidden;
  min-height: 0;
}
/* Un <form> qui EST lui-même le corps (ex. « Ajouter une ligne ») doit
   défiler : la règle ci-dessus, plus spécifique que .sidepanel-body, lui
   imposait overflow:hidden et rendait le bas du formulaire inatteignable. */
.sidepanel > form.sidepanel-body {
  overflow-y: auto;
}
.sidepanel-body { min-height: 0; }
/* ══ Panneau LARGE : detail d une session de caisse (/manager/registers) ══ */
.sidepanel--wide { width: 920px; max-width: 94vw; }
/* ⚠️ Corps = colonne flex qui DEFILE : sans flex-shrink:0, les enfants
   (dont les .table-wrap, qui ont leur propre overflow) sont ECRASES a 0 px
   au lieu de deborder — tableaux invisibles et rien a faire defiler. */
.rd-body > * { flex-shrink: 0; }
.rd-body { gap: 1rem; padding-top: 1.25rem; overscroll-behavior: contain; }

.rd-head { align-items: flex-start; gap: 1rem; }
.rd-head__main { min-width: 0; }
.rd-head__eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); }
.rd-head h2 { font-size: 1.25rem; margin: .1rem 0 .35rem; overflow-wrap: anywhere; }
.rd-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; font-size: .82rem; color: var(--gray-500); }
.rd-head__phone { white-space: nowrap; }

.rd-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1rem; align-items: start; }
.rd-kpis { display: grid; gap: .6rem; }
.rd-kpi { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .65rem .85rem; background: #fff; }
.rd-kpi__label { font-size: .75rem; color: var(--gray-500); display: flex; align-items: center; gap: .4rem; }
.rd-kpi__value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.rd-kpi__hint { font-size: .72rem; color: var(--gray-400); }
.rd-kpi--bad { background: var(--danger-light); border-color: #fca5a5; }
.rd-kpi--bad .rd-kpi__value { color: var(--danger); }
.rd-kpi--good { background: var(--success-light); border-color: #6ee7b7; }
.rd-kpi--good .rd-kpi__value { color: var(--success); }
.rd-kpi--ok .rd-kpi__value { color: var(--success); }
.rd-pill { font-size: .65rem; font-weight: 600; padding: .05rem .4rem; border-radius: 999px; background: var(--warning-light); color: var(--warning); }

.rd-ledger { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .65rem .9rem; background: var(--gray-50); font-size: .86rem; }
.rd-ledger__title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); margin-bottom: .35rem; }
.rd-ledger__row { display: flex; justify-content: space-between; gap: 1rem; padding: .22rem 0; }
.rd-ledger__row > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rd-ledger__row[data-sign="in"] > span:last-child { color: var(--success); }
.rd-ledger__row[data-sign="out"] > span:last-child { color: var(--danger); }
.rd-ledger__row.is-zero { color: var(--gray-400); }
.rd-ledger__row.is-zero > span:last-child { color: var(--gray-400); font-weight: 400; }
.rd-ledger__total { border-top: 1px dashed var(--gray-300); margin-top: .3rem; padding-top: .45rem; font-weight: 700; }
.rd-ledger__total > span:last-child { color: var(--gray-900) !important; font-size: 1rem; }
.rd-ledger__foot { font-size: .78rem; color: var(--gray-500); padding-top: .3rem; }
.rd-ledger__foot[hidden] { display: none; }

/* Onglets epingles en haut de la zone qui defile. */
.rd-tabs { position: sticky; top: -1.25rem; z-index: 3; display: flex; gap: .25rem; margin: .25rem -1.5rem 0; padding: .5rem 1.5rem 0; background: #fff; border-bottom: 1px solid var(--gray-200); }
.rd-tab { border: none; background: none; padding: .6rem .9rem; font-size: .9rem; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: .4rem; }
.rd-tab:hover { color: var(--gray-900); }
.rd-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.rd-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }
.rd-tab__count { font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); font-variant-numeric: tabular-nums; }
.rd-tab.is-active .rd-tab__count { background: var(--primary-light); color: var(--primary); }
.rd-pane { display: flex; flex-direction: column; gap: .75rem; }
.rd-pane[hidden] { display: none; }

.rd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.rd-stat { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .5rem .75rem; }
.rd-stat__label { font-size: .72rem; color: var(--gray-500); }
.rd-stat__value { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-stat__sub { font-size: .72rem; color: var(--gray-400); font-variant-numeric: tabular-nums; }
.rd-stat--out .rd-stat__value { color: var(--danger); }
.rd-stat--ok { border-color: #6ee7b7; background: #f0fdf4; }
.rd-stat--warn { border-color: #fcd34d; background: var(--warning-light); }
.rd-stat.is-zero .rd-stat__value { color: var(--gray-400); font-weight: 500; }
.rd-substats:empty { display: none; }

.rd-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.rd-search { position: relative; flex: 1 1 240px; max-width: 340px; }
.rd-search__icon { position: absolute; inset-inline-start: .65rem; top: 50%; transform: translateY(-50%); font-size: .8rem; opacity: .55; pointer-events: none; }
.rd-search__input, .rd-select select { width: 100%; height: 2.25rem; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: #fff; font-size: .88rem; color: var(--gray-900); }
.rd-search__input { padding-inline: 2rem 2rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .02em; }
.rd-search__input::placeholder { text-transform: none; font-family: inherit; letter-spacing: 0; color: var(--gray-400); }
.rd-search__input:focus, .rd-select select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.rd-search__input::-webkit-search-cancel-button { display: none; }
.rd-search__clear { position: absolute; inset-inline-end: .3rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--gray-500); font-size: .85rem; padding: .25rem .4rem; line-height: 1; border-radius: 4px; }
.rd-search__clear:hover { color: var(--gray-900); background: var(--gray-100); }
.rd-search__clear[hidden] { display: none; }
.rd-select { display: flex; align-items: center; gap: .5rem; }
.rd-select select { width: auto; min-width: 220px; padding: 0 .6rem; }
.rd-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.rd-chips .chip { display: inline-flex; align-items: center; gap: .35rem; }
.chip__count { font-size: .72rem; font-weight: 700; padding: 0 .4rem; border-radius: 999px; background: rgba(0,0,0,.06); font-variant-numeric: tabular-nums; }
.chip--active .chip__count { background: rgba(255,255,255,.25); }
.chip.chip--warn:not(.chip--active) { border-color: #f3c6c6; }
.rd-filtered { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rd-filtered[hidden] { display: none; }

.rd-table .table { font-size: .84rem; }
.rd-table .table th { white-space: nowrap; padding: .55rem .55rem; font-size: .7rem; }
.rd-table .table td { vertical-align: top; padding: .55rem .55rem; }
.rd-line .rd-l1 { font-weight: 600; white-space: nowrap; }
.rd-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-strong { font-weight: 600; }
.rd-nowrap { white-space: nowrap; }
.rd-neutral { color: var(--gray-500); }
.rd-code code { font-size: .76rem; white-space: nowrap; }
.rd-tab__short { display: none; }
.rd-l1 { line-height: 1.3; }
.rd-l2 { font-size: .75rem; color: var(--gray-500); line-height: 1.3; font-weight: 400; }
.rd-row--void td { color: var(--gray-400); }
.rd-row--void .rd-code code { text-decoration: line-through; }
.rd-table .table td.rd-empty { text-align: center; color: var(--gray-500); padding: 1.25rem .5rem !important; }
.rd-toolbar[hidden] { display: none; }
.rd-busy-target { transition: opacity .15s; }
.rd-busy-target.is-busy { opacity: .45; pointer-events: none; }
#rd-tickets mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }
.sidepanel .pipeline-pager[hidden] { display: none; }
/* Boutons du panneau : police de l application (un <button> ne l herite PAS
   par defaut) ; pager en <button> sans la bordure par defaut du navigateur. */
.rd-panel button { font-family: inherit; }
.rd-panel button.pipeline-pager__btn { border: none; cursor: pointer; font-size: .9rem; }
.rd-panel button.pipeline-pager__btn:hover { background: var(--gray-300); }
.rd-panel button.pipeline-pager__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.rd-body:focus { outline: none; }

@media (max-width: 760px) {
  .rd-overview { grid-template-columns: 1fr; }
  .rd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rd-kpi { padding: .5rem .6rem; }
  .rd-kpi__value { font-size: 1rem; }
}
@media (max-width: 640px) {
  .rd-body { padding: 1rem; }
  .rd-tabs { top: -1rem; margin: .25rem -1rem 0; padding: .25rem 1rem 0; }
  .rd-tab { flex: 1; justify-content: center; padding: .6rem .4rem; }
  .rd-stats { gap: .4rem; }
  .rd-stat { padding: .4rem .5rem; }
  .rd-stat__value { font-size: .92rem; }
  .rd-search { max-width: none; flex-basis: 100%; }
  .rd-select, .rd-select select { width: 100%; min-width: 0; }
  .rd-tab__long { display: none; }
  .rd-tab__short { display: inline; }
  /* Cartes COMPACTES sur 2 colonnes, libelle AU-DESSUS de la valeur : le
     code sert de titre, ligne + taxi/chauffeur sur toute la largeur. */
  .rd-table .table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem .6rem; }
  .rd-table .table td.rd-status { grid-column: 3; grid-row: 2; }
  .rd-table .table td { flex-direction: column; align-items: flex-start; gap: .05rem; min-height: 0; padding: .2rem 0 !important; }
  .rd-table .table td[data-label]::before { min-width: 0; font-size: .62rem; }
  .rd-table .table td.rd-code, .rd-table .table td.rd-wide, .rd-table .table td.rd-empty { grid-column: 1 / -1; }
  .rd-table .table td.rd-code { font-size: .95rem; padding-bottom: .3rem !important; border-bottom: 1px solid var(--gray-100); margin-bottom: .2rem; }
  .rd-table .table td.rd-code::before { display: none; }
  .rd-table .table td.rd-num { text-align: start; }
}
@media (max-width: 640px) {
  .sidepanel { width: 100%; max-width: 100%; }
}

/* ── Tabs ─────────────────────────────────────── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none; border: none;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn--active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}
.tab-content { display: none; }
.tab-content--active { display: block; }

/* ── Filters ───────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.filter-group {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.filter-label {
  font-size: 0.82rem; font-weight: 600; color: var(--gray-500);
  margin-right: 0.25rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.chip {
  display: inline-block; padding: 0.3rem 0.75rem;
  font-size: 0.82rem; border-radius: 999px;
  border: 1px solid var(--gray-300); color: var(--gray-600);
  text-decoration: none; transition: all 0.15s;
  cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip--active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
}
.chip--active:hover { opacity: 0.9; color: #fff; }

/* ── Section header ───────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}

/* ── Grid ─────────────────────────────────────── */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ── Helpers ──────────────────────────────────── */
.table-actions { white-space: nowrap; display: flex; gap: 0.4rem; align-items: center; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }

/* ── Card ─────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card--action {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  color: var(--gray-900);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.card--action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-icon { font-size: 2rem; }
.card-title { font-weight: 600; }
.card-price { font-size: 1.25rem; font-weight: 700; color: var(--primary); }

/* ── Btn ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: #1e40af; }
.btn--success { background: var(--success); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--warning { background: var(--warning); color: #fff; }
.btn--outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn--outline:hover { border-color: var(--gray-400); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn--xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; line-height: 1; }
.btn--danger { background: var(--red, #e74c3c); color: #fff; border-color: var(--red, #e74c3c); }
.btn--danger:hover { background: #c0392b; border-color: #c0392b; }
.btn--lg { padding: 0.85rem 1.5rem; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form ─────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--gray-700); }
.field input, .field select, .field textarea {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field small { color: var(--gray-400); font-size: 0.8rem; }
.field-hint { color: var(--gray-400); font-size: 0.8rem; }

/* ── Sous-sections de formulaire ──────────────────
   `fieldset.affectation-box` + `legend` regroupent des réglages qui vont
   ensemble (affectation de ligne, plafonds de file courte…). Ces classes
   étaient utilisées dans les vues SANS être définies nulle part (rendu par
   défaut du navigateur) — d'où ce bloc. */
.affectation-box {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 1.1rem;
  margin: 0 0 1rem;
  min-width: 0; /* un fieldset ne rétrécit pas sans ça → déborde en grille */
}
.affectation-box > legend {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 0.45rem;
  color: var(--gray-700);
}
.affectation-help {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin: 0 0 0.9rem;
}

/* ── Radio cards ──────────────────────────────── */
.radio-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-card {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 0.95rem;
}
.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.radio-card input { accent-color: var(--primary); }

/* ── Alert ────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.alert--danger { background: var(--danger-light); color: var(--danger); }
.alert--error { background: var(--danger-light); color: var(--danger); }
.alert--success { background: var(--success-light); color: var(--success); }
.alert--warning { background: var(--warning-light); color: var(--warning); }
.alert--info { background: var(--info-light); color: var(--info); }

/* ── Autocomplete (liste de résultats) ────────── */
.autocomplete-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 4px 0;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  max-height: 240px;
  overflow-y: auto;
}
.autocomplete-item {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.autocomplete-item:hover { background: var(--bg-muted, #f1f5f9); }
.autocomplete-item.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Champ avec bouton de réinitialisation (ex. taxi sélectionné) ── */
.input-with-clear { position: relative; }
.input-with-clear > input { width: 100%; padding-inline-end: 2rem; }
.input-clear-btn {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.input-clear-btn:hover { background: var(--border, #e2e8f0); color: var(--text, #1e293b); }

/* ── Ligne de boutons radio ───────────────────── */
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-opt { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }

/* ── Actions dropdown menu ────────────────────── */
.actions-menu { position: relative; display: inline-block; }
.actions-menu-trigger { cursor: pointer; font-size: 1rem; letter-spacing: 2px; min-width: 2rem; }
.actions-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem 0;
  margin-top: 0.25rem;
}
.actions-menu.open .actions-menu-dropdown { display: block; }
.actions-menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--gray-700);
  white-space: nowrap;
}
.actions-menu-item:hover { background: var(--gray-100); }
.actions-menu-item--danger { color: var(--danger); }
.actions-menu-item--danger:hover { background: var(--danger-light); }
.actions-menu-item--warning { color: var(--warning); }
.actions-menu-item--warning:hover { background: var(--warning-light); }

/* ── Ticket detail panel ─────────────────────── */
.detail-section { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.detail-label { font-size: 0.82rem; color: var(--gray-500); }
.detail-value { font-size: 0.9rem; font-weight: 500; color: var(--gray-900); text-align: right; }
.detail-value--big { font-size: 1.15rem; font-weight: 700; }
.detail-sep { border: none; border-top: 1px solid var(--gray-200); margin: 0.25rem 0; }
.detail-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-700); padding: 0.5rem 0 0.15rem; }
.detail-value a { color: var(--primary); text-decoration: none; }
/* Cellule « Chauffeur » des listes de tickets : nom + téléphone empilés. */
.ticket-driver-cell { line-height: 1.25; }
.ticket-driver-cell .ticket-driver-phone { display: block; font-size: 0.78rem; color: var(--gray-500); }
.ticket-driver-cell .ticket-driver-phone a { color: inherit; text-decoration: none; }
.ticket-row--clickable { cursor: pointer; }
.ticket-row--clickable:hover { background: var(--gray-50, #f9fafb); }

/* ── Badge ────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge--active, .badge--filling { background: var(--success-light); color: var(--success); }
.badge--inactive, .badge--departed { background: var(--gray-200); color: var(--gray-500); }
.badge--queued { background: var(--warning-light); color: var(--warning); }
.badge--full { background: var(--primary-light); color: var(--primary); }
/* Forfait : taxi hors affectation (urgence). Rouge sobre, distinct de "full". */
.badge--forfeit { background: var(--danger-light); color: var(--danger); }
/* Congé temporaire : taxi hors affectation, DE FAÇON PRÉVUE et à ÉCHÉANCE
   (distinct du forfait "urgence" — couleur INFO plutôt que DANGER). */
.badge--on-leave { background: var(--info-light); color: var(--info); }
/* Taxi APPELÉ du parking vers la file courte (mode station "sur appel"). */
.badge--called { background: var(--warning-light); color: var(--warning); }
.badge--admin { background: var(--danger-light); color: var(--danger); }
.badge--manager { background: var(--primary-light); color: var(--primary); }
.badge--cashier { background: var(--success-light); color: var(--success); }
.badge--driver { background: var(--warning-light); color: var(--warning); }
.badge--used { background: var(--gray-200); color: var(--gray-500); }
.badge--cancelled { background: var(--danger-light); color: var(--danger); }
.badge--refunded { background: var(--warning-light); color: var(--warning); }
.badge--new { background: #dbeafe; color: #1e40af; }
.badge--in_progress { background: var(--warning-light); color: var(--warning); }
.badge--station { background: var(--primary-light); color: var(--primary); }
/* Source du chauffeur dans l'autocomplete : local (base app) vs externe (profiles). */
.badge--local-src { background: var(--warning-light); color: var(--warning); }
.badge--external-src { background: var(--primary-light); color: var(--primary); }
.badge--resolved { background: var(--success-light); color: var(--success); }
.badge--closed { background: var(--gray-200); color: var(--gray-500); }
.badge--cash { background: var(--success-light); color: var(--success); }
.badge--wetaxi_card { background: var(--primary-light); color: var(--primary); }
.badge--line { background: #e0f2fe; color: #0369a1; margin: 0.1rem 0.15rem 0.1rem 0; text-transform: none; font-weight: 500; }
/* Type de ticket : affecté (défaut) vs non-affect (compensation). */
.badge--affected { background: var(--gray-200); color: var(--gray-500); }
.badge--nonaffect { background: #fef3c7; color: #b45309; }
/* 🚕 Course complète (petit taxi) : ni affecté ni non-affect — 3e type. */
.badge--course { background: #dbeafe; color: #1d4ed8; }
/* État de règlement d'un ticket : payé (chauffeur/non-affect) vs en attente. */
.badge--paid { background: #dcfce7; color: #15803d; }
.badge--unpaid { background: #fef3c7; color: #b45309; }

/* ── Checkbox list (multi-line select) ─────────── */
.checkbox-list { display: flex; flex-direction: column; gap: 0.4rem; }
.checkbox-item { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.checkbox-item input[type="checkbox"] { width: 1rem; height: 1rem; cursor: pointer; }
.badge--bank_card { background: var(--info-light); color: var(--info); }

/* ── Table ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 0.85rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}
.table th { font-weight: 600; color: var(--gray-500); font-size: 0.8rem; text-transform: uppercase; }
.table tbody tr:nth-child(even) { background: #fff; }
.table tbody tr:nth-child(odd) { background: var(--gray-50); }
.table tr:hover { background: var(--gray-100); }

/* ── Table mobile card layout ─────────────────── */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  .table thead { display: none; }
  .table,
  .table tbody,
  .table tr,
  .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: .625rem;
    padding: .625rem .875rem;
    box-shadow: var(--shadow);
  }
  .table tbody tr:nth-child(even),
  .table tbody tr:nth-child(odd) { background: #fff; }
  .table tr:hover { background: var(--gray-50); }
  .table td {
    display: flex;
    align-items: center;
    padding: .25rem 0;
    border: none;
    font-size: .875rem;
    gap: .5rem;
    min-height: 1.6rem;
  }
  .table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-400);
    min-width: 68px;
    flex-shrink: 0;
  }
  .table td.td-actions {
    padding-top: .5rem;
    margin-top: .375rem;
    border-top: 1px solid var(--gray-100);
    justify-content: flex-end;
  }
}

/* ── Stats ────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-icon { font-size: 1.75rem; margin-bottom: 0.3rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--gray-400); text-transform: uppercase; }
.stat-card--primary { border-left: 4px solid var(--primary); }
.stat-card--success { border-left: 4px solid var(--success); }
.stat-card--warning { border-left: 4px solid var(--warning); }
.stat-card--info { border-left: 4px solid var(--info); }
.stat { text-align: center; }

/* ── Cards ────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.card__header h3 { font-size: 0.95rem; font-weight: 600; }
.card__body { padding: 0; }
.card__body .table { margin: 0; }
.table--compact th, .table--compact td { padding: 0.5rem 0.75rem; font-size: 0.85rem; }

/* ── Progress bar ─────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.progress-bar__label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
  display: inline-block;
}

/* ── Rank badges ──────────────────────────────── */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.rank--top { background: var(--success); }
.rank--flop { background: var(--danger); }

/* ── Section ──────────────────────────────────── */
.section { margin-top: 2rem; }

/* ── Seats ────────────────────────────────────── */
.taxi-seats { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.seat {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
}
.seat--free { background: var(--success-light); color: var(--success); border: 2px solid var(--success); cursor: pointer; transition: all 0.15s ease; }
.seat--free:hover { transform: scale(1.1); box-shadow: 0 0 0 2px rgba(59,130,246,.3); }
.seat--taken { background: var(--gray-200); color: var(--gray-400); border: 2px solid var(--gray-300); cursor: not-allowed; opacity: 0.6; }
.seat--selected { background: rgba(59,130,246,.12); color: #2563eb; border: 2px solid #2563eb; cursor: pointer; transition: all 0.15s ease; }
.seat--selected:hover { transform: scale(1.1); }

.taxi-seats-mini { display: flex; gap: 0.25rem; align-items: center; }
.seat-mini {
  width: 0.75rem; height: 0.75rem;
  border-radius: 50%;
  background: var(--success);
}
.seat-mini--taken { background: var(--gray-300); }

/* ── Taxi info ────────────────────────────────── */
.taxi-info { text-align: center; }
.taxi-plate { font-size: 1.5rem; font-weight: 700; }

/* ── Queue ────────────────────────────────────── */
.queue-list { display: flex; flex-direction: column; gap: 0.5rem; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.queue-item--filling { border-left: 4px solid var(--success); }
.queue-item--queued { border-left: 4px solid var(--warning); }
.queue-pos { font-size: 1.25rem; font-weight: 700; color: var(--gray-400); min-width: 2rem; }
.queue-info { flex: 1; }
.queue-plate { font-weight: 700; }
.queue-badge { margin-left: auto; }

/* ── Pipeline Kanban (manager /taxis) ────────── */
.pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}
.pipeline-col {
  background: var(--gray-50, #fafafa);
  border-radius: var(--radius);
  min-height: 200px;
}
.pipeline-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--gray-200);
}
.pipeline-col--queued  .pipeline-col__header { border-bottom-color: var(--warning); }
.pipeline-col--filling .pipeline-col__header { border-bottom-color: var(--success); }
.pipeline-col--full    .pipeline-col__header { border-bottom-color: var(--primary); }
/* 🚖 Colonne des PETITS taxis (course complète) — distincte des colonnes de
   statut : ils ne se vendent pas par place. */
.pipeline-col--small   .pipeline-col__header { border-bottom-color: #1d4ed8; }

.pipeline-col__count {
  font-size: 0.75rem;
  background: var(--gray-200);
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-weight: 600;
}
/* ⭐ Pagination PAR COLONNE — pied discret sous le corps de la colonne.
   ⚠️ Rendu uniquement quand la colonne a plus d'une page (voir `pager()`) :
   un pager à page unique serait du bruit. */
.pipeline-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem 0.6rem;
  font-size: 0.75rem;
}
.pipeline-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 6px;
  background: var(--gray-200);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
}
.pipeline-pager__btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.pipeline-pager__pos {
  font-weight: 600;
  opacity: 0.75;
}

.pipeline-col__body {
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pipeline-empty {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
  padding: 1rem 0;
}
.pipeline-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.pipeline-card__toprow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.pipeline-card__toprow .pipeline-card__number {
  margin-bottom: 0;
}
.pipeline-card__seats-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.pipeline-card__seats-block .pipeline-card__price {
  margin-top: 0.35rem;
}
.pipeline-card__price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
  margin-top: 0.3rem;
}
.pipeline-card__number {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.pipeline-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
  color: var(--gray-500, #666);
  margin-bottom: 0.4rem;
}
/* Durée d'attente relative, à côté de l'heure absolue : volontairement plus
   discrète que l'heure elle-même — elle se relit d'un coup d'œil mais ne doit
   pas concurrencer l'horodatage, qui est la donnée de référence (ordre FIFO). */
.pipeline-card__since { opacity: 0.75; font-size: 0.95em; }
/* Appel en cours : l'échéance décide si le chauffeur perd sa place, elle doit
   se distinguer des horodatages purement informatifs. */
.pipeline-card__call { color: var(--warning-700, #92400e); font-weight: 600; }
.pipeline-card__countdown { font-variant-numeric: tabular-nums; }
/* Sous une minute — l'urgence doit se voir sans lire les chiffres. */
.pipeline-card__countdown.is-urgent { color: var(--danger-600, #dc2626); font-weight: 700; }
.pipeline-card__countdown.is-expired { color: var(--gray-500, #666); font-weight: 400; }
/* Anomalie de contrôle (sortie non badgée) : signalée en rouge, c'est un
   contournement possible du frais station, pas une information de service. */
.pipeline-card__missed { color: var(--danger-600, #dc2626); font-weight: 600; }
.pipeline-card__btn { width: 100%; font-size: 0.8rem; }

/* ── Kebab menu ─────────────────────────────── */
.kebab-menu { position: relative; }
.kebab-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 0.15rem 0.35rem;
  border-radius: 4px; color: var(--gray-500, #666);
}
.kebab-btn:hover { background: var(--gray-100, #f3f3f3); }
.kebab-dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  min-width: 140px; z-index: 50; overflow: hidden;
}
.kebab-dropdown.open { display: block; }
.kebab-item {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.75rem;
  font-size: 0.82rem; border: none; background: none; cursor: pointer;
}
.kebab-item:hover { background: var(--gray-100, #f5f5f5); }
.kebab-item--warn { color: var(--danger, #e74c3c); }
.kebab-item--success { color: var(--success, #27ae60); }

@media (max-width: 900px) {
  .pipeline:not(.pipeline--by-line) { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pipeline:not(.pipeline--by-line) { grid-template-columns: 1fr; }
}

/* ── Pipeline: scroll vertical par colonne (les deux modes) ─────────────── */
/* Hauteur cap = viewport moins l'entête/nav/marges ; le corps défile en Y. */
.pipeline-col__body {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}

/* ── Mode "par ligne" : colonnes fixes + défilement horizontal ──────────── */
/* Supporte 30-50 lignes sans écraser les colonnes : largeur fixe, scroll-x. */
.pipeline--by-line {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: .5rem; /* place pour la scrollbar */
}
.pipeline--by-line .pipeline-col {
  flex: 0 0 260px;
  width: 260px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
}
.pipeline--by-line .pipeline-col__header--line {
  border-bottom-color: var(--primary);
  /* Hauteur d'entête IDENTIQUE pour toutes les colonnes (UX) : hauteur fixe
     (2 lignes : nom + config), nom tronqué sur une ligne (ellipsis). Les 2
     lignes restent monolignes (ellipsis) → la hauteur ne varie jamais. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 72px;
  box-sizing: border-box;
  flex: 0 0 auto;
  gap: .25rem;
}
.pipeline--by-line .pipeline-col__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.pipeline--by-line .pipeline-col__header-top > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline--by-line .pipeline-col__header-top .pipeline-col__count {
  flex: 0 0 auto;
}
.pipeline-col__config {
  font-size: .68rem;
  font-weight: 600;
  color: var(--gray-500, #667);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline--by-line .pipeline-col__body {
  max-height: none; /* la colonne (flex) porte le cap ; le corps prend le reste */
  flex: 1;
  min-height: 0;
}

/* ── Carte : index FIFO + badges type (short/parking) ───────────────────── */
.pipeline-card__index {
  display: inline-block;
  min-width: 1.5em;
  margin-right: .4rem;
  padding: 0 .35rem;
  border-radius: 20px;
  background: var(--gray-200, #e5e5e5);
  color: var(--gray-600, #555);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}
.pipeline-card__badges {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.pipeline-card__type {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: .12rem .45rem;
  border-radius: 20px;
}
.pipeline-card__type--parking {
  background: rgba(52,152,219,.15);
  color: #2471a3;
}
.pipeline-card__type--short {
  background: rgba(230,126,34,.15);
  color: #ca6f1e;
}
.pipeline-card__class {
  font-size: .68rem;
  font-weight: 700;
  padding: .12rem .45rem;
  border-radius: 20px;
}
.pipeline-card__class--local {
  background: rgba(39,174,96,.15);
  color: #1e8449;
}
.pipeline-card__class--foreign {
  background: rgba(142,68,173,.15);
  color: #7d3c98;
}
.pipeline-card__badges .badge { margin-left: auto; }
/* Taxi non résolu (entré par caméra, plaque introuvable dans l'externe). */
.pipeline-card__badge--unresolved {
  font-size: .62rem;
  font-weight: 700;
  padding: .12rem .45rem;
  border-radius: 20px;
  background: #fef3c7;
  color: #b45309;
}
.pipeline-card--unresolved { border: 1px solid #f59e0b; }
/* Taxi entré par une VOIE « sans lignes » : sa destination reste à poser.
   ⚠️ Couleur DISTINCTE de l'ambre « non résolu » : ce sont deux problèmes
   différents (identité inconnue vs destination manquante) et les confondre
   enverrait l'agent sur la mauvaise action. */
.pipeline-card__badge--nolines {
  font-size: .62rem;
  font-weight: 700;
  padding: .12rem .45rem;
  border-radius: 20px;
  background: #dbeafe;
  color: #1d4ed8;
}
.pipeline-card__resolve { margin-top: .4rem; font-size: .75rem; }
.pipeline-card__resolve summary { cursor: pointer; color: #b45309; font-weight: 600; }
.pipeline-card__resolve .resolve-form { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.pipeline-card__resolve .resolve-form label { display: flex; flex-direction: column; gap: .15rem; font-size: .7rem; }
.pipeline-card__resolve .resolve-form input,
.pipeline-card__resolve .resolve-form select { padding: .25rem .4rem; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; }

/* ── Queue public (client view) — Grid ─────────── */

/* Header */
.station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}
.station-header-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
}
.station-header-logo:hover { opacity: 0.8; }

/* Two-column layout */
.station-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  padding: 1.25rem;
  min-height: calc(100vh - 56px);
}
.station-main {
  flex: 1;
  min-width: 0;
}
.station-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Sidebar */
.station-sidebar {
  width: 260px;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--gray-700);
}
.sidebar-stations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sidebar-station-link {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--gray-900);
  transition: background 0.15s, box-shadow 0.15s;
}
.sidebar-station-link:hover {
  box-shadow: var(--shadow-md);
}
.sidebar-station-link--active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}
.sidebar-station-link--active .sidebar-station-city {
  color: rgba(255,255,255,0.8);
}
.sidebar-station-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.sidebar-station-city {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

/* Line sections */
.lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.line-column {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--gray-200);
}
.line-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--gray-200);
}
.line-column-title {
  font-size: 0.95rem;
  margin: 0;
  flex: 1;
}
.line-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.line-section-header h2 { margin-bottom: 0; }
.line-price-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
}
.line-column-taxis {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.queue-grid-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.queue-grid-card:hover { box-shadow: var(--shadow-md); }
.queue-grid-card--filling { border-color: var(--success); }
.queue-grid-pos {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
}
.queue-grid-plate {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-900);
}
.queue-grid-seats {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin: 0.2rem 0;
}
.seat-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
}
.seat-dot--free { background: var(--success); }
.seat-dot--taken { background: var(--gray-300); }
.pipeline-card__seats {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
}
.seat-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-left: 0.2rem;
}
.queue-grid-places {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ── Airport Departure Board ──────────────────── */
body:has(.board) {
  background: #0a0e17;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.board {
  background: #0a0e17;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: #e2e8f0;
}
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(90deg, #1a237e 0%, #0d47a1 100%);
  border-bottom: 3px solid #ffc107;
}
.board-brand {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.board-clock {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffc107;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
/* Filtres actifs (type de taxi, zone) — un écran mural n'a pas de barre
   d'adresse : sans ces pastilles, un tableau FILTRÉ se lit comme la file
   entière. */
.board-filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.board-chip {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.board-chip--type {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.board-chip--zone {
  background: #ffc107;
  color: #1a237e;
}

/* 📺 PAGES du tableau (rotation taxis ↔ véhicules virtuels).
   ⚠️ `.board` est une colonne flex où `.board-lines` portait `flex:1` ; en
   l'enveloppant, c'est le WRAPPER qui doit désormais porter la croissance,
   sinon la page se replie sur la hauteur de son contenu.
   ⚠️⚠️ Le `display:none` sous `[hidden]` est OBLIGATOIRE : le `display:flex`
   ci-dessus l'emporterait sinon sur le style par défaut du navigateur pour
   l'attribut `hidden`, et les DEUX pages se rendraient empilées. */
.board-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.board-view[hidden] {
  display: none;
}

/* ── Board Table ── */
/* ⚠️⚠️ `.board-vlines` / `.board-vcard*` = la page « véhicules virtuels ».
   Classes DISTINCTES de `.board-lines`/`.board-card` À DESSEIN : le script de
   pagination sélectionne ces dernières À L'ÉCHELLE DU DOCUMENT
   (`querySelectorAll('.board-card')`) et pose un `style="display:none"` INLINE
   sur les cartes qui ne tiennent pas dans le viewport. Réutiliser les mêmes
   noms ferait donc rendre la page 2 ENTIÈREMENT VIDE (le style inline survit au
   retrait de `hidden`, `.board-card` n'ayant aucune règle `display` propre).
   La parité visuelle est obtenue en ÉTENDANT les sélecteurs, sans dupliquer une
   seule valeur. */
.board-lines,
.board-vlines {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}
.board-card,
.board-vcard {
  background: #0f1525;
  border: 1px solid #1e3a5f;
  border-radius: 10px;
  flex-shrink: 0;
}
.board-card-header,
.board-vcard-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(90deg, #131a2e 0%, #162040 100%);
  border-bottom: 2px solid #ffc107;
}
.board-card-dest,
.board-vcard-dest {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.03em;
  flex: 1;
}
.board-card-count,
.board-vcard-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: #90caf9;
  background: #1a2540;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}
.board-card-body,
.board-vcard-body {
  padding: 0.6rem 1.2rem;
}
/* 📍 Poteau d'attente sur la carte de ligne du tableau public — même jaune que
   la bordure d'en-tête ; le NUMÉRO domine, le libellé reste discret. */
.board-pole {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  padding: 0.15rem 0.55rem 0.25rem;
  background: #ffc107;
  color: #0b1220;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
}
.board-pole-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
.board-pole-number {
  font-size: 1.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.board-pin {
  width: 1.5em;
  height: 1.5em;
  color: #ffc107;
  flex-shrink: 0;
}

/* ── Taxis row inside board ── */
.board-taxis-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.board-taxi {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a2540;
  border: 1px solid #2a3a5c;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  transition: background 0.15s, border-color 0.15s;
}
.board-taxi--filling {
  background: #1b3a20;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
  animation: taxi-blink 1.8s ease-in-out infinite;
}
/* ── Taxi APPELÉ (mode `calling`, file parking) ──────────────────────────────
   Convocation avec ÉCHÉANCE : passé le délai le taxi est mis hors affectation.
   C'est la seule info du tableau qui exige une action immédiate, donc elle
   domine visuellement le vert « en remplissage » (ambre + halo). */
.board-taxi--called {
  background: #4a3410;
  border-color: #ffc107;
  box-shadow: 0 0 14px rgba(255, 193, 7, 0.55);
  animation: taxi-called-pulse 1.2s ease-in-out infinite;
}
@keyframes taxi-called-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 193, 7, 0.45); }
  50% { box-shadow: 0 0 22px rgba(255, 193, 7, 0.9); }
}
/* ── FILE PHYSIQUE : VOIE COURTE vs PARKING ──────────────────────────────────
   ⚠️ Ce n'est pas décoratif : `sortShortFirst` place TOUTE la voie courte avant
   TOUT le parking, AVANT même le ratio. Sans repère, un taxi en tête « sans
   raison visible » (il est simplement en voie) passe pour un défaut de tri.
   ⚠️ Repère DISCRET et SANS TEXTE (demande du user) : les cartes sont déjà
   denses. La pastille de RANG — déjà présente sur chaque carte — devient
   simplement CLAIRE pour un taxi en VOIE, sombre pour un taxi au PARKING. Aucun
   contenu ajouté, aucune largeur consommée.
   ⚠️ Volontairement NEUTRE : c'est un CONTEXTE, pas une alerte — il ne doit
   concurrencer ni « APPELÉ » (ambre) ni « en remplissage » (vert), seules
   informations de l'écran qui exigent une action. */
/* ── Taxi NATIONAL (`taxiClass: 'foreign'`) ──────────────────────────────────
   ⚠️ C'est une IDENTITÉ, pas un ÉTAT : contrairement à « en remplissage »
   (vert) et « appelé » (ambre), elle ne réclame AUCUNE action et ne doit donc
   pas concurrencer ces deux alertes. D'où un liseré latéral bleu + un fond à
   peine teinté, PAS de halo ni d'animation.
   ⚠️ Le liseré est posé en `border-left` (et non sur `border-color`) pour que
   les modificateurs d'ÉTAT gardent leur bordure : un national EN REMPLISSAGE
   reste visiblement vert, tout en portant sa marque bleue.
   ⚠️ La pastille « N » double le repère par un CARACTÈRE : sur un écran mural
   vu de loin, ou pour un daltonien, la seule couleur ne suffit pas. */
.board-taxi--national {
  border-left: 4px solid #4a9eff;
  background: #16233d;
}
.board-taxi--national .board-taxi-plate::after {
  content: "N";
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.32rem;
  border-radius: 4px;
  background: #4a9eff;
  color: #0d1526;
  font-size: 0.68em;
  font-weight: 700;
  vertical-align: middle;
}

/* Débordement d'une file trop longue : « +N de plus ». Volontairement DISCRET
   (pas de liseré vif, pas d'animation) — c'est une indication de TRONCATURE, pas
   un taxi ni une alerte : elle ne doit pas concurrencer le badge « APPELÉ »,
   seule information de l'écran qui exige une action immédiate. */
.board-taxi--more {
  background: transparent;
  border-style: dashed;
  border-color: #3a4a6c;
  color: #90caf9;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.board-taxi-called {
  background: #ffc107;
  color: #141a2a;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}

/* La carte de ligne qui porte un appel : liseré ambre, jamais masquée par la
   rotation (voir `data-called` dans la vue). */
.board-card--called {
  border-color: #ffc107 !important;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.35);
}

@keyframes taxi-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.board-taxi-pos {
  background: #141a2a;
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── FILE PHYSIQUE : une ICÔNE DISCRÈTE, jamais un aplat de couleur ──────────
   ⚠️ Demande du user : « discret et pas très visible ». C'est un CONTEXTE que
   seul le personnel a besoin de lire — il ne doit concurrencer NI « APPELÉ »
   (ambre) NI « en remplissage » (vert), seules informations de l'écran qui
   exigent une action immédiate.
   ⚠️ Rendue en `::after` du conteneur, PAS dans le markup : le gabarit rend la
   carte à DEUX endroits (liste plate + vue par ligne) et une icône posée à la
   main serait oubliée dans l'un des deux — c'est exactement le mutant qui avait
   survécu. Une seule règle CSS couvre les deux rendus par construction.
   ⚠️ Opacité basse + taille réduite : l'icône se lit en s'approchant, elle
   n'attire pas l'œil de loin.
   ⚠️ `aria-hidden` implicite (pseudo-élément) : les lecteurs d'écran ne
   l'annoncent pas, ce qui est correct — c'est une aide VISUELLE d'appoint, la
   donnée reste `type` côté API. */
/* ⚠️ `::before` (et non `::after`) : la carte se TERMINE déjà par les pastilles
   de places et le compteur « n/6 ». Un `margin-left:auto` en fin de carte
   pousserait l'icône APRÈS eux et creuserait un vide au milieu — la carte est
   un flexbox. En tête, l'icône s'aligne avec le rang, sans rien déplacer. */
.board-taxi::before {
  content: "⌂";                 /* PARKING — abri, forme calme */
  font-size: 0.8em;
  line-height: 1;
  opacity: 0.3;
  flex-shrink: 0;
  /* Annule le `gap` du flex : l'icône se colle au rang plutôt que d'élargir. */
  margin-right: -0.2rem;
}
.board-taxi--short::before {
  content: "›";                 /* VOIE — chevron « en partance » */
  font-weight: 700;
  opacity: 0.45;
}
/* ⚠️ La pastille de rang REDEVIENT NEUTRE : elle portait la distinction, ce qui
   la rendait invisible tant qu'aucun taxi n'était en voie (rien à comparer) et
   la faisait concurrencer les états. L'icône la remplace. */

.board-taxi-plate {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffc107;
  letter-spacing: 0.04em;
}
/* SÉRIE du véhicule — identité SECONDAIRE : elle ne départage que deux taxis
   portant le même numéro, elle ne doit donc pas concurrencer le numéro à la
   lecture (plus petite, grisée, dans sa propre puce pour qu'on ne la lise
   jamais comme la suite du numéro). */
.board-taxi-serial {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9fb3d1;
  background: #141a2a;
  border: 1px solid #2a3a5c;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.board-taxi-seats {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.board-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.board-dot--free {
  background: #555;
}
.board-dot--taken {
  background: #4caf50;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}
.board-taxi-count {
  font-size: 0.85rem;
  color: #90caf9;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.board-empty {
  font-size: 1rem;
  color: #555;
  font-style: italic;
}

/* ── Board footer ── */
.board-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background: #131a2e;
  border-top: 2px solid #1e3a5f;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ── Register ─────────────────────────────────── */
.register-status {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1rem;
}
.status-dot {
  width: 0.75rem; height: 0.75rem;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.register-stats { margin: 1rem 0; }

/* ── Tickets list ─────────────────────────────── */
.tickets-list { display: flex; flex-direction: column; gap: 0.3rem; }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--gray-700);
}
.ticket-row:hover { background: var(--gray-100); }
.ticket-code { font-weight: 600; font-family: monospace; }

/* ── Ticket print ─────────────────────────────── */
.ticket-print {
  max-width: 360px;
  margin: 2rem auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ticket-header {
  background: var(--primary);
  color: #fff;
  padding: 1.25rem;
  text-align: center;
}
.ticket-header h1 { font-size: 1.3rem; }
.ticket-code-big {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
  margin-top: 0.5rem;
  letter-spacing: 2px;
}
.ticket-body { padding: 1.25rem; }
.ticket-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.ticket-arrow { color: var(--primary); font-size: 1.5rem; }
/* 📍 Poteau d'attente — imprimé GROS : c'est l'information que le passager
   cherche du regard en sortant du guichet. Bordure pleine (pas de fond) pour
   rester lisible sur une imprimante thermique monochrome. */
.ticket-pole {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 3px solid currentColor;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  margin: 0 auto 1rem;
  width: fit-content;
}
.ticket-pole-label { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.ticket-pole-number { font-size: 2.6rem; font-weight: 800; line-height: 1; font-family: monospace; }
.ticket-details { display: flex; flex-direction: column; gap: 0.5rem; }
.ticket-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--gray-200);
}
.ticket-detail .label { color: var(--gray-400); font-size: 0.85rem; }
.ticket-detail .value { font-weight: 600; }
.ticket-qr { text-align: center; margin: 1rem 0; }
.ticket-qr img { width: 150px; }
.ticket-footer { text-align: center; font-size: 0.85rem; color: var(--gray-400); margin-top: 1rem; }

/* ── Auth ─────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-sub { color: var(--gray-400); margin-bottom: 1.5rem; }

/* ── Client page ──────────────────────────────── */
.client-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.25rem;
}
.client-page--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: #1a56db;
}
html:has(.client-page--centered),
html:has(.client-page--centered) body {
  background: #1a56db;
}
.client-center-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem;
}
.client-hero-logo {
  height: 150px;
  max-height: 30vh;
  max-width: 90vw;
  object-fit: contain;
  margin-bottom: 2rem;
}
.client-baseline {
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.05em;
  text-align: center;
}
.client-footer {
  padding: 1.5rem 1rem;
  text-align: center;
  width: 100%;
}
.client-signature {
  font-size: 0.7rem;
  color: #fff;
  margin: 0;
}
.client-hero {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.client-hero h1 { font-size: 1.75rem; }
.client-hero p { opacity: 0.85; margin-top: 0.5rem; }

.stations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.station-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--gray-900);
  transition: transform .15s;
}
.station-card:hover { transform: translateY(-2px); }
.station-icon { font-size: 2rem; margin-bottom: 0.3rem; }
.station-card h2 { font-size: 1rem; }
.station-card p { font-size: 0.85rem; color: var(--gray-400); }
.client-search { margin-top: 2rem; }

/* ── Print ────────────────────────────────────── */
@media print {
  .no-print, .nav { display: none !important; }
  body { background: #fff; }
  .ticket-print { box-shadow: none; margin: 0 auto; }
}

/* ══════════════════════════════════════════════════
   POS LAYOUT
   ══════════════════════════════════════════════════ */
.pos {
  display: grid;
  grid-template-columns: 1fr 300px 340px;
  gap: 1.25rem;
  min-height: calc(100vh - 80px);
}
.pos-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pos-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pos-register-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--success-light);
  color: var(--success);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* POS ticket placeholder */
.pos-ticket--empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  min-height: 200px;
}
.pos-ticket-placeholder {
  text-align: center;
  color: var(--gray-400);
}
.pos-ticket-placeholder-icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* POS form */
.pos-form {
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.pos-summary-card {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.pos-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.pos-summary-left {
  text-align: left;
  flex: 1;
  min-width: 0;
}
.pos-line-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}
.pos-taxi-info {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
}
.pos-seats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.pos-fields {
  display: flex;
  gap: 0.75rem;
}
.pos-field-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pos-field-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
}
.pos-field-row input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color .15s;
}
.pos-field-row input:focus { border-color: var(--primary); }

/* Payment methods */
.pos-payment-methods {
  display: flex;
  gap: 0.5rem;
}
.pos-pay-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.6rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  font-size: 0.9rem;
  font-weight: 600;
}
.pos-pay-btn input { display: none; }
.pos-pay-btn--active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* POS calculator */
.pos-calc {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pos-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}
.pos-calc-value {
  font-weight: 700;
  font-size: 1.1rem;
}
.pos-calc-value--total {
  font-size: 1.5rem;
  color: var(--primary);
}
.pos-calc-row--input {
  padding: 0.5rem 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.pos-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  transition: border-color .15s;
}
.pos-input-wrap:focus-within { border-color: var(--primary); }
.pos-input-wrap input {
  border: none;
  outline: none;
  font-size: 1.25rem;
  font-weight: 700;
  width: 80px;
  text-align: right;
  background: transparent;
}
.pos-input-wrap input::-webkit-outer-spin-button,
.pos-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pos-input-unit { color: var(--gray-400); font-weight: 600; }
.pos-calc-row--change {
  padding-top: 0.5rem;
}
.pos-calc-row--change .pos-calc-value {
  color: var(--success);
  font-size: 1.3rem;
}
.pos-change--negative { color: var(--danger) !important; }

/* Sell button */
.pos-sell-btn {
  font-size: 1.1rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

/* Shortcuts */
.pos-shortcuts {
  display: flex;
  gap: 0.5rem;
}
.pos-shortcut {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: transform .1s, box-shadow .15s;
}
.pos-shortcut:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Register summary */
.pos-register-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.pos-reg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}
.pos-reg-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gray-400);
}
.pos-reg-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Queue panel (centre) */
.pos-queue {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.pos-queue-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  text-align: center;
  min-height: 200px;
}
.pos-queue-list {
  flex-direction: column;
  gap: 0.5rem;
}
.pos-queue-empty {
  text-align: center;
  color: var(--gray-400);
  padding: 2rem 1rem;
}

/* Queue taxi cards */
.queue-taxi {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  transition: all .15s;
}
.queue-taxi--current {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}
.queue-taxi--filling { border-left: 4px solid var(--success); }
.queue-taxi--queued { border-left: 4px solid var(--warning); }
.queue-taxi--full { border-left: 4px solid var(--danger); opacity: 0.6; }
.queue-taxi-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.queue-taxi-pos {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  min-width: 1.5rem;
}
.queue-taxi-plate {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}
.queue-taxi-number {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}
.queue-taxi-details {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 0.2rem;
}
.queue-taxi-permit {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-left: 0.5rem;
}
.queue-taxi-status {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.queue-taxi-driver {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}
.queue-taxi-seats {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.queue-taxi-seats .seat {
  width: 26px; height: 26px;
  font-size: 0.7rem;
}
.queue-taxi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}
.queue-taxi-avail {
  font-weight: 600;
  white-space: nowrap;
}
.queue-taxi-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.queue-taxi-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .3s;
}
.queue-taxi-time {
  white-space: nowrap;
  font-size: 0.7rem;
}

/* Right panel — Lines */
.pos-right-title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}
.pos-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pos-line-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--gray-50);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}
.pos-line-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.pos-line-card--active {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
/* Colonne gauche : destination + config d'affectation empilées. */
.pos-line-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
/* Colonne droite : prix + badges taxis empilés, alignés à droite. */
.pos-line-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}
.pos-line-dest {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  min-width: 0;
}
.pos-line-dest > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pos-line-arrow {
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.pos-line-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  font-size: 1rem;
}
/* Résumé config d'affectation de la ligne (POS) + chips classe/type par taxi */
.pos-line-config {
  font-size: .72rem;
  color: var(--gray-500);
  line-height: 1.2;
}
.queue-taxi-chips {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin: .25rem 0;
}
.queue-taxi-class, .queue-taxi-type {
  font-size: .66rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 20px;
}
.queue-taxi-class--local { background: rgba(39,174,96,.15); color: #1e8449; }
.queue-taxi-class--foreign { background: rgba(142,68,173,.15); color: #7d3c98; }
.queue-taxi-type--parking { background: rgba(52,152,219,.15); color: #2471a3; }
.queue-taxi-type--short { background: rgba(230,126,34,.15); color: #ca6f1e; }
.pos-line-taxis {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
/* Bascule "vente sans affectation" (POS). Neutre par défaut, ambre quand active. */
.pos-nonaffect-toggle {
  display: block;
  width: 100%;
  margin: 0.25rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.pos-nonaffect-toggle:hover { border-color: #d97706; color: #b45309; }
.pos-nonaffect-toggle--active {
  background: rgba(217, 119, 6, .12);
  border-style: solid;
  border-color: #d97706;
  color: #b45309;
}
/* 🗂️ Groupes de lignes — boutons de RACCOURCI DE SAISIE dans les panneaux
   d'ajout et d'édition. Style volontairement NEUTRE (pas d'alerte) : cocher un
   groupe n'a aucune conséquence métier, c'est de l'ergonomie. */
.line-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .35rem;
}
.line-group-btn {
  padding: .3rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 999px;
  background: var(--gray-50, #f9fafb);
  color: var(--gray-700, #374151);
  cursor: pointer;
}
.line-group-btn:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

/* ⚡ Affectation FORCÉE — encart visible seulement quand la ligne n'a aucun
   taxi. Volontairement marqué (ambre) : c'est une DÉROGATION journalisée,
   pas une option de confort. */
.pos-force-row {
  margin: .5rem 0;
  padding: .6rem .75rem;
  border: 1px dashed #d97706;
  border-radius: 8px;
  background: rgba(217, 119, 6, .07);
}
.pos-force-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  color: #b45309;
  cursor: pointer;
}
.pos-force-hint {
  margin: .35rem 0 0;
  font-size: .75rem;
  color: var(--gray-500, #6b7280);
}
.pos-taxi-badge {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.pos-taxi-badge--filling { color: var(--success); }
.pos-taxi-badge--queued { color: var(--warning); }
.pos-taxi-badge--empty { color: var(--gray-400); }

/* Right panel — Recent tickets */
.pos-recent { margin-top: 1rem; }
.pos-recent h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}
.pos-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pos-recent-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--gray-700);
}
.pos-recent-item:hover { background: var(--gray-50); }
.pos-recent-code {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.75rem;
}
.pos-recent-route { flex: 1; }
.pos-recent-price { font-weight: 700; white-space: nowrap; }

/* ── Mobile adjustments ───────────────────────── */
@media (max-width: 640px) {
  .pos {
    grid-template-columns: 1fr;
  }
  .pos-right {
    max-height: none;
    order: -1;
  }
  .pos-queue {
    max-height: none;
    order: 1;
  }
  .pos-fields { flex-direction: column; }
  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .queue-item { flex-wrap: wrap; }
  h1 { font-size: 1.25rem; }
  .btn--lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
}
@media (max-width: 400px) {
  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr;
  }
  .radio-group { flex-direction: column; }
  .pos-payment-methods { flex-direction: column; }
  .pos-register-summary { grid-template-columns: 1fr; }
}

/* ── Station page responsive ──────────────────── */
@media (max-width: 768px) {
  .station-layout {
    flex-direction: column;
  }
  .station-sidebar {
    width: 100%;
    order: -1;
  }
  .sidebar-stations {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .sidebar-station-link {
    padding: 0.45rem 0.7rem;
  }
  .sidebar-station-city { display: none; }
}

/* ═══════ Commande groupée — Sélecteur sièges ═══════ */
.pos-group-order {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}
.pos-group-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pos-group-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
}
.pos-group-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border-radius: 8px;
  border: none;
}
.pos-group-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-primary-light, #e8f0fe);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-primary);
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.pos-group-btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}
.pos-group-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pos-group-count {
  min-width: 40px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}
.pos-group-hint {
  font-size: 0.78rem;
  color: var(--color-text-light);
  white-space: nowrap;
  font-weight: 400;
}

/* ══════ Filtres du pipeline (manager + courtier) ══════ */

/* Indice sous un champ de filtre : dit ce que la recherche couvre réellement,
   pour éviter d'essayer un critère qui n'est pas indexé. */
.field__hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--gray-400);
  font-size: 0.75rem;
  line-height: 1.35;
}

/* Bandeau « N filtre(s) actif(s) · X taxis affichés sur Y ».
   ⚠️ Rendu VISIBLE et persistant tant qu'un filtre est posé : une liste filtrée
   qui ressemble à la file complète est la principale source d'erreur ici. */
.pipeline-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.pipeline-filter-summary #filter-summary-text { font-weight: 600; }

/* État « aucun résultat » : distingue « rien ne correspond au filtre » d'une
   file réellement vide — deux situations que le même écran vide confondrait. */
.pipeline-no-match {
  padding: 2rem 0;
  font-size: 0.95rem;
  color: var(--gray-500, var(--gray-400));
}

/* ── Réclamation client (QR du ticket imprimé) — 2026-08-18 ─────────────────
   Écran PUBLIC, ouvert sur le téléphone d'un passager : préfixe `cx-` dédié
   pour ne rien emprunter aux classes du back-office (qui peuvent changer). */
.cx-wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px; }
.cx-card { background: #fff; border-radius: 14px; padding: 28px 24px;
           box-shadow: 0 2px 16px rgba(16, 24, 40, .08); }
.cx-title { font-size: 1.35rem; margin: 0 0 6px; color: #101828; }
.cx-sub { color: #475467; margin: 0 0 18px; line-height: 1.5; }
.cx-note { font-weight: 600; color: #101828; margin: 22px 0 12px; }
.cx-row { display: flex; align-items: center; justify-content: space-between;
          gap: 16px; padding: 10px 0; border-bottom: 1px solid #f2f4f7; }
.cx-label { color: #344054; font-size: .95rem; }
.cx-req { color: #d92d20; margin-inline-start: 2px; }

/* Étoiles en radios natifs : `row-reverse` + `~` colore les précédentes.
   Aucun JS — la page doit marcher sur n'importe quel téléphone. */
.cx-stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.cx-stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.cx-stars label { font-size: 1.6rem; line-height: 1; color: #d0d5dd;
                  cursor: pointer; transition: color .12s; }
.cx-stars input:checked ~ label,
.cx-stars label:hover, .cx-stars label:hover ~ label { color: #f5a524; }
.cx-stars input:focus-visible + label { outline: 2px solid #2970ff; border-radius: 4px; }

.cx-field { margin: 16px 0; }
.cx-input { width: 100%; padding: 10px 12px; border: 1px solid #d0d5dd;
            border-radius: 8px; font: inherit; color: #101828; background: #fff; }
.cx-input:focus { outline: 2px solid #2970ff; outline-offset: 1px; border-color: #2970ff; }
.cx-input--err { border-color: #d92d20; }
.cx-err { color: #d92d20; font-size: .82rem; margin: 4px 0 0; }
.cx-count { text-align: end; color: #98a2b3; font-size: .8rem; margin-top: 4px; }
.cx-alert { background: #fef3f2; border: 1px solid #fecdca; color: #b42318;
            padding: 10px 12px; border-radius: 8px; margin: 0 0 16px; }
.cx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cx-grid { grid-template-columns: 1fr; } }
.cx-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.cx-btn { background: #2970ff; color: #fff; border: 0; border-radius: 999px;
          padding: 11px 28px; font: inherit; font-weight: 600; cursor: pointer; }
.cx-btn:hover { background: #1c5ae0; }
.cx-btn:disabled { background: #eaecf0; color: #98a2b3; cursor: not-allowed; }

.cx-state { text-align: center; padding: 18px 6px; }
.cx-ico { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; color: #667085; }
.cx-state--ok .cx-ico { color: #12b76a; }

/* ✈️ Sélecteur de destination du POS (mode COURSE) — 2026-08-25.
   ⚠️ Les classes DOIVENT être définies ici : une classe absente du CSS se rend
   sans erreur et ne s'affiche jamais (piège `is-open` déjà rencontré). */
.pos-dest-results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 15rem;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #d1d5db);
  border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.pos-dest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.pos-dest-item:hover,
.pos-dest-item:focus { background: var(--hover-bg, #f3f4f6); }
.pos-dest-item + .pos-dest-item { border-top: 1px solid var(--border, #e5e7eb); }
.pos-dest-item-tag { flex: 0 0 auto; opacity: .7; }
.pos-dest-status {
  margin-top: .35rem;
  font-size: .85em;
  color: var(--text-muted, #6b7280);
}
.pos-dest-status--fixed { color: #15803d; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   🌗 ÉDITEUR DE TARIF JOUR / NUIT D'UNE LIGNE (partials/line-fare-config.eta)
   ⚠️ Classes DÉFINIES ici : une classe qu'aucune règle ne définit se rend sans
   erreur et ne s'affiche jamais (piège `is-open` déjà rencontré).
   ═══════════════════════════════════════════════════════════════════════ */
.fare-box {
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-top: 0.75rem;
}
.fare-box legend { font-weight: 600; padding: 0 0.4rem; font-size: 0.9rem; }
.fare-cycles { margin-top: 0.6rem; }
.fare-cycles-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.85rem;
}
.fare-cycle-row {
  display: flex; align-items: center; gap: 0.4rem;
  flex-wrap: wrap; margin-bottom: 0.35rem;
}
.fare-cycle-row select,
.fare-cycle-row input[type="time"] {
  padding: 0.25rem 0.4rem; font-size: 0.85rem;
  border: 1px solid var(--border, #d1d5db); border-radius: 6px;
}
.fare-arrow { color: var(--text-muted, #6b7280); }
.fare-inline { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; }
/* Avertissement de couverture incomplète — le serveur REFUSE ce cas, donc il
   doit se voir AVANT la soumission, pas après un refus opaque. */
.fare-warn {
  margin: 0.4rem 0 0; font-size: 0.8rem; font-weight: 600;
  color: var(--danger, #b91c1c);
}
/* Aperçu « en ce moment » : ce que la vente facturerait à cette seconde. */
.fare-preview {
  margin: 0.35rem 0 0; font-size: 0.82rem; font-weight: 600;
  color: var(--success, #15803d);
}
.fare-preview--fallback { color: var(--text-muted, #6b7280); font-weight: 500; }
/* Période tarifaire à côté du prix au POS — discret : c'est une PRÉCISION sur
   le prix, pas une alerte. */
.pos-line-fare { display: block; font-size: 0.7rem; font-weight: 600; opacity: 0.85; }

/* ── 💸 Décaissement au courtier (« Ma caisse », 2026-11-11) ── */
.cp-card { border: 2px solid var(--primary); }
.cp-hero { text-align: center; background: var(--primary-light); border-radius: var(--radius-sm); padding: 1rem; margin: .75rem 0 1rem; }
.cp-hero__label { display: block; font-weight: 600; color: var(--gray-700); }
.cp-hero__amount { display: block; font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1.2; margin: .25rem 0; }
.cp-hero__help { display: block; font-size: .85rem; color: var(--gray-500); }
.cp-steps td:last-child { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-steps tr.cp-steps__total td { border-top: 2px solid var(--gray-300); font-weight: 700; }
.cp-steps small { color: var(--gray-500); }
.cp-detail { margin: .75rem 0; }
.cp-detail summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.cp-detail__scroll { overflow-x: auto; }
.cp-detail__scroll table td, .cp-detail__scroll table th { white-space: nowrap; }
.cp-sessions { display: grid; gap: .5rem; margin: .5rem 0 1rem; }
.cp-session { display: flex; align-items: flex-start; gap: .6rem; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .6rem .8rem; cursor: pointer; }
.cp-session:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.cp-session input { margin-top: .25rem; }
.cp-session__name { font-weight: 600; }
.cp-session__meta { display: block; font-size: .8rem; color: var(--gray-500); }
.cp-session--disabled { opacity: .55; cursor: not-allowed; background: var(--gray-50); }
.cp-section-label { font-weight: 600; margin-top: 1rem; display: block; }
@media (max-width: 640px) {
  /* Le calcul reste une liste compacte « libellé … montant », pas des cartes. */
  .cp-card .cp-steps tr { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; border: none; border-bottom: 1px solid var(--gray-100); border-radius: 0; box-shadow: none; margin: 0; padding: .45rem .25rem; }
  .cp-card .cp-steps td { display: block; width: auto; padding: 0; min-height: 0; }
  .cp-card .cp-steps tr.cp-steps__total { border-top: 2px solid var(--gray-300); }
  .cp-card .cp-steps tr.cp-steps__total td { border-top: none; }
  .cp-card .table td:empty { display: none; }
}
@media (max-width: 560px) {
  .cp-hero__amount { font-size: 1.8rem; }
  .cp-card .table { font-size: .85rem; }
}
