/* =============================================================================
   Mortarbase Dashboard — Design System
   Aesthetic: Vercel Geist + Linear. True-gray neutrals, one indigo accent,
   hairline borders, near-zero shadows, 14px Inter, mono for keys.
   Sections: 1 Tokens · 2 Reset/Base · 3 Layout · 4 Components · 5 Utilities · 6 Responsive
   ============================================================================= */

/* ------------------------------ 0. FONTS ---------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("vendor/inter.woff2") format("woff2");
}

/* ----------------------------- 1. TOKENS ---------------------------------- */
:root {
  /* surfaces (light) */
  --bg: #fafafa;
  --surface: #ffffff;
  --subtle: #f5f5f5;
  --hover: #f5f5f5;
  --border: #e8e8e8;
  --border-strong: #d4d4d4;
  /* text */
  --text: #171717;
  --muted: #525252;
  --faint: #8f8f8f;
  /* accent (indigo) */
  --accent: #5e6ad2;
  --accent-hover: #515dc4;
  --accent-fg: #ffffff;
  --accent-subtle: #eef0fb;
  --accent-text: #4853c4;
  --ring: rgba(94, 106, 210, 0.35);
  /* semantic */
  --success: #15803d;        --success-subtle: #f0fdf4;  --success-solid: #16a34a;
  --warning: #b45309;        --warning-subtle: #fffbeb;  --warning-solid: #f59e0b;
  --danger: #dc2626;         --danger-subtle: #fef2f2;   --danger-solid: #dc2626;
  --info: #2563eb;           --info-subtle: #eff6ff;     --info-solid: #3b82f6;
  /* radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 9999px;
  /* elevation (deliberately subtle) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.12);
  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  /* dims */
  --topbar-h: 52px;
  --sidebar-w: 248px;
}

.dark {
  --bg: #0a0a0a;
  --surface: #161616;
  --subtle: #1f1f1f;
  --hover: #1c1c1c;
  --border: #262626;
  --border-strong: #383838;
  --text: #fafafa;
  --muted: #a3a3a3;
  --faint: #6e6e6e;
  --accent: #818cf0;
  --accent-hover: #939df3;
  --accent-fg: #0a0a0a;
  --accent-subtle: #1b1d2e;
  --accent-text: #a4adf5;
  --ring: rgba(129, 140, 240, 0.4);
  --success: #4ade80;        --success-subtle: #0e1f15;  --success-solid: #22c55e;
  --warning: #fbbf24;        --warning-subtle: #241b08;  --warning-solid: #f59e0b;
  --danger: #f87171;         --danger-subtle: #2a1414;   --danger-solid: #ef4444;
  --info: #60a5fa;           --info-subtle: #0f1b2e;     --info-solid: #3b82f6;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* ------------------------- 2. RESET / BASE -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05", "cv08", "cv11", "ss03";
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.014em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
code, pre { font-family: var(--font-mono); }
::selection { background: var(--accent-subtle); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--bg); }

/* ---------------------------- 3. LAYOUT ----------------------------------- */
.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .grow { flex: 1; }

.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.content { flex: 1; min-width: 0; padding: 28px 32px 80px; }
.container { max-width: 920px; margin: 0 auto; }
.container-wide { max-width: 1140px; margin: 0 auto; }

.page-head { margin-bottom: 24px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }

/* auth screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; }
.auth-card h1 { font-size: 19px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 13.5px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 20px; font-size: 13px; }

/* --------------------------- 4. COMPONENTS -------------------------------- */

/* brand mark */
.brandmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; font-size: 14.5px; }
.brandmark .logo {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { filter: brightness(1.07); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger-ghost:hover { background: var(--danger-subtle); border-color: var(--danger); }
.btn:disabled, .btn[disabled] { opacity: .5; pointer-events: none; }

/* cards / panels */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: 20px 22px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-head h2, .card-head h3 { flex: 1; }
.card-head .desc { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.card-foot { padding: 13px 22px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; align-items: center; gap: 10px; }
.card + .card { margin-top: 18px; }

/* inputs */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select {
  display: block; width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s; font-size: 14px;
}
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input.has-error { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }

/* badges / status pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge-neutral { background: var(--subtle); color: var(--muted); border-color: var(--border); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger { background: var(--danger-subtle); color: var(--danger); }
.badge-info { background: var(--info-subtle); color: var(--info); }
.badge-accent { background: var(--accent-subtle); color: var(--accent-text); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.badge-warning .dot, .badge-info .dot { animation: pulse-dot 1.4s ease-in-out infinite; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0 16px 10px; }
.table td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* sidebar nav */
.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 10px; margin-bottom: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 450;
  transition: background .1s, color .1s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 500; }
.nav-item.active svg { opacity: 1; }

/* switcher (top-left) */
.switcher {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px;
  border-radius: var(--r-sm); color: var(--text); font-weight: 500; font-size: 13.5px;
}
.switcher:hover { background: var(--hover); }
.switcher .sep { color: var(--faint); }
.switcher svg.chev { width: 14px; height: 14px; color: var(--faint); }

/* icon button */
.iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--muted); background: transparent; border: none; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn svg { width: 17px; height: 17px; }

/* avatar */
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* dropdown menu */
.menu { position: absolute; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 5px; z-index: 60; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 9px; border-radius: var(--r-sm); color: var(--text); background: transparent; border: none; font-size: 13.5px; }
.menu-item:hover { background: var(--hover); }
.menu-item svg { width: 15px; height: 15px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu-label { font-size: 11.5px; color: var(--faint); padding: 6px 9px 3px; }

/* key / secret field */
.keyfield { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--subtle); overflow: hidden; }
.keyfield input { flex: 1; min-width: 0; border: none; background: transparent; padding: 0 12px; height: 36px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); letter-spacing: .01em; }
.keyfield input:focus { outline: none; }
.keyfield .kbtn { display: grid; place-items: center; width: 38px; border: none; border-left: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.keyfield .kbtn:hover { background: var(--hover); color: var(--text); }
.keyfield .kbtn svg { width: 15px; height: 15px; }
.keyfield.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border-strong)); }

.cred-row { margin-bottom: 16px; }
.cred-row:last-child { margin-bottom: 0; }
.cred-row .cred-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cred-row .cred-label .name { font-size: 13px; font-weight: 500; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 9px 12px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

/* code block */
.code { background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--text); overflow-x: auto; white-space: pre; }
.code .tok-key { color: var(--accent-text); }
.code .tok-str { color: var(--success); }
.code .tok-com { color: var(--faint); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .k svg { width: 15px; height: 15px; opacity: .7; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--faint); font-weight: 400; }

/* project card (grid) */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.proj-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.proj-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.proj-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.proj-card .name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.proj-card .ref { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-top: 2px; }
.proj-card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.proj-card .meta svg { width: 14px; height: 14px; flex-shrink: 0; }

/* empty state */
.empty { text-align: center; padding: 72px 24px; }
.empty .ico { width: 52px; height: 52px; border-radius: var(--r-lg); background: var(--subtle); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 18px; color: var(--muted); }
.empty .ico svg { width: 24px; height: 24px; }
.empty h2 { font-size: 17px; margin-bottom: 7px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 22px; font-size: 13.5px; }

/* provisioning steps */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 12px; padding: 11px 4px; font-size: 13.5px; color: var(--muted); }
.step .si { width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; }
.step.done { color: var(--text); }
.step.done .si { background: var(--success-solid); border-color: var(--success-solid); color: #fff; }
.step.active { color: var(--text); font-weight: 500; }
.step.active .si { border-color: var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progressbar { height: 4px; background: var(--subtle); border-radius: 999px; overflow: hidden; }
.progressbar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }

/* toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); font-size: 13.5px; }
.toast .ti { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success .ti { color: var(--success-solid); }
.toast.error .ti { color: var(--danger-solid); }
.toast.info .ti { color: var(--info-solid); }

/* divider, misc */
.hr { height: 1px; background: var(--border); border: none; margin: 22px 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 28%, var(--border)); }
.danger-zone .card-head { border-bottom-color: color-mix(in srgb, var(--danger) 18%, var(--border)); }

/* ---------------------------- 5. UTILITIES -------------------------------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 16px); }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.center { align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.strong { font-weight: 600; }
.t-12 { font-size: 12px; } .t-13 { font-size: 13px; } .t-15 { font-size: 15px; } .t-18 { font-size: 18px; }
.acc { color: var(--accent-text); }
.ok { color: var(--success); } .warn { color: var(--warning); } .bad { color: var(--danger); }
.hide { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--accent-text); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* --------------------------- 6. RESPONSIVE -------------------------------- */
.menu-toggle { display: none; }
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 22px 18px 64px; }
}
@media (max-width: 560px) {
  .content { padding: 18px 14px 56px; }
  .proj-grid { grid-template-columns: 1fr; }
  .switcher .org-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Alpine: hide declaratively-bound elements until initialized */
[x-cloak] { display: none !important; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); width: 100%; max-width: 460px; padding: 26px 28px; box-shadow: var(--shadow-pop); }
.modal h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* theme-toggle icon swap (driven by the .dark class on <html>, so it's reactive) */
.theme-toggle .icon-moon { display: none; }
.dark .theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-moon { display: block; }

/* database page */
.db-wrap { display: flex; gap: 16px; align-items: flex-start; }
.db-list { width: 224px; flex-shrink: 0; max-height: 72vh; overflow-y: auto; padding: 8px; }
.db-tbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13px; }
.db-tbl:hover { background: var(--hover); color: var(--text); }
.db-tbl.active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 500; }
.db-tbl .ct { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.db-data { flex: 1; min-width: 0; }
.db-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.data-table { font-size: 12.5px; }
.data-table th { padding: 9px 12px; background: var(--subtle); text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.data-table td { padding: 8px 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; }
.data-table tbody tr:hover { background: var(--hover); }
.sql-editor textarea { min-height: 150px; resize: vertical; line-height: 1.6; font-size: 13px; }

/* docs / knowledge base */
.docs-layout { display: flex; align-items: flex-start; }
.docs-nav { position: sticky; top: var(--topbar-h); width: 244px; flex-shrink: 0; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 24px 14px; border-right: 1px solid var(--border); }
.docs-nav .cat { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 10px; margin: 20px 0 6px; }
.docs-nav .cat:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; }
.docs-nav a:hover { background: var(--hover); color: var(--text); }
.docs-nav a.active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 500; }
.docs-content { flex: 1; min-width: 0; padding: 42px 52px 96px; }
.prose { max-width: 720px; }
.prose .eyebrow { color: var(--accent-text); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.prose h1 { font-size: 30px; letter-spacing: -.025em; margin-bottom: 6px; }
.prose .sub { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.prose h2 { font-size: 20px; margin: 36px 0 10px; }
.prose h3 { font-size: 15.5px; margin: 24px 0 8px; }
.prose p { margin: 12px 0; color: var(--muted); line-height: 1.72; }
.prose ul, .prose ol { margin: 12px 0; padding-left: 22px; color: var(--muted); line-height: 1.8; }
.prose li { margin: 5px 0; }
.prose a { color: var(--accent-text); font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--subtle); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text); }
.prose pre { margin: 16px 0; }
.prose pre code { display: block; background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; font-size: 12.5px; line-height: 1.7; overflow-x: auto; white-space: pre; }
.prose .callout { background: var(--accent-subtle); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: var(--r-md); padding: 13px 18px; margin: 18px 0; font-size: 13.5px; color: var(--text); }
.prose .callout.warn { background: var(--warning-subtle); border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--subtle); font-weight: 600; color: var(--text); }
.prose td { color: var(--muted); }
.docs-foot { max-width: 720px; margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 900px) { .docs-nav { display: none; } .docs-content { padding: 28px 20px 64px; } }

/* banners / alerts */
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid transparent; margin-bottom: 16px; }
.banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.banner-danger { background: var(--danger-subtle); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.banner-info { background: var(--info-subtle); color: var(--info); }
.banner-warning { background: var(--warning-subtle); color: var(--warning); }
