@font-face { font-family: Inter; font-weight: 400; src: url(../vendor/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; src: url(../vendor/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; src: url(../vendor/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; src: url(../vendor/fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --side: #0e2a20; --side-2: #143a2c; --side-txt: #b9cfc4;
  --green: #129a5c; --green-2: #1fbf74; --green-3: #9fe0bd; --green-soft: #e6f6ed; --stmig: #41a62a;
  --ink: #12211b; --ink-2: #4a5a53; --ink-3: #7b8a83; --line: #e3e9e6; --bg: #f1f4f2; --card: #fff;
  --red: #e5484d; --red-soft: #fdecec; --amber: #f2a93b; --amber-soft: #fff4e2; --blue: #2f6fb3;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 1px 1px rgba(16, 40, 30, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
.demo-banner { background: #fff4e2; color: #8a5a00; text-align: center; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid #f3d9a6; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: #c9d6cf; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #0f874f; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.grid2 > *, .grid3 > * { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* Pastilles */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: #0b7a47; }
.chip.warn { background: var(--amber-soft); color: #9a5b00; }
.chip.ko { background: var(--red-soft); color: #b42318; }
.chip.info { background: #e8f0fb; color: #1f5596; }
.chip.grey { background: #eef1ef; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Connexion ---------- */
.login { min-height: 100%; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #164634 0%, var(--side) 55%); padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-card .logos { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.login-card .logos img { height: 34px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- Web ---------- */
.web { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side) 236px, transparent 236px); }
.side { background: var(--side); color: var(--side-txt); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #fff; padding: 4px 8px 14px; }
.side .brand .logo-plate { background: #fff; border-radius: 10px; padding: 9px 14px; width: 100%; box-sizing: border-box; display: flex; justify-content: center; }
.side .brand .stmig { width: 100%; max-width: 168px; height: auto; display: block; }
.side .brand span { font-size: 10px; letter-spacing: .8px; line-height: 1.4; color: var(--green-3); font-weight: 600; }
.brand .leaf { width: 34px; height: 34px; border-radius: 9px; background: var(--stmig); display: grid; place-items: center; flex: none; }
.brand b { display: block; letter-spacing: .4px; font-size: 15px; }
.brand span { display: block; font-size: 10.5px; color: var(--side-txt); letter-spacing: .3px; }
.side h6 { margin: 14px 8px 8px; color: var(--green-2); font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; }
.side nav a { display: flex; align-items: center; gap: 10px; color: var(--side-txt); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 2px; }
.side nav a:hover { background: var(--side-2); color: #fff; }
.side nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--green-2); font-weight: 600; }
.side nav a .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 1px 7px; }
.side .ico { width: 16px; text-align: center; opacity: .85; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; background: var(--side-2); border-radius: 10px; padding: 10px; }
.side .me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.side .me b { color: #fff; font-size: 12.5px; display: block; }
.side .me span { font-size: 11px; }


.main { padding: 22px 26px 30px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar .sub { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.live { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--green-3); color: #0b7a47; background: var(--green-soft); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.live .dot { background: var(--green-2); box-shadow: 0 0 0 0 rgba(31,191,116,.7); animation: pulse 2s infinite; }
.live.off { border-color: #f3d9a6; background: var(--amber-soft); color: #9a5b00; }
.live.off .dot { background: var(--amber); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,191,116,.6); } 70% { box-shadow: 0 0 0 7px rgba(31,191,116,0); } 100% { box-shadow: 0 0 0 0 rgba(31,191,116,0); } }
.select { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 500; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card h3 { margin: 0; font-size: 14px; }
.card .csub { color: var(--ink-3); font-size: 11.5px; margin: 2px 0 12px; }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-head .right { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; color: var(--ink-2); text-transform: uppercase; }
.kpi .val { font-size: 26px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -.5px; }
.kpi .val.green { color: var(--green); }
.kpi .val small { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.kpi .foot { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; margin-bottom: 14px; }
.gauge-wrap { position: relative; height: 150px; }
.gauge-val { position: absolute; left: 0; right: 0; top: 70px; text-align: center; }
.gauge-val b { font-size: 30px; display: block; }
.gauge-val span { font-size: 10px; letter-spacing: 1px; color: var(--ink-3); font-weight: 700; }
.mini2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mini2 > div { background: #f6f8f7; border-radius: 9px; padding: 9px 11px; font-size: 11.5px; color: var(--ink-2); }
.mini2 b { display: block; font-size: 16px; color: var(--ink); margin: 2px 0; }
.funnel .fr { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; margin: 12px 0; font-size: 12.5px; font-weight: 500; }
.funnel .bar { background: #eef3f0; border-radius: 6px; height: 24px; overflow: hidden; }
.funnel .bar i { display: flex; align-items: center; height: 100%; padding-left: 10px; color: #fff; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--green); border-radius: 6px; white-space: nowrap; }
.chart-box { position: relative; height: 230px; }
.hl { margin-top: 10px; background: var(--green-soft); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: #0b5f39; }

table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfa; position: sticky; top: 0; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t.nowrap td, table.t.nowrap th { white-space: nowrap; }
table.t.nowrap td.wrap { white-space: normal; min-width: 150px; }
table.t td.tnum, table.t td[style*="right"] { white-space: nowrap; }
table.t tr.click:hover td { background: #f6faf8; }
table.t tr.flash td { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: #d9f5e6; } to { background: transparent; } }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: none; }
.tbl-wrap { overflow-x: scroll; overflow-y: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tbl-wrap table.t.nowrap, .hscroll table.t.nowrap { width: max-content; min-width: 100%; }
.hscroll { overflow-x: scroll; }
.tbl-wrap::-webkit-scrollbar, .hscroll::-webkit-scrollbar { height: 12px; width: 10px; }
.tbl-wrap::-webkit-scrollbar-track, .hscroll::-webkit-scrollbar-track { background: #eef3f0; border-radius: 6px; }
.tbl-wrap::-webkit-scrollbar-thumb, .hscroll::-webkit-scrollbar-thumb { background: #9fbfae; border-radius: 6px; border: 2px solid #eef3f0; }
.tbl-wrap::-webkit-scrollbar-thumb:hover, .hscroll::-webkit-scrollbar-thumb:hover { background: var(--green); }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 120px; flex: 1; }
.filters .field input[type=date] { min-width: 140px; }
.thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #eee; }
.plate { display: inline-flex; align-items: center; font-family: Inter, sans-serif; font-weight: 700; letter-spacing: .5px; border: 1.5px solid #222; border-radius: 4px; background: #fff; overflow: hidden; font-size: 12px; }
.plate::before { content: 'F'; background: #039; color: #fff; font-size: 8px; padding: 3px 3px; align-self: stretch; display: flex; align-items: flex-end; }
.plate span { padding: 1px 6px; }

/* Fenêtre modale */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 25, 18, .55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 920px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 17px; }
.modal header .x { margin-left: auto; }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--side); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 90; font-size: 13px; max-width: 360px; }
.empty { text-align: center; color: var(--ink-3); padding: 30px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button.on { background: var(--side); color: #fff; border-color: var(--side); }
.foot-note { color: var(--ink-3); font-size: 11px; margin-top: 14px; }
.report-card { display: flex; gap: 14px; align-items: center; }
.report-card .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; flex: none; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(3, 1fr); } .row3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .web { grid-template-columns: 1fr; } .side { display: none; } .row2, .row3 { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } }

/* ---------- Mobile ---------- */
.m { max-width: 560px; margin: 0 auto; overflow-x: clip; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.m-head { background: var(--side); color: #fff; padding: 14px 16px 16px; position: sticky; top: 0; z-index: 10; }
.m-head .l1 { display: flex; align-items: center; gap: 10px; }
.m-head .l1 b { font-size: 16px; }
.m-head .av { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; border: 2px solid rgba(255,255,255,.85); }
.m-head .l1 .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.m-head .site { font-size: 12px; color: var(--side-txt); margin-top: 4px; }
.m-head .back { background: none; border: 0; color: #fff; font-size: 22px; padding: 0 6px 0 0; cursor: pointer; }
.net { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(31,191,116,.18); color: var(--green-3); }
.net.off { background: rgba(242,169,59,.2); color: #ffd28a; }
.m-body { padding: 14px; flex: 1; }
.m-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.m-kpis .card { padding: 12px 14px; }
.m-kpis .v { font-size: 22px; font-weight: 700; }
.m-kpis .l { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.bigbtn { width: 100%; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 14px; padding: 18px; font-size: 17px; font-weight: 700; margin-bottom: 10px; cursor: pointer; text-align: left; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); }
.bigbtn .bi { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none; background: var(--green) !important; overflow: hidden; }
.bigbtn .bi img { width: 100%; height: 100%; display: block; }
.bigbtn small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.bigbtn.main-act { background: var(--green); color: #fff; border-color: var(--green); }
.bigbtn.main-act small { color: #d6f5e4; }
.bigbtn.main-act .bi { background: #0b6e40 !important; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: #d9e2dd; }
.steps i.on { background: var(--green); }
.m h2 { font-size: 18px; margin: 4px 0 12px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.choices.c4 { grid-template-columns: repeat(4, 1fr); }
.choices.c3 { grid-template-columns: repeat(3, 1fr); }
.choice { border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 13px 8px; text-align: center; font-weight: 600; cursor: pointer; font-size: 14px; }
.choice.on { border-color: var(--green); background: var(--green-soft); color: #0b6a3e; box-shadow: inset 0 0 0 1px var(--green); }
.choice.ko.on { border-color: var(--red); background: var(--red-soft); color: #b42318; box-shadow: inset 0 0 0 1px var(--red); }
.choice.warn.on { border-color: var(--amber); background: var(--amber-soft); color: #9a5b00; box-shadow: inset 0 0 0 1px var(--amber); }
.m .field input, .m .field select, .m .field textarea { padding: 13px 12px; font-size: 16px; border-radius: 11px; }
.m-foot { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 12px 14px; display: flex; gap: 10px; }
.m-foot .btn { flex: 1; justify-content: center; padding: 14px; font-size: 15px; border-radius: 12px; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.photo-grid .ph { width: 88px; height: 70px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }
.photo-add { width: 88px; height: 70px; border-radius: 9px; border: 2px dashed #b9c7c0; display: grid; place-items: center; color: var(--ink-3); font-size: 26px; cursor: pointer; background: #fff; }
.platebox { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; margin-bottom: 12px; }
.platebox .plate { font-size: 26px; border-width: 2.5px; border-radius: 6px; }
.platebox .plate::before { font-size: 12px; padding: 6px 6px; }
.platebox .plate span { padding: 4px 14px; }
.platebox .conf { margin-top: 8px; font-size: 12.5px; }
.suggest { background: var(--green-soft); border: 1px solid var(--green-3); border-radius: 11px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.cam { position: fixed; inset: 0; background: #000; z-index: 80; display: flex; flex-direction: column; }
.cam video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.cam .guide { position: absolute; left: 8%; right: 8%; top: 38%; height: 18%; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.cam .guide-txt { position: absolute; left: 0; right: 0; top: calc(38% - 34px); text-align: center; color: #fff; font-weight: 600; }
.cam .bar { display: flex; justify-content: space-around; align-items: center; padding: 18px; background: #000; }
.cam .bar .shoot { width: 70px; height: 70px; border-radius: 50%; border: 5px solid #fff; background: var(--green-2); }
.cam .bar button { color: #fff; background: none; border: 0; font-size: 15px; }
.list-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.list-item .meta { font-size: 12px; color: var(--ink-3); }
.list-item .right { margin-left: auto; text-align: right; }
.spinner { width: 34px; height: 34px; border: 4px solid #d9e2dd; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; margin: 16px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.checks label { display: flex; gap: 8px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px; font-weight: 600; }
.checks input { width: 20px; height: 20px; accent-color: var(--green); }
.recap { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.recap .kv { grid-template-columns: 130px 1fr; }
