/* JetTaxi — back-office */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #c6cee0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 50; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; }
.brand img { width: 34px; height: 34px; }
.brand .name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: #fff; }
.brand .name span { color: var(--brand); }
.brand .tag { font-size: 10.5px; color: #7d89a6; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 20px; scrollbar-width: thin; scrollbar-color: #26314d transparent; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #5d6985; padding: 6px 10px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: #b3bdd3; transition: background .12s, color .12s; position: relative; }
.nav a .lucide { width: 17px; height: 17px; color: #7e8aa8; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; }
.nav a.active .lucide { color: var(--brand); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a .nav-count { margin-left: auto; background: var(--brand); color: var(--ink); font-size: 10.5px; font-weight: 800; border-radius: 99px; padding: 1px 7px; }
.side-foot { padding: 14px; border-top: 1px solid var(--ink-3); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.side-user .who { min-width: 0; }
.side-user .who b { display: block; color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { font-size: 11.5px; color: #7d89a6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; background: rgba(244, 245, 249, .85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .burger { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch .input { background: var(--surface); height: 38px; }
.gsearch-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.gsearch-results a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.gsearch-results a:hover, .gsearch-results a.sel { background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock-widget { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; height: 40px; }
.clock-widget .t { font-size: 12px; line-height: 1.2; }
.clock-widget .t b { display: block; font-size: 12.5px; }
.bell { position: relative; }
.bell .n { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.dropdown { position: absolute; right: 0; top: 46px; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; }
.dropdown .dd-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.dropdown .dd-body { max-height: 380px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif.unread { background: var(--brand-50); }
.notif .lucide { color: var(--muted); margin-top: 2px; }

.view { padding: 26px 28px 60px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 12px; }

/* ------------------------------------------------ connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-art { background: radial-gradient(1200px 600px at 10% 0%, #1d2a4a 0%, var(--ink) 55%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -140px; bottom: -140px; width: 480px; height: 480px; border-radius: 50%; border: 70px solid rgba(255, 194, 26, .08); }
.login-art h1 { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; max-width: 520px; }
.login-art h1 em { font-style: normal; color: var(--brand); }
.login-art p { color: #9aa6c2; font-size: 15px; max-width: 460px; margin-top: 14px; }
.login-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 520px; position: relative; z-index: 1; }
.login-feat { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 14px; }
.login-feat .lucide { color: var(--brand); }
.login-feat b { display: block; margin-top: 8px; font-size: 13.5px; }
.login-feat span { font-size: 12px; color: #8995b3; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-box { width: min(420px, 100%); }
.login-box h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.demo-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-acc { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.demo-acc:hover { border-color: var(--brand-600); background: var(--brand-50); }
.demo-acc b { display: block; font-size: 12.5px; }
.demo-acc span { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------ dispatch */
.dispatch { display: grid; grid-template-columns: 400px 1fr; gap: 16px; height: calc(100vh - 64px - 26px - 110px); min-height: 560px; }
.dispatch-list { display: flex; flex-direction: column; min-height: 0; }
.dispatch-list .scroller { overflow-y: auto; flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ride-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ride-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ride-card.urgent { border-left: 4px solid var(--warning); }
.ride-card.sel { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(255, 194, 26, .25); }
.map-card { position: relative; overflow: hidden; }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; background: var(--surface); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 12px; display: flex; gap: 12px; }
.sugg { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.sugg + .sugg { margin-top: 8px; }
.sugg.best { border-color: var(--success); background: var(--success-bg); }

/* ------------------------------------------------ planning */
.plan { overflow: auto; max-height: calc(100vh - 260px); }
.plan table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
.plan th, .plan td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px; font-size: 12px; }
.plan thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; text-align: center; font-weight: 700; }
.plan thead th.today { background: var(--brand-50); }
.plan td.emp, .plan th.emp { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 210px; text-align: left; }
.plan thead th.emp { z-index: 3; }
.plan td.cell { text-align: center; cursor: pointer; min-width: 92px; height: 46px; }
.plan td.cell:hover { background: var(--surface-2); }
.plan td.cell.today { background: #fffcf0; }
.shift-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; border-radius: 8px; padding: 4px 2px; color: #fff; font-weight: 700; line-height: 1.15; }
.shift-chip small { font-weight: 600; opacity: .85; font-size: 10.5px; }
.shift-chip.absent { background: repeating-linear-gradient(45deg, #fdecec, #fdecec 6px, #fbdada 6px, #fbdada 12px) !important; color: var(--danger); }
.leave-chip { display: block; border-radius: 8px; padding: 6px 2px; font-weight: 700; font-size: 11px; }

/* ------------------------------------------------ tâches (kanban) */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kcol { background: var(--slate-bg); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kcol h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 4px 10px; }
.ktask { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); cursor: pointer; }
.ktask:hover { border-color: var(--border-strong); }
.ktask.overdue { border-left: 3px solid var(--danger); }

/* ------------------------------------------------ rôles */
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .mod td { background: var(--surface-2); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ------------------------------------------------ documents imprimables */
.doc { background: #fff; color: #0f172a; padding: 36px; border-radius: 12px; border: 1px solid var(--border); font-size: 13px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--ink); padding-bottom: 18px; margin-bottom: 22px; }
.doc h2 { font-size: 22px; font-weight: 800; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border-strong); padding: 8px 6px; }
.doc td { padding: 7px 6px; border-bottom: 1px solid var(--border); }
.doc .tot td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
/* ---------- Suivi GPS ---------- */
.gps-marker { position: relative; width: 30px; height: 30px; --c: #3b82f6; }
.gps-marker.mouvement { --c: #16a34a; }
.gps-marker.arret { --c: #3b82f6; }
.gps-marker.hors_ligne { --c: #94a3b8; }
.gps-marker.alert { --c: #dc2626; }
.gps-marker .gm-body { position: absolute; inset: 0; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.28); display: grid; place-items: center; }
.gps-marker .gm-body svg { width: 17px; height: 17px; fill: #fff; transition: transform .4s; }
.gps-marker .gm-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.gps-marker.sel .gm-body { box-shadow: 0 0 0 5px rgba(255, 194, 26, .65), 0 3px 8px rgba(0,0,0,.28); }
.gps-marker.alert .gm-body { animation: pulse 1.6s infinite; }
.gps-marker .gm-tag { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font: 700 10px/1 'JetBrains Mono', monospace; padding: 3px 5px; border-radius: 5px; white-space: nowrap; pointer-events: none; }
.gps-chip { width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
.gps-chip.mouvement { background: #16a34a; } .gps-chip.hors_ligne { background: #94a3b8; } .gps-chip.alert { background: #dc2626; }
.gps-panel { position: absolute; right: 12px; top: 12px; z-index: 500; width: 300px; max-height: calc(100% - 24px); overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg, var(--shadow)); padding: 14px 16px; }
.map-opt { position: absolute; left: 56px; top: 12px; z-index: 500; background: var(--surface); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.gps-history { display: grid; grid-template-columns: 1fr 360px; gap: 16px; height: calc(100vh - 64px - 26px - 250px); min-height: 520px; }
.gps-history .scroller { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.replay { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.replay input[type=range] { flex: 1; accent-color: var(--ink); }
.stop-marker, .alert-marker { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 800 11px/1 inherit; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.stop-marker { background: #1d4ed8; }
.alert-marker { background: #dc2626; border-radius: 50%; }
pre.code { background: var(--ink); color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; line-height: 1.5; }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
}

@media (max-width: 1100px) {
  .dispatch { grid-template-columns: 1fr; height: auto; }
  .dispatch .map-card { height: 420px; }
  .gps-history { grid-template-columns: 1fr; height: auto; }
  .gps-history .map-card { height: 480px; }
  .gps-history .scroller { max-height: 420px; }
  .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 262px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 0 14px; }
  .topbar .burger { display: inline-flex; }
  .view { padding: 18px 14px 50px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .clock-widget .t { display: none; }
  .dropdown { width: calc(100vw - 28px); right: -60px; }
}
