@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* =========================================================================
   Laycor design system v4 — "Studio". Hand-written, no build step.
   A dark command rail, a quiet canvas, one electric accent, display type
   for the numbers that matter. Tokens → base → shell → components →
   modules → utilities → responsive.
   ========================================================================= */

:root {
  --brand-50: #f3edff; --brand-100: #e7dbff; --brand-200: #d1b8ff; --brand-300: #b28cff; --brand-400: #9460ff;
  --brand-500: #7a2ff0; --brand-600: #6416d4; --brand-700: #5112b0; --brand-800: #3d0c86;
  --violet: #8b5cf6; --sky: #0ea5e9; --teal: #14b8a6; --emerald: #10b981; --amber: #f59e0b; --rose: #f43f5e; --lime: #a3e635;

  --canvas: #f4f6fb;
  --canvas-glow: radial-gradient(1100px 520px at 18% -12%, rgba(122,47,240,.14), transparent 62%),
                 radial-gradient(900px 480px at 100% 0%, rgba(20,184,166,.10), transparent 58%);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f7;
  --ink: #0b1020;
  --ink-2: #2f3650;
  --muted: #68708a;
  --muted-2: #9aa2b8;
  --line: #e7e9f2;
  --line-2: #d6dae8;

  --success: #16a34a; --success-bg: #e9f9ef; --success-ink: #15803d;
  --warning: #d97706; --warning-bg: #fff6e5; --warning-ink: #b45309;
  --danger: #e11d48;  --danger-bg: #ffeef1;  --danger-ink: #be123c;
  --info: #0284c7;    --info-bg: #eaf6ff;    --info-ink: #0369a1;

  /* The rail (sidebar) is dark in both themes. */
  --rail: #0b0f1f; --rail-2: #10162b; --rail-line: rgba(255,255,255,.07);
  --rail-ink: #e6e9f5; --rail-muted: #8d95b0; --rail-active: rgba(122,47,240,.18);

  --radius: 14px; --radius-sm: 9px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(11,16,32,.05);
  --shadow-card: 0 1px 2px rgba(11,16,32,.04), 0 8px 24px -12px rgba(11,16,32,.12);
  --shadow-hover: 0 2px 4px rgba(11,16,32,.05), 0 20px 40px -16px rgba(11,16,32,.22);
  --shadow-pop: 0 0 0 1px rgba(11,16,32,.06), 0 24px 56px -16px rgba(11,16,32,.3);
  --ring: 0 0 0 4px rgba(122,47,240,.22);
  --grad-brand: linear-gradient(135deg, #7a2ff0 0%, #6416d4 52%, #4a0f9e 100%);
  --grad-aurora: linear-gradient(120deg, #7a2ff0, #8b5cf6 48%, #14b8a6);
  --grad-warm: linear-gradient(135deg, #f59e0b, #f43f5e);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 260px;
  --topbar-h: 62px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"], :root[data-theme="dark"] {
  --canvas: #070912;
  --canvas-glow: radial-gradient(1100px 520px at 18% -12%, rgba(122,47,240,.18), transparent 62%),
                 radial-gradient(900px 480px at 100% 0%, rgba(20,184,166,.10), transparent 58%);
  --surface: #0f1322; --surface-2: #141829; --surface-3: #1a1f33;
  --ink: #f2f4fb; --ink-2: #c8cde0; --muted: #8f97b2; --muted-2: #626a86;
  --line: #1f2439; --line-2: #2a3049;
  --brand-50: #1e1240; --brand-100: #2c1a5c;
  --rail: #060811; --rail-2: #0b0f1f; --rail-line: rgba(255,255,255,.06);
  --success-bg: #0b2f1a; --success-ink: #4ade80;
  --warning-bg: #2d1d05; --warning-ink: #fbbf24;
  --danger-bg: #31101a; --danger-ink: #fb7185;
  --info-bg: #0a2c45;   --info-ink: #38bdf8;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-card: 0 0 0 1px rgba(255,255,255,.03), 0 10px 28px -12px rgba(0,0,0,.6);
  --shadow-hover: 0 0 0 1px rgba(255,255,255,.06), 0 22px 44px -16px rgba(0,0,0,.7);
  --shadow-pop: 0 0 0 1px rgba(255,255,255,.08), 0 24px 56px -16px rgba(0,0,0,.8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #070912;
    --canvas-glow: radial-gradient(1100px 520px at 18% -12%, rgba(122,47,240,.18), transparent 62%),
                   radial-gradient(900px 480px at 100% 0%, rgba(20,184,166,.10), transparent 58%);
    --surface: #0f1322; --surface-2: #141829; --surface-3: #1a1f33;
    --ink: #f2f4fb; --ink-2: #c8cde0; --muted: #8f97b2; --muted-2: #626a86;
    --line: #1f2439; --line-2: #2a3049;
    --brand-50: #1e1240; --brand-100: #2c1a5c;
    --rail: #060811; --rail-2: #0b0f1f; --rail-line: rgba(255,255,255,.06);
    --success-bg: #0b2f1a; --success-ink: #4ade80;
    --warning-bg: #2d1d05; --warning-ink: #fbbf24;
    --danger-bg: #31101a; --danger-ink: #fb7185;
    --info-bg: #0a2c45;   --info-ink: #38bdf8;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow-card: 0 0 0 1px rgba(255,255,255,.03), 0 10px 28px -12px rgba(0,0,0,.6);
    --shadow-hover: 0 0 0 1px rgba(255,255,255,.06), 0 22px 44px -16px rgba(0,0,0,.7);
    --shadow-pop: 0 0 0 1px rgba(255,255,255,.08), 0 24px 56px -16px rgba(0,0,0,.8);
  }
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--canvas); background-image: var(--canvas-glow); background-attachment: fixed;
  color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01", "tnum";
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.022em; color: var(--ink); font-family: var(--display); }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; }
h2 { font-size: 17px; }
h3 { font-size: 15px; letter-spacing: -0.012em; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; color: var(--ink-2); }
pre code, .code code { background: none; padding: 0; color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: rgba(122,47,240,.26); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* App shell: dark rail + glass topbar ----------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
  background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%); color: var(--rail-ink);
  display: flex; flex-direction: column; padding: 16px 12px 14px; border-right: 1px solid var(--rail-line);
}
.sidebar::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 260px; background: radial-gradient(360px 200px at 20% 0%, rgba(122,47,240,.35), transparent 70%); pointer-events: none; }
.sidebar > * { position: relative; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--rail-ink); font-weight: 800; font-size: 17px; letter-spacing: -0.03em; font-family: var(--display); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 8px 20px -8px rgba(122,47,240,.9), inset 0 1px 0 rgba(255,255,255,.3); }
.brand small { display: block; font: 500 10.5px/1 var(--font); color: var(--rail-muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.workspace { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--rail-line); }
.workspace .ws-avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: var(--grad-aurora); flex: none; }
.workspace .ws-name { font-weight: 650; font-size: 13px; color: var(--rail-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace .ws-plan { font-size: 11px; color: var(--rail-muted); margin-top: 1px; }
.workspace select { background: transparent; border: 0; color: var(--rail-ink); font-weight: 650; font-size: 13px; padding: 0; height: auto; box-shadow: none; width: 100%; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d95b0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 2px center; background-size: 14px 14px; padding-right: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace .ws-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace select option { color: #0b1020; }
.nav-section { margin-top: 8px; }
.nav-title { padding: 0 10px 7px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--rail-muted); }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin-bottom: 1px; border-radius: 10px;
  color: var(--rail-muted); font-weight: 520; position: relative; transition: background .15s var(--ease), color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: var(--rail-ink); }
.nav-item.active { background: var(--rail-active); color: #fff; font-weight: 620; box-shadow: inset 0 0 0 1px rgba(122,47,240,.3); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-aurora); box-shadow: 0 0 12px rgba(122,47,240,.9); }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav-item.active svg { opacity: 1; color: var(--brand-300); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--rail-ink); background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 999px; }
.sidebar-footer { margin-top: auto; padding-top: 14px; display: grid; gap: 10px; }
.trial-card { position: relative; overflow: hidden; background: var(--grad-brand); color: #fff; border-radius: 14px; padding: 14px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 14px 30px -14px rgba(122,47,240,.8); }
.trial-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 999px; background: rgba(255,255,255,.14); }
.trial-card strong { display: block; color: #fff; margin-bottom: 3px; font-size: 13px; }
.trial-card a { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 600; color: #fff; background: rgba(255,255,255,.18); padding: 5px 10px; border-radius: 8px; position: relative; }
.trial-card a:hover { background: rgba(255,255,255,.28); text-decoration: none; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--rail-ink); }
.rail-user:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.rail-user .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.rail-user .who { min-width: 0; }
.rail-user .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user .who span { font-size: 11.5px; color: var(--rail-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 26px;
  background: color-mix(in srgb, var(--canvas) 74%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); position: sticky; top: 0; z-index: 20;
}
.topbar .spacer { flex: 1; }
.account-switch { display: flex; align-items: center; gap: 8px; }
.account-switch select { max-width: 220px; height: 34px; }
.account-switch strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 220px; font-weight: 650; font-family: var(--display); }
.topbar-search { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px 0 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; width: 340px; margin-left: 8px; cursor: text; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.topbar-search:hover { border-color: var(--line-2); box-shadow: var(--shadow-card); }
.topbar-search svg { width: 15px; height: 15px; }
.topbar-search kbd { margin-left: auto; font: 11px var(--mono); color: var(--muted-2); background: var(--surface-3); border-radius: 6px; padding: 2px 6px; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--ink-2); padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; }
.user-chip:hover { background: var(--surface); border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--grad-aurora); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.quick-add summary { padding-left: 12px; }
.quick-add .menu-list { min-width: 240px; }
.quick-add .menu-list a { display: flex; align-items: center; gap: 10px; }
.quick-add .menu-list svg { width: 16px; height: 16px; color: var(--muted); }
.quick-add .menu-list .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 8px 10px 4px; font-weight: 700; }
.content { padding: 30px 30px 72px; max-width: 1320px; width: 100%; }
.content.wide { max-width: none; }

/* Command palette -------------------------------------------------------- */
.topbar-search { border: 1px solid var(--line); text-align: left; font: inherit; }
.palette { position: fixed; inset: 0; z-index: 100; background: rgba(11,16,32,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; animation: fade .15s var(--ease); }
.palette[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pal-box { width: 100%; max-width: 640px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop), 0 0 0 1px rgba(255,255,255,.06); overflow: hidden; animation: rise .18s var(--ease); border: 1px solid var(--line); }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pal-input svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pal-input input { flex: 1; border: 0; background: transparent; font: 16px var(--font); color: var(--ink); outline: none; min-width: 0; }
.pal-input input::placeholder { color: var(--muted-2); }
.pal-input kbd, .pal-foot kbd, .pal-item kbd { font: 11px var(--mono); color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 2px 6px; border: 1px solid var(--line); cursor: pointer; }
.pal-results { max-height: min(56vh, 520px); overflow-y: auto; padding: 8px; }
.pal-group { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--ink); text-decoration: none; }
.pal-item:hover { text-decoration: none; }
.pal-item.active { background: var(--brand-50); }
.pal-item.active strong { color: var(--brand-700); }
[data-theme="dark"] .pal-item.active strong { color: var(--brand-300); }
.pal-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; }
.pal-item.active .pal-ic { background: var(--grad-brand); color: #fff; }
.pal-ic svg { width: 16px; height: 16px; }
.pal-text { min-width: 0; flex: 1; display: grid; }
.pal-text strong { font-weight: 620; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.pal-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--muted); }
.pal-foot span { display: inline-flex; gap: 4px; align-items: center; }
body.palette-open { overflow: hidden; }
.nav-more { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--rail-muted); font: 600 12px var(--font); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.nav-more:hover { color: var(--rail-ink); background: rgba(255,255,255,.06); }

/* Page header ----------------------------------------------------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header .lead { color: var(--muted); margin-top: 7px; max-width: 680px; font-size: 14.5px; }
.page-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 8px; }
.breadcrumbs { display: flex; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.breadcrumbs span:first-child::before { content: none; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 11px; border: 1px solid transparent; font-weight: 620; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .15s, color .15s; text-decoration: none; letter-spacing: -0.005em;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 10px 22px -10px rgba(122,47,240,.9); }
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 14px 28px -10px rgba(122,47,240,1); transform: translateY(-1px); filter: saturate(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 11px; display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }

/* Cards ----------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); border: 1px solid var(--line); transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; }
a.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--line-2); text-decoration: none; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-header p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Grid helpers ---------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* Stat tiles ------------------------------------------------------------ */
.stat { padding: 20px 22px 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad-brand); opacity: .9; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.stat .value { font-size: 32px; font-weight: 800; letter-spacing: -0.035em; margin-top: 8px; line-height: 1.02; font-variant-numeric: tabular-nums; grid-column: 1; font-family: var(--display); }
.stat .delta { font-size: 12.5px; margin-top: 8px; color: var(--muted); grid-column: 1; }
.stat .stat-icon { grid-column: 2; grid-row: 1 / span 3; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-500) 14%, transparent); }
.stat .stat-icon svg { width: 19px; height: 19px; }
.stat.danger::after { background: var(--grad-warm); }
.stat.danger .value { color: var(--danger-ink); }
.stat.danger .stat-icon { background: var(--danger-bg); color: var(--danger-ink); box-shadow: none; }
.stat.success::after { background: linear-gradient(90deg, var(--teal), var(--emerald)); }
.stat.success .stat-icon { background: var(--success-bg); color: var(--success-ink); box-shadow: none; }
.stat.info::after { background: linear-gradient(90deg, var(--sky), var(--brand-400)); }
.stat.info .stat-icon { background: var(--info-bg); color: var(--info-ink); box-shadow: none; }
.stat.warning::after { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.stat.warning .value { color: var(--warning-ink); }
.stat.warning .stat-icon { background: var(--warning-bg); color: var(--warning-ink); box-shadow: none; }

/* Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 16px; }
.field label, .label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.hint { color: var(--muted); font-size: 12.5px; }
.error { color: var(--danger-ink); font-size: 12.5px; }
.input, select, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; box-shadow: var(--shadow-xs);
}
.input::placeholder { color: var(--muted-2); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa2b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); outline: none; }
.input.is-invalid { border-color: var(--danger); }
.input-group { display: flex; }
.input-group .input { border-radius: 11px 0 0 11px; }
.input-group .btn { border-radius: 0 11px 11px 0; margin-left: -1px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toggle input:checked + .track { background: var(--grad-brand); }
.toggle input:checked + .track::after { transform: translateX(17px); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Badges ---------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 620; white-space: nowrap; letter-spacing: -0.005em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge.neutral { background: var(--surface-3); color: var(--muted); }
.badge.success { background: var(--success-bg); color: var(--success-ink); }
.badge.warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger-ink); }
.badge.info { background: var(--info-bg); color: var(--info-ink); }
.badge.brand { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .badge.brand { color: var(--brand-300); }
.badge.plain::before { content: none; }

/* Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > .table-wrap:first-child { border-radius: var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 11px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-50) 55%, var(--surface)); }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--ink); font-weight: 620; }
.table a.row-link:hover { color: var(--brand-600); text-decoration: none; }
.table .sub { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; font-weight: 400; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Empty state ----------------------------------------------------------- */
.empty { text-align: center; padding: 56px 24px; }
.empty .icon { width: 60px; height: 60px; border-radius: 20px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; position: relative; box-shadow: 0 16px 30px -14px rgba(122,47,240,.8); }
.empty .icon::after { content: ""; position: absolute; inset: -12px; border-radius: 28px; background: var(--brand-50); z-index: -1; }
.empty .icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 420px; }

/* Flash ----------------------------------------------------------------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 13px; margin-bottom: 22px; font-weight: 500; border: 1px solid transparent; animation: rise .3s var(--ease); background: var(--surface); box-shadow: var(--shadow-card); }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash svg { width: 18px; height: 18px; flex: none; }
.flash.success { background: var(--success-bg); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.flash.warning { background: var(--warning-bg); color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.flash.danger { background: var(--danger-bg); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.flash.info { background: var(--info-bg); color: var(--info-ink); border-color: color-mix(in srgb, var(--info) 22%, transparent); }

/* Tabs ------------------------------------------------------------------ */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs .tab { white-space: nowrap; }
.tab { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; transition: color .15s; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
[data-theme="dark"] .tab.active { color: var(--brand-300); }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 13px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; transition: all .15s; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

/* Code block ------------------------------------------------------------ */
.code { background: #0b0f1f; color: #dbe4ff; border-radius: 14px; padding: 18px; overflow-x: auto; position: relative; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre; border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.code .copy { position: absolute; top: 10px; right: 10px; }
.code .copy .btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.12); backdrop-filter: blur(6px); }
.code .copy .btn:hover { background: rgba(255,255,255,.16); }

/* Checklist ------------------------------------------------------------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 22px; height: 22px; border-radius: 999px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: #fff; flex: none; transition: all .2s; }
.checklist .tick svg { width: 12px; height: 12px; }
.checklist li.done .tick { background: var(--emerald); border-color: var(--emerald); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 18%, transparent); }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-aurora); border-radius: 999px; transition: width .4s var(--ease); }

/* Hero / welcome banner ------------------------------------------------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 28px 30px; color: #fff; background: linear-gradient(120deg, #0b0f1f 0%, #241352 45%, #5112b0 100%); box-shadow: 0 24px 48px -24px rgba(54,69,207,.8); }
.hero-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 240px at 90% -20%, rgba(20,184,166,.55), transparent 60%), radial-gradient(420px 220px at 10% 120%, rgba(139,92,246,.5), transparent 60%); }
.hero-card::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 36px 36px; mask-image: radial-gradient(600px 300px at 70% 50%, #000, transparent 75%); }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h2 { color: #fff; font-size: 22px; letter-spacing: -0.025em; }
.hero-card p { color: rgba(255,255,255,.78); margin-top: 6px; max-width: 580px; }
.hero-card .btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.hero-card .btn-secondary:hover { background: rgba(255,255,255,.22); }
.hero-card .btn-primary { background: #fff; color: var(--brand-700); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }

/* Dashboard: command center -------------------------------------------- */
.today-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); display: grid; gap: 4px; overflow: hidden; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi .k-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label svg { width: 15px; height: 15px; color: var(--brand-500); }
.kpi .k-value { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }
.kpi.hot .k-value { color: var(--danger-ink); }
.kpi.good .k-value { color: var(--success-ink); }
.kpi .k-spark { position: absolute; right: 16px; bottom: 14px; display: flex; align-items: flex-end; gap: 3px; height: 28px; opacity: .9; }
.kpi .k-spark i { display: block; width: 5px; border-radius: 3px; background: var(--brand-200); }
.kpi .k-spark i:last-child { background: var(--brand-500); }
[data-theme="dark"] .kpi .k-spark i { background: var(--brand-100); }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 620; font-size: 13px; transition: all .15s var(--ease); }
.quick:hover { text-decoration: none; border-color: var(--brand-300); background: var(--brand-50); transform: translateY(-1px); }
.quick .q-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-brand); color: #fff; flex: none; box-shadow: 0 8px 16px -8px rgba(122,47,240,.9); }
.quick .q-ic svg { width: 15px; height: 15px; }
.quick small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.agenda li:last-child { border-bottom: 0; }
.agenda .time { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
.agenda .time small { display: block; font: 500 11px var(--font); color: var(--muted); text-transform: uppercase; }
.agenda .what strong { display: block; }
.agenda .what span { color: var(--muted); font-size: 12.5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 22px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .f-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand-500); margin-top: 7px; flex: none; box-shadow: 0 0 0 3px var(--brand-50); }
.feed .f-dot.ok { background: var(--emerald); box-shadow: 0 0 0 3px var(--success-bg); }
.feed .f-dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--warning-bg); }
.feed .when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Plugin cards ---------------------------------------------------------- */
.plugin-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; height: 100%; }
.plugin-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plugin-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 12px 24px -12px rgba(122,47,240,.9), inset 0 1px 0 rgba(255,255,255,.25); }
.plugin-icon svg { width: 21px; height: 21px; }
.plugin-card h3 { margin-top: 12px; font-size: 15.5px; }
.plugin-card .desc { color: var(--muted); font-size: 13px; flex: 1; margin-top: 4px; line-height: 1.5; }
.plugin-card .meta { font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.plugin-card .meta b { color: var(--ink-2); font-weight: 600; }
.plugin-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Kanban ---------------------------------------------------------------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--surface-3); border-radius: 16px; padding: 12px; min-height: 260px; border: 1px solid var(--line); }
.column h4 { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin: 2px 4px 12px; text-transform: uppercase; letter-spacing: .07em; font-family: var(--font); }
.deal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-card); border: 1px solid var(--line); padding: 13px; margin-bottom: 10px; transition: transform .15s var(--ease), box-shadow .15s; }
.deal:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.deal .title { font-weight: 620; }
.deal .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.deal form { margin-top: 10px; }

/* Timeline -------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.timeline .dot { width: 28px; height: 28px; border-radius: 999px; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; box-shadow: 0 0 0 4px var(--surface); }
.timeline .dot svg { width: 14px; height: 14px; }
.timeline .when { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Definition list ------------------------------------------------------- */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; color: var(--ink); word-break: break-word; }

/* Dropdown / details ---------------------------------------------------- */
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu .menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; animation: rise .18s var(--ease); border: 1px solid var(--line); }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); background: none; border: 0; cursor: pointer; font-weight: 500; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.menu-list .danger { color: var(--danger-ink); }

/* Auth pages ------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: #0b0f1f; color: #fff; padding: 52px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(800px 500px at 20% 10%, rgba(122,47,240,.6), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(20,184,166,.45), transparent 60%), radial-gradient(500px 400px at 70% 30%, rgba(139,92,246,.45), transparent 60%); }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(600px 500px at 50% 40%, #000, transparent 75%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand { color: #fff; }
.auth-side h2 { color: #fff; font-size: 38px; line-height: 1.1; max-width: 520px; letter-spacing: -0.035em; font-weight: 800; }
.auth-side p { color: rgba(255,255,255,.75); margin-top: 16px; max-width: 460px; font-size: 15.5px; }
.auth-side ul { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.92); }
.auth-side li svg { width: 18px; height: 18px; color: #b28cff; flex: none; }
.auth-quote { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 18px 20px; backdrop-filter: blur(8px); max-width: 480px; }
.auth-quote p { color: #fff; margin: 0; font-size: 14.5px; }
.auth-quote .who { color: rgba(255,255,255,.6); font-size: 12.5px; margin-top: 8px; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; }
.auth-form .card { width: 100%; max-width: 440px; border-radius: 22px; }
.auth-form .card-body { padding: 36px; }
.auth-form h1 { font-size: 26px; }
.auth-form .sub { color: var(--muted); margin: 6px 0 26px; }

/* Form builder ---------------------------------------------------------- */
.builder { display: grid; grid-template-columns: 224px minmax(0, 1fr) 324px; gap: 16px; align-items: start; }
.builder.with-preview { grid-template-columns: 224px minmax(0, 1fr) 324px 420px; }
.builder-palette, .builder-inspector, .builder-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
.palette-grid { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 10px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px dashed transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; color: var(--ink-2); font-weight: 500; transition: all .15s; }
.palette-item:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); transform: translateX(2px); }
.palette-item svg { width: 16px; height: 16px; color: var(--muted); }
.palette-item:hover svg { color: var(--brand-600); }
.canvas-list { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 160px; }
.canvas-empty { padding: 8px; }
.canvas-item { grid-column: span 2; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.canvas-item.half { grid-column: span 1; }
.canvas-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-card); }
.canvas-item.selected { border-color: var(--brand-500); box-shadow: var(--ring); }
.canvas-item.dragging { opacity: .4; }
.canvas-item .handle { color: var(--muted-2); cursor: grab; display: grid; }
.canvas-item .handle svg { width: 16px; height: 16px; }
.canvas-item .meta { flex: 1; min-width: 0; }
.canvas-item .meta .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-item .meta .kind { font-size: 12px; color: var(--muted); }
.canvas-item .flags { display: flex; gap: 4px; }
.canvas-item .flags span { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 2px 7px; }
.builder-inspector .card-body .field + .field { margin-top: 12px; }
.inspector-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.options-list { display: grid; gap: 6px; }
.options-list .row { flex-wrap: nowrap; }
.builder-preview iframe { width: 100%; height: 70vh; border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: #fff; }

/* Utilities ------------------------------------------------------------- */
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 620; } .ink { color: var(--ink); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; }
.display { font-family: var(--display); }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1200px) { .builder, .builder.with-preview { grid-template-columns: 1fr; } .builder-palette, .builder-inspector, .builder-preview { position: static; } .palette-grid { grid-template-columns: repeat(3, 1fr); } .topbar-search { display: none; } .today-strip, .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); z-index: 40; transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .content { padding: 20px 16px 56px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .account-switch strong { max-width: 130px; }
  .user-chip > span:not(.avatar) { display: none; }
  .topbar .btn-sm span.btn-label { display: none; }
  .grid-2, .grid-3, .grid-4, .form-row, .today-strip, .quick-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 10px; }
  h1 { font-size: 24px; }
  .agenda li { grid-template-columns: 54px 1fr; }
  .agenda li > :last-child { grid-column: 2; }
}

/* Calendar -------------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-head { padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; align-content: start; gap: 4px; }
.cal-day:nth-child(7n+1) { border-left: 0; } .cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); opacity: .6; }
.cal-day.today .cal-num { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(122,47,240,.9); }
.cal-num { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-event { display: block; font-size: 12px; line-height: 1.25; padding: 4px 7px; border-radius: 7px; background: var(--brand-50); color: var(--brand-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--brand-500); }
.cal-event:hover { text-decoration: none; filter: brightness(.97); }
.cal-event span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.cal-event.success { background: var(--success-bg); color: var(--success-ink); border-left-color: var(--success); }
.cal-event.danger { background: var(--danger-bg); color: var(--danger-ink); border-left-color: var(--danger); }
.cal-event.info { background: var(--info-bg); color: var(--info-ink); border-left-color: var(--info); }
.avail { font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; }
.avail.ok { background: var(--success-bg); color: var(--success-ink); } .avail.low { background: var(--warning-bg); color: var(--warning-ink); } .avail.none { background: var(--danger-bg); color: var(--danger-ink); }
.pod-page { max-width: 520px; margin: 0 auto; } .pod-page .btn { height: 52px; font-size: 16px; }
@media (max-width: 860px) { .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 11px; } .cal-day { min-height: 70px; padding: 4px; } .cal-event span { display: none; } }

/* ---- Field App (phone-first) ---- */
.field-list { display: flex; flex-direction: column; gap: 10px; }
.field-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-xs); transition: border-color .15s, transform .15s, box-shadow .15s; }
.field-card:hover { border-color: var(--brand-300); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-card); }
.field-card.is-done { opacity: .6; }
.field-time { display: flex; flex-direction: column; align-items: center; min-width: 60px; padding: 8px 6px; border-radius: 12px; background: var(--surface-2); line-height: 1.1; }
.field-time strong { font-size: 17px; letter-spacing: -0.02em; font-family: var(--display); }
.field-time span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.field-time small { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.field-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.field-title { font-size: 15px; font-weight: 620; }
.field-steps { display: grid; gap: 10px; }
.field-steps .btn { justify-content: center; }
.rot-90 { transform: rotate(90deg); }
.inline-icon { display: inline-flex; align-items: center; gap: 5px; }
.inline-icon svg { flex: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.signature img { object-fit: contain; background: #fff; }
.photo.signature span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--ink); color: #fff; }
.signature-pad { position: relative; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface); }
.signature-pad canvas { width: 100%; height: 160px; display: block; touch-action: none; border-radius: 12px; }
.signature-pad button { position: absolute; right: 6px; top: 6px; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { .field-grid { grid-template-columns: 1fr; } .field-page .page-header .actions { width: 100%; } }

/* ---- Dispatch board ---- */
.dispatch-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.dispatch-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; transition: border-color .15s, background .15s; }
.dispatch-col.is-over { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme="dark"] .dispatch-col.is-over { background: color-mix(in srgb, var(--brand-500) 12%, var(--surface-2)); }
.dispatch-col.is-unassigned { border-style: dashed; }
.dispatch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dispatch-drop { display: flex; flex-direction: column; gap: 8px; padding: 10px; flex: 1; }
.dispatch-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: grab; box-shadow: var(--shadow-xs); }
.dispatch-card.is-dragging { opacity: .5; }
.dispatch-card:active { cursor: grabbing; }
.dispatch-title { font-weight: 620; color: var(--ink); }
.dispatch-time { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; background: var(--surface-2); color: var(--ink); }
.dispatch-time:hover, .dispatch-time:focus { border-color: var(--line-2); outline: none; }
.dispatch-empty { padding: 18px; text-align: center; border: 1px dashed var(--line-2); border-radius: 12px; }

/* ---- Estimates editor ---- */
.estimate-tiers { gap: 14px; }
.tier-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.tier-card.recommended { border-color: var(--brand-400); background: var(--brand-50); }
[data-theme="dark"] .tier-card.recommended { background: color-mix(in srgb, var(--brand-500) 12%, var(--surface-2)); }
.tier-head { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.tier-head small { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.tier-head input { accent-color: var(--brand-600); }
.tier-card .input-group { display: flex; align-items: center; }
.tier-card .input-group .prefix { padding: 0 10px; color: var(--muted); font-weight: 600; }
@media (max-width: 860px) { .estimate-tiers { grid-template-columns: 1fr; } }

/* ---- Weather strip ---- */
.weather-strip { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.weather-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.weather-day.today { border-color: var(--brand-400); }
.weather-day.risky { background: var(--warning-bg); }
[data-theme="dark"] .weather-day.risky { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.wd-head { display: flex; justify-content: space-between; align-items: baseline; }
.wd-icon { font-size: 28px; line-height: 1.1; }
.wd-temp strong { font-size: 18px; }
.wd-jobs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.wd-job { font-size: 12.5px; color: var(--ink); text-decoration: none; display: flex; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wd-job span { color: var(--muted); flex: none; }
.wd-job.at-risk { color: var(--warning-ink); font-weight: 600; }
.weather-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.weather-chip.risky { background: var(--warning-bg); color: var(--warning-ink); font-weight: 600; }
@media (max-width: 1024px) { .weather-strip { grid-template-columns: repeat(7, 170px); } }

/* ---- Assistant chat ---- */
.chat { display: flex; flex-direction: column; min-height: 560px; }
.chat-log { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; }
.chat-empty { text-align: center; margin: auto; max-width: 420px; }
.chat-empty .icon { width: 52px; height: 52px; border-radius: 16px; background: var(--grad-aurora); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; box-shadow: 0 14px 28px -14px rgba(122,47,240,.9); }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chat-msg { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg .bubble { padding: 11px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; line-height: 1.5; }
.chat-msg.me .bubble { background: var(--grad-brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai .bubble { border-bottom-left-radius: 4px; }
.bubble.thinking { color: var(--muted); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; }

/* ---- Review card preview ---- */
.review-card { --rc-accent: var(--brand-600); width: 288px; min-height: 432px; background: #fff; color: #111827; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-hover); padding: 0 22px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rc-bar { width: calc(100% + 44px); height: 10px; background: var(--rc-accent); border-radius: 6px 6px 0 0; margin-bottom: 14px; }
.rc-biz { font-weight: 700; font-size: 14px; }
.rc-head { font-size: 24px; font-weight: 800; color: var(--rc-accent); letter-spacing: -0.02em; }
.rc-text { font-size: 12.5px; color: #374151; margin: 0; }
.rc-qr { width: 190px; height: 190px; margin: 8px 0; }
.rc-qr svg { width: 100%; height: 100%; }
.rc-scan { font-weight: 700; font-size: 12px; }
.rc-url { font-size: 10.5px; color: #6b7280; }
.rc-foot { margin-top: auto; font-size: 10.5px; color: #6b7280; padding-top: 10px; }
.social-preview { width: 100%; max-width: 420px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-hover); }
.social-preview svg { width: 100%; height: 100%; display: block; }
.stars { color: #f59e0b; letter-spacing: 1px; }

/* ---- Contact conversation thread + properties ---- */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; display: flex; flex-direction: column; gap: 3px; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg .bubble { padding: 10px 13px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.msg.out .bubble { background: var(--brand-50); border-bottom-right-radius: 4px; }
[data-theme="dark"] .msg.out .bubble { background: color-mix(in srgb, var(--brand-500) 16%, var(--surface-2)); }
.msg.in .bubble { border-bottom-left-radius: 4px; }
details.property { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
details.property summary { cursor: pointer; list-style: none; }
details.property summary::-webkit-details-marker { display: none; }
.filters .card-body { flex-wrap: wrap; }

/* ---- generic secondary line under a label (contact tasks, lists) ---- */
.sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; font-weight: 400; }

/* Reports: inline meters and charts */
.meter { height: 8px; border-radius: 4px; background: var(--brand-50); overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--grad-brand); min-width: 2px; }
[data-theme="dark"] .meter { background: var(--surface-3); }
.chart text { font-family: inherit; }
.chart g:hover path { fill: var(--brand-400); }

/* Platform admin */
.support-banner { display: flex; align-items: center; gap: 12px; padding: 10px 30px; background: linear-gradient(90deg, #5112b0, #4a0f9e); color: #fff; font-size: 13.5px; }
.support-banner svg { width: 18px; height: 18px; flex: none; }
.support-banner .grow { flex: 1; }
.support-banner form { margin: 0; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.funnel .f-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 5px; }
.funnel .f-label { font-weight: 600; color: var(--ink-2); }
.funnel .f-num { font-family: var(--display); font-weight: 800; font-size: 16px; }
.funnel .f-num small { font-family: var(--font); font-weight: 500; color: var(--muted); font-size: 12px; }
.funnel .f-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.funnel .f-bar span { display: block; height: 100%; background: var(--grad-aurora); border-radius: 999px; transition: width .4s var(--ease); }
.flash.announcement { align-items: center; }
.flash.announcement form { margin: 0; }

/* Contracts */
.contract-body { white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: var(--ink-2); max-height: 70vh; overflow: auto; }

/* Getting started */
.checklist.onboarding li { align-items: flex-start; padding: 13px 0; }
.checklist.onboarding .tick { margin-top: 2px; }
.checklist.onboarding li.done strong { color: var(--muted); text-decoration: line-through; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 12px/1.5 var(--mono); overflow: auto; margin: 6px 0 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.filters .card-body { display: flex; gap: 10px; align-items: center; }
.filters select, .filters .input { width: auto; min-width: 170px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpi-grid { grid-template-columns: 1fr; } .filters select, .filters .input { width: 100%; } }

.brand-img { width: 36px; height: 36px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 14px rgba(122,47,240,.45)); }

.brand-logo { height: 34px; width: auto; display: block; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
.auth-side .brand-logo { height: 38px; }
