/* QA Tracker — styles. Light + dark via tokens. No external fonts or CDNs. */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --bg: #F2F5F3; --surface: #FFFFFF; --surface2: #F7F9F8; --line: #DCE3DF; --line2: #E9EEEB;
  --ink: #14201A; --mute: #586962; --faint: #8A9992;
  --accent: #166A4A; --accent-h: #0F5539; --accent-soft: #E0F0E8; --accent-ink: #FFFFFF;
  --side: #10281F; --side-ink: #DCEBE3; --side-mute: #8FB0A2; --side-active: #1E4D3B;
  --good-bg: #DCF1E4; --good: #17663F;
  --warn-bg: #FFF0C4; --warn: #7A5300;
  --bad-bg: #FADAD6;  --bad: #9E1F1F;
  --neu-bg: #E7EBE9;  --neu: #48564F;
  --info-bg: #DDEBFA; --info: #1F5C99;
  --orange-bg: #FFE2C6; --orange: #8A4500;
  --crit-bg: #B42318; --crit: #FFFFFF;
  --c-good: #2E9E5B; --c-warn: #E0A82E; --c-bad: #D64545; --c-neu: #A3B0AA; --c-info: #3B82C4;
  --shadow: 0 1px 2px rgba(16, 40, 31, .05), 0 8px 24px rgba(16, 40, 31, .06);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1512; --surface: #131F1A; --surface2: #182620; --line: #263831; --line2: #1E2E28;
    --ink: #E4EEE8; --mute: #9BB0A6; --faint: #6F857A;
    --accent: #4CC28C; --accent-h: #6FD3A5; --accent-soft: #143528; --accent-ink: #06231A;
    --side: #0A120F; --side-ink: #DCEBE3; --side-mute: #7F9A8E; --side-active: #163628;
    --good-bg: #143826; --good: #6FD9A0; --warn-bg: #3B2F0E; --warn: #F0C866;
    --bad-bg: #40191A; --bad: #F4908F; --neu-bg: #232F2A; --neu: #B2C2BA;
    --info-bg: #14304A; --info: #8CC0F0; --orange-bg: #40260F; --orange: #F2B27A;
    --crit-bg: #D4382B; --crit: #FFFFFF;
    --c-good: #3DBB74; --c-warn: #E8B640; --c-bad: #E25C5C; --c-neu: #5D6F67; --c-info: #5A9BD8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0C1512; --surface: #131F1A; --surface2: #182620; --line: #263831; --line2: #1E2E28;
  --ink: #E4EEE8; --mute: #9BB0A6; --faint: #6F857A;
  --accent: #4CC28C; --accent-h: #6FD3A5; --accent-soft: #143528; --accent-ink: #06231A;
  --side: #0A120F; --side-ink: #DCEBE3; --side-mute: #7F9A8E; --side-active: #163628;
  --good-bg: #143826; --good: #6FD9A0; --warn-bg: #3B2F0E; --warn: #F0C866;
  --bad-bg: #40191A; --bad: #F4908F; --neu-bg: #232F2A; --neu: #B2C2BA;
  --info-bg: #14304A; --info: #8CC0F0; --orange-bg: #40260F; --orange: #F2B27A;
  --crit-bg: #D4382B; --crit: #FFFFFF;
  --c-good: #3DBB74; --c-warn: #E8B640; --c-bad: #E25C5C; --c-neu: #5D6F67; --c-info: #5A9BD8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot { padding: 4rem; text-align: center; color: var(--mute); }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-size: 15px; letter-spacing: .01em; line-height: 1.15; }
.brand small { display: block; color: var(--side-mute); font-size: 11px; font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav .badge { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 1px 7px; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--side-active); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.me b { display: block; font-size: 13px; }
.me small { color: var(--side-mute); text-transform: capitalize; }
.side-tools { display: grid; gap: 2px; margin-top: 10px; }
.side-tools button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; background: transparent; border: 0; color: var(--side-ink); border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 13px; text-align: left; }
.side-tools button:hover { background: rgba(255, 255, 255, .07); }
.main { min-width: 0; padding: 26px 30px 56px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { font-size: 22px; letter-spacing: -.01em; }
.ph p { color: var(--mute); margin-top: 2px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ controls */
.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: 500; white-space: nowrap; }
.btn:hover { background: var(--surface2); border-color: var(--faint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-danger { color: var(--bad); border-color: var(--bad-bg); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-solid-danger { background: var(--crit-bg); border-color: var(--crit-bg); color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--mute); }
.iconbtn:hover { background: var(--surface2); border-color: var(--line); color: var(--ink); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.inp, select.inp, textarea.inp { width: 100%; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--ink); }
textarea.inp { resize: vertical; min-height: 64px; line-height: 1.4; }
.inp:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.inp:disabled, .inp[readonly] { background: var(--surface2); color: var(--mute); cursor: not-allowed; }
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--mute); margin-bottom: 4px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ------------------------------------------------------------ pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.p-good { background: var(--good-bg); color: var(--good); }
.p-warn { background: var(--warn-bg); color: var(--warn); }
.p-bad { background: var(--bad-bg); color: var(--bad); }
.p-neu { background: var(--neu-bg); color: var(--neu); }
.p-info { background: var(--info-bg); color: var(--info); }
.p-orange { background: var(--orange-bg); color: var(--orange); }
.p-crit { background: var(--crit-bg); color: var(--crit); }
.p-none { color: var(--faint); font-weight: 400; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--neu-bg); color: var(--neu); vertical-align: middle; }

/* ------------------------------------------------------------ dashboard */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow); }
.kpi { background: var(--surface); padding: 14px 16px 13px; display: block; color: inherit; min-width: 0; }
a.kpi:hover { background: var(--surface2); text-decoration: none; }
.kpi .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v.sm { font-size: 22px; padding-top: 6px; }
.kpi .c { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi .bar { height: 5px; background: var(--neu-bg); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.t-good { color: var(--good); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); } .t-neu { color: var(--neu); } .t-accent { color: var(--accent); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.nw { white-space: nowrap; }
[hidden] { display: none !important; }
.stack { display: grid; gap: 16px; align-content: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel > h2 { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; }
.panel > h2 a { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.pb { padding: 12px 16px 16px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: none; }
.donut text { fill: var(--ink); font-family: var(--font); }
.legend { display: grid; gap: 6px; flex: 1; min-width: 140px; }
.legend a, .legend div { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.legend a:hover { text-decoration: none; background: var(--surface2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .n { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .pc { width: 38px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 104px 1fr 30px; gap: 10px; align-items: center; color: inherit; }
a.hbar:hover { text-decoration: none; }
a.hbar:hover .lab { color: var(--accent); }
.hbar .lab { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .trk { height: 9px; background: var(--neu-bg); border-radius: 5px; overflow: hidden; }
.hbar .trk i { display: block; height: 100%; border-radius: 5px; min-width: 0; }
.hbar .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--neu-bg); min-width: 90px; }
.seg i { display: block; height: 100%; }
.s-good { background: var(--c-good); } .s-warn { background: var(--c-warn); } .s-bad { background: var(--c-bad); } .s-neu { background: var(--c-neu); } .s-info { background: var(--c-info); } .s-crit { background: var(--crit-bg); } .s-orange { background: #E58A2E; }

/* ------------------------------------------------------------ tables */
.tbl-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { position: sticky; top: 0; z-index: 2; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); background: var(--surface2); border-bottom: 1px solid var(--line); padding: 9px 12px; white-space: nowrap; }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--ink); }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t td.c, .t th.c { text-align: center; }
.t td.r, .t th.r { text-align: right; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface2); }
.t .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t .fname { font-weight: 600; }
.t .sub2 { color: var(--faint); font-size: 12px; }
.t.compact td { padding: 7px 12px; vertical-align: middle; }
.t td.nw { white-space: nowrap; }
.people-list { display: flex; flex-wrap: wrap; gap: 3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--neu-bg); color: var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 12px; white-space: nowrap; }
.tracker-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface); align-items: center; }
.filters .inp { width: auto; min-width: 130px; padding: 6px 9px; font-size: 13px; }
.filters .search { flex: 1 1 220px; min-width: 200px; }
.tbl-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 200px; }
.tbl-scroll table.t { min-width: 1100px; }
.tbl-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12.5px; background: var(--surface2); }
.empty { padding: 44px 20px; text-align: center; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.popwrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.pop label { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.pop label:hover { background: var(--surface2); }

/* ------------------------------------------------------------ drill-down */
.tree { display: grid; gap: 10px; }
.tnode { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.trow { display: grid; grid-template-columns: 26px minmax(160px, 1.6fr) minmax(90px, 1fr) 96px 92px 130px; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; }
.trow:hover { background: var(--surface2); }
.trow .chev { width: 22px; height: 22px; display: grid; place-items: center; color: var(--mute); transition: transform .12s; }
.trow[aria-expanded="true"] .chev { transform: rotate(90deg); }
.trow .nm { font-weight: 650; min-width: 0; }
.trow .nm small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.trow .ct { text-align: right; font-variant-numeric: tabular-nums; color: var(--mute); font-size: 13px; }
.trow.lvl2 { padding-left: 34px; border-top: 1px solid var(--line2); }
.trow.lvl2 .nm { font-weight: 600; }
.feat { border-top: 1px solid var(--line2); background: var(--surface2); padding: 4px 14px 10px 60px; overflow-x: auto; }
.feat table.t th { background: transparent; position: static; padding: 6px 10px; }
.feat table.t td { border-color: var(--line); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tools .search { flex: 1 1 240px; max-width: 340px; }
.thead-row { display: grid; grid-template-columns: 26px minmax(160px, 1.6fr) minmax(90px, 1fr) 96px 92px 130px; gap: 12px; padding: 0 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }
.thead-row span:nth-child(n+4) { text-align: right; }
.thead-row span:last-child { text-align: left; }

/* ------------------------------------------------------------ drawer / modal */
.scrim { position: fixed; inset: 0; background: rgba(8, 20, 15, .45); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 51; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0, 0, 0, .18); animation: slide .18s ease-out; }
.dh { padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.dh .crumb { color: var(--mute); font-size: 12.5px; }
.dh h2 { font-size: 18px; margin: 2px 0 10px; letter-spacing: -.01em; padding-right: 36px; }
.dh .x { position: absolute; top: 12px; right: 14px; }
.tabs { display: flex; gap: 2px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--mute); font-weight: 600; }
.tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.db { flex: 1; overflow: auto; padding: 16px 20px 24px; }
.df { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface2); align-items: center; }
.df .sp { flex: 1; }
.fs { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0 0 14px; min-width: 0; }
.fs > legend { padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { margin-bottom: 11px; min-width: 0; }
.fld:last-child { margin-bottom: 0; }
.row2 .fld { margin-bottom: 0; }
.row2 + .fld, .fld + .row2, .row2 + .row2 { margin-top: 11px; }
.hint { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-top: 8px; }
.result { display: flex; align-items: center; gap: 10px; background: var(--surface2); border-radius: 8px; padding: 10px 12px; margin-bottom: 11px; }
.result small { color: var(--mute); }
.pp { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; position: relative; min-height: 34px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pp.ro { background: var(--surface2); }
.pp .chip button { background: none; border: 0; padding: 0 0 0 2px; cursor: pointer; color: var(--mute); font-size: 15px; line-height: 1; }
.pp .add { background: none; border: 1px dashed var(--line); border-radius: 999px; padding: 1px 10px; cursor: pointer; color: var(--mute); font-size: 12px; }
.pp .add:hover { border-color: var(--accent); color: var(--accent); }
.pp .pop { left: 0; right: auto; max-height: 240px; overflow: auto; }
.pp .none { color: var(--faint); font-size: 12.5px; padding: 0 4px; }
.cmt { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.cmt .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--mute); }
.cmt .meta b { color: var(--ink); }
.cmt p { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hist { display: grid; gap: 0; }
.hist .h { padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 13px; overflow-wrap: anywhere; }
.hist .h small { display: block; color: var(--faint); }
.arrow { color: var(--faint); padding: 0 3px; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal .scrim { z-index: 0; }
.mbox { position: relative; z-index: 1; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; }
.mbox.wide { width: min(640px, 100%); }
.mbox h2 { font-size: 17px; margin-bottom: 4px; }
.mbox .mp { color: var(--mute); margin-bottom: 14px; }
.mbox .macts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #14201A; color: #fff; padding: 9px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: slide .15s; }
.toast.bad { background: var(--crit-bg); }

/* ------------------------------------------------------------ admin */
.atabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.atabs a { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--mute); font-weight: 600; margin-bottom: -1px; }
.atabs a:hover { text-decoration: none; color: var(--ink); }
.atabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.struct { display: grid; gap: 12px; max-width: 820px; }
.smod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.smod-h { display: flex; align-items: center; gap: 6px; padding: 10px 12px; }
.smod-h b { font-size: 15px; margin-right: auto; }
.ssub { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 28px; border-top: 1px solid var(--line2); }
.ssub span { margin-right: auto; }
.ssub small, .smod-h small { color: var(--faint); }
.sadd { display: flex; gap: 6px; padding: 8px 12px 12px 28px; border-top: 1px solid var(--line2); }
.sadd .inp { max-width: 260px; padding: 5px 9px; font-size: 13px; }
.formgrid { display: grid; gap: 14px; max-width: 520px; }
.note { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--mute); font-size: 13px; }
.note b { color: var(--ink); }
.zone { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); max-width: 760px; margin-bottom: 16px; }
.zone h3 { font-size: 15px; margin-bottom: 4px; }
.zone.danger { border-color: var(--bad-bg); }
.zone .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.res { margin-top: 12px; font-size: 13px; }
.res ul { margin: 6px 0 0; padding-left: 18px; color: var(--mute); }

/* ------------------------------------------------------------ auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 26px 24px; }
.auth-card .brand { padding: 0 0 16px; }
.auth-card .brand b { font-size: 17px; }
.auth-card .brand small { color: var(--mute); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--mute); margin-bottom: 18px; }
.auth-card form { display: grid; gap: 13px; }
.auth-card .btn { justify-content: center; padding: 10px; }
.envbox { max-width: 560px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand small, .side-foot .me div, .nav .sep { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a span.lbl-t { display: none; }
  .nav .badge { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; }
  .side-tools { margin-top: 0; display: flex; gap: 2px; }
  .side-tools button { padding: 8px; }
  .side-tools button span { display: none; }
  .main { padding: 18px 14px 40px; }
  .trow, .thead-row { grid-template-columns: 24px minmax(0, 1fr) 90px; }
  .trow .seg-cell, .trow .ct-open, .trow .ct-qa, .thead-row span:nth-child(3), .thead-row span:nth-child(4), .thead-row span:nth-child(5) { display: none; }
  .feat { padding-left: 14px; }
  .trow.lvl2 { padding-left: 20px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .row2 .fld + .fld { margin-top: 11px; }
  .hbar { grid-template-columns: 84px 1fr 26px; }
  .tbl-scroll { max-height: none; }
  .brand div, .side-foot .me { display: none; }
  .side { gap: 4px; padding: 8px; }
  .nav a { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .side, .acts, .filters, .tbl-foot, .df, .btn { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .tbl-scroll { max-height: none; }
}
