/* =========================================================
   pages.css — styles propres aux rubriques
   (tableau de bord, planning, flotte, chauffeurs, suivi…)
   ========================================================= */

/* ---------- Utilitaires partagés ---------- */
.px-18 { padding-left: 18px; padding-right: 18px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.veh-svg { width: 100%; height: auto; display: block; color: var(--primary); }
.pulse { animation: pulse 1.2s ease; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29, 95, 209, .45); } 100% { box-shadow: 0 0 0 14px rgba(29, 95, 209, 0); } }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Tableau de bord ---------- */
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--subtle); margin-left: 3px; }
.kpi-bump { animation: kpiBump .9s ease; }
@keyframes kpiBump { 0% { box-shadow: 0 0 0 0 var(--primary-ring); background: var(--primary-light); } 100% { box-shadow: 0 0 0 10px transparent; background: var(--surface); } }

#dash-alerts:empty, #dash-maint:empty, #dash-docs:empty { display: none; }
#dash-maint, #dash-docs { border-top: 1px solid #edf0f4; }

.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--neutral-bg); gap: 2px; }
.sb-seg { display: block; height: 100%; min-width: 4px; }
.sd-b-gray { background: #8a95a6; }
.legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .lg-pct { width: 38px; text-align: right; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.hbars li { display: grid; grid-template-columns: 128px 1fr auto; gap: 10px; align-items: center; }
.hb-label .type-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; border-radius: 5px; background: var(--neutral-bg); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 5px; filter: saturate(1.6) brightness(.85); }
.hb-val { white-space: nowrap; text-align: right; min-width: 92px; }

.vbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; }
.vb { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; color: var(--muted); font-size: 11.5px; text-align: center; border-radius: 6px; padding: 2px 0; }
.vb:hover { background: var(--surface-2); text-decoration: none; }
.vb-n { font-weight: 700; color: var(--text); font-size: 13px; }
.vb-col { flex: 1; width: 60%; max-width: 30px; display: flex; align-items: flex-end; background: var(--neutral-bg); border-radius: 5px; overflow: hidden; }
.vb-fill { width: 100%; background: #9dbcf0; display: flex; align-items: flex-end; border-radius: 5px 5px 0 0; min-height: 2px; }
.vb-done { width: 100%; background: var(--success); display: block; }
.vb.today .vb-d { color: var(--primary); font-weight: 700; }
.vb.today .vb-fill { background: var(--primary); }
.vb.today .vb-done { background: var(--success); }
.key-plan { background: #9dbcf0; }
.key-done { background: var(--success); }

/* Activité des véhicules */
.fa-scale { display: grid; grid-template-columns: 170px 1fr 190px; gap: 14px; margin-bottom: 6px; }
.fa-scale > div { position: relative; height: 16px; }
.fa-scale > div span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--subtle); }
.fa-scale > div span:first-child { transform: none; }
.fa-scale > div span:last-child { transform: translateX(-100%); }
.fleet-act { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fleet-act li { display: grid; grid-template-columns: 170px 1fr 190px; gap: 14px; align-items: center; }
.fa-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fa-id .veh-tag { align-self: flex-start; }
.fa-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mini-track {
  position: relative; height: 28px; border-radius: 6px; background-color: var(--surface-2); border: 1px solid var(--border);
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(12.5% - 1px), #e7ebf0 calc(12.5% - 1px), #e7ebf0 12.5%);
}
.mt-block { position: absolute; top: 3px; bottom: 3px; border: 0; border-radius: 4px; padding: 0; cursor: pointer; opacity: .9; }
.mt-block:hover, .mt-block:focus-visible { opacity: 1; outline: 2px solid var(--text); outline-offset: 1px; }
.mt-off { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--warning);
  background: repeating-linear-gradient(45deg, rgba(184, 100, 10, .08) 0 6px, transparent 6px 12px); border-radius: 6px; }
.mt-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); border-radius: 2px; pointer-events: none; }
.mt-now-key { width: 2px; height: 12px; background: var(--danger); display: inline-block; }

/* ---------- Planning ---------- */
.plan-card { overflow: hidden; }
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.plan-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-title { font-size: 16px; margin: 0 8px; min-width: 230px; text-transform: capitalize; }
.plan-nav .input-sm { height: 34px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.plan-switch { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-switch .seg button { display: inline-flex; align-items: center; gap: 5px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
.legend-inline .lg { width: 12px; height: 12px; border-radius: 3px; border-left: 3px solid; display: inline-block; }
.lg-conflict { border: 2px dashed var(--danger) !important; background: var(--danger-bg); }

/* Couleurs des blocs par statut */
.gb-b-gray   { --gb: #7d8899; --gb-bg: #f0f2f5; }
.gb-b-blue   { --gb: var(--primary); --gb-bg: #e8f0fd; }
.gb-b-indigo { --gb: var(--info); --gb-bg: #ecebfb; }
.gb-b-green  { --gb: var(--success); --gb-bg: #e4f4ea; }
.gb-b-orange { --gb: #d9821c; --gb-bg: #fdf0dc; }
.gb-b-red    { --gb: var(--danger); --gb-bg: #fde8e8; }
.gb-b-strike { --gb: var(--subtle); --gb-bg: #f3f4f6; }
.gb-b-violet { --gb: #9b51d0; --gb-bg: #f5ecfc; }
.legend-inline .lg { border-left-color: var(--gb); background: var(--gb-bg); }

.gantt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt { --lane: 62px; --label: 200px; min-width: 980px; }
.g-row { display: grid; grid-template-columns: var(--label) 1fr; border-bottom: 1px solid var(--border); }
.g-row:last-child { border-bottom: 0; }
.g-head { background: var(--surface-2); position: sticky; top: 0; z-index: 6; }
.g-head .g-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.g-label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-right: 1px solid var(--border); background: var(--surface); position: sticky; left: 0; z-index: 5; min-width: 0; }
.g-head .g-label { background: var(--surface-2); }
.g-label > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; font-size: 13px; }
.g-label .badge { font-size: 10.5px; padding: 1px 7px; }
.g-veh { width: 48px; flex-shrink: 0; }
.g-label.none { background: var(--warning-bg); }
.g-scale { position: relative; display: grid; grid-template-columns: repeat(var(--hours), 1fr); }
.g-scale span { font-size: 11px; color: var(--muted); padding: 8px 0 8px 4px; border-left: 1px solid var(--border); }
.g-track {
  position: relative; min-height: calc(var(--lanes, 1) * var(--lane) + 8px); cursor: copy;
  background-image:
    repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / var(--hours))),
    repeating-linear-gradient(to right, transparent 0 calc(50% / var(--hours)), #f1f3f6 calc(50% / var(--hours)) calc(50% / var(--hours) + 1px), transparent calc(50% / var(--hours) + 1px) calc(100% / var(--hours)));
}
.g-track:hover { background-color: #fbfcfe; }
.g-none .g-track { background-color: #fffaf2; }
.g-off { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--warning); z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(184, 100, 10, .07) 0 8px, transparent 8px 16px); }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.g-scale span.g-now-tag { position: absolute; top: 50%; transform: translate(-50%, -50%); background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border: 0; border-radius: 4px; z-index: 2; }
.g-block {
  position: absolute; height: calc(var(--lane) - 8px); z-index: 2; border: 1px solid color-mix(in srgb, var(--gb) 30%, transparent);
  border-left: 4px solid var(--gb); background: var(--gb-bg); border-radius: 6px; padding: 4px 7px; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 1px; font-size: 12px; line-height: 1.25; color: var(--text); cursor: grab;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: box-shadow .15s, transform .15s;
}
.g-block:hover, .g-block:focus-visible { box-shadow: 0 4px 12px rgba(16, 24, 40, .16); z-index: 3; outline: none; transform: translateY(-1px); }
.g-block:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.g-block > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.gb-line1 strong { color: var(--gb); }
.gb-line1 .ic { color: var(--gb); flex-shrink: 0; }
.gb-client { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.gb-line2, .gb-line3 { color: var(--muted); font-size: 11px; }
.gb-line3 .sdot { width: 7px; height: 7px; }
.g-block.conflict, .w-chip.conflict {
  border: 2px dashed var(--danger); border-left: 4px solid var(--danger);
  background-image: repeating-linear-gradient(45deg, rgba(207, 52, 52, .07) 0 6px, transparent 6px 12px);
}
.gb-warn { color: var(--danger) !important; }
.g-block.cancelled, .w-chip.cancelled { opacity: .6; text-decoration: line-through; }
.g-block.dragging, .w-chip.dragging { opacity: .4; }
.g-block.flash, .w-chip.flash { animation: blockFlash 1.6s ease; }
@keyframes blockFlash { 0%, 35% { box-shadow: 0 0 0 4px rgba(255, 196, 0, .7); } 100% { box-shadow: 0 1px 2px rgba(16, 24, 40, .06); } }
.is-dragging .g-track, .is-dragging .w-cell { cursor: move; }
.drop-over { background-color: var(--primary-light) !important; box-shadow: inset 0 0 0 2px var(--primary); }
.g-track.drop-over::after { content: attr(data-hint); position: absolute; right: 8px; top: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; z-index: 5; }

/* Vue semaine */
.week { min-width: 1020px; }
.w-row { display: grid; grid-template-columns: var(--label, 200px) repeat(7, minmax(110px, 1fr)); border-bottom: 1px solid var(--border); }
.w-row:last-child { border-bottom: 0; }
.w-head { background: var(--surface-2); position: sticky; top: 0; z-index: 6; }
.w-head .g-label { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.w-day { border-left: 1px solid var(--border); padding: 6px; text-align: center; }
.w-day.today { background: var(--primary-light); }
.w-daylink { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); padding: 2px 6px; border-radius: 4px; text-transform: capitalize; cursor: pointer; }
.w-daylink:hover { color: var(--primary); text-decoration: underline; }
.w-day.today .w-daylink { color: var(--primary); }
.w-cell { border-left: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-height: 78px; position: relative; cursor: copy; }
.w-cell:hover { background: #fbfcfe; }
.w-cell.today { background: #f7faff; }
.w-cell.off { background: repeating-linear-gradient(45deg, rgba(184, 100, 10, .07) 0 8px, transparent 8px 16px); }
.w-off { font-size: 11px; font-weight: 600; color: var(--warning); }
.w-chip { border: 1px solid color-mix(in srgb, var(--gb) 30%, transparent); border-left: 3px solid var(--gb); background: var(--gb-bg); border-radius: 5px; padding: 3px 6px;
  font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); cursor: grab; position: relative; z-index: 1; }
.w-chip strong { color: var(--gb); }
.w-chip:hover, .w-chip:focus-visible { box-shadow: 0 3px 8px rgba(16, 24, 40, .14); outline: none; }

/* Panneaux sous le planning */
#panel-unassigned .list-item .type-chip { flex-shrink: 0; }
.free-res { display: flex; align-items: center; gap: 8px; min-width: 150px; flex-shrink: 0; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { border: 1px dashed #9fd2b2; background: var(--success-bg); color: var(--success); border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.slot .muted { font-weight: 500; }
.slot:hover, .slot:focus-visible { border-style: solid; background: #d2ecdc; }

/* ---------- Adaptations écrans ---------- */
@media (max-width: 1280px) {
  .kpis-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
@media (max-width: 900px) {
  .fa-scale, .fleet-act li { grid-template-columns: 90px 1fr; }
  .fa-scale > span:last-child, .fa-stat { display: none; }
  .gantt, .week { --label: 150px; }
  .g-veh { display: none; }
  .plan-title { min-width: 0; flex-basis: 100%; order: 5; margin: 6px 0 0; }
}
@media (max-width: 640px) {
  .kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbars li { grid-template-columns: 1fr auto; }
  .hbars .hb-track { grid-column: 1 / -1; grid-row: 2; }
  .gantt, .week { --label: 112px; }
  .g-label .muted, .g-label .badge { display: none; }
  .plan-bar { padding: 10px 14px; }
  .plan-switch { width: 100%; }
  .legend-inline { width: 100%; }
  .free-res { min-width: 0; }
  #free-list .list-item { flex-direction: column; align-items: flex-start; }
}
@media print {
  .gantt-wrap { overflow: visible; }
  .plan-bar .seg, .plan-nav button, .plan-nav input { display: none !important; }
}

/* =========================================================
   Suivi des opérations
   ========================================================= */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; min-width: 120px; }
.stepper li { flex: 1; height: 6px; border-radius: 3px; background: var(--neutral-bg); position: relative; }
.stepper li.done { background: var(--success); }
.stepper li.cur { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-ring); }
.stepper.st-retardee li.cur { background: var(--warning); box-shadow: 0 0 0 2px rgba(184, 100, 10, .2); }
.stepper.st-incident li.cur { background: var(--danger); box-shadow: 0 0 0 2px rgba(207, 52, 52, .2); }
.op-note { display: flex; gap: 5px; align-items: flex-start; margin-top: 6px; font-size: 11.5px; color: var(--muted); max-width: 260px; }
.op-note .ic { margin-top: 1px; }
.side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.map-box { padding: 12px 14px; }
.map-svg { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.map-lbl text { font-size: 10px; fill: #5b6676; font-weight: 600; }
.map-note { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.mk { cursor: pointer; transition: transform .6s ease; }
.mk circle { stroke: #fff; stroke-width: 2; }
.mk text { font-size: 9.5px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.mk-blue circle { fill: var(--primary); } .mk-indigo circle { fill: var(--info); } .mk-green circle { fill: var(--success); }
.mk-orange circle { fill: var(--warning); } .mk-red circle { fill: var(--danger); }
.mk circle.mk-pulse { stroke: none; opacity: .25; transform-box: fill-box; transform-origin: center; animation: mk-pulse 1.8s ease-out infinite; }
.mk:focus-visible circle:not(.mk-pulse) { stroke: var(--text); }
@keyframes mk-pulse { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.5); opacity: 0; } }
.ops-table td { vertical-align: top; }
.ops-log { max-height: 340px; overflow: auto; }
.ops-log li.fresh { background: var(--primary-light); border-radius: var(--radius-sm); }

/* =========================================================
   Vue chauffeur (mobile)
   ========================================================= */
body.driver-app { background: #e6ebf2; }
.phone-shell { max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drv-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--sidebar-bg); color: #fff; position: sticky; top: 0; z-index: 20; }
.drv-top .icon-btn { color: #fff; border-color: rgba(255, 255, 255, .2); background: transparent; }
.drv-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.drv-who .strong { line-height: 1.2; }
.drv-sub { color: var(--sidebar-text); }
.drv-day { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; }
.drv-clock { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.drv-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.drv-summary > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.drv-summary b { display: block; font-size: 18px; }
.drv-summary span { font-size: 11px; color: var(--muted); }
.drv-tabs { padding: 0 16px; background: var(--bg); }
.drv-main { flex: 1; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
#drv-list { display: flex; flex-direction: column; gap: 12px; }
.dm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.dm-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.dm-card.done { opacity: .72; }
.dm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dm-time { font-size: 20px; font-weight: 700; }
.dm-time span { font-size: 13px; font-weight: 500; color: var(--muted); }
.dm-client { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.dm-route { margin: 0; }
.dm-meta { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.dm-meta > span { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dm-actions { display: flex; flex-direction: column; gap: 8px; }
.dm-actions .btn-lg { min-height: 48px; font-size: 15px; }
.dm-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-secondary .btn { justify-content: center; min-height: 40px; }
.drv-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.drv-hist li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.drv-foot { padding: 12px 16px 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; border-top: 1px solid var(--border); }

/* =========================================================
   Flotte
   ========================================================= */
.fleet-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); padding: 16px 18px 18px; }
.veh-card { display: flex; flex-direction: column; overflow: visible; }
.vc-top { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.vc-top .veh-svg { width: 150px; height: auto; }
.t-voiture { background: #e8f0fd; color: #1d5fd1; }
.t-minibus { background: #ecebfb; color: #4f46c8; }
.t-autocar { background: #e4f4ea; color: #1d8148; }
.vc-status { position: absolute; top: 10px; left: 10px; }
.vc-top .plate { position: absolute; bottom: 8px; right: 10px; }
.plate { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em; background: #fff; color: var(--text); border: 1.5px solid var(--text); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.plate.sm { font-size: 11px; padding: 0 5px; }
.vc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vc-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.vc-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vc-specs > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; display: flex; flex-direction: column; }
.vc-specs span { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.vc-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-maint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.vc-maint > .ic { margin-top: 2px; color: var(--muted); }
.vc-foot { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.vc-foot .dropdown { margin-left: auto; }
.veh-ill { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 40px; border-radius: var(--radius); flex-shrink: 0; }
.veh-ill .veh-svg { width: 52px; height: auto; }
.fleet-table td { vertical-align: middle; }

/* =========================================================
   Chauffeurs
   ========================================================= */
.drv-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding: 16px 18px 18px; }
.drv-card { display: flex; flex-direction: column; overflow: visible; }
.dc-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--border); }
.dc-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.dc-week { margin-top: 8px; }
.dc-next { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.dc-next .ic { margin-top: 2px; color: var(--muted); }
.wk-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }
.wk-d { border-radius: var(--radius-sm); padding: 4px 0; text-align: center; font-size: 10.5px; border: 1px solid transparent; }
.wk-d span { display: block; opacity: .8; }
.wk-d b { display: block; font-size: 12px; }
.wk-busy { background: var(--primary-light); color: var(--primary-dark); }
.wk-rest { background: var(--neutral-bg); color: var(--neutral); }
.wk-abs { background: var(--warning-bg); color: var(--warning); }
.wk-free { background: var(--success-bg); color: var(--success); }
.wk-d.today { border-color: var(--text); }
.wk-d.mini { display: inline-block; width: 10px; height: 10px; padding: 0; border-radius: 3px; vertical-align: -1px; margin: 0 3px 0 8px; }
.wk-legend { display: flex; align-items: center; flex-wrap: wrap; }
.wk-lbl { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.dispo-list { list-style: none; margin: 0; padding: 0; }
.dispo-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dispo-list li.today { font-weight: 700; }
.rest-days .check-row { min-width: 64px; }

/* Utilitaires complémentaires */
.mt-4 { margin-top: 4px; }
.ml-auto { margin-left: auto; }
.empty-state { padding: 32px 18px; text-align: center; color: var(--muted); }
.danger-text { color: var(--danger); }
.fs-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.fs-plain legend { padding: 0; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }

/* =========================================================
   Maintenance, rentabilité, rapports, paramètres, connexion
   ========================================================= */
.warn-text { color: var(--warning); }
.success-text { color: var(--success); }
.pb-12 { padding-bottom: 12px; }
#p-table tfoot td, #r-table tfoot td { border-top: 2px solid var(--border); background: var(--surface-2); }
.r-filters { padding: 12px 0 0; border: 0; }
.r-filters label.small { display: inline-flex; align-items: center; gap: 6px; }
.r-kpis { padding: 0 18px 14px; margin: 0; }
.report-sheet .card-head { align-items: flex-start; }
.settings-form { max-width: 820px; }
.settings-form h3, .card-body h3 { font-size: 14px; margin: 0 0 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.notif-list .switch { flex-shrink: 0; }
.demo-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.demo-box p { margin: 4px 0 0; max-width: 620px; }
.roles-table td:first-child { font-weight: 600; }

body.login-page { background: linear-gradient(160deg, #e8eef8 0%, #f5f7fb 60%); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; }
.login-card h1 { font-size: 20px; margin: 20px 0 6px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.profile-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.profile-card:hover, .profile-card:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.profile-card .grow { display: flex; flex-direction: column; }
@media print { .report-sheet { border: 0; } .r-kpis .kpi { break-inside: avoid; } }
@media (max-width: 680px) { .login-card { padding: 20px; } .demo-box .btn { width: 100%; justify-content: center; } }

/* ---------- Bilan du jour (tableau de bord) ---------- */
.dr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dr-tile { border: 1px solid var(--border, #e3e7ee); border-radius: 10px; padding: 10px 12px; background: #fafbfc; min-width: 0; }
.dr-tile.ok { border-left: 3px solid var(--success); }
.dr-tile.post { border-left: 3px solid #9b51d0; }
.dr-tile.neg { border-left: 3px solid var(--danger); }
.dr-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.dr-value { font-size: 20px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dr-h { font-size: 14px; margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.dr-list { border: 1px solid var(--border, #e3e7ee); border-radius: 10px; }
.dr-list .list-item { padding: 9px 14px; }
@media (max-width: 900px) { .dr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
