/* shift.bot dashboard — design tokens + base styles */

:root {
  --accent: #7cffb2;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, transparent);
  --accent-strong: color-mix(in oklab, var(--accent) 80%, white);

  --danger: #fb7185;
  --warn: #fbbf24;
  --info: #5eead4;
  --violet: #c8a8ff;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* density-driven */
  --gap-xs: 6px;
  --gap-sm: 10px;
  --gap-md: 14px;
  --gap-lg: 22px;
  --row-h: 36px;
  --pad-card: 18px;
}

/* ── Theme: dark (default) ──────────────────────────────────── */
:root[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-2: #0f1114;
  --surface: #131519;
  --surface-2: #181b20;
  --surface-3: #1d2127;
  --border: #1f242a;
  --border-strong: #2a3038;
  --text: #e9eaec;
  --text-muted: #7a8088;
  --text-dim: #545961;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px -12px rgba(0,0,0,0.6);
}

/* ── Theme: light ───────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg: #f7f7f8;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececef;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;
  --shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 4px 14px -8px rgba(0,0,0,0.08);
}

/* ── Density ────────────────────────────────────────────────── */
:root[data-density="compact"] {
  --gap-xs: 4px; --gap-sm: 7px; --gap-md: 10px; --gap-lg: 16px;
  --row-h: 30px; --pad-card: 14px;
}
:root[data-density="comfy"] {
  --gap-xs: 8px; --gap-sm: 12px; --gap-md: 18px; --gap-lg: 28px;
  --row-h: 42px; --pad-card: 22px;
}

/* ── Card style ─────────────────────────────────────────────── */
:root[data-card="flat"] .card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: none;
}
:root[data-card="elevated"] .card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
:root[data-card="outlined"] .card {
  background: transparent;
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }

/* scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ── Layout shell ───────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w, 232px) minmax(0, 1fr);
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "side top"
    "side main";
  height: 100vh;
  transition: grid-template-columns 200ms cubic-bezier(.2,.7,.2,1);
}
.app[data-sidebar="rail"] { --sidebar-w: 64px; }
.app[data-sidebar="hidden"] { --sidebar-w: 0px; }

.sidebar {
  grid-area: side;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar { grid-area: top; border-bottom: 1px solid var(--border); background: var(--bg); }
.main { grid-area: main; overflow: auto; background: var(--bg); }

/* ── Sidebar ────────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0b0d;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 14px;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden;
}
.brand-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap;
}
.dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.dot.danger { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 22%, transparent); }

.nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav-label {
  padding: 14px 12px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); font-weight: 500;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms, color 100ms;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="true"] {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item[aria-current="true"]::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 2px; background: var(--accent); border-radius: 999px;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.nav-item .nav-badge.danger { background: color-mix(in oklab, var(--danger) 18%, transparent); color: var(--danger); }

.app[data-sidebar="rail"] .brand-name,
.app[data-sidebar="rail"] .brand-status,
.app[data-sidebar="rail"] .nav-label,
.app[data-sidebar="rail"] .nav-text,
.app[data-sidebar="rail"] .nav-badge,
.app[data-sidebar="rail"] .side-footer { display: none; }
.app[data-sidebar="rail"] .nav-item { justify-content: center; padding: 8px; }
.app[data-sidebar="rail"] .brand { justify-content: center; padding: 14px 8px; }

.side-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-muted);
}
.side-footer .avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: linear-gradient(135deg, #7cffb2, #c8a8ff);
  flex-shrink: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  height: 56px;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.crumbs .sep { opacity: 0.4; }
.crumbs .crumb-current { color: var(--text); font-weight: 500; }

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 280px;
  font-size: 13px;
  color: var(--text-muted);
}
.search input { background: transparent; border: 0; outline: 0; flex: 1; color: var(--text); }
.search kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

/* ── Main + page ────────────────────────────────────────────── */
.page {
  padding: var(--gap-lg);
  max-width: 1500px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: var(--gap-lg);
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: 2px;
}
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--gap-md);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 0; }
.card-sub { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ── Stat card ──────────────────────────────────────────────── */
.stat {
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--font-mono); color: var(--text); }
.stat-delta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.stat-delta.up { color: var(--accent); }
.stat-delta.down { color: var(--danger); }
.stat-spark { height: 28px; margin-top: 4px; }

/* ── Grid helpers ───────────────────────────────────────────── */
.grid { display: grid; gap: var(--gap-md); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-12-5 { grid-template-columns: 1.7fr 1fr; }
.grid-8-4 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-12-5, .grid-8-4 { grid-template-columns: 1fr; }
}

/* ── Tables ─────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.tbl tbody td {
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  height: var(--row-h);
  vertical-align: middle;
  color: var(--text);
}
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); }
.tbl .mono { font-family: var(--font-mono); font-size: 12.5px; }
.tbl .muted { color: var(--text-muted); }

/* ── Badges / chips ─────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}
.chip.solid { background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent); border-color: transparent; }
.chip.danger { background: color-mix(in oklab, var(--danger) 16%, transparent); color: var(--danger); border-color: transparent; }
.chip.warn { background: color-mix(in oklab, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.chip.info { background: color-mix(in oklab, var(--info) 16%, transparent); color: var(--info); border-color: transparent; }
.chip.violet { background: color-mix(in oklab, var(--violet) 16%, transparent); color: var(--violet); border-color: transparent; }

.guild-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: #0a0b0d;
  flex-shrink: 0;
}

/* ── Sparkline / chart svg ──────────────────────────────────── */
.spark { width: 100%; height: 100%; display: block; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bar-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: inherit; }

/* ── Log stream ─────────────────────────────────────────────── */
.log-stream {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  max-height: 520px;
  overflow: auto;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.log-line {
  display: grid;
  grid-template-columns: 78px 60px 70px 1fr;
  gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
}
.log-line:last-child { border-bottom: 0; }
.log-line:hover { background: var(--surface-2); }
.log-line .t { color: var(--text-dim); }
.log-line .lvl { text-transform: uppercase; font-weight: 600; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; align-self: center; justify-self: start; }
.log-line .lvl.info { background: color-mix(in oklab, var(--info) 18%, transparent); color: var(--info); }
.log-line .lvl.warn { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.log-line .lvl.error { background: color-mix(in oklab, var(--danger) 18%, transparent); color: var(--danger); }
.log-line .src { color: var(--text-muted); }
.log-line .msg { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Toggle / form bits ─────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv-key { color: var(--text-muted); font-size: 13px; }
.kv-val { color: var(--text); font-size: 13px; }
.kv-val.mono { font-family: var(--font-mono); font-size: 12.5px; }

.switch {
  width: 32px; height: 18px;
  background: var(--surface-3); border-radius: 999px; position: relative;
  cursor: pointer; transition: background 120ms;
  border: 1px solid var(--border);
}
.switch[data-on="true"] { background: var(--accent); border-color: transparent; }
.switch::after {
  content: ''; position: absolute; left: 2px; top: 1px;
  width: 14px; height: 14px; border-radius: 999px;
  background: #fff;
  transition: left 120ms cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch[data-on="true"]::after { left: 15px; background: #0a0b0d; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #0a0b0d; border-color: transparent; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 14%, transparent); }

/* ── Tab strip ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 12px;
  font-size: 13px; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-current="true"] { color: var(--text); border-color: var(--accent); }

/* ── Misc ───────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

/* ── Font family tweak surface ──────────────────────────────── */
:root[data-font="inter"] { --font-sans: 'Inter', system-ui, sans-serif; }
:root[data-font="geist"] { --font-sans: 'Geist', system-ui, sans-serif; }
:root[data-font="ibm"] { --font-sans: 'IBM Plex Sans', system-ui, sans-serif; }
:root[data-font="system"] { --font-sans: system-ui, -apple-system, sans-serif; }

/* ── Command palette ───────────────────────────────────────── */
.palette-scrim {
  position: fixed; inset: 0;
  background: color-mix(in oklab, #000 65%, transparent);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: start center;
  padding-top: 12vh;
  animation: fadeIn 120ms ease-out;
}
.palette {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px color-mix(in oklab, var(--accent) 8%, transparent);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
  animation: pop 140ms cubic-bezier(.2,.7,.2,1);
}
@keyframes pop { from { transform: translateY(-8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.palette-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.palette-input input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 15px;
}
.palette-input kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.palette-list { overflow: auto; padding: 6px; flex: 1; }
.palette-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 12px 4px;
  font-weight: 500;
}
.palette-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border: 0; background: transparent;
}
.palette-item[data-active="true"] { background: var(--surface-2); }
.palette-label { color: var(--text); font-weight: 500; }
.palette-sub { color: var(--text-muted); font-size: 11.5px; }
.palette-kind {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3);
}
.palette-footer {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-2);
}
.palette-footer kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  margin-right: 4px;
}

/* ── Drawer ─────────────────────────────────────────────────── */
.drawer-scrim {
  position: fixed; inset: 0;
  background: color-mix(in oklab, #000 50%, transparent);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
  z-index: 90;
}
.drawer-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px -20px rgba(0,0,0,0.5);
  z-index: 91;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
  max-width: 92vw;
}
.drawer[data-open="true"] { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-body {
  flex: 1; overflow: auto;
  padding: 0;
}
.drawer-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.stat-mini {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.stat-value-sm {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
  font-family: var(--font-mono); color: var(--text);
}
.stat-mini .stat-spark { height: 22px; margin-top: 2px; }

/* ── Notification dropdown ──────────────────────────────────── */
.dropdown-scrim {
  position: fixed; inset: 0; z-index: 80;
}
.dropdown {
  position: fixed; top: 56px; right: 70px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  z-index: 81;
  display: flex; flex-direction: column;
  max-height: 70vh;
  animation: pop 140ms cubic-bezier(.2,.7,.2,1);
}
.dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.dropdown-body { overflow: auto; padding: 4px; flex: 1; }
.notif {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
}
.notif:hover { background: var(--surface-2); }
.notif .dot { margin-top: 5px; flex-shrink: 0; }
.dropdown-foot { padding: 10px 12px; border-top: 1px solid var(--border); }

/* ── Settings inputs ────────────────────────────────────────── */
.settings-input {
  width: 100%;
  padding: 7px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  outline: 0;
  transition: border-color 100ms, box-shadow 100ms;
}
.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* ── Code block ─────────────────────────────────────────────── */
.code-block {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
  color: var(--text);
  overflow: auto;
  max-height: 360px;
  white-space: pre;
  tab-size: 2;
}

/* search button look (replaces input on topbar) */
.topbar .search {
  border: 1px solid var(--border);
  cursor: pointer;
}
.topbar .search:hover { background: var(--surface-3); }

/* Toast notifications (bottom-right) */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-enter { animation: toastIn 220ms cubic-bezier(.2,.8,.2,1); }

/* Live clock (Overview) — base sizes (responsive below) */
.clock-hh { font-size: 54px; font-weight: 700; letter-spacing: 2px; }
.clock-ss { font-size: 26px; font-weight: 600; color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet / small laptop — collapse sidebar to an icon rail */
@media (max-width: 920px) {
  .app { grid-template-columns: 56px minmax(0, 1fr); }
  .topbar { overflow: hidden; }
  .sidebar .brand-name,
  .sidebar .brand-status,
  .nav-label, .nav-text, .nav-badge,
  .side-footer { display: none; }
  .nav-item { justify-content: center; padding: 8px; }
  .brand { justify-content: center; padding: 14px 8px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .search { width: 180px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-12-5, .grid-8-4 { grid-template-columns: 1fr; }
}

/* Phone — stack content, scrollable tables, compact topbar */
@media (max-width: 600px) {
  .page { padding: 14px; gap: 14px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .grid-4, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { gap: 8px; }
  .crumbs { font-size: 12px; min-width: 0; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search kbd { display: none; }
  /* tables scroll sideways instead of squishing */
  .tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .clock-hh { font-size: 40px; }
  .clock-ss { font-size: 20px; }
  .card { padding: 14px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .app { grid-template-columns: 46px minmax(0, 1fr); }
  .topbar { padding: 0 8px; }
  .page { padding: 10px; }
  .clock-hh { font-size: 34px; }
}

/* Prevent min-content overflow (grid/flex children + SVG sparklines) */
.grid > * { min-width: 0; }
.stat-card, .card { min-width: 0; }
.stat-card svg, .card svg { max-width: 100%; }
@media (max-width: 600px) {
  .main { overflow-x: hidden; }
  .page, .page > * { max-width: 100%; min-width: 0; }
}

/* Onboard banner — stack on mobile */
@media (max-width: 600px) {
  .onboard-banner { flex-direction: column; align-items: stretch; }
  .onboard-banner > div[style*="flex"] { width: 100%; }
  .onboard-banner .btn { width: 100%; }
}

/* ══ Theme polish — edgy / modern (same palette) ══════════════ */

/* Textured main surface: corner glows + subtle dot grid */
.main {
  background-color: var(--bg);
  background-image:
    radial-gradient(720px 360px at 100% -6%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 62%),
    radial-gradient(520px 320px at -6% 106%, color-mix(in oklab, var(--violet) 6%, transparent), transparent 60%),
    radial-gradient(circle, color-mix(in oklab, var(--border-strong) 34%, transparent) 1px, transparent 1.5px);
  background-size: auto, auto, 30px 30px;
}
:root[data-theme="light"] .main {
  background-image:
    radial-gradient(720px 360px at 100% -6%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 62%),
    radial-gradient(520px 320px at -6% 106%, color-mix(in oklab, var(--violet) 10%, transparent), transparent 60%),
    radial-gradient(circle, color-mix(in oklab, var(--border-strong) 50%, transparent) 1px, transparent 1.5px);
}

/* Cards react to hover with an accent edge-glow */
.card { transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.card:hover {
  border-color: color-mix(in oklab, var(--accent) 32%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 16%, transparent),
              0 10px 30px -16px color-mix(in oklab, var(--accent) 40%, transparent),
              var(--shadow);
}

/* Topbar: thin accent underline */
.topbar {
  box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--accent) 16%, transparent);
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 4%, var(--bg)), var(--bg));
}

/* Sidebar: faint gradient + active item glow */
.sidebar { background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 5%, var(--bg-2)), var(--bg-2)); }
.nav-item[aria-current="true"] {
  background: color-mix(in oklab, var(--accent) 12%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 22%, transparent);
}
.nav-item[aria-current="true"]::before { box-shadow: 0 0 10px var(--accent); }
.nav-item[aria-current="true"] svg { opacity: 1; color: var(--accent); }

/* Brand mark glow */
.brand-mark { box-shadow: 0 0 14px -2px color-mix(in oklab, var(--accent) 70%, transparent); }

/* Page title: tighter, faint accent underglow */
.page-title { text-shadow: 0 0 22px color-mix(in oklab, var(--accent) 18%, transparent); }

/* Chips a touch sharper */
.chip.solid { box-shadow: 0 0 12px -4px var(--accent); }
