/* ===== Coque applicative (client + admin) ===== */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100dvh; background: var(--mist); }
.sidebar { background: var(--navy-900); color: #c5d2e8; padding: 20px 14px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sidebar .logo { color: #fff; padding: 6px 10px 18px; }
.sidebar .badge-role { margin: 0 10px 14px; font-size: .75rem; color: var(--gold); border: 1px solid rgba(183,154,91,.4); border-radius: 99px; padding: 3px 10px; width: fit-content; }
.sidebar a { display: flex; gap: 12px; align-items: center; color: #c5d2e8; text-decoration: none; padding: 11px 12px; border-radius: var(--r-md); font-weight: 600; font-size: .92rem; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a[aria-current="page"] { background: var(--blue-600); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .count { margin-left: auto; background: var(--gold); color: var(--navy-950); font-size: .72rem; font-weight: 800; border-radius: 99px; padding: 1px 8px; }
.shell.client .sidebar { background: #fff; color: var(--ink); border-right: 1px solid var(--line); }
.shell.client .sidebar a { color: var(--ink); }
.shell.client .sidebar a:hover { background: var(--mist); color: var(--navy-900); }
.shell.client .sidebar a[aria-current="page"] { background: var(--blue-100); color: var(--blue-600); }
.shell.client .sidebar .logo { color: var(--navy-900); }
.topbar { display: none; }
.content { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; max-width: 1400px; width: 100%; }
.content > header.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 60; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
  .sidebar { position: fixed; z-index: 80; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(6,19,42,.5); z-index: 70; }
}

/* ===== Cartes de synthèse ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpis.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpis, .kpis.c3 { grid-template-columns: 1fr 1fr; gap: 10px; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.kpi .k { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi .v { font: 500 2.1rem/1.1 var(--serif); color: var(--navy-900); margin-top: 6px; font-variant-numeric: lining-nums tabular-nums; }
.kpi.accent { border-color: var(--gold); background: linear-gradient(180deg, #fff, var(--gold-soft)); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.panel > h2, .panel > .panel-head h2 { font: 700 1.05rem var(--sans); margin: 0; color: var(--navy-900); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.two-col.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .two-col, .two-col.even { grid-template-columns: 1fr; } }
dl.facts { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 10px 20px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .88rem; }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; gap: 2px; } dl.facts dd { margin-bottom: 10px; } }

/* ===== Dossier client (synthèse) ===== */
.dossier { background: var(--navy-900); color: #fff; border-radius: var(--r-lg); padding: clamp(22px, 3vw, 34px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.dossier h2 { color: #fff; font-size: 1.8rem; margin: 0 0 4px; }
.dossier .num { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; letter-spacing: .02em; }
.dossier dl { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 24px; margin: 22px 0 0; }
.dossier dt { font-size: .78rem; color: #9fb3d3; } .dossier dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; }
.dossier .badge { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 860px) { .dossier { grid-template-columns: 1fr; } .dossier dl { grid-template-columns: repeat(2, auto); } }
.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: start; }
.progress li { display: flex; gap: 12px; align-items: center; font-weight: 600; color: #9fb3d3; }
.progress li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #4a6390; display: grid; place-items: center; flex: none; font-style: normal; }
.progress li.done { color: #fff; } .progress li.done i { background: var(--ok); border-color: var(--ok); }
.progress li.current { color: #fff; } .progress li.current i { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(183,154,91,.25); background: var(--gold); }

/* ===== Timeline détaillée ===== */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 26px 44px; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; border-left: 2px solid var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.timeline .done .dot { background: var(--ok); border-color: var(--ok); }
.timeline .done::before { border-color: var(--ok); }
.timeline .current .dot { border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 0 0 5px rgba(46,107,255,.18); }
.timeline .stop .dot { background: var(--bad); border-color: var(--bad); }
.timeline .upcoming { opacity: .55; }
.timeline h4 { font: 700 1rem var(--sans); margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timeline .when { font-size: .8rem; color: var(--muted); font-weight: 500; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.timeline .note { margin-top: 8px; padding: 10px 14px; background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); font-size: .92rem; }

/* ===== Tableaux ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-weight: 700; font-size: .78rem; color: var(--muted); padding: 13px 16px; background: var(--mist); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tbl td.actions { text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tbl.stack td { border: 0; padding: 6px 16px; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .78rem; text-align: left; }
  .tbl.stack td.actions { justify-content: flex-end; }
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
.toolbar .field { min-width: 150px; flex: 1 1 150px; }
.toolbar .field.grow { flex: 3 1 240px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { font: 700 1.05rem var(--sans); color: var(--navy-900); }

/* Cartes de demandes (client) */
.app-card { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 16px; align-items: center; padding: 18px 22px; }
.app-card .num { font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .app-card { grid-template-columns: 1fr 1fr; } }

/* Notifications */
.notif { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #f4f8ff; }
.notif .ico { color: var(--blue-600); margin-top: 2px; }
.notif h4 { font: 700 .95rem var(--sans); margin: 0; }
.notif p { margin: 2px 0 6px; color: var(--muted); font-size: .9rem; }
.bell { position: relative; }
.bell .dotc { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; border-radius: 99px; font-size: .68rem; font-weight: 800; padding: 1px 6px; }

/* ===== Assistant de demande ===== */
.wizard { max-width: 860px; margin-inline: auto; }
.stepper { display: flex; gap: 6px; margin-bottom: 8px; }
.stepper i { flex: 1; height: 5px; border-radius: 5px; background: #d5dcea; }
.stepper i.done { background: var(--blue-600); } .stepper i.now { background: var(--gold); }
.wizard .step-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.wizard .step-title h2 { font-size: 1.6rem; margin: 0; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.recap { display: grid; gap: 22px; }
.recap h3 { font: 700 .95rem var(--sans); margin-bottom: 10px; display: flex; justify-content: space-between; }
.doc-slot { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed #b9c5d8; border-radius: var(--r-md); }
.doc-slot.has { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.doc-slot .fname { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.success { text-align: center; max-width: 560px; margin: 40px auto; }
.success .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 20px; }
.success .number { font: 500 2rem var(--serif); color: var(--navy-900); letter-spacing: .02em; margin: 10px 0 20px; }

/* ===== Graphiques SVG ===== */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font: 600 11px var(--sans); fill: var(--muted); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--blue-600); } .chart .bar.gold { fill: var(--gold); }
.chart .line { fill: none; stroke: var(--blue-600); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: rgba(46,107,255,.1); }
.chart .dot { fill: #fff; stroke: var(--blue-600); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.s0 { fill: var(--navy-900); background: var(--navy-900); } .s1 { fill: var(--blue-600); background: var(--blue-600); }
.s2 { fill: var(--gold); background: var(--gold); } .s3 { fill: #7fa4ff; background: #7fa4ff; }
.s4 { fill: #17835b; background: #17835b; } .s5 { fill: #b4322f; background: #b4322f; } .s6 { fill: #9aa8bf; background: #9aa8bf; }

.skeleton { background: linear-gradient(90deg, #e9edf4 25%, #f4f6fa 37%, #e9edf4 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: var(--r-md); min-height: 20px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sticky-side { position: sticky; top: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font: 700 .9rem var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--blue-600); border-color: var(--blue-600); }
.note-item { padding: 12px 14px; background: var(--mist); border-radius: var(--r-md); }
.note-item .meta { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }

.skeleton.tall { height: 64px; }
.topbar .burger { display: inline-flex; }
.sidebar .logout { margin: 10px 10px 0; color: inherit; border-color: rgba(128,140,165,.4); }
.sidebar .logout:hover { border-color: currentColor; }

ul.stack { list-style: none; padding: 0; margin: 0; }
.grow { flex: 1; min-width: 0; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.1fr) 3fr auto; gap: 10px; align-items: center; font-size: .85rem; margin: 10px 0; }
.hbar .track { background: var(--mist); border-radius: 6px; height: 10px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; width: var(--w, 0); background: var(--blue-600); border-radius: 6px; }
.hbar.gold .track i { background: var(--gold); }
.hbar b { font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--mist); }
.stackbar i { display: block; width: var(--w, 0); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
dialog.wide { width: min(94vw, 760px); }
dialog .dlg { max-height: 88dvh; overflow-y: auto; }
