:root{
  --navy:#003057; --navy-dark:#001c33; --border:#dfe2e6; --muted:#6b7280; --grey-bg:#f4f5f7;
  --green:#2e7d32; --red:#c62828;
}
*{ box-sizing:border-box; }
body{ font-family:Arial, Helvetica, sans-serif; margin:0; background:var(--app-bg, #fafbfc); color:#1a1a1a; font-size:13px; }

.scandia-logo{ display:flex; align-items:baseline; gap:10px; font-family:Georgia, 'Times New Roman', serif; }
.scandia-logo .scandia-word{ color:#0E2A4E; font-weight:700; font-size:20px; }
.scandia-logo .brand-word{ color:#111; font-weight:700; font-size:13px; letter-spacing:1px; }

.header{
  background:var(--navy-dark); color:#fff; display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px;
}
.header h1{ font-size:16px; margin:0; font-weight:600; }
.header .scandia-logo .scandia-word{ color:#ffffff; }
.header .scandia-logo .brand-word{ color:#c9d4de; }
.header-right{ display:flex; gap:8px; align-items:center; }
.header-right a, .header-right button{ color:#fff; }
.display-mode-picker{ display:flex; gap:4px; margin-right:8px; background:rgba(255,255,255,0.08); border-radius:6px; padding:3px; }
.dmp-btn{ font-size:10px; padding:5px 9px; border:none; border-radius:4px; background:transparent; color:#c9d4de; cursor:pointer; }
.dmp-btn.active{ background:#fff; color:var(--navy); font-weight:700; }
html.prep-only-mode #pageSidebar{ display:none; }
html.prep-only-mode #sectionToggleLeft{ display:none; }
html.prep-only-mode .main{ max-width:none; }

.search-box{ position:relative; margin-right:8px; }
.search-box input{ font-size:11px; padding:6px 10px; border-radius:6px; border:1px solid rgba(255,255,255,0.3); background:rgba(255,255,255,0.12); color:#fff; width:170px; }
.search-box input::placeholder{ color:#c9d4de; }
.search-box input:focus{ background:#fff; color:#1a1a1a; outline:none; }
.search-results-panel{ position:absolute; top:calc(100% + 4px); left:0; width:320px; max-height:340px; overflow-y:auto; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.2); z-index:1000; }
.search-result-item{ padding:8px 10px; border-bottom:1px solid var(--grey-bg); cursor:pointer; font-size:11px; }
.search-result-item:hover{ background:var(--grey-bg); }
.search-result-item:last-child{ border-bottom:none; }
.search-result-chassis{ font-weight:700; color:var(--navy); font-family:monospace; }
.search-result-meta{ color:var(--muted); font-size:10px; }
.search-no-results{ padding:12px; text-align:center; color:var(--muted); font-size:11px; }

.card-comment{ margin-top:8px; padding:8px 10px; background:#fff3e0; border:2px solid #f57c00; border-radius:6px; font-size:13px; font-weight:700; color:#8a4400; cursor:pointer; line-height:1.35; box-shadow:0 1px 3px rgba(245,124,0,0.25); }
.card-comment .comment-date{ font-weight:400; font-size:10px; color:#a97a3a; margin-left:4px; }
.card-comment .danger-icon{ margin-right:6px; font-size:18px; vertical-align:middle; }
.card-comment-add{ margin-top:6px; font-size:9px; color:var(--muted); cursor:pointer; opacity:0.6; }
.card-comment-add:hover{ opacity:1; text-decoration:underline; }
.veh-item-wrap{ margin-bottom:2px; }

.kpi-discreet{ display:flex; align-items:center; gap:6px; font-size:10.5px; color:#c9d4de; background:rgba(255,255,255,0.08); border-radius:6px; padding:4px 8px; margin-right:4px; }
.kpi-discreet select{ font-size:10px; padding:2px 5px; border-radius:4px; border:none; color:#333; }
.theme-picker{ display:flex; gap:4px; align-items:center; margin-right:8px; background:rgba(255,255,255,0.1); border-radius:8px; padding:5px 8px; }
.operator-badge{ font-size:11px; color:#fff; background:rgba(255,255,255,0.14); border-radius:8px; padding:5px 10px; text-decoration:none; white-space:nowrap; }
.operator-badge:hover{ background:rgba(255,255,255,0.25); }
.theme-swatch{ width:16px; height:16px; border-radius:50%; border:1px solid rgba(255,255,255,0.5); cursor:pointer; display:inline-block; }
.theme-swatch-photo{ background-size:cover; background-position:center; border:1px solid #fff; }
.theme-swatch:hover{ border-color:#fff; transform:scale(1.15); }

.btn{
  padding:7px 14px; border-radius:6px; border:1px solid rgba(255,255,255,0.3); background:transparent;
  font-size:12px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-block;
}
.btn.ghost{ color:#fff; }
.btn.ghost:hover{ background:rgba(255,255,255,0.1); }
.btn.primary{ background:var(--navy); color:#fff; border:none; padding:10px; }

#flashArea{ position:fixed; top:10px; right:10px; z-index:999; display:flex; flex-direction:column; gap:6px; }
.flash{ background:#c62828; color:#fff; padding:10px 14px; border-radius:6px; font-size:12px; max-width:360px; box-shadow:0 4px 12px rgba(0,0,0,0.2); }
.flash.success{ background:#2e7d32; }

.week-nav{ display:flex; align-items:center; justify-content:center; gap:16px; padding:10px 20px; background:#fff; margin:0 20px; border-radius:8px; border:1px solid var(--border); flex-wrap:wrap; }
.week-vehicle-kpi{ display:flex; gap:10px; margin-left:8px; padding-left:14px; border-left:1px solid var(--border); }
.wvk-item{ font-size:10.5px; color:var(--muted); white-space:nowrap; }
.wvk-item strong{ font-size:13px; color:var(--navy); margin-left:2px; }
.wvk-vn strong{ color:#0c5faa; }
.wvk-vo strong{ color:#6a1b9a; }
.wvk-ps strong{ color:#00897b; }
.wvk-total{ font-weight:700; }
.week-nav .week-label{ font-weight:700; color:var(--navy); font-size:13px; min-width:200px; text-align:center; }
.btn.small{ font-size:11px; padding:5px 10px; border:1px solid var(--border); color:#333; }
.form .hint{ font-size:10.5px; color:var(--muted); font-style:italic; margin:0 0 6px; line-height:1.4; }

.tabs{ display:flex; gap:6px; padding:14px 20px 0; }
.view-toggle{ display:flex; gap:6px; padding:8px 20px 0; }
.view-toggle .btn.small{ background:#fff; }
.view-toggle .btn.active{ background:var(--navy); color:#fff; border-color:var(--navy); }

.section-toggle{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 20px 0; }
.section-toggle-left{ display:flex; gap:8px; }
.section-toggle-right{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.section-toggle-right .section-btn{ padding:6px 12px; font-size:11px; background:#fff; }
.section-btn{ padding:9px 18px; font-size:13px; font-weight:700; border-radius:8px; border:1px solid var(--border); background:#fff; color:#333; text-decoration:none; }
.section-btn.active{ background:var(--navy); color:#fff; border-color:var(--navy); }
.options-dropdown{ position:relative; display:inline-block; }
.options-dropdown .section-btn{ cursor:pointer; }
.options-dropdown-menu{ display:none; position:absolute; top:calc(100% + 6px); left:0; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,0.12); min-width:190px; z-index:500; overflow:hidden; }
.options-dropdown-menu.open{ display:block; }
.options-dropdown-menu a{ display:block; padding:10px 14px; font-size:13px; font-weight:600; color:#333; text-decoration:none; border-bottom:1px solid var(--border); }
.options-dropdown-menu a:last-child{ border-bottom:none; }
.options-dropdown-menu a:hover{ background:#f4f5f7; }

.fill-overview{ display:flex; gap:14px; padding:10px 0; flex-wrap:wrap; }
.fill-day{
  display:flex; flex-direction:column; align-items:center; gap:6px; width:110px;
  padding:10px; border:1px solid var(--border); border-radius:10px; background:#fafbfc;
}
.fill-day.over{ border-color:var(--red); background:#fdecea; }
.fill-day-label{ font-size:12px; font-weight:700; color:var(--navy); text-align:center; }
.fill-gauge-bg{ width:28px; height:120px; background:var(--grey-bg); border-radius:6px; overflow:hidden; display:flex; align-items:flex-end; }
.fill-gauge-fill{ width:100%; transition:height 0.2s; }
.fill-gauge-fill.low{ background:var(--green); }
.fill-gauge-fill.mid{ background:#e0910a; }
.fill-gauge-fill.high{ background:#d9822b; }
.fill-gauge-fill.over{ background:var(--red); }
.fill-day-pct{ font-size:16px; font-weight:800; color:var(--navy); }
.fill-day-nums{ display:flex; flex-direction:column; align-items:center; font-size:10px; color:var(--muted); }
.fill-day-nums .ok{ color:var(--green); font-weight:700; }
.fill-day-nums .over{ color:var(--red); font-weight:700; }
.fill-day-absent{ font-size:9px; color:var(--red); text-align:center; }

.week-head-row{ display:grid; min-width:700px; }
.week-day-head{ text-align:center; padding:4px 2px; border-left:1px solid var(--border); }
.week-day-name{ font-size:11px; font-weight:700; color:var(--navy); }
.week-day-cap{ font-size:9px; color:var(--muted); }
.week-day-cap.over{ color:var(--red); font-weight:700; }
.week-day-absent{ position:absolute; bottom:2px; left:2px; right:2px; font-size:8px; color:var(--red); text-align:center; }
.cal-block{ overflow:hidden; }

.dms-week{ display:grid; gap:8px; align-items:start; overflow-x:auto; }
.dms-day-col{ background:#fafbfc; border:1px solid var(--border); border-radius:8px; padding:8px; min-width:150px; display:flex; flex-direction:column; gap:6px; }
.dms-day-header{ display:flex; justify-content:space-between; align-items:center; }
.dms-day-count{ font-size:16px; font-weight:800; color:var(--navy); background:#e8eef5; border-radius:6px; padding:2px 8px; }
.dms-add-btn{ width:24px; height:24px; border-radius:6px; border:1px solid var(--green); background:#fff; color:var(--green); font-size:15px; font-weight:800; cursor:pointer; line-height:1; }
.dms-add-btn:hover{ background:var(--green); color:#fff; }
.dms-day-name{ font-size:11px; font-weight:700; color:var(--navy); text-align:center; line-height:1.3; padding-bottom:4px; border-bottom:1px solid var(--border); }
.dms-card{ background:#fff; border-radius:6px; padding:6px 8px; box-shadow:0 1px 2px rgba(0,0,0,0.08); font-size:10.5px; cursor:zoom-in; }
.dms-card-model{ font-weight:800; color:var(--navy); font-size:11.5px; cursor:pointer; margin-bottom:2px; }
.dms-card-row{ color:#444; line-height:1.5; }
.dms-card-icons{ display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin-top:5px; }
.card-zoom-overlay{ display:none; position:fixed; inset:0; background:rgba(20,25,35,0.55); z-index:9000; align-items:center; justify-content:center; padding:20px; }
.card-zoom-overlay.open{ display:flex; }
.card-zoom-box{ background:#fff; border-radius:12px; padding:22px 26px; max-width:420px; width:100%; max-height:88vh; overflow-y:auto; box-shadow:0 12px 40px rgba(0,0,0,0.3); position:relative; font-size:16px; cursor:default; }
.card-zoom-box .dms-card-model{ font-size:19px; margin-bottom:8px; }
.card-zoom-box .dms-card-row{ font-size:15px; line-height:1.8; }
.card-zoom-box .dms-card-icons{ margin-top:14px; gap:8px; }
.card-zoom-box .dms-card-icons button, .card-zoom-box .dms-card-icons a{ font-size:13px; padding:7px 10px; }
.card-zoom-box .statut-badge{ font-size:13px; padding:4px 10px; }
.card-zoom-close{ position:absolute; top:10px; right:14px; font-size:22px; color:var(--muted); cursor:pointer; background:none; border:none; line-height:1; }
.card-zoom-close:hover{ color:#c62828; }
.statut-badge.small{ font-size:8px; padding:2px 5px; border-radius:3px; color:#fff; font-weight:700; }
.ct-btn.tiny, .mag-btn.tiny{ font-size:8px; padding:2px 5px; }

.dms-day-header.dms-level-low{ background:#e8f5e9; border-radius:6px; padding:2px 6px; }
.dms-day-header.dms-level-mid{ background:#fff3e0; border-radius:6px; padding:2px 6px; }
.dms-day-header.dms-level-high{ background:#ffe0b2; border-radius:6px; padding:2px 6px; }
.dms-day-header.dms-level-over{ background:#ffcdd2; border-radius:6px; padding:2px 6px; }
.dms-fill-pct{ font-size:12px; font-weight:800; color:#333; }
.dms-level-low .dms-fill-pct{ color:var(--green); }
.dms-level-mid .dms-fill-pct, .dms-level-high .dms-fill-pct{ color:#e0910a; }
.dms-level-over .dms-fill-pct{ color:var(--red); }
.dms-day-cap-line{ font-size:9px; color:var(--muted); text-align:center; }
.dms-day-absent{ font-size:8px; color:var(--red); text-align:center; }

.dms-hour-label{ font-size:9px; font-weight:700; color:var(--muted); border-top:1px solid var(--border); padding-top:3px; margin-top:2px; }
.dms-hour-empty{ height:6px; }
.dms-lunch-label{ color:#b8860b; background:repeating-linear-gradient(45deg,#fdf6e3,#fdf6e3 4px,#faedcd 4px,#faedcd 8px); text-align:center; border-radius:3px; padding:2px 0; }

.transport-email-box{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.dms-card-select{ display:block; font-size:8px; color:var(--muted); margin-bottom:2px; cursor:pointer; }
.dms-card-select input{ transform:scale(0.8); vertical-align:middle; margin-right:2px; }
.email-results{ background:#f4f8fb; border:1px solid var(--border); border-radius:8px; padding:10px; margin-bottom:10px; }
.email-result-card{ background:#fff; border:1px solid var(--border); border-radius:6px; padding:8px 10px; margin-bottom:6px; font-size:11px; }
.email-result-card.below-min{ border-color:var(--red); background:#fff5f5; }
.email-result-subject{ font-weight:700; color:var(--navy); margin-bottom:3px; }
.email-result-warn{ color:var(--red); font-size:10px; font-weight:700; }
.tab{
  padding:8px 16px; border-radius:8px 8px 0 0; border:1px solid var(--border); border-bottom:none;
  background:#fff; font-size:13px; font-weight:600; color:#333; text-decoration:none;
}
.tab.active{ background:var(--navy); color:#fff; border-color:var(--navy); }

.layout{ display:flex; gap:14px; padding:14px 20px; align-items:flex-start; }
.sidebar{ width:260px; flex-shrink:0; display:flex; flex-direction:column; gap:12px; }
.panel{ background:#fff; border:1px solid var(--border); border-radius:10px; padding:14px; }
.panel h3{ font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--muted); margin:0 0 10px; }

.kpi-panel{ border:1px solid var(--navy); background:linear-gradient(180deg,#fff,#e6edf5); text-align:center; }
.kpi-big{ font-size:28px; font-weight:800; }
.kpi-sub{ font-size:10.5px; color:var(--muted); }

.prep-row{ display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--grey-bg); }
.prep-row:last-child{ border-bottom:none; }
.dot{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.name-input{ border:none; background:transparent; font-size:12px; font-weight:600; flex:1; padding:2px 0; }
.kpi-val{ font-size:11px; font-weight:700; }

.form label{ font-size:11px; color:var(--muted); display:block; margin:8px 0 4px; font-weight:600; }
.form select, .form input[type=text], .form input[type=date], .form input[type=time]{
  width:100%; padding:7px 8px; border-radius:6px; border:1px solid var(--border); font-size:12px;
}
.form button{
  width:100%; margin-top:12px; padding:9px; border-radius:6px; border:none; background:var(--navy);
  color:#fff; font-size:12px; font-weight:700; cursor:pointer;
}
.form button:hover{ background:#00223f; }

.main{ flex:1; min-width:0; }

.calendar-panel{ margin-bottom:14px; }
.calendar-panel-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.calendar-panel-head h3{ margin:0; }
.day-export-links{ display:flex; gap:6px; }
.calendar-panel h3{ text-transform:none; font-size:13px; font-weight:700; color:var(--navy); }
.calendar-wrap{ overflow-x:auto; }
.cal-head-row{ display:grid; grid-template-columns:56px repeat(3, 1fr); min-width:600px; }
.cal-hour-col-head{ }
.cal-prep-head{ font-size:12px; font-weight:700; text-align:center; padding:4px 0; border-left:1px solid var(--border); }
.cal-body{ position:relative; display:grid; grid-template-columns:56px repeat(3, 1fr); min-width:600px; }
.cal-hour-col{ position:relative; border-right:1px solid var(--border); }
.cal-hour-label{ position:absolute; right:6px; font-size:10px; color:var(--muted); transform:translateY(-6px); }
.cal-day-col{ position:relative; border-left:1px solid var(--border); }
.cal-hour-line{ position:absolute; left:0; right:0; border-top:1px solid var(--grey-bg); }
.cal-lunch{ position:absolute; left:0; right:0; background:repeating-linear-gradient(45deg,#fafafa,#fafafa 6px,#f0f0f0 6px,#f0f0f0 12px); }
.cal-block{
  position:absolute; left:2px; right:2px; border-radius:5px; padding:3px 5px; overflow:hidden;
  font-size:10px; line-height:1.25; cursor:pointer; color:#fff;
}
.cal-block-time{ display:block; font-weight:700; font-size:9px; opacity:0.9; }
.cal-block-chassis{ display:block; font-weight:800; font-size:11px; }
.cal-block-meta{ display:block; opacity:0.9; font-size:9px; }
.grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-bottom:16px; }
@media (max-width:900px){ .grid{ grid-template-columns:1fr; } }

.card{ background:#fff; border:1px solid var(--border); border-radius:10px; padding:14px; }
.card-title{ font-size:14px; font-weight:700; margin:0 0 8px; }
.bar-bg{ height:8px; background:var(--grey-bg); border-radius:4px; overflow:hidden; margin-bottom:8px; }
.bar-fill{ height:100%; }
.counters{ display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-bottom:10px; }
.restant.ok{ color:var(--green); font-weight:700; }
.restant.over{ color:var(--red); font-weight:700; }

.section-label{ font-size:11px; font-weight:700; text-transform:uppercase; color:var(--muted); margin:10px 0 6px; }
.veh-list{ display:flex; flex-direction:column; gap:5px; }
.rdv-encart{ border-left:4px solid #ef6c00; }
.rdv-encart-count{ background:#ef6c00; color:#fff; font-size:11px; font-weight:800; border-radius:10px; padding:1px 8px; margin-left:6px; }
.rdv-encart-list{ display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.rdv-encart-item{ font-size:11px; border-bottom:1px solid var(--grey-bg); padding-bottom:5px; display:flex; flex-direction:column; }
.rdv-encart-date{ font-weight:700; color:var(--navy); }
.rdv-encart-name{ color:#444; }
.rdv-encart-warn{ color:var(--red); font-size:9px; font-weight:700; }
.schedule-form-row td{ background:#f4f8fb; padding:14px !important; }
.schedule-form-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; text-align:left; }
.schedule-form-grid label{ display:block; font-size:10px; font-weight:700; color:var(--navy); margin-bottom:3px; }
.schedule-form-grid input, .schedule-form-grid select{ width:100%; padding:6px 8px; border:1px solid var(--border); border-radius:6px; font-size:12px; box-sizing:border-box; }

.mini-cal-btn{ border:1px solid var(--border); background:#fff; border-radius:6px; padding:5px 8px; cursor:pointer; font-size:12px; margin-left:4px; vertical-align:middle; }
.mini-cal-btn:hover{ background:var(--grey-bg); }
.mini-cal-popup{ position:absolute; z-index:1000; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.18); padding:10px; width:230px; }
.mini-cal-header{ display:flex; justify-content:space-between; align-items:center; font-size:12px; font-weight:700; color:var(--navy); margin-bottom:8px; }
.mini-cal-nav{ border:none; background:none; cursor:pointer; font-size:14px; font-weight:800; color:var(--navy); padding:2px 8px; }
.mini-cal-nav:hover{ background:var(--grey-bg); border-radius:4px; }
.mini-cal-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:3px; }
.mini-cal-dow{ font-size:9px; color:var(--muted); text-align:center; font-weight:700; }
.mini-cal-day{ font-size:11px; text-align:center; padding:5px 0; border-radius:4px; cursor:pointer; }
.mini-cal-day:hover{ outline:2px solid var(--navy); }
.mini-cal-weekend{ opacity:0.35; cursor:not-allowed; }
.mini-cal-saturday{ box-shadow:inset 0 0 0 1px #ef6c00; }
.mini-cal-empty{}
.mini-cal-loading{ font-size:11px; color:var(--muted); text-align:center; padding:10px; }

.recap-vendeur-card{}

.mv-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; }
.mv-dow{ font-size:10px; font-weight:700; color:var(--muted); text-align:center; text-transform:uppercase; padding-bottom:4px; }
.mv-day{ display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:64px; border-radius:8px; padding:6px 4px; text-decoration:none; position:relative; cursor:pointer; }
.mv-day:hover{ outline:2px solid var(--navy); }
.mv-day.mv-out{ opacity:0.3; }
.mv-day.mv-sunday{ opacity:0.45; cursor:default; }
.mv-daynum{ font-size:11px; font-weight:700; color:var(--navy); margin-bottom:2px; }
.mv-count{ font-size:20px; font-weight:800; line-height:1; }
.mv-cap{ font-size:10px; color:var(--muted); }
.mv-warn{ position:absolute; top:3px; right:4px; font-size:11px; }
.mv-legend{ display:flex; flex-wrap:wrap; gap:14px; margin-top:14px; font-size:10px; color:var(--muted); align-items:center; }
.mv-legend-dot{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.reprise-icon{ font-size:0.85em; }
.decompte-fields{ background:#f4f8fb; border:1px solid var(--border); border-radius:8px; padding:10px; margin-bottom:8px; }
.decompte-fields input{ margin-bottom:6px; }
.camion-card{ background:#fafbfc; border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-bottom:10px; }
.camion-head{ font-size:12px; color:var(--navy); margin-bottom:6px; }
.camion-vehicles{ margin:0 0 8px 18px; padding:0; font-size:11px; color:var(--muted); }
.camion-actions{ display:flex; gap:8px; }
.arrivee-badge{ display:inline-block; padding:5px 9px; background:#e8f5e9; border:1px solid #2e7d32; color:#1b5e20; border-radius:6px; font-size:11px; font-weight:700; }
.recap-vendeur-head{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.vendeur-dot{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; }
.recap-vendeur-stats{ display:flex; gap:10px; font-size:11px; font-weight:700; }
.recap-stat.done{ color:var(--green); }
.recap-stat.upcoming{ color:#0c5faa; }
.recap-stat.total{ color:var(--muted); }
.recap-vendeur-cols{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.recap-col h4{ font-size:11px; text-transform:uppercase; letter-spacing:0.03em; color:var(--muted); margin:0 0 6px; }
.recap-item{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:11px; padding:5px 0; border-bottom:1px solid var(--grey-bg); cursor:pointer; }
.recap-item.done{ cursor:default; opacity:0.8; }
.recap-item-date{ font-weight:700; color:var(--navy); min-width:110px; }
.recap-item-main{ color:#333; }
.recap-item-client{ color:var(--muted); }

.veh-item{ display:flex; justify-content:space-between; align-items:center; border-radius:6px; padding:6px 8px; font-size:12px; gap:8px; }
.veh-item .prep-tag{ font-size:9px; font-weight:700; color:#fff; padding:2px 6px; border-radius:4px; flex-shrink:0; white-space:nowrap; }
.veh-main{ flex:1; display:flex; flex-direction:column; gap:2px; cursor:pointer; }
.veh-main .time{ font-weight:700; color:var(--navy); font-size:11px; }
.veh-main .chassis{ font-weight:800; }
.veh-main .meta{ color:var(--muted); font-size:11px; }
.veh-main .delivery-tag{ font-size:10px; color:var(--navy); font-weight:600; }
.statut-badge{ align-self:flex-start; font-size:9px; font-weight:700; padding:1px 5px; border-radius:3px; color:#3a2a00; }
.veh-item button.rm{ border:none; background:transparent; color:var(--muted); cursor:pointer; font-size:14px; }
.veh-item button.rm:hover{ color:var(--red); }
.ct-btn{
  border:1px solid #6a1b9a; background:#fff; color:#6a1b9a; font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.ct-btn.done{ background:#6a1b9a; color:#fff; }
.mag-btn{
  border:1px solid #1565c0; background:#fff; color:#1565c0; font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.mag-btn.done{ background:#1565c0; color:#fff; }
.immat-btn{
  border:1px solid #ef6c00; background:#fff; color:#ef6c00; font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.immat-btn.done{ background:#ef6c00; color:#fff; }
.pickup-btn{
  border:1px solid #00897b; background:#fff; color:#00897b; font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.pickup-btn.done{ background:#00897b; color:#fff; }
.pickup-btn.tiny{ font-size:8px; padding:2px 5px; }
.pickup-btn.add{ border-style:dashed; opacity:0.75; }
.pickup-btn.add:hover{ opacity:1; }
.immat-btn.tiny{ font-size:8px; padding:2px 5px; }
.edit-btn{
  border:1px solid var(--navy); background:#fff; color:var(--navy); font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.edit-btn.tiny{ font-size:8px; padding:2px 5px; }
.clean-btn{
  border:1px solid var(--green); background:#fff; color:var(--green); font-size:9px; font-weight:700;
  border-radius:4px; padding:3px 6px; cursor:pointer; white-space:nowrap;
}
.clean-btn.done{ background:var(--green); color:#fff; }
.planning-badge{ font-size:9px; font-weight:700; color:var(--green); background:#e8f5e9; padding:3px 6px; border-radius:4px; }
.cal-block .ct-tag{
  display:inline-block; margin-top:2px; font-size:8px; font-weight:700; padding:1px 4px; border-radius:3px;
  background:rgba(255,255,255,0.25); cursor:pointer;
}
.empty{ font-size:12px; color:#9aa0a6; font-style:italic; margin:4px 0; }
.slot-free{ display:flex; justify-content:space-between; background:#e8f5e9; color:#1b5e20; border-radius:6px; padding:5px 8px; font-size:12px; margin-bottom:4px; }

.hist-panel h3{ display:flex; justify-content:space-between; align-items:center; font-size:12px; text-transform:none; color:var(--navy); font-weight:700; }
.hist-count{ font-weight:400; font-size:10.5px; color:var(--muted); }
.hist-list{ max-height:260px; overflow-y:auto; display:flex; flex-direction:column; gap:3px; }
.hist-item{ font-size:11px; display:flex; gap:8px; padding:5px 6px; border-bottom:1px solid var(--grey-bg); }
.hist-item .ts{ color:var(--muted); min-width:118px; flex-shrink:0; }
.hist-item .tag{ font-weight:700; min-width:64px; flex-shrink:0; }
.hist-item .tag.add{ color:var(--green); }
.hist-item .tag.rem{ color:var(--red); }
.hist-item .tag.chg{ color:#8a5a00; }

.lock-screen{ position:fixed; inset:0; background:var(--navy-dark); display:flex; align-items:center; justify-content:center; }
.lock-card{ background:#fff; border-radius:12px; padding:32px 28px; width:320px; text-align:center; box-shadow:0 10px 40px rgba(0,0,0,0.3); }
.lock-logo{ font-weight:800; letter-spacing:1px; font-size:16px; color:var(--navy-dark); margin-bottom:6px; }
.lock-logo span{ background:var(--navy-dark); color:#fff; padding:2px 6px; margin-right:6px; border-radius:3px; }
.lock-sub{ font-size:11px; color:var(--muted); margin:0 0 18px; }
.lock-card input{ width:100%; padding:10px; border-radius:6px; border:1px solid var(--border); font-size:13px; margin-bottom:10px; text-align:center; box-sizing:border-box; }
.lock-card button{ width:100%; padding:10px; border-radius:6px; border:none; background:var(--navy); color:#fff; font-size:13px; font-weight:700; cursor:pointer; }
.lock-error{ color:var(--red); font-size:11px; margin:10px 0 0; }

.ref-table{ width:100%; border-collapse:collapse; font-size:12px; }
.ref-table th{ background:var(--grey-bg); text-align:left; padding:6px 8px; }
.ref-table td{ padding:5px 8px; border-bottom:1px solid var(--grey-bg); }
.ref-table input{ width:70px; padding:4px 6px; border:1px solid var(--border); border-radius:4px; }

/* Compatibilité des écrans PHP avec la présentation originale Python */
.ob-main{max-width:1500px;margin:0 auto;padding:16px 20px 40px}
.ob-page-title{font-size:19px;margin:4px 0 18px}
.header-right{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.ob-user{color:#f1f5f9;font-size:12px}
.ob-global-nav{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.ob-global-nav .btn.ghost{font-size:11px;text-decoration:none;white-space:nowrap}
.ob-planning-top{padding:0 0 14px}
.ob-week-label{font-weight:700;font-size:15px;margin:8px 0}
.ob-view-switch{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}
.ob-view-switch .section-btn{text-decoration:none}
.ob-view-switch .section-btn.active{background:#003057;color:white;border-color:#003057}
.ob-day-selector{display:grid;grid-template-columns:repeat(5,minmax(100px,1fr));gap:10px;margin:12px 0}
.ob-day-selector .metric{display:block;text-align:center;text-decoration:none;background:white;border:1px solid #dfe2e6;border-radius:7px;padding:9px}
.ob-day-selector .metric small{display:block;color:#6b7280}.ob-day-selector .metric b{display:block;font-size:21px;color:#003057}
.ob-main .panel{background:white;border:1px solid #dfe2e6;border-radius:7px;padding:15px;margin:12px 0}
.ob-main .panel h2{font-size:16px;margin:0 0 10px}
.ob-main .tablewrap{overflow:auto}
.ob-main table{width:100%;border-collapse:collapse}
.ob-main th,.ob-main td{padding:8px;border-bottom:1px solid #e4e7eb;text-align:left}
.ob-main th{background:#eef1f5}
.ob-main .status{border-radius:5px;background:#edf2f7;padding:3px 7px}
.ob-main .narrow{max-width:520px;margin:30px auto}
.ob-main label{display:block;margin:10px 0}
.ob-main input,.ob-main select{max-width:100%}
.ob-main .error{color:#c62828}
@media(max-width:760px){.ob-day-selector{grid-template-columns:repeat(2,1fr)}.header-right{justify-content:flex-start}.ob-main{padding:12px}}

/* Organizer Bonnevoie : restitution des commandes et de la disposition Python */
.ob-original-week{display:flex;justify-content:center;align-items:center;gap:35px;flex-wrap:wrap;background:#fff;border:1px solid #dce2e8;border-radius:7px;padding:10px;margin-bottom:10px}.ob-original-week strong{min-width:170px;text-align:center;color:#003057}.ob-week-kpi{border-left:1px solid #dce2e8;padding-left:15px;font-size:12px}.ob-original-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0}.ob-toolbar-left,.ob-toolbar-right{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.ob-original-toolbar .btn,.ob-view-toggle .btn,.ob-original-week .btn{font-size:12px!important;padding:7px 10px!important;border:1px solid #d6dce3!important;border-radius:6px!important;background:#fff!important;color:#14273a!important;text-decoration:none!important;box-shadow:none!important;white-space:nowrap}.ob-original-toolbar .btn.active,.ob-view-toggle .btn.active{background:#003057!important;color:#fff!important;border-color:#003057!important}.ob-unavailable{opacity:.55;cursor:not-allowed!important}.ob-menu{position:relative}.ob-menu summary{list-style:none;cursor:pointer}.ob-menu summary::-webkit-details-marker{display:none}.ob-menu-items{position:absolute;z-index:50;top:100%;left:0;min-width:205px;background:#fff;border:1px solid #d6dce3;border-radius:7px;box-shadow:0 7px 20px #0002;padding:5px}.ob-menu-items a,.ob-menu-items span{display:block;padding:9px 10px;font-size:12px;text-decoration:none;color:#12304d}.ob-menu-items a:hover{background:#edf4fa}.ob-menu-items span{color:#84909c}.ob-menu-items small{font-size:10px}.ob-view-toggle{display:flex;gap:6px;margin:8px 0}.ob-original-tabs{display:flex;gap:5px;flex-wrap:wrap;margin:10px 0 12px}.ob-day-tab{padding:9px 14px;background:#fff;border:1px solid #d7dfe8;border-radius:6px 6px 0 0;color:#152e49;text-decoration:none;font-size:12px;font-weight:bold}.ob-day-tab.active{background:#003057;color:#fff}.ob-original-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:14px;align-items:start}.ob-original-sidebar .panel{padding:12px!important;margin:0!important}.ob-pending{border-left:4px solid #f4740a!important}.ob-pending h3{font-size:12px;letter-spacing:.5px;margin:0 0 8px;color:#315174}.ob-pending h3 span{background:#f4740a;color:white;border-radius:12px;padding:2px 7px}.ob-pending-item{padding:8px 0;border-bottom:1px solid #edf0f3;font-size:12px}.ob-pending-item strong{font-size:11px;color:#002e59}.ob-pending-item small{color:#c43131;display:block}.ob-pending .btn{display:block;text-align:center;margin-top:10px}.ob-original-content{min-width:0}.ob-original-content .panel{margin-top:0!important}@media(max-width:950px){.ob-original-layout{grid-template-columns:1fr}.ob-original-sidebar{order:2}.ob-original-content{order:1}}@media(max-width:650px){.ob-original-week{gap:10px}.ob-original-toolbar{align-items:flex-start}.ob-day-tab{padding:7px}}

/* Correction 26-10 : planning pleine largeur, onglets visibles, sans débordement */
body:has(.ob-original-layout) .ob-main{max-width:none;width:100%;padding:12px 8px 30px}
body:has(.ob-original-layout){overflow-x:hidden}
body:has(.ob-original-layout) header{max-width:100%;min-width:0}
body:has(.ob-original-layout) .header-right{min-width:0}
.ob-original-week{width:100%;margin-inline:auto;gap:clamp(10px,3vw,38px)}
.ob-original-toolbar{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center}
.ob-toolbar-right{justify-content:flex-end;min-width:0}
.ob-original-tabs{display:flex;flex-wrap:nowrap;gap:5px;overflow-x:auto;max-width:100%;scrollbar-width:thin;padding-bottom:2px}
.ob-day-tab{flex:0 0 auto;white-space:nowrap}
.ob-original-layout{grid-template-columns:260px minmax(0,1fr);width:100%}
.ob-original-content{min-width:0;overflow:hidden}
.ob-original-content .tablewrap{max-width:100%;overflow-x:auto}
.ob-original-content .ob-cal-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;overflow-x:auto}
.ob-original-content .ob-cal-day{min-width:0}
.ob-original-content .ob-cal-head{padding:8px}
.ob-original-content .ob-cal-card{margin:5px;padding:8px;font-size:12px}
.ob-original-content .ob-cal-card span{font-size:11px}
.ob-original-content .ob-cal-hour{padding:5px 8px}
.ob-original-content .ob-cal-grid .ob-cal-day{border-top:0}
.ob-original-content .ob-cal-head{border-top-width:0!important}
.ob-original-content .ob-cal-head:has(+ *){border-radius:6px}
.ob-original-content .ob-day-summary{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:7px 8px;border-radius:6px;background:#e5f4e8;color:#003057;font-weight:700;margin-bottom:5px}
.ob-original-content .ob-day-summary.is-busy{background:#fff0d8}
.ob-original-content .ob-day-summary.is-over{background:#ffe0e0}
.ob-original-content .ob-day-summary b{font-size:17px}
.ob-original-content .ob-day-summary em{font-style:normal;color:#187438;font-size:12px}
.ob-original-content .ob-day-summary.is-busy em{color:#9d5900}
.ob-original-content .ob-day-summary.is-over em{color:#b32121}
.ob-original-content .ob-cal-head small{display:block}
.ob-original-content .ob-cal-grid .ob-cal-day .ob-cal-head strong{text-align:center}
@media(max-width:1250px){.ob-original-toolbar{display:flex;flex-wrap:wrap}.ob-toolbar-right{justify-content:flex-start}.ob-original-content .ob-cal-grid{grid-template-columns:repeat(5,minmax(185px,1fr))}.ob-original-content .ob-cal-day{min-width:185px}}
@media(max-width:950px){.ob-original-layout{grid-template-columns:1fr}.ob-original-sidebar{order:2}.ob-original-content{order:1}}
