/* ==========================================================================
   BizPlatform — design system
   Dark-first, light-ready. Layered over Bootstrap 5.3.
   ========================================================================== */

/* ---------- Tokens ---------------------------------------------------- */
:root {
  --font: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --grad: linear-gradient(135deg, #7c6cff 0%, #c05cf7 50%, #ff7a45 100%);
  --grad-h: linear-gradient(90deg, #7c6cff 0%, #c05cf7 50%, #ff7a45 100%);
  --gold: #f5b83d;

  --r-xs: 7px;
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 18px;

  --sidebar-w: 256px;
  --topbar-h: 58px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080a;
  --bg-2: #0a0b0e;
  --panel: #0e0f12;
  --panel-2: #141519;
  --panel-3: #1b1c21;
  --hover: rgba(255, 255, 255, .03);
  --input: rgba(255, 255, 255, .025);
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .1);
  --line-3: rgba(255, 255, 255, .16);
  --fg: #f3f4f6;
  --fg-2: #a3a7b0;
  --fg-3: #6b7079;
  --iris: #8f84ff;
  --iris-strong: #7c6cff;
  --ember: #ff8a4c;
  --ok: #3ddc97;
  --warn: #f5c451;
  --bad: #ff6b7a;
  --info: #62b3ff;
  --violet: #b38cff;
  --glass: rgba(9, 10, 13, .72);
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 40px -16px rgba(0, 0, 0, .7);
  --shadow-3: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px -20px rgba(0, 0, 0, .8);
  --glow-a: rgba(124, 108, 255, .16);
  --glow-b: rgba(255, 122, 69, .08);

  --iris-rgb: 143, 132, 255;
  --ok-rgb: 61, 220, 151;
  --warn-rgb: 245, 196, 81;
  --bad-rgb: 255, 107, 122;
  --info-rgb: 98, 179, 255;
  --fg-rgb: 243, 244, 246;
  --fg-2-rgb: 163, 167, 176;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f8;
  --bg-2: #fbfbfc;
  --panel: #ffffff;
  --panel-2: #f4f4f7;
  --panel-3: #ebebef;
  --hover: rgba(15, 17, 28, .022);
  --input: #ffffff;
  --line: rgba(15, 17, 28, .075);
  --line-2: rgba(15, 17, 28, .11);
  --line-3: rgba(15, 17, 28, .18);
  --fg: #0c0d10;
  --fg-2: #565b66;
  --fg-3: #8a8f99;
  --iris: #6a58ff;
  --iris-strong: #5b47ff;
  --ember: #f2621f;
  --ok: #10a05b;
  --warn: #c78a00;
  --bad: #e5484d;
  --info: #0b84e5;
  --violet: #8a5cf6;
  --glass: rgba(251, 251, 252, .78);
  --shadow-1: 0 1px 2px rgba(15, 17, 28, .05), 0 0 0 0 transparent;
  --shadow-2: 0 1px 2px rgba(15, 17, 28, .04), 0 16px 36px -18px rgba(15, 17, 28, .18);
  --shadow-3: 0 0 0 1px rgba(15, 17, 28, .06), 0 30px 80px -24px rgba(15, 17, 28, .3);
  --glow-a: rgba(124, 108, 255, .10);
  --glow-b: rgba(255, 122, 69, .06);

  --iris-rgb: 106, 88, 255;
  --ok-rgb: 16, 160, 91;
  --warn-rgb: 199, 138, 0;
  --bad-rgb: 229, 72, 77;
  --info-rgb: 11, 132, 229;
  --fg-rgb: 12, 13, 16;
  --fg-2-rgb: 86, 91, 102;
}

/* Legacy tokens used by inline styles across pages */
html[data-theme] {
  --brand: var(--iris);
  --brand-hover: var(--iris-strong);
  --brand-light: color-mix(in srgb, var(--iris) 12%, transparent);
  --brand-subtle: color-mix(in srgb, var(--iris) 20%, transparent);
  --accent: var(--ember);
  --accent-hover: color-mix(in srgb, var(--ember) 85%, #000);
  --accent-light: color-mix(in srgb, var(--ember) 13%, transparent);
  --sidebar-bg: var(--bg-2);
  --sidebar-dark: var(--bg);
  --sidebar-text: var(--fg-2);
  --sidebar-text-muted: var(--fg-3);
  --surface: var(--bg);
}

/* Bootstrap bridge */
html[data-bs-theme] {
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 14px;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--fg);
  --bs-emphasis-color: var(--fg);
  --bs-heading-color: var(--fg);
  --bs-secondary-color: var(--fg-2);
  --bs-tertiary-color: var(--fg-3);
  --bs-secondary-bg: var(--panel-2);
  --bs-tertiary-bg: var(--panel-2);
  --bs-border-color: var(--line-2);
  --bs-border-color-translucent: var(--line);
  --bs-border-radius: var(--r-sm);
  --bs-border-radius-sm: var(--r-xs);
  --bs-border-radius-lg: var(--r);
  --bs-border-radius-xl: var(--r-lg);
  --bs-link-color: var(--iris);
  --bs-link-hover-color: var(--iris);
  --bs-link-color-rgb: var(--iris-rgb);
  --bs-link-hover-color-rgb: var(--iris-rgb);
  --bs-code-color: var(--violet);

  --bs-primary: var(--iris);
  --bs-primary-rgb: var(--iris-rgb);
  --bs-success-rgb: var(--ok-rgb);
  --bs-warning-rgb: var(--warn-rgb);
  --bs-danger-rgb: var(--bad-rgb);
  --bs-info-rgb: var(--info-rgb);
  --bs-secondary-rgb: var(--fg-2-rgb);
  --bs-dark-rgb: var(--fg-rgb);

  --bs-primary-bg-subtle: color-mix(in srgb, var(--iris) 13%, transparent);
  --bs-success-bg-subtle: color-mix(in srgb, var(--ok) 13%, transparent);
  --bs-warning-bg-subtle: color-mix(in srgb, var(--warn) 14%, transparent);
  --bs-danger-bg-subtle: color-mix(in srgb, var(--bad) 13%, transparent);
  --bs-info-bg-subtle: color-mix(in srgb, var(--info) 13%, transparent);
  --bs-secondary-bg-subtle: var(--panel-3);

  --bs-primary-text-emphasis: var(--iris);
  --bs-success-text-emphasis: var(--ok);
  --bs-warning-text-emphasis: var(--warn);
  --bs-danger-text-emphasis: var(--bad);
  --bs-info-text-emphasis: var(--info);
  --bs-secondary-text-emphasis: var(--fg-2);

  --bs-primary-border-subtle: color-mix(in srgb, var(--iris) 30%, transparent);
  --bs-success-border-subtle: color-mix(in srgb, var(--ok) 30%, transparent);
  --bs-warning-border-subtle: color-mix(in srgb, var(--warn) 30%, transparent);
  --bs-danger-border-subtle: color-mix(in srgb, var(--bad) 30%, transparent);
  --bs-info-border-subtle: color-mix(in srgb, var(--info) 30%, transparent);
  --bs-secondary-border-subtle: var(--line-2);

  --bs-focus-ring-color: color-mix(in srgb, var(--iris) 30%, transparent);
}

/* ---------- Base ------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "cv11" on;
}
::selection { background: color-mix(in srgb, var(--iris) 35%, transparent); color: var(--fg); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--fg); letter-spacing: -0.02em; font-weight: 600; }
.fw-bold { font-weight: 650 !important; }
.fs-1, .fs-2, .fs-3, .fs-4 { letter-spacing: -0.03em; }
a { color: var(--iris); text-underline-offset: 3px; }
hr { border-color: var(--line-2); opacity: 1; }
code, kbd, .font-monospace, .mono { font-family: var(--mono) !important; }
small, .small { font-size: 0.855em; }
.num, [data-count] { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--iris) 70%, transparent); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-3); }
::-webkit-scrollbar-track { background: transparent; }

/* Utility bridges */
.text-muted { color: var(--fg-2) !important; }
.text-dark, .text-body { color: var(--fg) !important; }
.text-secondary { color: var(--fg-2) !important; }
.text-fg-3 { color: var(--fg-3) !important; }
.bg-light { background-color: var(--panel-2) !important; }
.bg-white { background-color: var(--panel) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--line) !important; }
.shadow-sm { box-shadow: var(--shadow-2) !important; }
.shadow { box-shadow: var(--shadow-3) !important; }
.text-gradient { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.min-w-0 { min-width: 0; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font: 500 11px/1 var(--mono);
  color: var(--fg-3);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* ---------- App shell ------------------------------------------------- */
#sidebar {
  width: var(--sidebar-w);
  height: 100vh; height: 100dvh;
  position: fixed; inset: 0 auto 0 0;
  z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.sb-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px 12px; }
.logo-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--grad);
  color: #fff; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -8px 16px rgba(0,0,0,.18), 0 6px 18px -6px rgba(192, 92, 247, .6);
  position: relative;
}
.sb-brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; color: var(--fg); line-height: 1.15; }
.sb-brand-sub { font-size: 12px; color: var(--fg-3); line-height: 1.2; }

.sb-search {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 34px; padding: 0 8px 0 10px; margin: 4px 0 6px;
  color: var(--fg-3); font-size: 13px; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .15s, color .15s, background .15s;
}
.sb-search:hover { border-color: var(--line-3); color: var(--fg-2); }
.sb-search .kbd { margin-left: auto; }

.sb-label { font-size: 11.5px; font-weight: 500; color: var(--fg-3); padding: 18px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
.sb-label a { color: var(--fg-3); text-decoration: none; font-size: 14px; line-height: 1; }
.sb-label a:hover { color: var(--fg); }

.sb-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  font-size: 13.5px; font-weight: 500; color: var(--fg-2);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sb-link > i { font-size: 15px; width: 18px; text-align: center; color: var(--fg-3); transition: color .15s; }
.sb-link:hover { background: var(--hover); color: var(--fg); background: var(--panel-2); }
.sb-link:hover > i { color: var(--fg-2); }
.sb-link.active { background: var(--panel-3); color: var(--fg); }
.sb-link.active > i { color: var(--iris); }
.sb-link.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad);
}
.sb-count {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  font: 600 11px/1 var(--font); color: #fff;
  background: var(--grad); border-radius: 99px;
}

.sb-loc { margin-bottom: 2px; }
.sb-loc-row { display: flex; align-items: center; }
.sb-loc-row .sb-link { flex: 1; min-width: 0; }
.sb-loc-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-avatar {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--fg);
  background: var(--panel-3); border: 1px solid var(--line-2);
}
.sb-health { font: 500 11px/1 var(--mono); color: var(--fg-3); }
.sb-health.ok { color: var(--ok); } .sb-health.warn { color: var(--warn); } .sb-health.bad { color: var(--bad); }
.sb-chevron {
  width: 26px; height: 26px; margin-left: 2px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--fg-3); background: transparent; border: 0; border-radius: 7px;
}
.sb-chevron:hover { background: var(--panel-2); color: var(--fg); }
.sb-chevron i { font-size: 11px; transition: transform .2s var(--ease); }
.sb-chevron[aria-expanded="true"] i { transform: rotate(90deg); }
.sb-sub { position: relative; margin: 2px 0 6px 19px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.sb-sub .sb-link { height: 30px; font-size: 13px; gap: 9px; }
.sb-sub .sb-link > i { font-size: 13.5px; }
.sb-sub .sb-link.active::before { left: -13px; top: 6px; bottom: 6px; width: 1px; border-radius: 0; }

.sb-foot { padding: 12px; border-top: 1px solid var(--line); }
.plan-card {
  position: relative; overflow: hidden;
  padding: 12px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.plan-card::after {
  content: ''; position: absolute; inset: -40% -30% auto auto; width: 140px; height: 140px;
  background: radial-gradient(closest-side, rgba(192, 92, 247, .22), transparent);
  pointer-events: none;
}
.plan-card .progress { height: 4px; margin: 10px 0 8px; }
.plan-card a { font-size: 12.5px; font-weight: 500; text-decoration: none; }

#main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; position: relative; isolation: isolate; }
#main-wrapper::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  top: 0; left: var(--sidebar-w); right: 0; height: 520px;
  background:
    radial-gradient(640px 320px at 18% -8%, var(--glow-a), transparent 70%),
    radial-gradient(520px 280px at 88% -12%, var(--glow-b), transparent 70%);
}

#top-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.crumbs a { color: var(--fg-3); text-decoration: none; white-space: nowrap; transition: color .15s; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--line-3); font-size: 12px; }
.crumbs .here { color: var(--fg); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  color: var(--fg-2); background: transparent;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 16px; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--fg); border-color: var(--line); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  font: 600 10px/1 var(--font); color: #fff;
  background: var(--grad); border-radius: 99px;
  box-shadow: 0 0 0 2px var(--bg);
  transform: translate(35%, -35%);
}
.search-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 12px; min-width: 220px;
  font-size: 13px; color: var(--fg-3);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .15s, color .15s;
}
.search-pill:hover { border-color: var(--line-3); color: var(--fg-2); }
.search-pill .kbd { margin-left: auto; }
.theme-toggle .bi-sun-fill { display: none; }
html[data-theme="light"] .theme-toggle .bi-sun-fill { display: inline; }
html[data-theme="light"] .theme-toggle .bi-moon-stars-fill { display: none; }

.avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-3);
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-plain { background: var(--panel-3); color: var(--fg-2); box-shadow: none; border: 1px solid var(--line-2); }

#page-content { padding: 28px; max-width: 1520px; margin: 0 auto; }

/* ---------- Page header ---------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1, .page-head h4 { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.page-head .sub { color: var(--fg-2); font-size: 14px; margin-top: 6px; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--fg-3); letter-spacing: .01em; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; }

/* ---------- Cards ----------------------------------------------------- */
.card {
  --bs-card-bg: var(--panel);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--r);
  --bs-card-inner-border-radius: calc(var(--r) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 14px;
  --bs-card-cap-padding-x: 18px;
  --bs-card-spacer-y: 18px;
  --bs-card-spacer-x: 18px;
  --bs-card-color: var(--fg);
  box-shadow: var(--shadow-1);
}
.card-header {
  display: flex; align-items: center; row-gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r) var(--r) 0 0 !important;
}
.card-header.d-flex { justify-content: space-between; column-gap: 12px; }
.card-header > span > i.bi:first-child,
.card-header > i.bi:first-child,
.card-header > div > i.bi:first-child,
.card-header > h6 > i.bi:first-child { color: var(--fg-3); }
.card-header h6 { font-size: 14px; }
.card-footer { background: transparent; border-top: 1px solid var(--line); }

/* Hover spotlight */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -100%), color-mix(in srgb, var(--iris) 9%, transparent), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.spot:hover::before { opacity: 1; }

/* Gradient hairline border */
.edge { position: relative; }
.edge::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
html[data-theme="light"] .edge::after { background: linear-gradient(180deg, rgba(255,255,255,.9), transparent 40%); }

/* ---------- KPI ------------------------------------------------------- */
.kpi {
  position: relative; overflow: hidden; height: 100%;
  padding: 16px 18px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg-2); font-weight: 500; }
.kpi-label i { color: var(--fg-3); font-size: 14px; }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; color: var(--fg-3); font-weight: 500; letter-spacing: -0.01em; margin-left: 2px; }
.kpi-foot { font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.kpi-spark { display: block; width: calc(100% + 36px); height: 52px; margin: 8px -18px 0; }
.kpi.no-spark { padding-bottom: 16px; }

.delta {
  display: inline-flex; align-items: center; gap: 2px;
  height: 20px; padding: 0 7px 0 5px;
  font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums;
  border-radius: 99px;
}
.delta.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.delta.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.delta.flat { color: var(--fg-2); background: var(--panel-3); }
.delta i { font-size: 13px; }

.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark { animation: wipe 1.4s var(--ease) .15s both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -2% 0 0); } }

/* Stat block (inline stats inside cards) */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-v { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-l { font-size: 12px; color: var(--fg-3); }
.stat-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.stat-grid > * { padding: 14px 18px; border-left: 1px solid var(--line); }
.stat-grid > *:first-child { border-left: 0; }

/* ---------- Health ring ---------------------------------------------- */
.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: var(--panel-3); }
.ring .val { stroke-linecap: round; animation: ringIn 1.4s var(--ease) .1s both; }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring.ok .val { stroke: var(--ok); } .ring.warn .val { stroke: var(--warn); } .ring.bad .val { stroke: var(--bad); }
.ring.glow.ok svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ok) 50%, transparent)); }
.ring.glow.warn svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--warn) 45%, transparent)); }
.ring.glow.bad svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--bad) 45%, transparent)); }

/* Legacy health ring */
.health-ring { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; border: 3px solid currentColor; }
.health-ring-lg { width: 80px; height: 80px; font-size: 1.25rem; border-width: 4px; }

/* ---------- Buttons --------------------------------------------------- */
.btn {
  --bs-btn-font-size: 13.5px;
  --bs-btn-font-weight: 500;
  --bs-btn-padding-y: .45rem;
  --bs-btn-padding-x: .9rem;
  --bs-btn-border-radius: var(--r-sm);
  --bs-btn-focus-box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 30%, transparent);
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .2s, transform .15s;
}
.btn > .bi { font-size: 1.05em; line-height: 1; }
.btn.me-1 > .bi, .btn .bi.me-1, .btn .bi.me-2 { margin-right: 0 !important; }
.btn-sm { --bs-btn-font-size: 12.5px; --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .65rem; --bs-btn-border-radius: 8px; gap: 5px; }
.btn-lg { --bs-btn-font-size: 15px; --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.25rem; --bs-btn-border-radius: 11px; }
.btn.w-100, .btn.d-block { display: flex; }

.btn-brand, .btn-primary {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--iris-strong) 88%, #fff) 0%, var(--iris-strong) 100%);
  border: 1px solid color-mix(in srgb, var(--iris-strong) 80%, #000);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 2px rgba(0,0,0,.25);
}
.btn-brand:hover, .btn-primary:hover, .btn-brand:focus-visible {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--iris-strong) 80%, #fff) 0%, var(--iris-strong) 100%);
  border-color: color-mix(in srgb, var(--iris-strong) 80%, #000);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 20px -6px color-mix(in srgb, var(--iris-strong) 70%, transparent);
}
.btn-brand:active, .btn-primary:active { transform: translateY(1px); color: #fff !important; background: var(--iris-strong) !important; }
.btn-brand:disabled, .btn-brand.disabled { color: #fff; background: var(--iris-strong); border-color: transparent; opacity: .5; }

.btn-accent, .btn-grad {
  color: #fff; border: 0;
  background: var(--grad); background-size: 140% 100%; background-position: 0% 0%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.25);
}
.btn-accent:hover, .btn-grad:hover { color: #fff; background-position: 100% 0%; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 24px -8px rgba(192, 92, 247, .7); }
.btn-accent:active, .btn-grad:active { color: #fff !important; transform: translateY(1px); }

.btn-outline-brand, .btn-outline-secondary, .btn-light, .btn-outline-accent, .btn-outline-primary, .btn-outline-dark, .btn-secondary {
  color: var(--fg);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
}
.btn-outline-brand:hover, .btn-outline-secondary:hover, .btn-light:hover, .btn-outline-accent:hover, .btn-outline-primary:hover, .btn-outline-dark:hover, .btn-secondary:hover {
  color: var(--fg); background: var(--panel-3); border-color: var(--line-3);
}
.btn-outline-brand:active, .btn-outline-secondary:active, .btn-light:active, .btn-outline-accent:active, .btn-secondary:active,
.btn-outline-brand.active, .btn-outline-secondary.active {
  color: var(--fg) !important; background: var(--panel-3) !important; border-color: var(--line-3) !important;
}
.btn-outline-danger { color: var(--bad); background: transparent; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-outline-danger:hover, .btn-outline-danger:active { color: var(--bad) !important; background: color-mix(in srgb, var(--bad) 12%, transparent) !important; border-color: color-mix(in srgb, var(--bad) 50%, transparent) !important; }
.btn-outline-success { color: var(--ok); background: transparent; border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.btn-outline-success:hover { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.btn-outline-warning { color: var(--warn); background: transparent; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.btn-outline-warning:hover { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.btn-danger { color: #fff; background: var(--bad); border: 1px solid var(--bad); }
.btn-danger:hover { color: #fff; background: color-mix(in srgb, var(--bad) 88%, #000); border-color: transparent; }
.btn-success { color: #04130c; background: var(--ok); border: 1px solid var(--ok); }
.btn-link { color: var(--iris); text-decoration: none; }
.btn-link:hover { color: var(--fg); }
.btn-link.text-danger:hover { color: var(--bad) !important; opacity: .8; }
.btn-ghost { color: var(--fg-2); background: transparent; border: 1px solid transparent; }
.btn-ghost:hover { color: var(--fg); background: var(--panel-2); border-color: var(--line); }
.btn-close { opacity: .5; }
.btn-close:hover { opacity: .9; }
html[data-theme="dark"] .btn-close:not(.btn-close-white) { filter: invert(1) grayscale(100%) brightness(200%); }

/* Segmented control */
.btn-group, .seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.btn-group > .btn, .seg > .btn, .seg > a {
  --bs-btn-border-radius: 7px;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  color: var(--fg-2); background: transparent; box-shadow: none;
  margin: 0 !important;
}
.btn-group > .btn:hover, .seg > .btn:hover { color: var(--fg); background: var(--hover); }
.btn-group > .btn.active, .btn-group > .btn-brand, .btn-group > .btn-check:checked + .btn,
.seg > .btn.active, .seg > .active, .seg > .btn-brand {
  color: var(--fg) !important;
  background: var(--panel) !important;
  border-color: var(--line-2) !important;
  box-shadow: var(--shadow-1) !important;
}
html[data-theme="dark"] .btn-group > .btn.active, html[data-theme="dark"] .btn-group > .btn-brand,
html[data-theme="dark"] .seg > .btn.active, html[data-theme="dark"] .seg > .active, html[data-theme="dark"] .seg > .btn-brand { background: var(--panel-3) !important; }

/* ---------- Forms ----------------------------------------------------- */
.form-label { font-size: 12.5px; font-weight: 500; color: var(--fg-2); margin-bottom: 6px; }
.form-text { color: var(--fg-3); font-size: 12px; }
.form-control, .form-select {
  font-size: 14px; color: var(--fg);
  background-color: var(--input);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: .5rem .75rem;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-select { padding-right: 2.25rem; }
.form-control::placeholder { color: var(--fg-3); }
.form-control:hover, .form-select:hover { border-color: var(--line-3); }
.form-control:focus, .form-select:focus {
  color: var(--fg); background-color: var(--input);
  border-color: color-mix(in srgb, var(--iris) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 22%, transparent);
}
.form-control:disabled, .form-control[readonly] { background-color: var(--panel-2); color: var(--fg-2); }
.form-control-sm, .form-select-sm { font-size: 13px; border-radius: 8px; padding-top: .35rem; padding-bottom: .35rem; }
.form-control-lg, .form-select-lg { font-size: 15px; border-radius: 11px; padding: .7rem .95rem; }
.form-control-color { padding: .3rem; }
textarea.form-control { line-height: 1.55; }
.input-group-text { color: var(--fg-3); background: var(--panel-2); border: 1px solid var(--line-2); font-size: 14px; }
.input-group > .form-control, .input-group > .input-group-text, .input-group > .btn { box-shadow: none; }

.form-check-input {
  background-color: var(--input);
  border: 1px solid var(--line-3);
  box-shadow: none;
}
.form-check-input:focus { border-color: color-mix(in srgb, var(--iris) 65%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 22%, transparent); }
.form-check-input:checked { background-color: var(--iris-strong); border-color: var(--iris-strong); }
.form-check-label { color: var(--fg); }
.form-switch .form-check-input {
  width: 2.25em; height: 1.3em; cursor: pointer;
  background-color: var(--panel-3);
  border-color: var(--line-2);
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a3a7b0'/%3e%3c/svg%3e");
  transition: background-position .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a3a7b0'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked {
  background-color: var(--iris-strong); border-color: var(--iris-strong);
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--iris) 60%, transparent);
}
.form-range::-webkit-slider-thumb { background: var(--iris-strong); }
.form-range::-webkit-slider-runnable-track { background: var(--panel-3); }
.form-range::-moz-range-thumb { background: var(--iris-strong); }
.form-range::-moz-range-track { background: var(--panel-3); }

/* ---------- Tables ---------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fg);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--hover);
  --bs-table-hover-color: var(--fg);
  --bs-table-striped-bg: var(--hover);
  --bs-table-striped-color: var(--fg);
  --bs-table-active-bg: var(--panel-2);
  font-size: 13.5px;
  margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--line); background-color: transparent; }
.table > :not(caption) > * > *:first-child { padding-left: 1.15rem; }
.table > :not(caption) > * > *:last-child { padding-right: 1.15rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .75rem; }
.table > thead > tr > th, .table > thead > tr > td {
  font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-3); white-space: nowrap;
  background: var(--panel-2) !important;
  border-bottom: 1px solid var(--line);
  padding-top: .6rem; padding-bottom: .6rem;
}
.table-light, .table > thead.table-light, .table > thead.bg-light { --bs-table-bg: transparent; --bs-table-color: var(--fg-3); background: transparent !important; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr { transition: background-color .12s; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--hover); }
.table > tbody > tr.bg-light > * { background: var(--panel-2) !important; }
.table-responsive { border-radius: 0 0 var(--r) var(--r); }
.card > .table-responsive:first-child, .card > .table:first-child { border-radius: var(--r) var(--r) 0 0; }

/* ---------- Badges / pills ------------------------------------------- */
.badge {
  --bs-badge-font-size: 11.5px;
  --bs-badge-font-weight: 500;
  --bs-badge-padding-y: .32em;
  --bs-badge-padding-x: .62em;
  --bs-badge-border-radius: 99px;
  letter-spacing: .005em;
  border: 1px solid transparent;
  vertical-align: middle;
}
.badge[class*="-subtle"] { border-color: color-mix(in srgb, currentColor 22%, transparent); }
.badge.bg-secondary-subtle { color: var(--fg-2) !important; background: var(--panel-3) !important; border-color: var(--line-2); }
.badge.bg-light { color: var(--fg-2) !important; border-color: var(--line-2); }
.badge.bg-success, .badge.bg-danger, .badge.bg-info, .badge.bg-primary { color: #fff; }
.badge.bg-warning { color: #1a1300; }
.badge.text-bg-light { color: var(--fg-2) !important; background: var(--panel-3) !important; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  font-size: 12.5px; font-weight: 500; color: var(--fg-2);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px;
  white-space: nowrap; text-decoration: none;
}
a.chip:hover { color: var(--fg); border-color: var(--line-3); }
.chip .bi { font-size: 12.5px; }

/* Listing / status dots */
.listing-dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--fg-3); }
.listing-dot.live, .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.listing-dot.processing, .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.listing-dot.submitted, .dot.info { background: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }
.listing-dot.not_synced, .dot.off { background: var(--fg-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg-3) 18%, transparent); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }

/* Stars */
.stars { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; vertical-align: -0.05em; }
.star-filled { color: var(--gold); }
.star-empty { color: var(--panel-3); }
html[data-theme="light"] .star-empty { color: #dcdce2; }

/* ---------- Alerts / progress / misc --------------------------------- */
.alert {
  --bs-alert-border-radius: 12px;
  color: var(--fg); background: var(--panel-2); border: 1px solid var(--line-2);
  font-size: 13.5px;
}
.alert-success { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.alert-danger { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.alert-info { background: color-mix(in srgb, var(--info) 10%, var(--panel)); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.alert .alert-link { color: inherit; }

.progress, .progress-stacked {
  --bs-progress-bg: var(--panel-3);
  --bs-progress-border-radius: 99px;
  --bs-progress-height: 6px;
  --bs-progress-bar-bg: var(--iris-strong);
  overflow: hidden;
}
.progress-bar { background-image: none; }
.progress-bar.grad, .progress .progress-bar:not([class*="bg-"]):not([style*="background"]) { background: var(--grad-h); }
.progress-bar.bg-warning { background-color: var(--gold) !important; }

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--fg); --bs-list-group-action-hover-bg: var(--hover); --bs-list-group-action-hover-color: var(--fg); }
.list-group-item.active { background: var(--panel-3); border-color: var(--line-2); color: var(--fg); }

.accordion { --bs-accordion-bg: transparent; --bs-accordion-border-color: var(--line); --bs-accordion-btn-bg: transparent; --bs-accordion-active-bg: var(--panel-2); --bs-accordion-active-color: var(--fg); --bs-accordion-btn-focus-box-shadow: none; }

/* ---------- Nav (tabs + pills) --------------------------------------- */
.nav-tabs { --bs-nav-tabs-border-color: var(--line); border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link {
  position: relative; border: 0; background: transparent; color: var(--fg-2);
  font-size: 13.5px; font-weight: 500; padding: .6rem .8rem; margin-bottom: 0;
}
.nav-tabs .nav-link:hover { color: var(--fg); }
.nav-tabs .nav-link.active { color: var(--fg); background: transparent; }
.nav-tabs .nav-link.active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad-h); }
.nav-pills { --bs-nav-pills-border-radius: var(--r-sm); --bs-nav-pills-link-active-bg: var(--panel-3); --bs-nav-pills-link-active-color: var(--fg); gap: 2px; }
.nav-pills .nav-link {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-2); font-size: 13.5px; font-weight: 500; padding: .55rem .75rem;
  transition: background .15s, color .15s;
}
.nav-pills .nav-link i { color: var(--fg-3); }
.nav-pills .nav-link:hover { color: var(--fg); background: var(--panel-2); }
.nav-pills .nav-link.active { color: var(--fg); background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-pills .nav-link.active i { color: var(--iris); }

/* ---------- Dropdown / modal / toast -------------------------------- */
.dropdown-menu {
  --bs-dropdown-bg: var(--panel);
  --bs-dropdown-border-color: var(--line-2);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-link-color: var(--fg-2);
  --bs-dropdown-link-hover-color: var(--fg);
  --bs-dropdown-link-hover-bg: var(--panel-2);
  --bs-dropdown-link-active-bg: var(--panel-3);
  --bs-dropdown-link-active-color: var(--fg);
  --bs-dropdown-divider-bg: var(--line);
  --bs-dropdown-header-color: var(--fg-3);
  --bs-dropdown-font-size: 13.5px;
  padding: 6px;
  box-shadow: var(--shadow-3);
}
.dropdown-item { border-radius: 7px; padding: .45rem .65rem; display: flex; align-items: center; gap: 8px; }
.dropdown-item i { color: var(--fg-3); }
.dropdown-item:hover i { color: var(--fg-2); }
.dropdown-item.text-danger i { color: inherit; }
.dropdown-item.text-danger:hover { color: var(--bad) !important; background: color-mix(in srgb, var(--bad) 10%, transparent); }

.modal { --bs-modal-bg: var(--panel); --bs-modal-border-color: var(--line-2); --bs-modal-border-radius: 18px; --bs-modal-header-border-color: var(--line); --bs-modal-footer-border-color: var(--line); --bs-modal-color: var(--fg); }
.modal-content { box-shadow: var(--shadow-3); }
.modal-backdrop { --bs-backdrop-bg: #000; --bs-backdrop-opacity: .6; }
.modal.show { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-title { font-weight: 600; letter-spacing: -0.02em; }

.toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast-x {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 420px; padding: 11px 12px 11px 14px;
  font-size: 13.5px; color: var(--fg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-3);
  animation: toastIn .35s var(--ease) both;
}
.toast-x.out { animation: toastOut .25s ease-in both; }
.toast-x .t-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; flex-shrink: 0; }
.toast-x.success .t-icon { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.toast-x.danger .t-icon { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.toast-x.info .t-icon { color: var(--info); background: color-mix(in srgb, var(--info) 15%, transparent); }
.toast-x .t-close { margin-left: auto; color: var(--fg-3); background: none; border: 0; padding: 2px 4px; font-size: 13px; }
.toast-x .t-close:hover { color: var(--fg); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Command palette ----------------------------------------- */
.cmdk { position: fixed; inset: 0; z-index: 2000; display: none; }
.cmdk.open { display: block; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .2s ease both; }
.cmdk-panel {
  position: relative; width: min(640px, calc(100vw - 32px)); margin: 12vh auto 0;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(124,108,255,.08), 0 0 80px -20px rgba(124,108,255,.35);
  overflow: hidden;
  animation: pop .22s var(--ease) both;
}
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.cmdk-input i { color: var(--fg-3); font-size: 16px; }
.cmdk-input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 16px; font-family: var(--font); letter-spacing: -0.01em; }
.cmdk-input input::placeholder { color: var(--fg-3); }
.cmdk-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; font-weight: 500; color: var(--fg-3); padding: 10px 10px 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 10px; border-radius: 9px;
  color: var(--fg-2); font-size: 14px; text-decoration: none; cursor: pointer;
}
.cmdk-item .ci { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg-2); font-size: 14px; flex-shrink: 0; }
.cmdk-item .hint { margin-left: auto; font-size: 12px; color: var(--fg-3); }
.cmdk-item.sel { background: var(--panel-2); color: var(--fg); }
.cmdk-item.sel .ci { color: #fff; background: var(--grad); border-color: transparent; }
.cmdk-empty { padding: 36px 10px; text-align: center; color: var(--fg-3); font-size: 13.5px; }
.cmdk-foot { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-3); background: var(--panel-2); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Charts ---------------------------------------------------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis text { fill: var(--fg-3); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .cursor { stroke: var(--line-3); stroke-dasharray: 3 3; }
.chart .dotp { fill: var(--panel); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5;
  min-width: 120px; padding: 8px 10px;
  font-size: 12px; color: var(--fg);
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-3);
  opacity: 0; transform: translate(-50%, -110%); transition: opacity .12s;
  white-space: nowrap;
}
.chart-tip.on { opacity: 1; }
.chart-tip .tl { color: var(--fg-3); font-size: 11.5px; margin-bottom: 2px; }
.chart-tip .tv { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-row .lv { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row .lp { width: 44px; text-align: right; color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* Stacked outcome bar */
.meter { display: flex; height: 10px; gap: 3px; border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; min-width: 6px; }

/* ---------- Location cards (dashboard) ------------------------------ */
.loc-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.loc-card:hover { border-color: var(--line-3); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.loc-card .lc-head { padding: 18px 18px 14px; display: flex; gap: 14px; align-items: flex-start; }
.loc-card .lc-title { font-size: 17px; font-weight: 650; letter-spacing: -0.025em; color: var(--fg); text-decoration: none; }
.loc-card .lc-title:hover { color: var(--fg); }
.loc-card .lc-meta { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.loc-card .lc-body { padding: 0 18px 16px; flex: 1; }
.loc-card .lc-foot { display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.loc-card .lc-spark { height: 64px; margin: 0 0 4px; }
.pubs { display: flex; gap: 5px; flex-wrap: wrap; }
.pub {
  width: 26px; height: 26px; display: grid; place-items: center; position: relative;
  font-size: 12px; color: var(--fg-2);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
}
.pub::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--panel); background: var(--fg-3); }
.pub.live::after { background: var(--ok); } .pub.processing::after { background: var(--warn); } .pub.submitted::after { background: var(--info); }

.add-tile {
  height: 100%; min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 1px dashed var(--line-3); border-radius: var(--r-lg);
  color: var(--fg-2); text-decoration: none;
  background: repeating-linear-gradient(135deg, transparent 0 12px, var(--hover) 12px 13px);
  transition: border-color .25s, background-color .25s, color .25s;
}
.add-tile:hover { border-color: color-mix(in srgb, var(--iris) 60%, transparent); color: var(--fg); background-color: color-mix(in srgb, var(--iris) 5%, transparent); }
.add-tile .plus { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; font-size: 22px; color: #fff; background: var(--grad); box-shadow: 0 10px 30px -10px rgba(192, 92, 247, .7); transition: transform .3s var(--ease); }
.add-tile:hover .plus { transform: rotate(90deg) scale(1.05); }
.add-tile-copy { align-items: center; text-align: center; gap: 2px; }
.add-tile-wide { min-height: 0; flex-direction: row; justify-content: flex-start; gap: 16px; padding: 18px 20px; }
.add-tile-wide .add-tile-copy { align-items: flex-start; text-align: left; }
.add-tile-wide .plus { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }

/* Legacy tiles (kept for any stray markup) */
.location-tile { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.add-location-tile { border: 1px dashed var(--line-3); border-radius: var(--r-lg); background: transparent; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; }

/* ---------- Hero ------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 28px 28px 26px;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(124, 108, 255, .22), transparent 70%),
    radial-gradient(480px 260px at 100% 0%, rgba(255, 122, 69, .14), transparent 70%),
    radial-gradient(420px 220px at 55% 120%, rgba(192, 92, 247, .12), transparent 70%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 70% 0%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 80% at 70% 0%, #000, transparent 70%);
}
html[data-theme="light"] .hero::before {
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(124, 108, 255, .14), transparent 70%),
    radial-gradient(480px 260px at 100% 0%, rgba(255, 122, 69, .10), transparent 70%),
    radial-gradient(420px 220px at 55% 120%, rgba(192, 92, 247, .08), transparent 70%);
}
.hero h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.1; margin: 0; }
.hero .lede { color: var(--fg-2); font-size: 15px; margin: 8px 0 0; max-width: 560px; }
.hero .lede strong { color: var(--fg); font-weight: 600; }

/* Attention feed */
.feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  color: var(--fg); text-decoration: none;
  transition: background .15s;
}
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--hover); color: var(--fg); }
.feed-item .fi-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; flex-shrink: 0; font-size: 14px; }
.feed-item .fi-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .fi-sub { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .fi-go { margin-left: auto; color: var(--fg-3); font-size: 12px; transition: transform .2s var(--ease), color .2s; }
.feed-item:hover .fi-go { color: var(--fg); transform: translateX(3px); }
.tone-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.tone-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tone-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.tone-info { color: var(--info); background: color-mix(in srgb, var(--info) 13%, transparent); }
.tone-iris { color: var(--iris); background: color-mix(in srgb, var(--iris) 14%, transparent); }
.tone-violet { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.tone-mute { color: var(--fg-2); background: var(--panel-3); }

/* Icon tile */
.itile { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex-shrink: 0; font-size: 16px; }
.itile-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.itile-lg { width: 44px; height: 44px; border-radius: 12px; font-size: 19px; }

/* Row list */
.rowlink {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  color: var(--fg); text-decoration: none; transition: background .15s;
}
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover { background: var(--hover); color: var(--fg); }
.rowlink .chev { margin-left: auto; color: var(--fg-3); font-size: 12px; transition: transform .2s var(--ease); }
.rowlink:hover .chev { transform: translateX(3px); color: var(--fg); }

/* ---------- Phone system ---------------------------------------------- */
.ivr-node, .ring-member, .time-condition-row { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s; }
.ring-member:hover { border-color: var(--line-3); }
.flow-node { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 1rem; text-align: center; position: relative; transition: all .2s; }
.flow-node:hover { border-color: color-mix(in srgb, var(--iris) 50%, transparent); box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--iris) 50%, transparent); }
.flow-node.active { border-color: var(--iris); background: color-mix(in srgb, var(--iris) 8%, var(--panel)); }
.flow-arrow { color: var(--iris); font-size: 1.5rem; }
.phone-num { font-family: var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Motion ---------------------------------------------------- */
.fade-in { animation: fadeUp .45s var(--ease) both; }
.reveal > * { animation: fadeUp .6s var(--ease) both; }
.reveal > *:nth-child(1) { animation-delay: .02s; }
.reveal > *:nth-child(2) { animation-delay: .08s; }
.reveal > *:nth-child(3) { animation-delay: .14s; }
.reveal > *:nth-child(4) { animation-delay: .2s; }
.reveal > *:nth-child(5) { animation-delay: .26s; }
.reveal > *:nth-child(6) { animation-delay: .32s; }
.reveal > *:nth-child(n+7) { animation-delay: .38s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

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

/* ---------- Responsive ----------------------------------------------- */
#sidebar-overlay { display: none; }
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-3); }
  #sidebar.show { transform: none; }
  #main-wrapper { margin-left: 0; }
  #main-wrapper::before { left: 0; }
  #sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
  #sidebar-overlay.show { display: block; opacity: 1; }
  #top-header { padding: 0 16px; }
  #page-content { padding: 20px 16px; }
  .search-pill { min-width: 0; width: 34px; padding: 0; justify-content: center; }
  .search-pill span, .search-pill .kbd { display: none; }
}
@media (max-width: 575.98px) {
  .page-head h1, .page-head h4 { font-size: 22px; }
  .hero { padding: 22px 18px; border-radius: 16px; }
  .stat-grid { --cols: 2 !important; }
  .stat-grid > *:nth-child(odd) { border-left: 0; }
  .stat-grid > *:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi-value { font-size: 26px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast-x { max-width: none; }
}
.cell-spark { display: block; width: calc(100% + 40px); height: 40px; margin: 8px -20px 0; }

/* ---------- Auth / standalone pages ---------------------------------- */
body.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-bg .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform; }
.auth-bg .b1 { width: 620px; height: 620px; left: -160px; top: -200px; background: #6d5bff; animation: drift1 22s ease-in-out infinite alternate; }
.auth-bg .b2 { width: 520px; height: 520px; right: -140px; top: 10%; background: #c05cf7; opacity: .35; animation: drift2 26s ease-in-out infinite alternate; }
.auth-bg .b3 { width: 560px; height: 560px; left: 30%; bottom: -320px; background: #ff7a45; opacity: .28; animation: drift3 30s ease-in-out infinite alternate; }
html[data-theme="light"] .auth-bg .blob { opacity: .22; }
html[data-theme="light"] .auth-bg .b3 { opacity: .16; }
.auth-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}
@keyframes drift1 { to { transform: translate(120px, 80px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-100px, 120px) scale(.9); } }
@keyframes drift3 { to { transform: translate(-140px, -60px) scale(1.15); } }

.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; }
.auth-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 28px 32px; display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 992px) { .auth-main { grid-template-columns: 1.15fr .85fr; gap: 64px; } }
.auth-h1 { font-size: clamp(38px, 4.4vw, 58px); font-weight: 650; letter-spacing: -0.045em; line-height: 1.02; margin: 0 0 18px; }
.auth-lede { font-size: 17px; color: var(--fg-2); max-width: 500px; margin: 0; line-height: 1.55; }
.auth-card {
  width: 100%; max-width: 440px; justify-self: center;
  padding: 32px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--shadow-3);
  animation: fadeUp .6s var(--ease) both;
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--fg-3); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.auth-foot { text-align: center; padding: 20px; font-size: 12px; color: var(--fg-3); }
.auth-foot a { color: var(--fg-3); }

.auth-stage { position: relative; height: 300px; margin: 36px 0 28px; }
.float-card {
  position: absolute;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow-3);
  animation: floaty 7s ease-in-out infinite;
}
.fc-kpi { left: 0; top: 10px; width: 290px; padding-bottom: 0; overflow: hidden; }
.fc-kpi .spark { margin: 6px -16px 0; width: calc(100% + 32px) !important; }
.fc-review { left: 300px; top: 0; width: 280px; animation-delay: -2s; }
.fc-call { left: 330px; top: 150px; width: 260px; display: flex; align-items: center; gap: 12px; animation-delay: -4s; }
.fc-health { left: 40px; top: 210px; width: 250px; display: flex; align-items: center; gap: 12px; animation-delay: -1s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 1199.98px) { .fc-review { left: 250px; } .fc-call { left: 270px; } }
@media (max-width: 575.98px) { .auth-card { padding: 24px 20px; border-radius: 18px; } .auth-top, .auth-main { padding-left: 16px; padding-right: 16px; } }
.reply-block { margin-left: 48px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); border-left: 2px solid var(--iris); }
@media (max-width: 575.98px) { .reply-block { margin-left: 0; } }
.plan-current { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--iris) 70%, transparent), 0 20px 50px -20px rgba(192, 92, 247, .55); }
.d-flex > .form-control, .d-flex > .form-select { min-width: 0; }
input[type="time"].form-control { padding-right: .5rem; }

/* ---------- Location switcher ---------------------------------------- */
.sb-switch {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  font-size: 13.5px; color: var(--fg); text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  transition: border-color .15s, background .15s;
}
.sb-switch:hover, .sb-switch[aria-expanded="true"] { border-color: var(--line-3); background: var(--panel-3); }
.sb-switch .sb-avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 12.5px; color: #fff; background: var(--grad); border: 0; }
.sb-switch + .dropdown-menu .sb-avatar { width: 22px; height: 22px; font-size: 10.5px; }
.sb-foot .sb-link { margin: 0; }

/* Settings tabs */
.settings-tabs { margin: -8px 0 24px; }

/* Service status chip */
.svc {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  font-size: 12px; font-weight: 500; color: var(--fg-2);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px;
  white-space: nowrap;
}
.svc .dot { width: 6px; height: 6px; box-shadow: none; }

/* Service card (location overview) */
.svc-card { display: flex; flex-direction: column; height: 100%; padding: 18px; color: var(--fg); text-decoration: none; }
.svc-card:hover { color: var(--fg); border-color: var(--line-3); }
.svc-card .go { margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 500; color: var(--iris); display: inline-flex; align-items: center; gap: 6px; }
.svc-card .go i { transition: transform .2s var(--ease); }
.svc-card:hover .go i { transform: translateX(3px); }
a.card { transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* Hours list */
.hours-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.hours-row:last-child { border-bottom: 0; }
.hours-row .d { color: var(--fg-2); }
.hours-row.today .d, .hours-row.today .h { color: var(--fg); font-weight: 600; }
.sync-to { display: flex; flex-wrap: wrap; gap: 6px; }

/* Hours editor */
.hours-edit { display: grid; grid-template-columns: 130px 110px 1fr; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours-edit:last-child { border-bottom: 0; }
.hours-edit .day { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.hours-edit .today-tag { font-size: 10.5px; font-weight: 600; color: var(--iris); background: color-mix(in srgb, var(--iris) 14%, transparent); padding: 1px 6px; border-radius: 99px; }
.hours-edit .state { font-size: 12.5px; color: var(--fg-2); }
.hours-edit .s-closed { display: none; }
.hours-edit .times { display: flex; align-items: center; gap: 8px; max-width: 300px; transition: opacity .2s; }
.hours-edit.is-closed .s-open { display: none; }
.hours-edit.is-closed .s-closed { display: inline; color: var(--fg-3); }
.hours-edit.is-closed .times { opacity: .3; pointer-events: none; }
@media (max-width: 575.98px) { .hours-edit { grid-template-columns: 1fr auto; } .hours-edit .times { grid-column: 1 / -1; max-width: none; } }

/* ---------- Website templates (customer site look, not app theme) --- */
.site { --s-font: 'Geist', system-ui, sans-serif; --s-radius: 12px; --s-btn-radius: 10px; --s-case: none; --s-weight: 700;
  font-family: var(--s-font); background: var(--s-bg); color: var(--s-fg); }
.site-modern  { --s-bg: #ffffff; --s-fg: #0f172a; --s-muted: #64748b; --s-accent: #4f46e5; --s-accent-fg: #fff; --s-card: #f1f5f9; --s-alt: #f8fafc;
  --s-hero-bg: linear-gradient(135deg, #4f46e5, #9333ea); --s-hero-fg: #ffffff; --s-hero-btn: #ffffff; --s-hero-btn-fg: #4f46e5; }
.site-classic { --s-bg: #fbf7f0; --s-fg: #2b2118; --s-muted: #7a6a58; --s-accent: #1f3a5f; --s-accent-fg: #fff; --s-card: #f3ebdf; --s-alt: #f6efe4;
  --s-hero-bg: #efe4d2; --s-hero-fg: #2b2118; --s-hero-btn: #1f3a5f; --s-hero-btn-fg: #fff; --s-font: Georgia, 'Times New Roman', serif; --s-radius: 4px; --s-btn-radius: 3px; }
.site-bold    { --s-bg: #0b0b0b; --s-fg: #ffffff; --s-muted: #a3a3a3; --s-accent: #ff5a1f; --s-accent-fg: #0b0b0b; --s-card: #1a1a1a; --s-alt: #121212;
  --s-hero-bg: radial-gradient(120% 90% at 100% 0%, #ff5a1f55, transparent 60%), #0b0b0b; --s-hero-fg: #ffffff; --s-hero-btn: #ff5a1f; --s-hero-btn-fg: #0b0b0b;
  --s-radius: 0; --s-btn-radius: 0; --s-case: uppercase; --s-weight: 900; }
.site-minimal { --s-bg: #ffffff; --s-fg: #111111; --s-muted: #6b7280; --s-accent: #111111; --s-accent-fg: #fff; --s-card: #ffffff; --s-alt: #fafafa;
  --s-hero-bg: #ffffff; --s-hero-fg: #111111; --s-hero-btn: #111111; --s-hero-btn-fg: #fff; --s-btn-radius: 99px; --s-weight: 500; }

.site h2, .site h4 { color: inherit; font-family: var(--s-font); text-transform: var(--s-case); font-weight: var(--s-weight); letter-spacing: -0.02em; }
.site .s-hero { padding: 64px 32px; text-align: center; background: var(--s-hero-bg); color: var(--s-hero-fg); }
.site .s-hero h2 { font-size: 36px; margin-bottom: 8px; }
.site .s-hero p { opacity: .8; margin-bottom: 20px; }
.site .s-btn { display: inline-block; padding: 10px 20px; font-weight: 600; font-size: 14px; background: var(--s-hero-btn); color: var(--s-hero-btn-fg); border-radius: var(--s-btn-radius); }
.site .s-sec { padding: 28px 32px; }
.site .s-sec p { color: var(--s-muted); margin: 0; }
.site .s-sec h4 { font-size: 20px; margin-bottom: 12px; }
.site .s-alt { background: var(--s-alt); }
.site .s-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.site .s-card { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--s-card); border-radius: var(--s-radius); font-size: 14px; border: 1px solid rgba(0,0,0,.06); }
.site-bold .s-card { border-color: #262626; }
.site .s-card span { color: var(--s-accent); font-weight: 600; white-space: nowrap; }
.site .s-hours { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(127,127,127,.2); font-size: 14px; }
.site .s-hours:first-of-type { margin-top: 12px; }

.tpl-pick { display: block; width: 100%; padding: 8px; text-align: left; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.tpl-pick:hover { border-color: var(--line-3); transform: translateY(-2px); }
.tpl-pick.on { border-color: transparent; box-shadow: 0 0 0 2px var(--iris), 0 14px 30px -14px rgba(124, 108, 255, .6); }
.tpl-thumb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; aspect-ratio: 4 / 3; padding: 10px; border-radius: 9px; overflow: hidden; }
.tpl-thumb::before { content: ''; position: absolute; inset: 0 0 42% 0; background: var(--s-hero-bg); }
.tpl-thumb > span { position: relative; display: block; }
.tpl-thumb .t-nav { align-self: stretch; display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 6px; }
.tpl-thumb .t-nav span { width: 12px; height: 3px; border-radius: 2px; background: var(--s-hero-fg); opacity: .5; }
.tpl-thumb .t-h { width: 62%; height: 8px; border-radius: 3px; background: var(--s-hero-fg); }
.site-bold .tpl-thumb .t-h, .tpl-thumb.site-bold .t-h { height: 11px; width: 74%; }
.tpl-thumb .t-p { width: 44%; height: 4px; border-radius: 2px; background: var(--s-hero-fg); opacity: .5; }
.tpl-thumb .t-btn { width: 26%; height: 8px; margin-top: 3px; border-radius: var(--s-btn-radius); background: var(--s-hero-btn); }
.tpl-thumb .t-cards { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: auto; }
.tpl-thumb .t-cards span { height: 22px; border-radius: min(var(--s-radius), 5px); background: var(--s-card); border: 1px solid rgba(127,127,127,.18); }

/* Phone routing */
.route-step { display: flex; gap: 14px; padding: 16px 0; }
.route-step + .route-step { border-top: 1px dashed var(--line-2); }
.route-step:first-child { padding-top: 4px; }
.route-detail { margin-top: 6px; font-size: 12.5px; color: var(--fg-3); }

/* Bill breakdown */
.bill-line { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 14px; color: var(--fg-2); border-bottom: 1px dashed var(--line-2); }
.bill-line .num { color: var(--fg); font-weight: 500; }
.bill-line.total { border-bottom: 0; padding-top: 14px; font-weight: 600; color: var(--fg); font-size: 15px; }
.bill-line.total .num { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.photo-tile.cover { grid-column: span 2; aspect-ratio: auto; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.logo img { object-fit: contain; padding: 10px; background: #fff; }
.photo-tag { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 99px; }
.photo-x { position: absolute; top: 6px; right: 6px; margin: 0; }
.photo-x button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.6); font-size: 11px; opacity: 0; transition: opacity .15s; }
.photo-tile:hover .photo-x button, .photo-x button:focus-visible { opacity: 1; }
.photo-add { height: 100%; margin: 0; }
.photo-add label { height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--fg-3); font-size: 12.5px; border: 1px dashed var(--line-3); border-radius: 12px; transition: color .15s, border-color .15s, background .15s; }
.photo-add label:hover { color: var(--fg); border-color: color-mix(in srgb, var(--iris) 60%, transparent); background: color-mix(in srgb, var(--iris) 6%, transparent); }
.photo-add i { font-size: 20px; }
@media (hover: none) { .photo-x button { opacity: 1; } }
.site .s-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: #fff; padding: 6px; margin-bottom: 14px; }

/* SMS preview */
.sms-thread { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sms-meta { font-size: 11.5px; color: var(--fg-3); padding-left: 4px; }
.sms-bubble { max-width: 92%; padding: 10px 13px; font-size: 13.5px; line-height: 1.4; color: var(--fg); background: var(--panel-3); border-radius: 18px 18px 18px 5px; white-space: pre-wrap; word-break: break-word; }
