:root {
    --bg: #f4f4f2;
    --surface: #fcfcfb;
    --surface-2: #f1f1ee;
    --line: rgba(11, 11, 11, .10);
    --line-strong: rgba(11, 11, 11, .28);
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --ink-3: #6b6a64;
    --accent: #1d57a8;
    --accent-fill: #0b0b0b;
    --accent-soft: #e6eefb;
    --on-accent: #f4f4f2;
    --in: #2a78d6;
    --out: #eb6834;
    --net: #1baf7a;
    --ok: #006300;
    --ok-soft: #dff3e8;
    --warn: #8a5a00;
    --warn-soft: #fbefd0;
    --bad: #b42323;
    --bad-soft: #fbe3e3;
    --hero: #0e0e0d;
    --hero-ink: #f0efec;
    --hero-ink-2: #c3c2b7;
    --radius: 18px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 14px 30px -18px rgba(11, 11, 11, .18);
    --focus: 0 0 0 3px rgba(42, 120, 214, .45);
    --side: 248px;
    --top: 60px;
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .28);
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-3: #a09f96;
    --accent: #6aa6f2;
    --accent-fill: #f0efec;
    --accent-soft: #1b2c4a;
    --on-accent: #0d0d0d;
    --in: #3987e5;
    --out: #d95926;
    --net: #199e70;
    --ok: #52c98d;
    --ok-soft: #123324;
    --warn: #e6b34d;
    --warn-soft: #3a2d10;
    --bad: #f08585;
    --bad-soft: #3d1a1a;
    --hero: #131312;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 30px -18px rgba(0, 0, 0, .7);
    --focus: 0 0 0 3px rgba(106, 166, 242, .5);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }

.side {
    position: sticky; top: 0; align-self: start; height: 100vh;
    display: flex; flex-direction: column; gap: 4px;
    padding: 0 12px 12px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    z-index: 50;
}

.brand {
    display: flex; align-items: center; gap: 10px;
    height: var(--top); flex-shrink: 0; padding: 0 6px;
    text-decoration: none; color: var(--ink);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--accent-fill); color: var(--on-accent); font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; font-weight: 800; }
.brand-text small { font-size: 11px; font-weight: 600; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding-top: 8px; }
.nav-label {
    padding: 14px 10px 6px; font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.nav-link, .nav-group-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--ink-2);
    font-size: 13.5px; font-weight: 600; text-align: left; text-decoration: none;
    cursor: pointer;
}
.nav-link i, .nav-group-btn > i:first-child { width: 18px; text-align: center; color: var(--ink-3); }
.nav-link:hover, .nav-group-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.nav-link[aria-current="page"] i { color: var(--ink); }
.nav-group-btn .chev { margin-left: auto; font-size: 11px; transition: transform .15s; }
.nav-group-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; padding: 2px 0 6px 18px; }
.nav-group-btn[aria-expanded="true"] + .nav-sub { display: flex; }
.nav-sub .nav-link { min-height: 36px; font-weight: 500; }

.side-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }

.top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 12px;
    height: var(--top); padding: 0 28px;
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.top-spacer { flex: 1; }
.top-search {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 12px; min-width: 220px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.top-search:hover { border-color: var(--line-strong); color: var(--ink-2); }
.top-search kbd, .kbd {
    margin-left: auto; padding: 1px 6px; border: 1px solid var(--line-strong);
    border-radius: 5px; font: 600 11px var(--font); color: var(--ink-3);
}
.icon-btn {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.menu-btn { display: none; }

.user {
    display: flex; align-items: center; gap: 10px; min-height: 40px;
    padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-fill); color: var(--on-accent); font-size: 12px; font-weight: 800;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info strong { font-size: 13px; }
.user-info small { font-size: 11px; color: var(--ink-3); }

.content { width: 100%; max-width: 1560px; padding: 28px 28px 80px; flex: 1; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.page-head p { margin-top: 4px; color: var(--ink-3); font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.sudo-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 28px; background: var(--warn-soft); color: var(--warn); font-weight: 600;
}

.backdrop { display: none; }

@media (max-width: 1024px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .side {
        position: fixed; inset: 0 auto 0 0; width: 280px;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    }
    .side.is-open { transform: translateX(0); }
    .backdrop.is-on { display: block; position: fixed; inset: 0; background: rgba(8, 12, 20, .55); z-index: 45; }
    .menu-btn { display: inline-grid; }
    .top { padding: 0 14px; }
    .top-search { min-width: 0; }
    .top-search span, .top-search kbd, .user-info { display: none; }
    .user { padding: 0 4px; }
    .content { padding: 20px 14px 60px; }
    .nav-link, .nav-group-btn, .icon-btn, .top-search, .user { min-height: 44px; }
    .icon-btn { width: 44px; height: 44px; }
}

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { color: var(--ink-3); font-size: 13px; }
.card-flush { padding: 0; overflow: hidden; }
.card::before, .kpi::before { content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 1px; background: linear-gradient(90deg, transparent, var(--in), transparent); opacity: .45; pointer-events: none; }
.kpi-hero::before { opacity: .7; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3, .grid-main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.t-right { text-align: right; }
.t-in { color: var(--in); } .t-out { color: var(--out); } .t-ok { color: var(--ok); } .t-bad { color: var(--bad); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 14px; border: 1px solid var(--accent-fill); border-radius: var(--radius-sm);
    background: var(--accent-fill); color: var(--on-accent);
    font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: opacity .15s, border-color .15s, background-color .15s;
}
.btn:hover { opacity: .88; }
.btn:where(:not(.btn-secondary, .btn-ghost, .btn-danger)) {
    --cor-botao: var(--accent-fill);
    --cor-botao-clara: color-mix(in srgb, var(--cor-botao) 80%, white);
    --cor-botao-brilho: color-mix(in srgb, var(--cor-botao) 60%, transparent);
    background: linear-gradient(to bottom, var(--cor-botao-clara), var(--cor-botao));
    box-shadow:
        inset 0 1px 0 #ffffff59,
        inset 0 -2px 0 #0003,
        0 1px 2px #0006,
        0 8px 24px -6px var(--cor-botao-brilho);
    transition: opacity .15s, border-color .15s, background-color .15s, translate .1s, box-shadow .1s;
}
.btn:where(:not(.btn-secondary, .btn-ghost, .btn-danger)):active {
    translate: 0 1px;
    box-shadow: inset 0 2px 4px #0004;
}
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--line-strong); opacity: 1; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); opacity: 1; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1b1b; opacity: 1; }
html[data-theme="dark"] .btn-danger { background: #c0392b; }
html[data-theme="dark"] .btn-danger:hover { background: #d44a3a; opacity: 1; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"]::after {
    content: ""; width: 14px; height: 14px; border: 2px solid currentColor;
    border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }
@media (max-width: 760px) { .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--ink); }
.label .req { color: var(--bad); }
.input, .select, .textarea {
    width: 100%; min-height: 42px; padding: 0 12px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    color: var(--ink);
}
.textarea { min-height: 96px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error { font-size: 12.5px; font-weight: 600; color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-fill); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section { padding-bottom: 8px; }
.form-section + .form-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section > h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
    border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
    background: var(--accent-soft); color: var(--accent);
}
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }

.filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 16px; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters .field { min-width: 160px; flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }

.tabs {
    display: flex; gap: 2px; padding: 4px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
    border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
    font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--on-accent); background: var(--accent-fill); }
.tabs.tem-pill .tab[aria-selected="true"] { background: transparent; }

.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    padding: 11px 14px; text-align: left; white-space: nowrap;
    font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3);
    background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.table-actions { display: flex; justify-content: flex-end; gap: 4px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.pagination .row { gap: 4px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px;
    border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
    background: var(--surface-2); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--accent-soft); color: var(--accent); }

.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12.5px; color: var(--ink-3); }
.kpi-hero { background-color: var(--hero); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 7px); border-color: transparent; color: var(--hero-ink); }
.kpi-hero .kpi-label, .kpi-hero .kpi-foot { color: var(--hero-ink-2); }
.kpi-hero .kpi-value { font-size: clamp(32px, 4vw, 48px); }
button.kpi { text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.kpi:hover { border-color: var(--line-strong); }

.delta { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.delta-up { background: var(--ok-soft); color: var(--ok); }
.delta-down { background: var(--bad-soft); color: var(--bad); }

.chart-box { position: relative; height: 280px; }
.chart-box canvas { position: absolute; inset: 0; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 16px; text-align: center; color: var(--ink-3); }
.empty i { font-size: 28px; }
.empty strong { color: var(--ink); font-size: 15px; }
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.modal {
    width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.modal::backdrop { background: rgba(8, 12, 20, .6); }
.modal-wide { width: min(860px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 220px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 12px 16px;
    border-radius: var(--radius-sm); background: var(--ink); color: var(--bg);
    font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: none; }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--bad); color: #fff; }
html[data-theme="dark"] .toast-success { background: #1f7a4f; }
html[data-theme="dark"] .toast-error { background: #b83a3a; }

.palette { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.palette::backdrop { background: rgba(8, 12, 20, .6); }
.palette-input { width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 15px; }
.palette-input:focus { outline: none; box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 360px; overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette-item .pin { margin-left: auto; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; min-width: 32px; min-height: 32px; }
.palette-item .pin[aria-pressed="true"] { color: var(--warn); }

.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.guest-card { width: min(440px, 100%); padding: 32px; }
.guest-card .brand { height: auto; padding: 0 0 20px; }
.guest-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.guest-card .sub { color: var(--ink-3); margin-bottom: 22px; }
.guest-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; }

.admin-top { gap: 20px; }
.admin-top .brand { height: auto; }
.admin-content { margin: 0 auto; }
@media (max-width: 760px) {
    .admin-top { gap: 8px; padding: 0 12px; }
    .admin-top .brand-text, .admin-top nav { display: none; }
    .admin-top .btn { min-height: 44px; }
}

.bc { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.bc i { font-size: 8px; opacity: .6; }
.bc b { color: var(--ink); font-weight: 600; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; min-width: 36px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--surface); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
@media (max-width: 1024px) { .seg button .seg-rot { display: none; } .seg button { min-height: 44px; min-width: 44px; } }

.tabs { position: relative; }
.tab { position: relative; z-index: 1; }
.tabpill {
    position: absolute; top: 0; left: 0; z-index: 0; border-radius: 10px; background: var(--accent-fill);
    pointer-events: none;
}

.nav { position: relative; }
.nav-link, .nav-label { position: relative; z-index: 1; }
.nav-pill {
    position: absolute; top: 0; left: 0; right: 0; z-index: 0; border-radius: var(--radius-sm); background: var(--surface-2);
    pointer-events: none;
}
.nav.tem-pill .nav-link:hover, .nav.tem-pill .nav-link[aria-current="page"] { background: transparent; }


@view-transition { navigation: auto; }
.side { view-transition-name: lateral; }
.top { view-transition-name: topo; }

:root {
    --surf: var(--surface);
    --surf2: var(--surface-2);
    --ink2: var(--ink-2);
    --muted: var(--ink-3);
    --on-ink: var(--on-accent);
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --border: var(--line);
    --borderH: var(--line-strong);
    --v1: var(--in);
    --v2: var(--out);
    --v3: var(--net);
    --v4: #eda100;
    --neu: #b9b8ae;
    --good: #006300;
    --crit: #d03b3b;
    --sh: var(--shadow);
    --spot: rgba(11, 11, 11, .38);
    --scrim: rgba(8, 8, 7, .62);
    --glow: var(--v1);
    --glow-hi: var(--v1);
    --hero-b: rgba(255, 255, 255, .08);
    --hero-ink2: #c3c2b7;
    --hero-muted: #a8a79e;
    --hero-grid: rgba(255, 255, 255, .09);
    --hero-axis: rgba(255, 255, 255, .22);
    --hero-v1: #3987e5;
    --hero-v2: #d95926;
    --hero-v3: #199e70;
    --hero-v4: #c98500;
    --hero-neu: #4a4943;
    --hm-b0: #cde2fb;
    --hm-b1: #86b6ef;
    --hm-b2: #3987e5;
    --hm-b3: #1c5cab;
    --hm-b4: #0d366b;
    --hm-o0: #fde3d6;
    --hm-o1: #f9b896;
    --hm-o2: #eb6834;
    --hm-o3: #b84a1d;
    --hm-o4: #7a2e0e;
    --hm-mid: #f0efec;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
    --grid: #2c2c2a;
    --axis: #383835;
    --v4: #c98500;
    --neu: #4a4943;
    --good: #0ca30c;
    --crit: #ec6a6a;
    --spot: rgba(255, 255, 255, .5);
    --glow-hi: #ffffff;
    --hero-b: rgba(255, 255, 255, .10);
    --hm-b0: #184f95;
    --hm-b1: #256abf;
    --hm-b2: #3987e5;
    --hm-b3: #6da7ec;
    --hm-b4: #b7d3f6;
    --hm-o0: #7a2e0e;
    --hm-o1: #a8431a;
    --hm-o2: #d95926;
    --hm-o3: #ef8a5e;
    --hm-o4: #f9c3a8;
    --hm-mid: #383835;
}
