/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand (Kuraka) · redesign: restyle
 * paper: oklch(99% 0.002 70) / oklch(17% 0.006 60) · accent: oklch(50% 0.14 40), the favicon terracotta · display: system-ui · body: system-ui
 * nav: kept (sidebar, menu under 768px) · signature: kept (domain table) · states: loading, empty, error, full
 * axes: light/grotesk-sans/warm · posture: Libredesk/Stalwart admin, warm stone panels, one terracotta signal · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H3 E4 S4 R4 V4 · weakest: H, system face kept: the panel ships no font files under its CSP */
/* Hallmark · tokens inline under the project's own names; base.css not imported, its page heads and block svg fight the app shell */
/* Hallmark · answered F24 · the modal keeps its hairline: the dark theme drops shadows, the edge carries it there */
:root {
  color-scheme: light;
  --bg: oklch(99% 0.002 70);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.5% 0.005 70);
  --panel: oklch(97.6% 0.004 70);
  --text: oklch(22% 0.008 50);
  --muted: oklch(48% 0.01 60);
  --border: oklch(91.5% 0.006 70);
  --border-strong: oklch(85% 0.008 70);
  --accent: oklch(50% 0.14 40);
  --accent-text: oklch(48% 0.14 40);
  --accent-soft: oklch(95.5% 0.025 45);
  --on-accent: oklch(100% 0 0);
  --ok: oklch(50% 0.12 150);
  --warn: oklch(55% 0.13 65);
  --danger: oklch(52% 0.19 25);
  --focus: oklch(55% 0.13 245);
  --scrim: oklch(22% 0.008 50 / 0.5);
  --shadow: 0 1px 2px oklch(22% 0.008 50 / 0.06);
  --shadow-pop: 0 12px 32px oklch(22% 0.008 50 / 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --transition: 120ms;
  --sidebar-width: 248px;
  --space: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: oklch(17% 0.006 60); --surface: oklch(19.5% 0.007 60); --surface-2: oklch(24% 0.008 60); --panel: oklch(15.5% 0.005 60);
    --text: oklch(96% 0.004 70); --muted: oklch(70% 0.01 70); --border: oklch(28.5% 0.008 60); --border-strong: oklch(36% 0.01 60);
    --accent: oklch(70% 0.14 42); --accent-text: oklch(76% 0.12 45); --accent-soft: oklch(27% 0.045 40); --on-accent: oklch(17% 0.006 60);
    --ok: oklch(76% 0.14 150); --warn: oklch(82% 0.13 85); --danger: oklch(72% 0.15 25); --focus: oklch(75% 0.11 240);
    --scrim: oklch(8% 0.005 60 / 0.7); --shadow: none; --shadow-pop: 0 16px 40px oklch(0% 0 0 / 0.5);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
html, body { overflow-x: clip; }
body { margin: 0; min-width: 0; }
::selection { background: var(--accent-soft); color: var(--text); }
.mono, .table th, .table td, .badge { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: var(--accent-text); text-underline-offset: 3px; }
svg, img { flex-shrink: 0; vertical-align: middle; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: 1.5rem; line-height: 1.25; }
h2 { font-size: 1.125rem; line-height: 1.4; }
h3 { font-size: 1rem; line-height: 1.4; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.gap-0 { gap: 0; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.gap-3 { gap: 24px; } .gap-4 { gap: 32px; } .gap-5 { gap: 40px; } .gap-6 { gap: 48px; }
.muted, .help { color: var(--muted); }
.mono { font-family: var(--font-mono); overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; } .right { margin-inline-start: auto; text-align: right; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: .9375rem; font-weight: 550; line-height: 1.35; text-decoration: none; text-align: center;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 88%, var(--text)); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow); }
.btn-danger { background: var(--danger); color: var(--surface); }
.btn-danger:hover:not(:disabled) { background: color-mix(in oklab, var(--danger) 86%, var(--text)); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-secondary:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label { font-size: .875rem; font-weight: 550; }
.help { font-size: .8125rem; }
.error { color: var(--danger); }
.error-box { border: 1px solid color-mix(in oklab, var(--danger) 40%, var(--border)); border-radius: var(--radius); padding: 12px 16px; background: color-mix(in oklab, var(--danger) 6%, var(--surface)); color: var(--danger); align-items: flex-start; }
.error-box span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-width: 0; min-height: 36px; padding: 8px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover { border-color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]):focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.checkbox { min-height: 36px; cursor: pointer; }
.card { padding: 24px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card form { max-width: 560px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.metric-value { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.metric-sparkline { display: block; width: 100%; height: 48px; color: var(--accent-text); }
.card .stack > .btn, .stack > .badge { align-self: flex-start; }
.auth-card .stack > .btn { align-self: stretch; }
dl.stack { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 32px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.table-wrap { position: relative; width: 100%; max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; white-space: nowrap; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table th { position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--muted); font-size: .8125rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel); }
.table .empty { white-space: normal; }
.badge, .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: .8125rem; }
.badge { background: var(--surface-2); font-weight: 550; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); } .neutral { color: var(--muted); }
.badge.ok { border-color: color-mix(in oklab, var(--ok) 35%, transparent); background: color-mix(in oklab, var(--ok) 10%, var(--surface)); }
.badge.warn { border-color: color-mix(in oklab, var(--warn) 35%, transparent); background: color-mix(in oklab, var(--warn) 10%, var(--surface)); }
.badge.danger { border-color: color-mix(in oklab, var(--danger) 35%, transparent); background: color-mix(in oklab, var(--danger) 10%, var(--surface)); }
.chip { background: var(--surface-2); max-width: 100%; overflow-wrap: anywhere; }
.chip .btn { padding: 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 8px 12px; min-height: 40px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 550; transition: color var(--transition), border-color var(--transition); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 48px 24px; }
.empty > svg { color: var(--muted); }
.empty p { max-width: 48ch; }
.loading { display: flex; align-items: center; justify-content: center; padding: 32px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body:has(dialog.modal[open]) { overflow: hidden; }
.modal { width: calc(100% - 48px); max-width: 560px; max-height: calc(100dvh - 48px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-pop); }
.modal::backdrop { background: var(--scrim); }
.modal-body { margin-block: 24px; overflow-wrap: anywhere; }
.modal-actions { justify-content: flex-end; }
.secret-warning { padding: 12px; border: 1px solid color-mix(in oklab, var(--warn) 40%, var(--border)); border-radius: var(--radius); background: color-mix(in oklab, var(--warn) 8%, var(--surface)); align-items: flex-start; }
.secret-warning svg { color: var(--warn); }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100% - 48px)); pointer-events: none; }
.toast { padding: 12px 16px; background: var(--surface); border: 1px solid currentColor; border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow-wrap: anywhere; }
.app-layout { height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { height: 100dvh; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-header { min-height: 64px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 8px; align-items: center; font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.sidebar-body { padding: 4px 12px 16px; display: flex; flex: 1; flex-direction: column; gap: 24px; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; text-decoration: none; transition: background-color var(--transition), color var(--transition); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--accent-text); }
.language-switch { display: flex; gap: 8px; }
.language-switch [aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.user-menu { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; overflow-wrap: anywhere; }
.user-menu .mono { font-size: .8rem; }
.main-shell { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.main-content { width: 100%; max-width: 1280px; margin-inline: auto; padding: 32px 40px; flex: 1; min-width: 0; }
.footer { color: var(--muted); font-size: .8125rem; padding: 16px 40px; border-top: 1px solid var(--border); }
.menu-toggle { display: none; }
.skip-link { position: fixed; left: 8px; top: -80px; z-index: 300; background: var(--surface); padding: 8px 16px; border: 1px solid var(--focus); border-radius: var(--radius); }
.skip-link:focus { top: 8px; }
.auth-page { background: var(--panel); min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; box-shadow: var(--shadow-pop); }
.auth-card form { margin-block: 24px; }
.auth-card h1 { margin-top: 24px; }
.auth-card .intro { margin-top: 8px; }
.auth-page .footer { border: 0; padding: 0; text-align: center; }
@media (max-width: 768px) {
  .app-layout { height: auto; min-height: 100dvh; display: flex; flex-direction: column; }
  .main-shell { overflow-y: visible; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-header { min-height: 64px; padding: 12px 16px; }
  .menu-toggle { display: inline-flex; }
  .sidebar-body { display: none; max-height: calc(100dvh - 64px); }
  .menu-open .sidebar-body { display: flex; }
  .main-shell { flex: 1; }
  .main-content { padding: 24px 16px; }
  .footer { padding: 16px; }
  .card, .auth-card { padding: 20px 16px; }
  .modal { width: calc(100% - 32px); padding: 16px; max-height: calc(100dvh - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
