/* ============================================================
   Anibal Auditor Pro — design system BiXYBER
   ============================================================ */
:root {
  --brand: #1795d0; --brand-600: #0f6fa3; --brand-100: #e3f2fb; --brand-50: #f2f9fd;
  --ink: #17202b; --ink-2: #3b4a5c; --muted: #6b7a8c; --line: #dfe6ee; --line-2: #eef2f6;
  --bg: #f3f6f9; --surface: #ffffff; --surface-2: #f8fafc;
  --side: #0d1a2b; --side-2: #132338; --side-3: #1b3049; --side-text: #b7c5d6; --side-active: #1795d0;
  --ok: #1f9d55; --danger: #d1343b; --warn: #e8791d; --caution: #d9a400; --info: #1795d0; --teal: #0f766e; --grey: #7a8593;
  --radius: 10px; --radius-sm: 6px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-lg: 0 10px 30px rgba(13,26,43,.18);
  --side-w: 272px; --rail-w: 64px; --top-h: 56px; --drawer-w: 560px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13.5px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
::selection { background: var(--brand-100); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; overflow: hidden; }
.app.rail { grid-template-columns: var(--rail-w) 1fr; }
.app.login-mode { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.side { grid-row: 1 / 3; background: linear-gradient(180deg, var(--side) 0%, #0b1524 100%); color: var(--side-text); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #0a1320; }
.side-brand { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.side-brand img { height: 30px; width: auto; }
.side-brand .brand-name { font-weight: 700; color: #fff; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.side-brand .brand-sub { font-size: 10.5px; color: var(--side-text); white-space: nowrap; }
.side-brand .burger { margin-left: auto; background: transparent; border: 0; color: var(--side-text); cursor: pointer; padding: 6px; border-radius: 6px; }
.side-brand .burger:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px 20px; scrollbar-width: thin; scrollbar-color: #2a3d56 transparent; }
.side-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #6f8098; padding: 14px 10px 6px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); cursor: pointer; white-space: nowrap; font-size: 13.5px; user-select: none; border: 0; background: transparent; width: 100%; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--side-active); color: #fff; box-shadow: 0 4px 12px rgba(23,149,208,.35); }
.nav-item .ico { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-item .ico svg { width: 18px; height: 18px; }
.nav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .cnt { font-size: 11px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 10px; }
.nav-item.sub { padding-left: 24px; font-size: 13px; }
.nav-item.sub2 { padding-left: 38px; font-size: 12.5px; }
.nav-item .chev { width: 14px; height: 14px; transition: transform .15s; opacity: .7; }
.nav-item.open .chev { transform: rotate(90deg); }
.nav-group.collapsed .nav-children { display: none; }
.side-foot { border-top: 1px solid rgba(255,255,255,.06); padding: 10px 12px; font-size: 11px; color: #6f8098; white-space: nowrap; }
.app.rail .side .lbl, .app.rail .side .cnt, .app.rail .side .chev, .app.rail .side-section, .app.rail .side-brand .brand-txt, .app.rail .side-foot, .app.rail .nav-item.sub, .app.rail .nav-item.sub2, .app.rail .side .audit-card { display: none; }
.app.rail .nav-item { justify-content: center; padding: 10px; }
.app.rail .side-brand { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 0; height: auto; }
.app.rail .side-brand .burger { margin-left: 0; }
.app.rail .side-brand img { height: 24px; }
.side .audit-card { margin: 6px 4px 8px; padding: 10px 12px; background: var(--side-2); border-radius: 10px; border: 1px solid #22364f; }
.side .audit-card .ref { font-size: 11px; color: #8ea1b8; font-family: var(--mono); }
.side .audit-card .ttl { color: #fff; font-weight: 600; font-size: 13px; margin: 2px 0 6px; line-height: 1.25; }
.side .audit-card .bar { height: 5px; background: #22364f; border-radius: 4px; overflow: hidden; }
.side .audit-card .bar > i { display: block; height: 100%; background: var(--brand); }
.side .audit-card .pct { font-size: 11px; color: #8ea1b8; margin-top: 4px; display: flex; justify-content: space-between; }

.top { grid-column: 2; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.top .crumbs a { color: var(--muted); }
.top .crumbs .cur { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumbs .sep { opacity: .5; }
.top .spacer { flex: 1; }
.top .save-state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.top .save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.top .save-state.saving .dot { background: var(--caution); animation: pulse 1s infinite; }
.top .save-state.error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.top .user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 20px; border: 1px solid transparent; }
.top .user:hover { background: var(--surface-2); border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.top .user .nm { font-weight: 600; font-size: 13px; line-height: 1.1; }
.top .user .rl { font-size: 11px; color: var(--muted); }

.main { grid-column: 2; overflow: auto; padding: 22px 26px 60px; position: relative; }
.main.flush { padding: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 550; font-size: 13px; line-height: 1.3; transition: .12s; white-space: nowrap; }
.btn:hover { border-color: #c7d2de; background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(23,149,208,.3); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.danger { color: var(--danger); border-color: #f1c4c6; background: #fff5f5; }
.btn.danger:hover { background: #fde8e9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn.xs { padding: 2px 7px; font-size: 11.5px; border-radius: 5px; }
.btn.icon { padding: 6px; }
.btn svg { width: 15px; height: 15px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--brand-100); border-color: var(--brand); color: var(--brand-600); z-index: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.card .card-h h3 { flex: 1; }
.card .card-b { padding: 16px; }
.card .card-b.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid.c4, .grid.c5 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) { .grid.c2, .grid.c3, .grid.c4, .grid.c5 { grid-template-columns: 1fr; } .app { grid-template-columns: var(--rail-w) 1fr; } }
.kpi { padding: 14px 16px; }
.kpi .k-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .k-val { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-left: 4px solid var(--brand); }
.kpi.danger { border-left: 4px solid var(--danger); }
.kpi.warn { border-left: 4px solid var(--warn); }
.kpi.ok { border-left: 4px solid var(--ok); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #fff; background: var(--grey); white-space: nowrap; line-height: 1.4; }
.badge.outline { background: transparent; border: 1px solid currentColor; }
.badge.lvl-CONFORME { background: var(--ok); } .badge.lvl-NC_MAJ { background: var(--danger); } .badge.lvl-NC_MIN { background: var(--warn); }
.badge.lvl-OBS { background: var(--caution); color: #2b2300; } .badge.lvl-PA { background: var(--info); } .badge.lvl-PF { background: var(--teal); } .badge.lvl-NA { background: var(--grey); }
.badge.lvl-none { background: var(--line); color: var(--muted); }
.badge.st-draft { background: #cbd5e1; color: #1e293b; } .badge.st-planned, .badge.st-submitted { background: var(--info); } .badge.st-in_progress { background: var(--brand-600); }
.badge.st-consolidation { background: #7c3aed; } .badge.st-reporting { background: var(--teal); } .badge.st-closed, .badge.st-validated { background: var(--ok); } .badge.st-rejected { background: var(--danger); }
.badge.st-todo { background: #cbd5e1; color: #1e293b; } .badge.st-done { background: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--brand-100); color: var(--brand-600); font-size: 11.5px; font-weight: 600; }
.chip.grey { background: var(--line-2); color: var(--ink-2); }
.chip.fam { background: #eef2ff; color: #3730a3; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:hover td { background: var(--brand-50); }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--muted); }
.tbl input, .tbl select, .tbl textarea { width: 100%; }
.tbl.compact td, .tbl.compact th { padding: 5px 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .5; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: .12s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23,149,208,.15); }
textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

.progress { height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .3s; }
.progress.ok > i { background: var(--ok); } .progress.warn > i { background: var(--warn); }
.stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line-2); }
.stack > i { display: block; height: 100%; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; display: inline-block; }
.donut::after { content: attr(data-label); position: absolute; inset: 28px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; text-align: center; white-space: pre-line; line-height: 1.1; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs .tab { padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13.5px; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { color: var(--brand-600); border-bottom-color: var(--brand); }

.tree { font-size: 13px; }
.tree .t-node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; user-select: none; }
.tree .t-node:hover { background: var(--line-2); }
.tree .t-node.active { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.tree .t-node .t-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.tree .t-node .t-ttl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .t-node .t-cnt { font-size: 11px; color: var(--muted); }
.tree .t-node .chev { width: 12px; height: 12px; flex-shrink: 0; transition: transform .15s; opacity: .6; }
.tree .t-node.open .chev { transform: rotate(90deg); }
.tree .t-children { margin-left: 14px; border-left: 1px dashed var(--line); padding-left: 4px; }
.tree .t-group.collapsed > .t-children { display: none; }
.tree .mini-bar { width: 46px; height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.tree .mini-bar i { display: block; height: 100%; background: var(--ok); }

.split { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.split .pane-left { position: sticky; top: 0; max-height: calc(100vh - var(--top-h) - 44px); overflow: auto; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } .split .pane-left { position: static; max-height: none; } }

.req-list .req { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: center; }
.req-list .req:hover { background: var(--brand-50); }
.req-list .req.active { background: var(--brand-100); }
.req-list .req.excluded { opacity: .5; }
.req-list .req .r-id { font-family: var(--mono); font-size: 12px; color: var(--brand-600); font-weight: 600; }
.req-list .req .r-ttl { font-weight: 550; }
.req-list .req .r-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.req-list .req .r-right { display: flex; gap: 6px; align-items: center; }
.req-list .chap-row { padding: 8px 14px; background: var(--surface-2); font-weight: 650; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.dot-w { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(13,26,43,.25); z-index: 40; opacity: 0; pointer-events: none; transition: .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer-w), 96vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 41; transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.wide { width: min(900px, 96vw); }
.drawer.open { transform: none; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer .d-h { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer .d-h h3 { flex: 1; line-height: 1.3; }
.drawer .d-b { flex: 1; overflow: auto; padding: 16px 18px; }
.drawer .d-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.d-sec { margin-bottom: 16px; }
.d-sec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.d-sec .box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.d-sec ul { margin: 0; padding-left: 18px; }
.obs-pick { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.obs-pick .op { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 12.5px; align-items: center; }
.obs-pick .op:last-child { border-bottom: 0; }
.obs-pick .op:hover { background: var(--brand-50); }
.obs-pick .op.on { background: var(--brand-100); }
.obs-pick .op-h { padding: 6px 10px; background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.finding-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.finding-card .fc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.finding-card .fc-h .who { font-weight: 600; }
.finding-card .fc-b { font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.finding-card.mine { border-color: var(--brand); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(13,26,43,.45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: up .18s; }
.modal.wide { width: min(1000px, 100%); }
.modal.xl { width: min(1280px, 100%); }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.modal .m-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .m-h h3 { flex: 1; }
.modal .m-b { padding: 18px 20px; overflow: auto; }
.modal .m-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 14px 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps .s { flex: 1; padding: 8px 10px; border-radius: 8px; background: var(--line-2); font-size: 12px; color: var(--muted); font-weight: 600; }
.steps .s.on { background: var(--brand); color: #fff; } .steps .s.done { background: var(--brand-100); color: var(--brand-600); }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; transition: .12s; }
.pick:hover { border-color: var(--brand); background: var(--brand-50); }
.pick.on { border-color: var(--brand); background: var(--brand-100); box-shadow: 0 0 0 2px rgba(23,149,208,.2); }
.pick .p-t { font-weight: 600; font-size: 13px; }
.pick .p-d { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); animation: up .2s; max-width: 380px; border-left: 4px solid var(--brand); }
.toast.error { border-left-color: var(--danger); } .toast.success { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #163a5c 0%, var(--side) 55%, #070e18 100%); }
.login .box { width: min(420px, 92vw); background: #fff; border-radius: 16px; padding: 32px 32px 26px; box-shadow: var(--shadow-lg); }
.login .box img { height: 54px; display: block; margin: 0 auto 8px; }
.login .box .tag { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.login .box h1 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.login .foot { color: #8ea1b8; font-size: 11.5px; text-align: center; margin-top: 16px; }

/* accordions / phases */
.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.acc .acc-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; background: var(--surface-2); }
.acc .acc-h .n { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-100); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.acc .acc-h .t { flex: 1; } .acc .acc-h .t b { display: block; } .acc .acc-h .t span { font-size: 12px; color: var(--muted); }
.acc .acc-h > svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform .15s; opacity: .6; }
.acc.open .acc-h > svg { transform: rotate(90deg); }
.acc .acc-b { padding: 6px 16px 14px; display: none; }
.acc.open .acc-b { display: block; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.step:last-child { border-bottom: 0; }
.step .s-t { font-weight: 600; }
.step .s-d { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.step .s-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.step .s-meta .chip { font-weight: 500; }
.step textarea { margin-top: 6px; min-height: 40px; font-size: 12.5px; }
.step select { width: 130px; }
.step.done .s-t { color: var(--muted); text-decoration: line-through; }

.day-block { margin-bottom: 14px; }
.day-block .day-h { display: flex; align-items: center; gap: 10px; font-weight: 650; margin-bottom: 6px; }
.day-block .day-h .d-date { font-weight: 500; color: var(--muted); font-size: 12.5px; }

/* report editor */
.report-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.rep-sections .rs { padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.rep-sections .rs:hover { background: var(--line-2); }
.rep-sections .rs.active { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.rep-sections .rs .auto { font-size: 10px; color: var(--muted); margin-left: auto; }
.editor { min-height: 400px; padding: 22px 28px; outline: none; line-height: 1.55; font-size: 13.5px; background: #fff; }
.editor:focus { box-shadow: inset 0 0 0 2px var(--brand-100); }
.editor h4 { margin: 14px 0 6px; color: var(--ink-2); }
.editor table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: 8px 0 12px; }
.editor th, .editor td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.editor th { background: var(--surface-2); }
.editor .badge { font-size: 10.5px; }
.editor .finding { border-left: 3px solid var(--brand); padding: 6px 12px; margin: 9px 0; background: var(--surface-2); }
.editor .finding.lvl-NC_MAJ { border-left-color: var(--danger); } .editor .finding.lvl-NC_MIN { border-left-color: var(--warn); }
.editor .finding.lvl-OBS { border-left-color: var(--caution); } .editor .finding.lvl-PA { border-left-color: var(--info); }
.editor .finding.lvl-PF { border-left-color: var(--teal); }
.editor .finding .f-req { color: #475569; font-size: 12px; font-style: italic; }
.editor .finding .f-meta { margin-top: 4px; }
.editor .muted { color: var(--muted); font-size: 12px; }
.editor .verdict { background: var(--brand-50); border-left: 4px solid var(--brand); padding: 10px 14px; margin: 12px 0; }
.editor .charts { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin: 14px 0; }
.editor .legend-wrap { padding-top: 26px; }
.editor .two { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.editor .two > div { flex: 1; min-width: 230px; }
.editor .kpis { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.editor .kpi { flex: 1; min-width: 118px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.editor .kpi .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.editor .kpi .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.editor .note { background: var(--surface-2); border-left: 3px solid var(--line); padding: 8px 12px; margin: 10px 0; font-size: 12.5px; }
.editor figure { margin: 0 0 10px; }
.editor figcaption { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }
.editor svg.chart { max-width: 100%; height: auto; }
.editor table.kpi { width: auto; min-width: 55%; }
.ed-toolbar { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.ed-toolbar .btn { padding: 3px 8px; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .mt-lg { margin-top: 22px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.list-plain { margin: 0; padding-left: 18px; line-height: 1.5; }
.matrix { border-collapse: collapse; }
.matrix td, .matrix th { border: 1px solid var(--line); width: 60px; height: 44px; text-align: center; font-size: 12px; font-weight: 600; }
.matrix td.acceptable { background: #d7f2e3; } .matrix td.tolerable { background: #fff1c9; } .matrix td.inacceptable { background: #f9d0d2; }
.matrix td .n { display: block; font-size: 15px; }
.json-area { font-family: var(--mono); font-size: 12px; min-height: 380px; }
.act-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.act-row .when { color: var(--muted); width: 120px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.act-row .who { font-weight: 600; width: 140px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.search { position: relative; }
.search input { padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.help { background: var(--brand-50); border: 1px solid #cfe6f5; color: #0b4e73; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.help ul { margin: 4px 0 0; padding-left: 18px; }
.warn-box { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.obs-editor .oe { display: grid; grid-template-columns: 1fr 150px 1fr auto; gap: 6px; margin-bottom: 6px; align-items: start; }
.obs-editor textarea { min-height: 40px; font-size: 12.5px; }
.ebios-table td { padding: 4px 6px; }
.ebios-table textarea { min-height: 34px; font-size: 12.5px; padding: 4px 6px; }
.ebios-table input, .ebios-table select { padding: 4px 6px; font-size: 12.5px; }
.calc { display: inline-block; padding: 3px 8px; background: var(--brand-100); border-radius: 6px; font-weight: 600; color: var(--brand-600); font-size: 12px; }
.calc.hi { background: #f9d0d2; color: #7f1d1d; } .calc.mid { background: #fff1c9; color: #713f12; } .calc.lo { background: #d7f2e3; color: #14532d; }
.print-only { display: none; }

/* ---------- support / signalements ---------- */
.box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
h4.sub-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 5px; font-weight: 700; }
h4.sub-h:first-child { margin-top: 0; }
.finding-card.internal { background: #fffbeb; border-color: #fde68a; }
.top .tools { display: flex; align-items: center; gap: 6px; margin-right: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--brand-600); border-color: var(--brand); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .cnt { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.report-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.report-btn:hover { border-color: var(--warn); color: var(--warn); background: #fff7ed; }
.report-btn svg { width: 15px; height: 15px; }
@media (max-width: 900px) { .report-btn .lbl { display: none; } .report-btn { padding: 0; width: 34px; justify-content: center; } }
.notif { border-bottom: 1px solid var(--line-2); padding: 9px 10px; cursor: pointer; border-radius: 6px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-50); border-left: 3px solid var(--brand); }
.notif:last-child { border-bottom: 0; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 34px; align-items: center; gap: 9px; font-size: 12.5px; }
.bar-row .bl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { height: 13px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 999px; transition: width .3s; }
.bar-row .bv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
