/* =====================================================================
   Sookth - Neo-Brutalism design system, shared by every project.
   Thick ink borders, hard offset shadows, bold colour blocks on a dotted
   cream page. Light and dark (follows the device, or the toggle).
   Copied to each <Project>/public/assets/core/ by: php bin/sookth assets
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
    --bg: #fff4d6;
    --dot: rgba(0, 0, 0, .13);
    --surface: #ffffff;
    --sunk: #fff9e8;
    --ink: #111111;
    --text: #111111;
    --muted: #4b4b4b;
    --on-color: #111111;

    --yellow: #ffd93d;
    --pink: #ff8fab;
    --blue: #74c0fc;
    --green: #69db7c;
    --orange: #ffa94d;
    --purple: #b197fc;

    --success: #1b7a32;
    --warning: #8a5300;
    --danger: #c2183f;

    --bw: 2.5px;
    --r: 12px;
    --r-sm: 8px;
    --shadow-sm: 2px 2px 0 var(--ink);
    --shadow: 4px 4px 0 var(--ink);
    --shadow-lg: 6px 6px 0 var(--ink);
    --ring: 0 0 0 3px var(--yellow);

    --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1b1915;
        --dot: rgba(255, 244, 214, .08);
        --surface: #2a2620;
        --sunk: #231f1a;
        --ink: #fff4d6;
        --text: #fff4d6;
        --muted: #d6ccb2;
        --success: #8ce99a;
        --warning: #ffd43b;
        --danger: #ffa8bf;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #1b1915;
    --dot: rgba(255, 244, 214, .08);
    --surface: #2a2620;
    --sunk: #231f1a;
    --ink: #fff4d6;
    --text: #fff4d6;
    --muted: #d6ccb2;
    --success: #8ce99a;
    --warning: #ffd43b;
    --danger: #ffa8bf;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font: 15px/1.5 var(--font);
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
    background-size: 18px 18px;
}
h1, h2, h3, h4 { margin: 0; font-weight: 850; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--yellow); color: var(--on-color); }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: var(--bw) solid var(--ink); margin: 1rem 0; }
:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-sm); }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
/* "hidden" always wins, also over components that set their own display (.alert, .row...). */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- Layout ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Brand: logo, coloured icon tile */
.brand { display: flex; align-items: center; gap: .6rem; flex: none; text-decoration: none; }
.brand:hover { background: none; }
/* The Sookth logo (assets/core/logo.png) on a white tile, so it reads in light and dark mode. */
.brand-logo {
    display: block; flex: none; width: 40px; height: 40px; padding: 4px;
    background: #ffffff;
    border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm);
    object-fit: contain;
}
.auth-head .brand-logo { width: 64px; height: 64px; padding: 6px; border-radius: 14px; box-shadow: var(--shadow); }
/* Coloured icon tile (sign-in steps) */
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px;
    background: var(--yellow); color: var(--on-color);
    border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm);
    font-weight: 900; font-size: 1.1rem;
}
.brand strong { display: block; font-weight: 900; font-size: 1.05rem; line-height: 1.1; }
.brand span span { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }

/* ---------- Side panel layout (admin): collapsible to an icon rail ---------- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s ease; }
.sidebar {
    position: sticky; top: 0; height: 100vh; z-index: 20;
    display: flex; flex-direction: column;
    background: var(--surface);
    border-right: 3px solid var(--ink);
}
.sidebar-head { display: flex; align-items: center; gap: .5rem; padding: .9rem .9rem .7rem; border-bottom: var(--bw) solid var(--ink); }
.sidebar-head .brand { flex: 1; min-width: 0; }
.sidebar-head .brand strong, .sidebar-head .brand span span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: .6rem .7rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.side-label { margin: .9rem .55rem .3rem; font-size: .7rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.side-link {
    display: flex; align-items: center; gap: .65rem;
    min-height: 40px; padding: .4rem .6rem;
    font-weight: 800; text-decoration: none; white-space: nowrap; color: var(--text);
    border: var(--bw) solid transparent; border-radius: 10px;
}
.side-link .icon { width: 20px; height: 20px; }
.side-link .side-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover { background: var(--sunk); border-color: var(--ink); color: var(--text); }
.side-link.is-active { background: var(--yellow); color: var(--on-color); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.side-link.is-disabled { opacity: .55; cursor: default; }
.side-link.is-disabled:hover { background: none; border-color: transparent; }
.side-link .badge { flex: none; }

/* Inside a product: "All products" back link, then the product as a header tile. */
.side-back { margin-bottom: .4rem; color: var(--muted); }
.side-app { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; margin-bottom: .5rem; border-bottom: var(--bw) solid var(--ink); }
.side-app .app-icon { width: 38px; height: 38px; border-radius: 10px; }
.side-app .app-icon .icon { width: 20px; height: 20px; }
.side-app strong { font-weight: 900; font-size: 1.05rem; }
.side-link .side-go { margin-left: auto; width: 16px; height: 16px; opacity: .55; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    padding: .7rem 1.5rem;
    background: var(--surface);
    border-bottom: 3px solid var(--ink);
}
.topbar h1 { font-size: 1.35rem; }
.topbar .page-actions { margin-left: auto; }
/* Right end of the top bar: light/dark + the account menu (a <details>, no script needed). */
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.topbar .page-actions + .topbar-end { margin-left: .5rem; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; padding: .25rem .6rem .25rem .25rem; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--yellow); color: var(--on-color); }
.user-menu .who strong { display: block; font-size: .88rem; line-height: 1.15; white-space: nowrap; }
.user-menu .who span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.user-menu[open] .who span, .user-menu > summary:hover .who span { color: var(--on-color); }
.user-menu .menu-caret { transform: rotate(90deg); transition: transform .15s ease; }
.user-menu[open] .menu-caret { transform: rotate(-90deg); }
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; width: 250px;
    display: flex; flex-direction: column; gap: .2rem; padding: .5rem;
    background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow);
}
.user-menu-panel form { margin-top: .3rem; padding-top: .5rem; border-top: 2px solid var(--ink); }
.avatar-photo { object-fit: cover; padding: 0; background: var(--surface); }
@media (max-width: 640px) { .user-menu .who, .user-menu .menu-caret { display: none; } }
.scrim { display: none; }

/* Collapsed to an icon rail (computer); remembered in the browser. */
@media (min-width: 901px) {
    :root[data-sidebar="collapsed"] .shell { grid-template-columns: 78px minmax(0, 1fr); }
    :root[data-sidebar="collapsed"] .sidebar .brand > span,
    :root[data-sidebar="collapsed"] .side-text,
    :root[data-sidebar="collapsed"] .side-go,
    :root[data-sidebar="collapsed"] .side-link .badge { display: none !important; }
    :root[data-sidebar="collapsed"] .sidebar-head { justify-content: center; padding: .8rem .5rem; }
    :root[data-sidebar="collapsed"] .sidebar-scroll { padding: .6rem .55rem; }
    :root[data-sidebar="collapsed"] .side-link { justify-content: center; padding: .4rem; }
    :root[data-sidebar="collapsed"] .side-app { justify-content: center; padding: .4rem 0 .6rem; }
    :root[data-sidebar="collapsed"] .side-label { height: 2px; margin: .6rem .4rem; font-size: 0; background: var(--ink); opacity: .25; }
}

/* Phone / small screens: the panel slides in over the page. */
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
    .nav-open .sidebar { transform: none; }
    .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .45); }
    .topbar { padding: .65rem 1rem; }
    .topbar h1 { font-size: 1.15rem; }
}

.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 900px) {
    .page { padding: 1rem; gap: 1.1rem; }
}

/* ---------- Surfaces ---------- */
.card {
    background: var(--surface);
    border: var(--bw) solid var(--ink);
    border-radius: var(--r);
    box-shadow: var(--shadow);
}
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding: .9rem 1.25rem;
    border-bottom: var(--bw) solid var(--ink);
}
.card-head h2 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.card-foot {
    display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap;
    padding: .9rem 1.25rem;
    background: var(--sunk);
    border-top: var(--bw) solid var(--ink);
    border-radius: 0 0 calc(var(--r) - 2px) calc(var(--r) - 2px);
}
.card.is-yellow { background: var(--yellow); color: var(--on-color); }
.card.is-pink   { background: var(--pink);   color: var(--on-color); }
.card.is-blue   { background: var(--blue);   color: var(--on-color); }
.card.is-green  { background: var(--green);  color: var(--on-color); }
.card.is-danger { border-color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 42px; padding: .5rem 1rem;
    font: inherit; font-weight: 850; line-height: 1.1; text-decoration: none; white-space: nowrap;
    color: var(--on-color);
    background: var(--yellow);
    border: var(--bw) solid var(--ink); border-radius: 10px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .06s ease, box-shadow .06s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); background: var(--yellow); color: var(--on-color); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn-ghost, .btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-pink, .btn-pink:hover { background: var(--pink); }
.btn-blue, .btn-blue:hover { background: var(--blue); }
.btn-green, .btn-green:hover { background: var(--green); }
.btn-danger, .btn-danger:hover { background: var(--pink); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 42px; padding: .5rem; }
.btn-icon.btn-sm { min-width: 34px; padding: .3rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.inline-form { display: inline; }

/* ---------- Badges, alerts ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .12rem .55rem;
    font-size: .75rem; font-weight: 900; letter-spacing: .02em; white-space: nowrap;
    color: var(--on-color); background: var(--surface);
    border: 2px solid var(--ink); border-radius: 999px;
}
.badge.is-yellow { background: var(--yellow); }
.badge.is-green  { background: var(--green); }
.badge.is-pink   { background: var(--pink); }
.badge.is-blue   { background: var(--blue); }
.badge.is-purple { background: var(--purple); }
.badge.is-orange { background: var(--orange); }
.badge.is-plain  { color: var(--text); }

.alert {
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .8rem 1rem;
    font-weight: 650; color: var(--on-color);
    background: var(--blue);
    border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.alert .icon { margin-top: .15em; }
.alert-success { background: var(--green); }
.alert-warning { background: var(--yellow); }
.alert-danger  { background: var(--pink); }
.alert p + p { margin-top: .25rem; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .label { font-weight: 850; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; min-height: 44px;
    padding: .55rem .8rem;
    font: inherit; color: var(--text);
    background: var(--surface);
    border: var(--bw) solid var(--ink); border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: var(--ring), var(--shadow-sm); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
/* Codes (bank code, agent code): shown in capitals even before the script has run. */
.input[data-uppercase] { text-transform: uppercase; }
.input[data-uppercase]::placeholder { text-transform: none; }
.field-error { font-size: .85rem; font-weight: 800; color: var(--danger); }
.checks { display: flex; flex-direction: column; gap: .5rem; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.input-code {
    font-family: var(--mono); font-size: 1.6rem; font-weight: 800;
    letter-spacing: .45em; text-align: center; padding-left: .45em;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .7rem 1rem; text-align: left; vertical-align: middle; border-bottom: 2px solid var(--ink); }
.table th { font-size: .75rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; background: var(--sunk); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--sunk); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Stat tiles, app cards ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; }
.stat-label { font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.stat-value { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; }
.stat-note { font-size: .82rem; font-weight: 650; }

.app-card { display: flex; flex-direction: column; text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
a.app-card:hover { background: var(--surface); color: var(--text); transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.app-card-top { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.15rem; }
.app-icon {
    display: grid; place-items: center; width: 48px; height: 48px; flex: none;
    color: var(--on-color);
    border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.app-icon .icon { width: 24px; height: 24px; }
.app-card h3 { font-size: 1.1rem; }
.app-card p { font-size: .88rem; color: var(--muted); }
.app-card-foot { margin-top: auto; padding: .7rem 1.15rem; border-top: var(--bw) solid var(--ink); display: flex; align-items: center; justify-content: space-between; font-weight: 850; font-size: .9rem; }
.app-card.is-soon { opacity: .7; }
.bg-yellow { background: var(--yellow); }
.bg-pink   { background: var(--pink); }
.bg-blue   { background: var(--blue); }
.bg-green  { background: var(--green); }
.bg-orange { background: var(--orange); }
.bg-purple { background: var(--purple); }

/* ---------- Avatar, user menu ---------- */
.avatar {
    display: grid; place-items: center; width: 38px; height: 38px; flex: none;
    font-weight: 900; font-size: .9rem; color: var(--on-color);
    background: var(--pink);
    border: var(--bw) solid var(--ink); border-radius: 10px;
}
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .5rem; border: var(--bw) solid var(--ink); border-radius: 12px; background: var(--sunk); }
.user-chip strong { display: block; font-size: .9rem; line-height: 1.15; }
.user-chip span { display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; border-bottom: 2px solid var(--ink); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; }
.dl dt { font-weight: 850; }
.dl dd { margin: 0; }

.empty { padding: 2.25rem 1.25rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty .icon { width: 36px; height: 36px; }

/* Recovery codes / secrets shown once */
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.codes code { padding: .45rem .6rem; text-align: center; font-weight: 800; background: var(--sunk); border: 2px solid var(--ink); border-radius: 8px; }
.secret-box { padding: .7rem .9rem; font-family: var(--mono); font-weight: 800; word-break: break-all; background: var(--sunk); border: 2px dashed var(--ink); border-radius: 10px; }
.qr { width: 200px; height: 200px; padding: 8px; background: #fff; border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm); }
.qr-lg { width: 260px; height: 260px; box-shadow: var(--shadow); }
.share-grid { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 640px) { .share-grid { grid-template-columns: 1fr; justify-items: center; } }

/* Bar charts drawn as SVG (shape attributes, no inline styles) */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--blue); stroke: var(--ink); stroke-width: 2; }
.chart .bar.is-today { fill: var(--yellow); }
.chart .axis-line { stroke: var(--ink); stroke-width: 2; }
.chart text { fill: var(--muted); font: 700 11px var(--font); }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1.25rem; border-top: var(--bw) solid var(--ink); }

/* ---------- Auth pages (centred card) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card {
    width: 100%; max-width: 430px;
    padding: 2rem 1.75rem;
    display: flex; flex-direction: column; gap: 1.25rem;
    background: var(--surface);
    border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.auth-head { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; }
.auth-head .brand-mark { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 14px; }
.auth-head h1 { font-size: 1.5rem; }
.auth-head p { color: var(--muted); font-weight: 600; }
.auth-foot { text-align: center; font-size: .88rem; color: var(--muted); }
.steps { display: flex; justify-content: center; gap: .4rem; }
.steps span { width: 34px; height: 8px; border: 2px solid var(--ink); border-radius: 99px; background: var(--surface); }
.steps span.is-done { background: var(--ink); }
.steps span.is-now { background: var(--yellow); }

/* Error page */
.error-code { font-size: 4.5rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; }

/* Theme toggle shows the icon for the mode you would switch to */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Print: plain ---------- */
@media print {
    body { background: #fff; color: #000; }
    .sidebar, .topbar, .scrim, .btn, .no-print { display: none !important; }
    .shell { display: block; }
    .page { padding: 0; }
    .card { box-shadow: none; border: 1px solid #000; }
}
