:root {
  --ink: #14212e; --muted: #5b6876; --line: #e2e7ec; --bg: #f3f5f8; --card: #fff; --navy: #0e2a43; --navy2: #17395a; --accent: #f0a202;
  --good: #177a44; --goodbg: #e4f4ea; --warn: #9a5b00; --warnbg: #fdf0d5; --bad: #c22f28; --badbg: #fde8e6; --watch: #1f5f9e; --watchbg: #e3eefa; --nonebg: #edf0f3;
  --s1: #235a94; --s2: #d98a00; --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); hyphens: manual; overflow-wrap: normal; }
body.lock { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin-bottom: 12px; }
h2 small, h3 small { font-weight: 400; color: var(--muted); font-size: 13px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
a { color: #14558f; text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--muted); font-size: 12.5px; }
b, .num, td, .kpi b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .grow { flex: 1; min-width: 0; } .tneg { color: var(--bad); } .just { text-align: justify; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand small { display: block; color: #a9bccd; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--navy); font-weight: 800; display: grid; place-items: center; letter-spacing: -.03em; flex: none; }
.logo.big { width: 56px; height: 56px; font-size: 22px; border-radius: 15px; }
.side nav { display: grid; gap: 3px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #cfdbe6; font-weight: 500; }
.side nav a:hover { background: var(--navy2); text-decoration: none; }
.side nav a.on { background: #fff; color: var(--navy); }
.badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11.5px; min-width: 21px; height: 21px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.who { margin-top: auto; padding: 12px; border-top: 1px solid #244a6d; display: grid; gap: 2px; }
.who small { color: #a9bccd; } .who .linkbtn { color: #cfdbe6; text-align: left; margin-top: 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: #14558f; font: inherit; cursor: pointer; text-decoration: underline; }
main { padding: 26px 30px 60px; min-width: 0; max-width: 1280px; width: 100%; display: grid; gap: 16px; align-content: start; }
.tabs { display: none; }
.offline { background: var(--warnbg); color: var(--warn); padding: 10px 14px; border-radius: 10px; }

.top { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.top p { color: var(--muted); margin-top: 2px; }
.tools, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13.5px; }
select, input, textarea { font: inherit; color: inherit; border: 1px solid #cdd5dd; border-radius: 10px; padding: 9px 11px; background: #fff; min-height: 40px; max-width: 100%; }
select:focus, input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid #2a78d6; outline-offset: 1px; }
.btn { font: inherit; font-weight: 600; border: 1px solid #cdd5dd; background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #9fb0c0; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy2); }
.btn.small { padding: 5px 11px; min-height: 32px; font-size: 13.5px; }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); }
.btn.danger { color: var(--bad); border-color: #efc2be; }
.btn:disabled { opacity: .6; }
.seg { display: inline-flex; border: 1px solid #cdd5dd; border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-weight: 600; border: 0; background: none; padding: 9px 13px; min-height: 38px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chips button { font: inherit; font-weight: 600; border: 1px solid #cdd5dd; background: #fff; border-radius: 999px; padding: 7px 15px; cursor: pointer; color: var(--ink); min-height: 36px; }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips.small button { font-size: 13.5px; padding: 5px 12px; min-height: 32px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 200px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.cardhead h2 { margin: 0; } .card .cardhead:not(:first-child) { margin-top: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2.inner { margin-top: 6px; gap: 26px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis.tight { margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.card .kpi { background: #f7f9fb; }
.kpi small { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { font-size: 24px; letter-spacing: -.02em; white-space: nowrap; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi.hero { background: var(--navy); border-color: var(--navy); color: #fff; }
.kpi.hero small, .kpi.hero span { color: #b9cadb; }
.kpi.neg b { color: var(--bad); } .kpi.hero.neg { background: #7d1d18; border-color: #7d1d18; } .kpi.hero.neg b { color: #fff; }
.demo { background: #fff8e6; border: 1px solid #f3dfa8; color: #6a4a00; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; text-align: justify; }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insights li { padding: 10px 14px 10px 16px; border-radius: 10px; border-left: 4px solid; background: #f7f9fb; }
.insights .bad { border-color: var(--bad); background: var(--badbg); } .insights .warn { border-color: #d98a00; background: var(--warnbg); }
.insights .good { border-color: var(--good); background: var(--goodbg); } .insights .info { border-color: var(--watch); background: var(--watchbg); }
.cocard { display: grid; gap: 4px; color: var(--ink); border-top: 4px solid var(--c); }
.cocard:hover { text-decoration: none; border-color: var(--c); box-shadow: 0 4px 16px #0e2a4314; }
.cohead small { display: block; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mini b { color: var(--ink); display: block; }

.chart { width: 100%; height: auto; display: block; }
.chart .s1, .legend i.s1 { fill: var(--s1); background: var(--s1); } .chart .s2, .legend i.s2 { fill: var(--s2); background: var(--s2); }
.chart .grid { stroke: #e8ecf0; } .chart .axis { stroke: #c5ced7; }
.chart text { font-size: 11px; fill: var(--muted); } .chart .xl { text-anchor: middle; }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; } .chart .dot { fill: var(--s1); stroke: #fff; stroke-width: 2; } .chart .hit { fill: transparent; }
.chart path:hover { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.tip { position: fixed; z-index: 60; background: #14212e; color: #fff; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; pointer-events: none; display: grid; gap: 1px; box-shadow: 0 6px 20px #0003; }
.tip[hidden] { display: none; }
.rank, .cat { display: grid; grid-template-columns: 86px 1fr 96px; gap: 10px; align-items: center; padding: 6px 0; color: var(--ink); }
.cat { grid-template-columns: minmax(110px, 190px) 1fr 44px; font-size: 13.5px; }
.rank:hover { text-decoration: none; background: #f7f9fb; }
.rank b, .cat b { text-align: right; white-space: nowrap; }
.pl, .plate { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: .02em; }
.track { height: 10px; background: #edf0f3; border-radius: 5px; overflow: hidden; display: block; }
.track i { display: block; height: 100%; border-radius: 5px; background: var(--s1); }
.track i.neg { background: var(--bad); }
.foot { margin-top: 10px; font-size: 13.5px; } .empty { color: var(--muted); padding: 8px 0; }

.co { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px 3px 8px; border-radius: 999px; background: #f0f3f6; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.co::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip.good { background: var(--goodbg); color: var(--good); } .chip.warn { background: var(--warnbg); color: var(--warn); } .chip.bad { background: var(--badbg); color: var(--bad); }
.chip.watch { background: var(--watchbg); color: var(--watch); } .chip.none { background: var(--nonebg); color: var(--muted); }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; }
.vcard:hover { text-decoration: none; box-shadow: 0 4px 16px #0e2a4314; border-color: #c5ced7; }
.vcard.sold, .row.sold { opacity: .55; }
.vphoto { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #eef1f4; display: block; }
.vphoto.ph { padding: 14px 30%; }
.vbody { padding: 12px 14px 14px; display: grid; gap: 3px; }
.vtop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vcard .plate { font-size: 17px; }
.vres { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.vhead { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.vhead .vphoto { width: 250px; border-radius: 10px; flex: none; } .vhead .vphoto.ph { padding: 12px 50px; }
.vhead p { color: var(--muted); margin: 4px 0 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #dfe6ed; display: grid; place-items: center; font-weight: 700; color: var(--navy); overflow: hidden; flex: none; }
.avatar.big { width: 84px; height: 84px; font-size: 32px; } .avatar img { width: 100%; height: 100%; object-fit: cover; }

.fiche { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.fiche dt { font-size: 12px; color: var(--muted); } .fiche dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.files { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.file { display: inline-flex; align-items: center; gap: 4px; background: #eef3f8; border-radius: 8px; padding: 5px 6px 5px 10px; font-size: 13.5px; font-weight: 600; }
.file button, .x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.rows { display: grid; }
.row { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border: 0; border-bottom: 1px solid #eef1f4; background: none; font: inherit; color: var(--ink); text-align: left; width: 100%; cursor: pointer; }
.rows .row:last-child { border-bottom: 0; }
.row:hover { background: #f7f9fb; text-decoration: none; }
.row small { display: block; } .w90 { width: 96px; flex: none; font-size: 13.5px; } .row .num { white-space: nowrap; font-weight: 600; text-align: right; }
.say { background: #f1f5f9; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; text-align: justify; }
.say.warn { background: var(--warnbg); }
.roi { display: grid; gap: 8px; margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: right; padding: 7px 8px; border-bottom: 1px solid #eef1f4; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover { background: #f7f9fb; }
.scroll { overflow-x: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { text-align: left; font: inherit; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c, var(--navy)); border-radius: var(--r); padding: 16px; cursor: pointer; display: grid; gap: 4px; color: var(--ink); min-height: 92px; align-content: start; }
.tile:hover { box-shadow: 0 4px 16px #0e2a4314; } .tile b { font-size: 16px; } .tile span { color: var(--muted); font-size: 13.5px; }

.modal { position: fixed; inset: 0; background: #0e2a4380; z-index: 50; display: grid; place-items: center; padding: 16px; }
.sheet { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.sheet header, .sheet footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; }
.sheet header { border-bottom: 1px solid var(--line); justify-content: space-between; } .sheet header h2 { margin: 0; font-size: 18px; }
.sheet footer { border-top: 1px solid var(--line); }
.sheetbody { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.fgrid .full { grid-column: 1 / -1; } .fgrid h3 { margin-bottom: 0; }
.fld { display: grid; gap: 4px; align-content: start; min-width: 0; } .fld label { font-size: 13px; font-weight: 600; } .fld label i { color: var(--bad); font-style: normal; }
.fld input, .fld select, .fld textarea { width: 100%; }
.check { display: flex; gap: 9px; align-items: center; min-height: 40px; font-weight: 500; } .check input { width: 19px; height: 19px; min-height: 0; flex: none; }
.err { color: var(--bad); background: var(--badbg); padding: 9px 12px; border-radius: 9px; font-weight: 600; }
.lines { width: 100%; border-collapse: collapse; min-width: 560px; } .lines td { padding: 3px; } .lines input, .lines select { width: 100%; padding: 7px 8px; min-height: 36px; } .lines .narrow { width: 74px; }
.tot { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; background: #f1f5f9; border-radius: 10px; padding: 11px 14px; } .tot small { flex-basis: 100%; }
.pick { display: grid; gap: 2px; background: #f7f9fb; border-radius: 10px; padding: 8px 12px; }
.checks { display: grid; gap: 8px; }
.chk { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #eef1f4; }
.chk > input { grid-column: 1 / -1; }
.chk .seg label { cursor: pointer; } .chk .seg input { position: absolute; opacity: 0; min-height: 0; }
.chk .seg b { display: block; padding: 7px 12px; font-size: 13px; color: var(--muted); }
.chk .seg input:checked + b { background: var(--good); color: #fff; } .chk .seg .ko input:checked + b { background: var(--bad); }
.chk .seg input:focus-visible + b { outline: 2px solid #2a78d6; outline-offset: -2px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; } .thumb img { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; display: block; }
.thumb button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; z-index: 70; font-weight: 600; box-shadow: 0 6px 20px #0003; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

.login { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 20px; }
.login form { width: min(380px, 100%); display: grid; gap: 8px; padding: 28px; }
.login p { color: var(--muted); margin-bottom: 10px; } .login label { font-weight: 600; font-size: 13px; margin-top: 6px; } .login .btn { margin-top: 12px; }

@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  #app { display: block; }
  .side { display: none; }
  main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); gap: 14px; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .tabs a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 5px 0; position: relative; font-weight: 600; }
  .tabs a.on { color: var(--navy); } .tabs a:hover { text-decoration: none; }
  .tabs .badge { position: absolute; top: -2px; left: 54%; min-width: 18px; height: 18px; font-size: 10.5px; }
  .grid2 { grid-template-columns: 1fr; } h1 { font-size: 22px; }
  .kpi b { font-size: 19px; } .card { padding: 15px; }
  .fgrid, .fiche { grid-template-columns: 1fr; }
  .vhead .vphoto { width: 100%; } .w90 { width: 78px; }
  .modal { padding: 0; place-items: end stretch; } .sheet { border-radius: 16px 16px 0 0; max-height: 94dvh; width: 100%; }
  .rank { grid-template-columns: 76px 1fr 88px; } .row { flex-wrap: wrap; gap: 4px 10px; } .row .grow { flex-basis: 60%; }
}
@media print { .side, .tabs, .tools, .actions, .btn { display: none !important; } #app { display: block; } }
