/* Espace web (superviseur, Back Office, banque, direction, administration) — maquette 2026. Jetons : app.css. */
body.web { background: var(--c-bg); font-size: var(--fs-md); }
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }

/* Barre latérale marine à motif de cercles ; l'élément actif est une pastille blanche */
.side { background: var(--c-navy) repeating-radial-gradient(circle at 100% 100%, transparent 0 34px, rgba(255, 255, 255, .045) 34px 35px); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-7) var(--sp-6) var(--sp-6); }
.side-logo img { width: 200px; height: auto; }
.side-nav { display: grid; gap: var(--sp-2); padding: 0 var(--sp-4); flex: 1; align-content: start; }
.side-group { font-size: var(--fs-sm); color: #9BA3C9; padding: var(--sp-5) var(--sp-4) var(--sp-2); }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 52px; padding: 0 var(--sp-4); border-radius: var(--r-md); color: #fff; text-decoration: none; font-weight: 500; }
.side-nav a[aria-current="page"] { background: #fff; color: var(--c-navy); font-weight: 600; box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.side-nav a .count { background: var(--c-cyan); color: #fff; border-radius: var(--r-pill); padding: 0 8px; font-size: var(--fs-xs); line-height: 20px; }
.side-nav a:focus-visible, .side-out:focus-visible, .side .side-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.side-user { margin: 0 var(--sp-4); border-top: 1px solid rgba(255, 255, 255, .14); padding: var(--sp-5) var(--sp-4) var(--sp-6); }
.side-name { color: #C9CEE6; font-size: var(--fs-sm); } .side-role { color: #9BA3C9; font-size: var(--fs-sm); }
.side-out { margin-top: var(--sp-2); background: none; border: 0; color: #C9CEE6; padding: var(--sp-1) 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-sm); }
.side .side-close { display: none; width: 44px; height: 44px; flex: none; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: transparent; color: #fff; cursor: pointer; }
@media (hover: hover) { .side-nav a:not([aria-current="page"]):hover { background: rgba(255, 255, 255, .08); } .side .side-close:hover { background: rgba(255, 255, 255, .1); } }

/* Contenu */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--c-navy); color: #fff; position: sticky; top: 0; z-index: 4; }
.topbar img { height: 26px; width: auto; }
.icon-btn { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 0; background: none; color: inherit; cursor: pointer; position: relative; }
.content { padding: var(--sp-8) var(--sp-8) var(--sp-9); max-width: 1640px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-head h1 { font-size: clamp(1.9rem, 2.6vw, 2.6rem); font-weight: 600; }
.crumb { color: var(--c-muted); font-size: var(--fs-md); margin-bottom: var(--sp-1); } .crumb a { text-decoration: none; } .crumb a:hover { text-decoration: underline; }
.head-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.panel, .card { background: var(--c-surface); border: 0; border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow); min-width: 0; margin: 0; }
.panel-title { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-4); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.panel-head .panel-title { margin: 0; } .panel-head a { font-size: var(--fs-sm); font-weight: 500; color: var(--c-cyan); text-decoration: none; }
.section-title { font-size: var(--fs-lg); font-weight: 600; margin: var(--sp-7) 0 var(--sp-4); }
.grid2 { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.dash { display: grid; gap: var(--sp-5); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.cols { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Tuiles : la première est la tuile vedette marine */
.tiles { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-column: span 12; margin-bottom: var(--sp-6); }
.dash > .tiles { margin-bottom: 0; }
.tile { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-7); text-decoration: none; display: grid; gap: var(--sp-2); align-content: start; box-shadow: var(--shadow); min-height: 150px; }
.tile:first-child { background: var(--c-navy) var(--pattern); color: #fff; box-shadow: 0 16px 30px rgba(31, 40, 104, .28); }
.tile-label { color: var(--c-muted); font-size: var(--fs-md); } .tile:first-child .tile-label { color: #C9CEE6; }
.tile-value { font-size: 3rem; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile:first-child .tile-value { color: #fff; }
.tile-sub { font-size: var(--fs-sm); color: var(--c-muted); } .tile:first-child .tile-sub { color: #C9CEE6; }
@media (hover: hover) { a.tile:hover { transform: translateY(-2px); } } a.tile { transition: transform var(--dur-fast) var(--ease-out); }
.meter { display: block; } .meter-track { fill: var(--c-line); } .meter-fill { fill: var(--c-cyan); } .tile:first-child .meter-track { fill: rgba(255, 255, 255, .2); } .tile:first-child .meter-fill { fill: var(--c-cyan); }

/* Filtres : boîtes blanches ombrées */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; margin-bottom: var(--sp-6); }
.filters .field { margin: 0; min-width: 170px; } .filters .field > label { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 500; }
.filters .input { min-height: 52px; background-color: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--shadow); }
.filters .btn { min-height: 52px; }

/* Tableaux */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--c-surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); font-size: var(--fs-md); }
.panel .table { box-shadow: none; border: 1px solid var(--c-line); border-radius: var(--r-md); }
.table th { text-align: left; font-weight: 500; color: var(--c-muted); padding: var(--sp-5) var(--sp-5); background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table td { padding: var(--sp-5) var(--sp-5); border-bottom: 1px solid var(--c-line); vertical-align: middle; color: var(--c-navy); }
.table tr:last-child td { border-bottom: 0; }
.table td.strong, .table td b { font-weight: 600; } .table .num { text-align: right; font-variant-numeric: tabular-nums; } .table td.act { text-align: right; width: 1%; white-space: nowrap; }
.table a { font-weight: 600; text-decoration: none; } .table a:hover { text-decoration: underline; }
.table tbody tr:hover td { background: #FBFCFF; }
.table-mini th, .table-mini td { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
.empty-row td { color: var(--c-muted); text-align: center; padding: var(--sp-7); }
.age-late { color: var(--c-fix); font-weight: 600; }
.pager { display: flex; gap: var(--sp-3); align-items: center; justify-content: flex-end; margin-top: var(--sp-4); font-size: var(--fs-sm); }
.audit-action { font-size: var(--fs-sm); font-weight: 500; background: var(--c-field); padding: 2px var(--sp-2); border-radius: 6px; }
.kv-list { display: grid; margin: 0; } .kv-list .kv { border-bottom: 1px solid var(--c-line); padding: var(--sp-4) 0; } .kv-list .kv:last-child { border-bottom: 0; }
.kv-list dt { color: var(--c-muted); } .kv-list dd { font-weight: 500; color: var(--c-navy); }
.status-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.status-tabs a { display: inline-flex; gap: var(--sp-2); align-items: center; min-height: 40px; padding: 0 var(--sp-4); border-radius: var(--r-pill); text-decoration: none; font-size: var(--fs-sm); background: var(--c-surface); box-shadow: var(--shadow); }
.status-tabs a[aria-current="page"] { background: var(--c-navy); color: #fff; font-weight: 600; }
.doc-tabs { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.doc-tabs a { min-height: 44px; padding: 0 var(--sp-5); display: inline-flex; align-items: center; border-radius: var(--r-pill); background: var(--c-field); text-decoration: none; font-weight: 500; }
.doc-tabs a[aria-current="page"] { background: var(--c-navy); color: #fff; font-weight: 600; box-shadow: var(--shadow-btn); }
.preview { min-height: 420px; border: 1.5px dashed var(--c-cyan-line); border-radius: var(--r-md); background: var(--c-cyan-soft); display: grid; place-items: center; overflow: hidden; text-align: center; color: var(--c-navy); }
.preview img { width: 100%; max-height: 640px; object-fit: contain; background: #fff; }
.checkline { display: flex; align-items: center; gap: var(--sp-3); } .checkline input { width: 22px; height: 22px; accent-color: var(--c-navy); }
.flash { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); margin-bottom: var(--sp-5); background: var(--c-cyan-soft); font-weight: 500; }
.flash-ok { background: var(--c-ok-soft); color: #0B7A52; } .flash-error { background: var(--c-fix-soft); color: var(--c-fix); }
.inline { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; } .inline .input { min-height: 44px; width: auto; flex: 1; min-width: 140px; }

/* Graphiques (une série par panneau) */
.hbars { display: grid; gap: var(--sp-4); margin-top: var(--sp-2); }
.hb-row { display: grid; grid-template-columns: minmax(130px, 42%) minmax(0, 1fr) 64px; gap: var(--sp-4); align-items: center; border-radius: var(--r-sm); }
.hb-label { font-size: var(--fs-md); overflow-wrap: anywhere; } .hb-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; } .hb-value small { color: var(--c-muted); font-weight: 400; }
.hb-track { display: block; border-radius: 6px; background: var(--c-line); } .hb-bar { fill: var(--c-cyan); }
.hbars.tones .hb-row:first-child .hb-bar { fill: var(--c-ok); } .hbars.tones .hb-row:last-child .hb-bar { fill: var(--c-fix); }
.hbars.funnel .hb-row:last-child .hb-bar { fill: var(--c-ok); }
.chart-hero { margin: 0 0 var(--sp-3); } .chart-hero b { font-size: var(--fs-xl); }
.colchart { width: 100%; height: auto; display: block; overflow: visible; }
.colchart .grid { stroke: var(--c-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.colchart .bar { fill: #A9DDF3; } .colchart .bar-now { fill: var(--c-cyan); } .colchart .hit { fill: transparent; }
.colchart .col:hover .bar, .colchart .col:focus-visible .bar { fill: var(--c-navy); } .colchart .col:focus-visible { outline: none; }
.colchart-x { display: flex; margin-top: var(--sp-2); } .colchart-x span { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--c-muted); white-space: nowrap; }
.chart-table { margin-top: var(--sp-4); font-size: var(--fs-sm); } .chart-table summary { cursor: pointer; color: var(--c-muted); min-height: 32px; }
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--c-navy); color: #fff; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); font-size: var(--fs-sm); max-width: 280px; box-shadow: var(--shadow-btn); }
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: var(--c-cyan); transform-origin: left; animation: load 1.2s var(--ease-out) infinite; }
@keyframes load { 0% { transform: scaleX(0); } 60% { transform: scaleX(.7); } 100% { transform: scaleX(.95); } }
#main[aria-busy="true"] { opacity: .6; transition: opacity var(--dur-fast) 120ms; }

/* Connexion : carte centrée, grands cercles pâles */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4); position: relative; overflow: hidden; }
.auth-page::before, .auth-page::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; }
.auth-page::before { width: 700px; height: 700px; left: -320px; top: -360px; background: #DDF1FB; }
.auth-page::after { width: 760px; height: 760px; right: -330px; bottom: -380px; background: #E5E7F7; }
.auth { position: relative; z-index: 1; width: min(100%, 520px); background: #fff; border-radius: 28px; padding: var(--sp-8) var(--sp-7); box-shadow: 0 30px 60px rgba(31, 40, 104, .1); }
.auth h1 { font-size: var(--fs-2xl); margin: var(--sp-6) 0 var(--sp-3); }
.auth .lead { color: var(--c-muted); margin-bottom: var(--sp-5); }
.auth .foot { color: var(--c-muted); font-size: var(--fs-sm); margin-top: var(--sp-4); }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.code-boxes input { width: 100%; aspect-ratio: 1 / 1.1; text-align: center; font-size: var(--fs-xl); font-weight: 600; border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--c-field); color: var(--c-navy); }
.code-boxes input:focus { outline: none; border-color: var(--c-cyan); background: var(--c-cyan-soft); }
.code-boxes input.filled { background: var(--c-cyan); color: #fff; }
.secret { font-size: var(--fs-lg); font-weight: 600; letter-spacing: .12em; word-break: break-all; }

@media (max-width: 1280px) { .content { padding: var(--sp-6); } .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; } .topbar { display: flex; }
  .js .side { display: none; } .js .side.open { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; height: 100vh; }
  .js .side.open .side-close { display: inline-flex; }
  .side-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(31, 40, 104, .45); }
  body.menu-open { overflow: hidden; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
  .tile { padding: var(--sp-5); min-height: 0; } .tile-value { font-size: 2.25rem; }
  .hb-row { grid-template-columns: minmax(0, 1fr) 56px; } .hb-row .hb-track { grid-column: 1 / -1; grid-row: 2; }
}
.side-backdrop { display: none; }
@media (max-width: 720px) {
  .table thead { display: none; } .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--c-line); padding: var(--sp-3) 0; } .table td { border: 0; padding: var(--sp-1) var(--sp-5); }
  .table td[data-l]::before { content: attr(data-l) " · "; color: var(--c-muted); font-size: var(--fs-xs); }
  .table .num, .table td.act { text-align: left; }
  .auth { padding: var(--sp-7) var(--sp-5); }
}
@media print { .side, .topbar, form { display: none; } .shell { display: block; } }
.app-icon-web { border-radius: 24%; box-shadow: 0 14px 30px rgba(31, 40, 104, .22); }
.topbar .count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--c-cyan); color: #fff; font-size: .7rem; font-weight: 600; line-height: 18px; text-align: center; }
.code-boxes { border: 0; padding: 0; margin: 0 0 var(--sp-5); }
.doc-foot { margin-top: var(--sp-4); } .sub-title { font-size: var(--fs-md); font-weight: 600; margin: var(--sp-4) 0 var(--sp-3); } .filter-box { min-height: 52px; background-color: var(--c-surface); box-shadow: var(--shadow); width: auto; }
.section-gap { margin-top: var(--sp-6); }
.pill-select { appearance: none; border: 0; cursor: pointer; padding: 6px var(--sp-4) 6px var(--sp-3); font: inherit; font-weight: 600; font-size: var(--fs-sm); }
.pill-select:focus-visible { outline: 3px solid var(--c-cyan); }
.suffix { display: flex; align-items: center; background: var(--c-field); border-radius: var(--r-md); padding-right: var(--sp-4); }
.suffix .input { background: transparent; } .suffix span { color: var(--c-muted); white-space: nowrap; }
.suffix:focus-within { box-shadow: 0 0 0 4px var(--c-cyan-soft); }
.kv dt .row-title { color: var(--c-navy); }
.table td.age-late, .table td .age-late { color: var(--c-fix); font-weight: 600; }
.panel .table th, .panel .table td { padding: 14px 12px; }
.table td:first-child, .table td:first-child a { white-space: nowrap; }
.table input[type="checkbox"], .checkline input { width: 22px; height: 22px; accent-color: var(--c-navy); }
.kv-list.docs dt { color: var(--c-navy); }
.panel > .hbars:only-child, .panel .empty-chart { margin: 0; }
