/* DevHotspot control centre — Nexora-style: dark by default, light on demand */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/fonts/inter/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(/fonts/inter/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(/fonts/inter/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(/fonts/inter/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-display: swap; src: url(/fonts/inter/inter-latin-800-normal.woff2) format('woff2'); }
/* The DevHotspot wordmark */
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url(/fonts/outfit/outfit-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #090C13;
  --sidebar-bg: #0B0E16;
  --surface: #0F131C;
  --surface-2: #141924;
  --surface-3: #1A202D;
  --raised: #161B27;
  --line: #1B2130;
  --line-2: #262E40;
  --text: #ECEEF3;
  --text-2: #BCC2CF;
  --muted: #8890A2;
  --faint: #5B6376;
  --primary: #6366F1;
  --primary-hover: #7679F5;
  --primary-soft: rgba(99, 102, 241, .14);
  --primary-text: #A9ACFF;
  --on-primary: #FFFFFF;
  --gold: #F5B83D;
  --success: #34D399; --success-bg: rgba(52, 211, 153, .12);
  --warning: #FBBF24; --warning-bg: rgba(251, 191, 36, .12);
  --orange: #FB923C;  --orange-bg: rgba(251, 146, 60, .13);
  --danger: #F87171;  --danger-bg: rgba(248, 113, 113, .12);
  --info: #60A5FA;    --info-bg: rgba(96, 165, 250, .12);
  --neutral: #A2A9B8; --neutral-bg: rgba(162, 169, 184, .1);
  --violet: #B39CFC;  --violet-bg: rgba(139, 92, 246, .15);
  --pink: #F472B6;    --pink-bg: rgba(244, 114, 182, .13);
  --c1: #6366F1; --c2: #14B8A6; --c3: #F59E0B; --c4: #3B82F6; --c5: #EF4444; --c6: #A855F7; --c7: #22C55E; --c8: #64748B;
  --grid: rgba(255, 255, 255, .055);
  --tip-bg: #1A1F2C;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  --glow: 0 6px 20px -6px rgba(99, 102, 241, .65);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: var(--font);
  --font-body: var(--font);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --r-xs: 5px; --r-sm: 7px; --r-md: 9px; --r-lg: 12px; --r-xl: 16px;
  --sidebar: 222px;
  --topbar: 58px;
  --drawer: 344px;
  --gap: 16px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4F6FB;
  --sidebar-bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EDF1F7;
  --raised: #FFFFFF;
  --line: #E5E9F1;
  --line-2: #D5DBE6;
  --text: #0E1525;
  --text-2: #334055;
  --muted: #667185;
  --faint: #98A2B3;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF0FF;
  --primary-text: #4338CA;
  --success: #0E9F6E; --success-bg: #E4F7EF;
  --warning: #B7791F; --warning-bg: #FEF4DC;
  --orange: #C2560F;  --orange-bg: #FFEEDF;
  --danger: #D92D20;  --danger-bg: #FEECEB;
  --info: #2563EB;    --info-bg: #E8F0FE;
  --neutral: #5B6577; --neutral-bg: #EEF1F5;
  --violet: #6D28D9;  --violet-bg: #F1EBFE;
  --pink: #BE185D;    --pink-bg: #FDEBF3;
  --c1: #4F46E5; --c2: #0D9488; --c3: #E58A0B; --c4: #2563EB; --c5: #E5484D; --c6: #9333EA; --c7: #16A34A; --c8: #94A3B8;
  --grid: #EDF0F5;
  --tip-bg: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
  --glow: 0 6px 16px -6px rgba(79, 70, 229, .55);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 13px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font); font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num, .tabnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: rgba(99, 102, 241, .35); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -0.01em; }
.code { font-family: var(--mono); font-weight: 600; letter-spacing: .04em; color: var(--primary-text); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up { color: var(--success); }
.down { color: var(--danger); }

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

/* ═══════════ Shell ═══════════ */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar-bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px 14px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 10px; }
/* Logo: the "D + signal" mark on an indigo tile (files in /assets/img/brand) and the Outfit wordmark */
.brand-mark { width: 32px; height: 32px; border-radius: 23.4%; background: linear-gradient(rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 53%), linear-gradient(140deg, #818CF8 0%, #6366F1 48%, #4338CA 100%); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .6); overflow: hidden; }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.1; }
.brand-mark svg.dh-glyph { width: 100%; height: 100%; stroke-width: initial; }
.brand-text b { display: block; font: 700 17px/1.05 'Outfit', var(--font); letter-spacing: -0.02em; }
.brand-text span { display: block; font-size: 7.5px; font-weight: 600; color: var(--primary-text); letter-spacing: .32em; margin-top: 3px; }
.nav-group { margin-top: 16px; }
.nav-group:first-of-type { margin-top: 12px; }
.nav-group > span { display: block; padding: 0 10px 7px; font-size: 10px; font-weight: 600; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 12.8px; position: relative; transition: background .12s, color .12s; }
.nav a svg { width: 16px; height: 16px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(99, 102, 241, .2), rgba(99, 102, 241, .07)); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
:root[data-theme="light"] .nav a.active { background: var(--primary-soft); color: var(--primary-text); }
.nav a.active svg { color: var(--primary-text); }
.nav a .badge { margin-left: auto; }
.upgrade { margin-top: auto; border-radius: var(--r-lg); padding: 14px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); position: relative; overflow: hidden; }
.upgrade::before { content: ''; position: absolute; right: -30px; top: -34px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(closest-side, rgba(99, 102, 241, .22), transparent); }
.upgrade .up-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.upgrade .crown { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(245, 184, 61, .14); color: var(--gold); }
.upgrade .crown svg { width: 15px; height: 15px; }
.upgrade .up-chip { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; }
.upgrade h4 { font-size: 13px; font-weight: 700; margin: 0 0 4px; position: relative; }
.upgrade p { margin: 0 0 12px; font-size: 11px; color: var(--muted); line-height: 1.45; position: relative; }
.upgrade .btn { width: 100%; position: relative; }
.sidebar-foot { font-size: 10.5px; color: var(--faint); padding: 10px 6px 0; line-height: 1.4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.icon-btn.menu-btn { display: none; }
.crumb { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; margin-right: 6px; }
.search { position: relative; flex: 0 1 340px; }
.search input { width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 56px 0 34px; font-size: 12.5px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search > svg { position: absolute; left: 11px; top: 9px; width: 14px; height: 14px; color: var(--faint); }
.search kbd { position: absolute; right: 8px; top: 7px; font: 600 10px var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; background: var(--surface-2); letter-spacing: .04em; }
.search-results { position: absolute; top: 40px; left: 0; right: 0; min-width: 340px; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r-sm); font-size: 12.5px; }
.search-results a:hover, .search-results a.on { background: var(--surface-3); }
.search-results .type { margin-left: auto; font-size: 11px; color: var(--faint); }
.search-results .empty-s { padding: 14px; color: var(--muted); text-align: center; font-size: 12.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.dot-badge { position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 3px 6px 3px 3px; margin-left: 6px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left; }
.user-btn:hover { background: var(--surface-2); border-color: var(--line); }
.user-btn .avatar { width: 30px; height: 30px; }
.user-btn .ub-text b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.user-btn .ub-text span { display: block; font-size: 10.5px; color: var(--muted); }
.popover { position: absolute; right: 0; top: 42px; width: 360px; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.popover-head h4 { font-size: 13.5px; }
.popover .list { max-height: 440px; overflow: auto; }
.popover .list a, .popover .list button { display: flex; gap: 11px; padding: 10px 14px; width: 100%; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.popover .list a:hover, .popover .list button:hover { background: var(--surface-2); }
.popover .list a:last-child, .popover .list button:last-child { border-bottom: 0; }
.menu-pop { width: 220px; padding: 5px; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-2); font-weight: 500; font-size: 12.5px; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); color: var(--text); }
.menu-pop svg { width: 15px; height: 15px; color: var(--muted); }
.menu-pop .btn-danger, .menu-pop .btn-danger svg { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu-pop .on svg { color: var(--primary-text); }

.workspace { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); padding: 6px 24px 18px; align-items: start; }
.workspace.has-drawer { grid-template-columns: minmax(0, 1fr) var(--drawer); }
.content { min-width: 0; outline: none; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 4px 24px 18px; color: var(--faint); font-size: 11.5px; }
.footer nav { display: flex; gap: 18px; }
.footer a:hover { color: var(--text); }
.footer .dev-credit { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.footer .dev-credit a { color: var(--primary-text); font-weight: 600; }

/* ═══════════ Page header ═══════════ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -0.02em; }
.page-head h1 .hicon { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.page-head h1 .hicon svg { width: 11px; height: 11px; stroke-width: 2.4; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .ph-lead { display: flex; gap: 12px; align-items: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--success); font-weight: 500; letter-spacing: 0; }
.status-inline svg { width: 13px; height: 13px; }

/* ═══════════ Buttons & inputs ═══════════ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 12.5px; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--text) 20%); background: var(--surface-3); }
:root[data-theme="light"] .btn { background: var(--surface); }
:root[data-theme="light"] .btn:hover { background: var(--surface-2); }
.btn-primary, :root[data-theme="light"] .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: var(--glow); }
.btn-primary:hover, :root[data-theme="light"] .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger-solid, :root[data-theme="light"] .btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost, :root[data-theme="light"] .btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover, :root[data-theme="light"] .btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-soft, :root[data-theme="light"] .btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; gap: 6px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11px; border-radius: 6px; gap: 5px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .count { background: rgba(255, 255, 255, .16); color: inherit; border-radius: 6px; padding: 0 6px; font-size: 10.5px; line-height: 17px; }
.btn:not(.btn-primary) .count { background: var(--primary-soft); color: var(--primary-text); }
.btn-split { display: inline-flex; }
.btn-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, .2); padding: 0 8px; }
.link { color: var(--primary-text); font-weight: 500; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; }
.link svg { width: 13px; height: 13px; }
.link:hover { text-decoration: underline; }

.input, .select { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 11px; font-size: 12.5px; transition: border-color .12s, box-shadow .12s; }
:root[data-theme="light"] .input, :root[data-theme="light"] .select { background: var(--surface); }
.input::placeholder { color: var(--faint); }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[readonly], .input:disabled, .select:disabled { color: var(--muted); }
.input[readonly] { background: var(--surface); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238890A2' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }
.select option { background: var(--raised); color: var(--text); }
input[type=date].input, input[type=time].input { min-width: 0; color-scheme: inherit; }
.field { display: grid; gap: 5px; margin-bottom: 12px; align-content: start; }
.field > label, .label { font-size: 11.5px; font-weight: 500; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field .hint { font-size: 11px; color: var(--faint); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.input-icon .input, .input-icon .select { padding-left: 33px; }
.input-icon .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }
input[type=checkbox] { accent-color: var(--primary); }
.switch { position: relative; width: 34px; height: 19px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

/* ═══════════ Cards ═══════════ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; display: flex; flex-direction: column; }
:root[data-theme="light"] .card { box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.card-head h3 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.card-head h3 svg { width: 15px; height: 15px; color: var(--primary-text); }
.card-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.card-head .select { width: auto; height: 28px; font-size: 11.5px; padding: 0 26px 0 10px; background-position: right 8px center; }
.card-head .head-actions { display: flex; gap: 6px; align-items: center; }
.card-body { padding: 12px 16px 16px; flex: 1; }
.card-body.flush { padding: 8px 0 0; }
.card-body.center { display: flex; align-items: center; }
.card-foot { padding: 0 14px 14px; display: flex; justify-content: center; }
.card-foot > .link, .card-foot > a.foot-btn, .card-foot > button.foot-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-weight: 500; font-size: 11.5px; }
.card-foot > .link:hover, .card-foot > .foot-btn:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.card-foot.split { justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.grid { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.row { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split-a { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1fr); }
.split-b { grid-template-columns: minmax(0, 1fr) minmax(290px, .34fr); }
.split-c { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
/* page with a right rail that starts at the top (Analytics, Activity, Security, Settings) */
.rail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 25.5%); gap: var(--gap); align-items: start; }
.rail-layout > .rail { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.rail-layout > .rail-main { min-width: 0; }

/* KPI cards */
.kpi { display: flex; gap: 12px; align-items: center; padding: 14px 16px; position: relative; overflow: hidden; min-height: 78px; }
.card.kpi { flex-direction: row; }
.tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; position: relative; }
.tile svg { width: 19px; height: 19px; }
.tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.tile.sm svg { width: 16px; height: 16px; }
.tile.xs { width: 26px; height: 26px; border-radius: 7px; }
.tile.xs svg { width: 14px; height: 14px; }
.tile.lg { width: 48px; height: 48px; border-radius: 12px; }
.tile.lg svg { width: 22px; height: 22px; }
.tile.violet { background: linear-gradient(140deg, #9B6BFF, #7C3AED); box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .6); }
.tile.indigo { background: linear-gradient(140deg, #7F84FA, #4F46E5); box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); }
.tile.blue { background: linear-gradient(140deg, #5EA2FA, #2563EB); box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55); }
.tile.teal { background: linear-gradient(140deg, #2DD4BF, #0D9488); box-shadow: 0 6px 16px -6px rgba(13, 148, 136, .55); }
.tile.amber { background: linear-gradient(140deg, #FBBF24, #EA8A0C); box-shadow: 0 6px 16px -6px rgba(234, 138, 12, .55); }
.tile.orange { background: linear-gradient(140deg, #FB923C, #EA580C); box-shadow: 0 6px 16px -6px rgba(234, 88, 12, .55); }
.tile.red { background: linear-gradient(140deg, #F87171, #DC2626); box-shadow: 0 6px 16px -6px rgba(220, 38, 38, .55); }
.tile.green { background: linear-gradient(140deg, #4ADE80, #16A34A); box-shadow: 0 6px 16px -6px rgba(22, 163, 74, .55); }
.tile.pink { background: linear-gradient(140deg, #F472B6, #DB2777); box-shadow: 0 6px 16px -6px rgba(219, 39, 119, .55); }
.tile.slate { background: linear-gradient(140deg, #8C9AB2, #56647D); }
.tile.soft { background: var(--surface-3); color: var(--text-2); box-shadow: none; border: 1px solid var(--line-2); }
.tile.sm, .tile.xs { box-shadow: none; }
/* tinted icon tiles (activity rows, lists) */
.ticon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; border: 1px solid transparent; }
.ticon svg { width: 15px; height: 15px; }
.ticon.sm { width: 24px; height: 24px; border-radius: 7px; }
.ticon.sm svg { width: 13px; height: 13px; }
.ticon.violet { background: var(--violet-bg); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 22%, transparent); }
.ticon.indigo, .ticon.blue { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.ticon.indigo { background: var(--primary-soft); color: var(--primary-text); border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
.ticon.teal, .ticon.green { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.ticon.amber { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.ticon.orange { background: var(--orange-bg); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 22%, transparent); }
.ticon.red { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.ticon.pink { background: var(--pink-bg); color: var(--pink); border-color: color-mix(in srgb, var(--pink) 22%, transparent); }
.ticon.slate { background: var(--neutral-bg); color: var(--neutral); border-color: var(--line-2); }
.kpi-body { min-width: 0; flex: 1 1 auto; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; margin: 2px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.kpi-value small { font-size: .55em; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-right: .18em; }
.kpi-foot { font-size: 10.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; }
.kpi-foot > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kpi-spark { flex: 0 3 84px; min-width: 0; height: 32px; align-self: center; overflow: hidden; }
.kpi-foot.wrap { white-space: normal; flex-wrap: wrap; row-gap: 0; }
.kpi-foot.wrap > span:last-child { white-space: normal; overflow: visible; }
.sb-value, .sp-value, .mk-value, .mc-value, .ag-value, .donut-center, .sc-money, .fit { white-space: nowrap; overflow: hidden; }
.kpi-value small, .sb-value small, .mk-value small, .mc-value small { flex: none; }
.kpi.stacked { flex-direction: column; align-items: stretch; gap: 0; padding: 13px 15px 10px; }
.kpi.stacked .kpi-spark { flex: none; width: 100%; height: 30px; margin-top: 6px; }
.kpi .kpi-side { flex: none; align-self: center; }
.delta { font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.delta svg { width: 11px; height: 11px; stroke-width: 2.4; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.tabs button { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tabs button:hover { color: var(--text); background: var(--surface); }
.tabs button.on { background: var(--surface); border-color: var(--line-2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.tabs .count { font-size: 10.5px; color: var(--muted); font-weight: 600; background: var(--surface-3); border-radius: 5px; padding: 1px 6px; line-height: 15px; }
.tabs button.on .count { color: var(--primary-text); background: var(--primary-soft); }
.tabs .count.warn { color: var(--danger); background: var(--danger-bg); }
.tabs .add-filter { color: var(--muted); border: 1px dashed var(--line-2); }
.tabs .tabs-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.underline-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.underline-tabs::-webkit-scrollbar { display: none; }
.underline-tabs button { border: 0; background: none; padding: 9px 0; color: var(--muted); font-weight: 500; font-size: 12.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.underline-tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.underline-tabs button:hover { color: var(--text); }
.underline-tabs .count { font-size: 10.5px; background: var(--surface-3); border-radius: 5px; padding: 0 5px; color: var(--muted); font-weight: 600; }
.pill-tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.pill-tabs button { height: 26px; padding: 0 12px; border: 0; background: transparent; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pill-tabs button.on { background: var(--surface-3); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
:root[data-theme="light"] .pill-tabs button.on { background: var(--surface); }

/* Filters bar */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filters .input-icon { flex: 1 1 180px; max-width: 300px; }
.filters .select, .filters .input { height: 30px; font-size: 12px; }
.filters .select { width: auto; min-width: 0; padding-right: 28px; background-position: right 9px center; }
.filters .btn { height: 30px; font-size: 12px; }
.filters .spacer { flex: 1; }
.filters.bare { border: 0; padding: 0; margin-bottom: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; color: var(--text-2); font-weight: 500; }
.filter-chip b { color: var(--text); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); font-size: 11.5px; font-weight: 500; color: var(--primary-text); }
.chip button { width: 16px; height: 16px; border: 0; border-radius: 4px; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; opacity: .8; }
.chip button svg { width: 11px; height: 11px; }
.chip button:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.chip.plain { background: var(--surface-3); border-color: var(--line-2); color: var(--text-2); padding-right: 9px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.view-toggle button { width: 32px; height: 28px; border: 0; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.view-toggle button + button { border-left: 1px solid var(--line-2); }
.view-toggle button.on { background: var(--primary-soft); color: var(--primary-text); }
.view-toggle svg { width: 14px; height: 14px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.bulkbar .sel-count { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.bulkbar .btn-sm { background: var(--surface-2); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
.table th .sort { display: inline-flex; align-items: center; gap: 3px; }
.table th .sort svg { width: 11px; height: 11px; opacity: .6; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 14px; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.table tbody tr.selected td { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.table tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table .w-check { width: 34px; padding-right: 0; }
.table .w-star { width: 30px; padding-right: 0; }
.table .strong { font-weight: 600; }
.table .amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table input[type=checkbox] { width: 14px; height: 14px; margin: 0; vertical-align: middle; }
.table.compact td { padding-top: 7px; padding-bottom: 7px; }
.table .idlink { color: var(--primary-text); font-weight: 600; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main > div { min-width: 0; }
.cell-main > div > b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-main > div > span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two b, .two > span:first-child { display: block; font-weight: 500; white-space: nowrap; }
.two .sub { margin-top: 1px; }
.sub { display: block; font-size: 11px; color: var(--muted); }
.table .sub { white-space: nowrap; }
.dots-btn { width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.dots-btn:hover { background: var(--surface-3); color: var(--text); }
.dots-btn svg { width: 15px; height: 15px; }
.star-btn { width: 22px; height: 22px; border: 0; background: none; color: var(--faint); display: grid; place-items: center; padding: 0; border-radius: 5px; }
.star-btn svg { width: 14px; height: 14px; }
.star-btn:hover { color: var(--text-2); }
.star-btn.on { color: var(--gold); }
.star-btn.on svg { fill: currentColor; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; flex-wrap: wrap; }
.table-foot .tf-right { display: flex; align-items: center; gap: 12px; }
.pager { display: flex; gap: 3px; align-items: center; }
.pager button { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-weight: 600; font-size: 11.5px; display: grid; place-items: center; }
.pager button svg { width: 14px; height: 14px; }
.pager button:hover { background: var(--surface-2); border-color: var(--line); }
.pager button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pager button[disabled] { opacity: .35; pointer-events: none; }
.pager span { padding: 0 3px; color: var(--faint); }

/* Pills, tags, badges */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1; }
.pill svg { width: 11px; height: 11px; stroke-width: 2.3; }
.pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.success { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 18%, transparent); }
.pill.warning { color: var(--warning); background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 18%, transparent); }
.pill.orange { color: var(--orange); background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 18%, transparent); }
.pill.danger { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.pill.info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.pill.neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--line-2); }
.pill.violet { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 20%, transparent); }
.pill.indigo { color: var(--primary-text); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.pill.pink { color: var(--pink); background: var(--pink-bg); border-color: color-mix(in srgb, var(--pink) 20%, transparent); }
.pill.lg { height: 24px; padding: 0 10px; font-size: 11.5px; }
.pill.solid { color: #fff; background: var(--primary); }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.tag.success { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.tag.warning { color: var(--warning); background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.tag.orange { color: var(--orange); background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 22%, transparent); }
.tag.danger { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.tag.info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.tag.violet { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 22%, transparent); }
.tag.neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--line-2); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.badge.red { background: var(--danger); color: #fff; }
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.solid { background: var(--primary); color: #fff; }
.count-bubble { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 600; color: var(--text-2); }
.count-bubble svg { width: 11px; height: 11px; }
.net { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.net i { width: 24px; height: 16px; border-radius: 4px; font: 800 7.5px/16px var(--font); text-align: center; font-style: normal; letter-spacing: .02em; flex: none; }
.net i.MTN { background: #FFCB05; color: #111; }
.net i.AIRTEL { background: #E40000; color: #fff; }
.net i.CASH { background: var(--success-bg); color: var(--success); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-dot.success { color: var(--success); }
.status-dot.warning { color: var(--warning); }
.status-dot.danger { color: var(--danger); }
.status-dot.neutral { color: var(--muted); }
.status-dot .t { color: var(--text); }

/* Avatars */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--font); color: #fff; flex: none; letter-spacing: .02em; position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 60px; height: 60px; font-size: 19px; }
.avatar.sm { width: 22px; height: 22px; font-size: 8.5px; }
.avatar.md { width: 32px; height: 32px; font-size: 11.5px; }
.avatar svg { width: 14px; height: 14px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.lg svg { width: 20px; height: 20px; }
.avatar .on-dot { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -7px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Progress */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.bar.thin { height: 4px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar.green > i { background: var(--success); }
.bar.amber > i { background: var(--c3); }
.bar.red > i { background: var(--danger); }
.bar.teal > i { background: var(--c2); }
.bar.blue > i { background: var(--c4); }
.bar.violet > i { background: var(--c6); }
.bar.grad > i { background: linear-gradient(90deg, #6366F1, #8B5CF6); }
.bar-row { display: flex; align-items: center; gap: 9px; }
.bar-row .bar { flex: 1; }
.bar-row b { font-size: 11.5px; min-width: 32px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .lead { min-width: 30px; text-align: left; }

/* Lists */
.list-rows > * { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-rows > *:last-child { border-bottom: 0; }
.list-rows.tight > * { padding: 7px 0; }
.list-rows .lr-main { flex: 1; min-width: 0; }
.list-rows .lr-main > b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-rows .lr-main > span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-rows .lr-side { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.list-rows .lr-side b { display: block; color: var(--text); font-size: 12px; font-weight: 600; }
.list-rows a:hover .lr-main b { color: var(--primary-text); }
.list-plain > * { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.kv dd .pill { vertical-align: middle; }
.kv.total { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.kv.total dt, .kv.total dd { color: var(--text); font-weight: 700; font-size: 12.5px; }
.legend { display: grid; gap: 9px; }
.legend > div { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 9px; align-items: center; font-size: 12px; }
.legend .lg-name { color: var(--text-2); text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.legend .lg-pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.legend.big > div { font-size: 12.5px; }

/* Charts */
.chart-box { position: relative; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-svg .gridline { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-svg .gridline.base { stroke-dasharray: none; }
.chart-svg .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart-svg .hover-line { stroke: color-mix(in srgb, var(--primary) 55%, transparent); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-callout { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--tip-bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 11px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-md); transition: opacity .12s; }
.chart-callout .cc-title { color: var(--muted); font-size: 10.5px; }
.chart-callout b { display: block; font-size: 13px; font-weight: 700; }
.chart-box.hovering .chart-callout { opacity: 0; }
.chart-tip { position: fixed; z-index: 80; pointer-events: none; background: var(--tip-bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; font-size: 11.5px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s; min-width: 150px; }
.chart-tip.show { opacity: 1; }
.chart-tip .tt-title { color: var(--text); font-weight: 600; font-size: 11.5px; margin-bottom: 5px; }
.chart-tip .tt-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; color: var(--muted); line-height: 1.7; }
.chart-tip .tt-row i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.chart-tip .tt-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.donut-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.donut-wrap.stack { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
.donut-wrap.stack .legend { width: 100%; }
.donut-center { font-weight: 700; letter-spacing: -0.02em; }
.series-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.series-legend span { display: inline-flex; align-items: center; gap: 6px; }
.series-legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.series-legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px) !important; }
.series-legend i.dot { width: 8px; height: 8px; border-radius: 50%; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { height: 24px; padding: 0 10px; border: 0; background: transparent; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
:root[data-theme="light"] .seg button.on { background: var(--surface); }
.hbars { display: grid; gap: 10px; }
.hbars > div { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 11.5px; }
.hbars .hb-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .hb-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbars .hb-track i { display: block; height: 100%; border-radius: 4px; }
.hbars b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* Ring */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; font-weight: 700; font-size: 11.5px; letter-spacing: -0.01em; }

/* Heat map */
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 10.5px; }
.heat th { color: var(--muted); font-weight: 500; text-align: center; padding: 3px; }
.heat th:first-child { text-align: left; }
.heat td { text-align: center; border-radius: 5px; padding: 6px 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat td.lbl { text-align: left; color: var(--text-2); font-weight: 500; background: none !important; white-space: nowrap; padding-left: 0; }

/* Drawer (right detail column) */
.drawer { position: sticky; top: calc(var(--topbar) + 6px); max-height: calc(100vh - var(--topbar) - 22px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
:root[data-theme="light"] .drawer { box-shadow: var(--shadow-sm); }
.drawer-label { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.drawer-label .dl-left { display: flex; align-items: center; gap: 8px; }
.drawer-label svg { width: 14px; height: 14px; color: var(--muted); }
.drawer-head { padding: 16px 16px 14px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.drawer-head .dh-main { flex: 1; min-width: 0; }
.drawer-head h3 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -0.015em; }
.drawer-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.drawer-head .dh-actions { display: flex; gap: 2px; flex: none; margin: -4px -6px 0 0; }
.drawer-head .icon-btn { width: 28px; height: 28px; }
.drawer-close { flex: none; }
.drawer-section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section h4 { font-size: 12.5px; margin-bottom: 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.drawer-section h4 .link { font-weight: 500; }
.drawer-tabs { padding: 0 16px; margin: 0; }
.drawer-tabs.underline-tabs { gap: 16px; margin-bottom: 0; }
.drawer-tabs.underline-tabs button { padding: 10px 0; font-size: 12px; }
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.qa-grid .btn { justify-content: flex-start; height: 32px; font-weight: 500; font-size: 12px; }
.qa-grid .btn svg { color: var(--muted); }
.qa-grid .btn.btn-danger svg { color: var(--danger); }
.qa-icons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.qa-icons button, .qa-icons a { display: grid; justify-items: center; gap: 5px; padding: 9px 4px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 10.5px; font-weight: 500; color: var(--text-2); text-align: center; line-height: 1.2; }
.qa-icons button:hover, .qa-icons a:hover { background: var(--surface-3); color: var(--text); }
.qa-icons svg { width: 15px; height: 15px; color: var(--muted); }
.qa-icons.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.icon-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.icon-actions button, .icon-actions a { display: grid; justify-items: center; gap: 4px; background: none; border: 0; color: var(--muted); font-size: 10.5px; font-weight: 500; padding: 4px; border-radius: 8px; }
.icon-actions button:hover, .icon-actions a:hover { background: var(--surface-2); color: var(--text); }
.icon-actions svg { width: 16px; height: 16px; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-pair .sp-label { font-size: 11px; color: var(--muted); }
.stat-pair .sp-value { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-pair .sp-sub { font-size: 11px; color: var(--muted); }
.stat-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-boxes > div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.stat-boxes .sb-label { font-size: 10.5px; color: var(--muted); }
.stat-boxes .sb-value { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 1px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat-boxes .sb-value small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.stat-boxes .sb-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 11px 12px; }
.mini-card + .mini-card { margin-top: 8px; }
.banner { display: flex; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 11.5px; margin: 12px 16px 0; align-items: flex-start; border: 1px solid transparent; }
.banner svg { width: 15px; height: 15px; margin-top: 1px; }
.banner b { display: block; font-size: 12px; margin-bottom: 1px; }
.banner > div { flex: 1; }
.banner .btn { flex: none; }
.banner.warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.banner.danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.banner.warning > div span, .banner.danger > div span, .banner.info > div span { color: var(--text-2); }
.drawer-empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.drawer-empty svg { width: 30px; height: 30px; color: var(--faint); margin-bottom: 8px; }
.drawer-foot { padding: 10px 16px; font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches span { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: var(--text-2); background: var(--surface-2); }
.tokens { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.tokens span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Activity timeline */
.feed-day { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 12.5px; }
.feed-day span { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.feed-row { display: grid; grid-template-columns: 66px 28px minmax(0, 1.75fr) 92px minmax(0, 1fr) minmax(0, .9fr) 26px; gap: 12px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.feed-row:hover { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.feed-row .time { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-row .time i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.feed-row .time i.read { background: var(--line-2); box-shadow: none; }
.feed-row .what { min-width: 0; }
.feed-row .what b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row .what span { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-row .what .pill { height: 17px; font-size: 10px; padding: 0 6px; vertical-align: 1px; }
.feed-row .tgt b { display: block; font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modal */
.modal { border: 1px solid var(--line-2); padding: 0; border-radius: var(--r-xl); width: min(520px, calc(100vw - 24px)); background: var(--raised); color: var(--text); box-shadow: var(--shadow-lg); }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(4, 6, 12, .62); backdrop-filter: blur(3px); }
.modal form { padding: 20px; }
.modal h2 { font-size: 17px; margin-bottom: 4px; font-weight: 700; }
.modal .sub-text { color: var(--muted); margin: 0 0 16px; font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.error-box { background: var(--danger-bg); color: var(--danger); padding: 9px 11px; border-radius: var(--r-md); margin-bottom: 12px; font-size: 12.5px; border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.script { background: #070A10; color: #D4DCEA; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; font: 11.5px/1.6 var(--mono); white-space: pre; overflow: auto; max-height: 320px; margin: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); background: var(--raised); color: var(--text); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: var(--r-md); font-weight: 500; font-size: 12.5px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); display: flex; gap: 8px; align-items: center; }
.toast svg { color: var(--success); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; border-color: var(--danger); }
.toast.error svg { color: #fff; }

/* Empty + loading */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 12.5px; }
.empty h3 { color: var(--text); font-size: 14.5px; margin-bottom: 5px; }
.empty p { margin: 0 auto 14px; max-width: 44ch; }
.empty.with-img { padding-top: 28px; }
.empty-img { display: block; width: min(260px, 70%); aspect-ratio: 4 / 3; object-fit: cover; margin: 0 auto 16px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--surface-2); }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-lg); border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }

/* ═══════════ Page-specific ═══════════ */
/* Dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 26.5%); gap: var(--gap); align-items: start; }
.dash-left { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); gap: var(--gap); min-width: 0; }
.dash-left > .wide { grid-column: 1 / -1; }
.health-row .hstate { min-width: 0; }
.health-row .hval { font-weight: 600; font-size: 12px; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* Routers */
.site-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.site-cards::-webkit-scrollbar { display: none; }
.site-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: left; min-width: 0; }
.site-card:hover { border-color: var(--line-2); }
.site-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.site-card .sc-text { flex: 1; min-width: 0; }
.site-card .sc-text b { display: block; font-size: 12.5px; font-weight: 600; }
.site-card .sc-text span { display: block; font-size: 11px; color: var(--muted); }
.site-card .sc-text .sc-money { color: var(--text); font-weight: 600; font-size: 12px; margin-top: 3px; }
.site-card .sc-text .status-dot { font-size: 10.5px; margin-top: 4px; }
.scroll-next { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2); box-shadow: var(--shadow-md); }
.scroll-next svg { width: 14px; height: 14px; }

/* Vouchers aging */
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.aging > * { min-width: 0; display: block; }
.aging .ag-label { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aging .ag-label small { display: block; font-size: 10.5px; color: var(--faint); }
.aging .ag-value { font-size: 17px; font-weight: 700; margin: 3px 0 8px; display: flex; justify-content: space-between; align-items: baseline; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.aging .ag-value span { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* Security */
.score-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.score-legend > div { grid-template-columns: 8px minmax(0, 1fr) auto; font-size: 11.5px; }
.sec-top { grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr)); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.sec-grid-2 { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); gap: var(--gap); }
.metric-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.metric-card .mc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.metric-card .mc-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.metric-card .mc-value { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; display: flex; align-items: baseline; gap: 6px; }
.metric-card .mc-value small { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.metric-card .mc-foot { font-size: 10.5px; color: var(--muted); }
.metric-card .bar { margin-top: 10px; }
.metric-card .link { margin-top: 10px; }
.insight { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.insight > div > b { display: block; font-size: 12.5px; font-weight: 600; }
.insight > div > span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.steps-list { display: grid; gap: 12px; }
.steps-list > div { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.steps-list .sn { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; border: 1.5px solid var(--line-2); color: var(--muted); }
.steps-list .sn svg { width: 11px; height: 11px; stroke-width: 3; }
.steps-list .sn.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps-list b { display: block; font-size: 12.5px; font-weight: 600; }
.steps-list span { display: block; font-size: 11px; color: var(--muted); }
.steps-list a:hover b { color: var(--primary-text); }

/* Settings */
.plan-card { padding: 16px; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 100% 0%, #5B4CF0 0%, #3A2C9E 38%, #1C1650 100%); color: #fff; border: 1px solid rgba(139, 124, 255, .35); position: relative; overflow: hidden; }
.plan-card::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(167, 139, 250, .35), transparent); pointer-events: none; }
.plan-card .muted { color: #C9C4FF; }
.plan-card .bar { background: rgba(255, 255, 255, .16); }
.plan-card .bar > i { background: linear-gradient(90deg, #A5B4FC, #fff); }
.plan-card .pc-row { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; }
.plan-card .pc-link { display: flex; justify-content: center; gap: 6px; margin-top: 14px; font-size: 11.5px; font-weight: 600; color: #fff; position: relative; z-index: 1; }
.plan-card .pc-link:hover { text-decoration: underline; }
.pref-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: 0; }
.pref-row .pr-main { flex: 1; min-width: 0; }
.pref-row .pr-main b { display: block; font-size: 12.5px; font-weight: 600; }
.pref-row .pr-main span { display: block; font-size: 11px; color: var(--muted); }
.pref-row .select { width: auto; min-width: 140px; height: 30px; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .95fr); gap: var(--gap); align-items: start; }
.settings-grid > .col { display: grid; gap: var(--gap); min-width: 0; align-content: start; }
.profile-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.profile-id { display: grid; justify-items: start; gap: 6px; align-content: start; }
.profile-id .avatar { position: relative; }
.profile-id b { font-size: 13.5px; font-weight: 700; }
.profile-id .sub { font-size: 11px; }
.save-note { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line); }
.save-note svg { width: 13px; height: 13px; color: var(--success); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone .card-head h3 { color: var(--danger); }

/* Reports builder */
.report-layout { display: grid; grid-template-columns: 210px 170px minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.rb-col { min-width: 0; }
.rb-col .underline-tabs { margin-bottom: 10px; }
.rb-col .rb-hint { font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.tpl { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; display: block; width: 100%; text-align: left; margin-bottom: 8px; transition: border-color .12s; }
.tpl:hover { border-color: var(--line-2); }
.tpl.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tpl b { display: block; font-size: 12.5px; font-weight: 600; }
.tpl > span { display: block; font-size: 10.5px; color: var(--muted); margin: 2px 0 8px; line-height: 1.35; }
.tpl .thumb { border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); padding: 7px; }
.tpl .tpl-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 10.5px; color: var(--faint); }
.module { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 5px; font-size: 12px; font-weight: 500; cursor: pointer; width: 100%; text-align: left; color: var(--text-2); }
.module:hover { border-color: var(--line-2); color: var(--text); }
.module svg { width: 14px; height: 14px; color: var(--muted); }
.module .mod-state { margin-left: auto; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.module .mod-state svg { width: 10px; height: 10px; color: #fff; stroke-width: 3; opacity: 0; }
.module.on .mod-state svg { opacity: 1; }
.canvas .donut-wrap { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
.canvas .donut-wrap .legend { width: 100%; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.mini-kpis .mini-card { margin: 0; padding: 10px 12px 8px; }
.mini-kpis .mk-value { font-weight: 700; font-size: 16px; letter-spacing: -.02em; margin: 2px 0 1px; white-space: nowrap; }
.mini-kpis .mk-value small { font-size: 10.5px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.mini-kpis [data-spark] { height: 24px; margin-top: 4px; }
.module.on { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); color: var(--text); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.module.on > svg:first-child { color: var(--primary-text); }
.module.on .mod-state { background: var(--primary); border-color: var(--primary); }
.module[disabled] { opacity: .45; cursor: not-allowed; }
.rb-section { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 14px 0 8px; }
.canvas { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 12px; }
.canvas .card { background: var(--surface); }
.canvas-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.canvas-grid { display: grid; gap: 12px; }
.canvas-grid.l2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.canvas-grid.l3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.canvas-grid.lleft { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.canvas-grid.lright { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.canvas-drop { border: 1px dashed var(--line-2); border-radius: 10px; padding: 14px; text-align: center; color: var(--faint); font-size: 11.5px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.audience { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; }
.audience .select { width: auto; height: 26px; font-size: 11px; margin-left: auto; padding-right: 24px; background-position: right 7px center; }
.method-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 12px; }
.method-row .mr-name { flex: 1; font-weight: 500; }
.method-row .select { width: auto; height: 26px; font-size: 11px; padding-right: 24px; background-position: right 7px center; }

/* Integrations */
.integration-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.istat { display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 128px; }
.istat > div > b { display: block; font-size: 16px; font-weight: 700; line-height: 1.15; }
.istat > div > span { display: block; font-size: 10.5px; color: var(--muted); }
.istat > div > small { display: block; font-size: 10.5px; color: var(--muted); }
.logo-tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font: 800 10px var(--font); flex: none; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.logo-tile.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 13px; }

/* Router brands */
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
.vendor-card { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.vendor-card:hover { border-color: var(--line-2); }
.vendor-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.vendor-card input { position: absolute; opacity: 0; pointer-events: none; }
.vendor-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.vendor-card .vc-text { min-width: 0; }
.vendor-card .vc-text b { display: block; font-size: 12.5px; font-weight: 600; }
.vendor-card .vc-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 10.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.vendor-note { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px 10px; margin: 0 0 14px; }
.vendor-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--primary-text); }
.modal .sub-text:has(.logo-tile), .modal .sub-text:has(.dev-thumb) { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.setup-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 14px; }
.setup-steps > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.setup-steps .sn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); }
.setup-steps b { display: block; font-size: 13px; font-weight: 600; margin-top: 3px; }
.setup-steps p { margin: 3px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.code-block { position: relative; margin-top: 8px; }
.code-block .script { max-height: 240px; padding-right: 70px; }
.code-block .btn { position: absolute; top: 8px; right: 8px; }
.code-line { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); min-width: 0; }
.code-line { flex-wrap: wrap; }
.code-line .mono { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font-size: 11.5px; }
.test-result { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 9px 11px; border-radius: 8px; font-size: 12px; background: var(--surface-2); color: var(--text-2); }
.test-result svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.test-result.ok { background: var(--success-bg); color: var(--success); }
.test-result.warn { background: var(--warning-bg); color: var(--warning); }
.test-result.bad { background: var(--danger-bg); color: var(--danger); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.env-toggle { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.env-toggle span { padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.env-toggle span.on { background: var(--success-bg); color: var(--success); font-weight: 600; }

/* Grid view cards (customers / bundles) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 14px; }
.gcard { border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); padding: 14px; cursor: pointer; display: grid; gap: 10px; text-align: left; min-width: 0; }
.gcard:hover { border-color: var(--line-2); }
.gcard.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.gcard .gc-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.gcard .gc-top > div { min-width: 0; flex: 1; }
.gcard .gc-top b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .gc-top span { display: block; font-size: 11px; color: var(--muted); }
.gcard .gc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; color: var(--muted); }
.gcard .gc-stats b { display: block; color: var(--text); font-size: 13px; font-weight: 700; }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1700px) {
  .sec-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sec-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 1500px) {
  :root { --drawer: 320px; }
  .sec-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .report-layout { grid-template-columns: 190px minmax(0, 1fr) 270px; }
  .report-layout .modules-col { display: none; }
  .settings-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .settings-grid > .col:last-child { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .kpi { padding: 13px 14px; gap: 11px; }
}
@media (max-width: 1440px) {
  .dash .donut-wrap { grid-template-columns: 1fr; justify-items: center; gap: 12px; }
  .dash .donut-wrap .legend { width: 100%; }
}
@media (max-width: 1440px) {
  .rail > .page-actions .btn .lbl { display: none; }
  .rail > .page-actions .btn:last-child .lbl { display: inline; }
}
@media (max-width: 1320px) {
  .rail > .page-actions .btn .lbl { display: inline; }
  .split-a { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split-a > :first-child { grid-column: 1 / -1; }
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash > .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail-layout { grid-template-columns: minmax(0, 1fr); }
  .rail-layout > .rail { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1240px) {
  .workspace.has-drawer { grid-template-columns: minmax(0, 1fr); }
  .drawer { position: fixed; top: 0; right: 0; bottom: 0; max-height: none; width: min(400px, 100vw); border-radius: 0; z-index: 60; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s ease; }
  .drawer.open { transform: none; }
  .drawer-scrim { position: fixed; inset: 0; background: rgba(4, 6, 12, .55); z-index: 55; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-b, .split-c { grid-template-columns: minmax(0, 1fr); }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .sec-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(4, 6, 12, .55); z-index: 25; }
  .icon-btn.menu-btn { display: grid; }
  .crumb { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .search { flex: 1; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .user-btn .ub-text { display: none; }
  .workspace { padding: 6px 14px 16px; }
  .footer { padding: 6px 14px 18px; flex-direction: column; }
  .split-a, .cols-2, .cols-3, .dash-left, .dash > .rail, .sec-top, .sec-grid { grid-template-columns: minmax(0, 1fr); }
  .split-a > :first-child, .sec-grid > :first-child { grid-column: auto; }
  .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aging { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 19px; }
  .feed-row { grid-template-columns: 56px 26px minmax(0, 1fr) 26px; }
  .feed-row .hide-sm { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .canvas-grid.l2, .canvas-grid.l3, .canvas-grid.lleft, .canvas-grid.lright { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cols-4 > .kpi:last-child:nth-child(odd), .cols-5 > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 12px; gap: 10px; min-height: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .donut-wrap .legend { width: 100%; }
  .page-actions .btn .lbl { display: none; }
  .page-actions .btn { padding: 0 10px; }
  .table .hide-sm, .list-rows .hide-sm { display: none; }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  .table th:last-child, .table td:last-child { padding-right: 10px; }
  .table .cell-main > div { max-width: 150px; }
  .table .cell-main > div > span, .table .sub { white-space: normal; }
  .feed-row .what b, .feed-row .what span { white-space: normal; }
  .table .cell-main { gap: 8px; }
  .filters .select { flex: 1 1 120px; }
  .score-card { grid-template-columns: 1fr; justify-items: center; }
  .icon-btn.theme { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #F7F8FA; --surface-3: #EEF0F4; --line: #E3E6EC; --line-2: #D5D9E1; --text: #111; --text-2: #333; --muted: #667; --faint: #99A; color-scheme: light; }
  .report-layout > :not(.canvas) { display: none !important; }
  .report-layout { display: block; }
  body { background: #fff; }
  .sidebar, .topbar, .drawer, .footer, .page-actions, .filters, .tabs { display: none !important; }
  .shell { display: block; }
}

/* Lists inside narrow cards drop their secondary column (container queries) */
.sec-grid > .card { container-type: inline-size; }
@container (max-width: 470px) { .hide-narrow { display: none !important; } }

/* Donut + legend stack vertically when their card is narrow */
.card-body.center, .card-body:has(> .donut-wrap) { container-type: inline-size; }
@container (max-width: 330px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; gap: 12px; } .donut-wrap .legend { width: 100%; } }

/* ── WiFi login page editor (Settings › WiFi Login Page) ── */
.portal-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.pe-main { display: grid; gap: var(--gap); min-width: 0; }
.pe-preview { min-width: 0; position: sticky; top: 76px; }
.pe-sticky { display: grid; gap: 10px; justify-items: center; }
.pe-label { display: flex; align-items: center; gap: 8px; font-size: 12px; width: 100%; flex-wrap: wrap; }
.pe-label .muted { font-size: 11px; margin-left: auto; }
.phone { width: 100%; max-width: 340px; aspect-ratio: 9 / 18.5; max-height: calc(100vh - 170px); min-height: 460px; border-radius: 34px; padding: 10px; background: linear-gradient(160deg, #2A3142, #0D1018); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 24px 60px -24px rgba(0, 0, 0, .7); position: relative; }
.phone::before { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 84px; height: 20px; border-radius: 12px; background: #05070B; z-index: 2; }
.phone { overflow: hidden; }
.phone iframe { width: 390px; height: 100%; border: 0; border-radius: 26px; background: #fff; display: block; transform-origin: 0 0; }
.phone.tablet { max-width: 100%; aspect-ratio: 3 / 4; border-radius: 22px; }
.phone.tablet::before { display: none; }
.tpl-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tp { position: relative; display: block; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.tp:hover { border-color: var(--line-2); }
.tp.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tp input, .bp input { position: absolute; opacity: 0; pointer-events: none; }
.tp:has(input:focus-visible), .bp:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tp > b { display: block; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.tp > span:last-child { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.tp-art { display: grid; gap: 4px; padding: 7px; border-radius: 8px; height: 92px; align-content: start; overflow: hidden; }
.tp-art i { display: block; border-radius: 4px; }
.tp-art .a { height: 9px; width: 55%; }
.tp-art .b { height: 30px; }
.tp-art .c { height: 9px; }
.tp-art.classic { background: #F4F6FA; border: 1px solid #E2E6EE; }
.tp-art.classic .a { background: #16A34A; }
.tp-art.classic .b { background: linear-gradient(120deg, #0F5132, #16A34A 60%, #F59E0B); }
.tp-art.classic .c { background: #fff; border: 1px solid #E2E6EE; box-shadow: inset -14px 0 0 #F59E0B; }
.tp-art.midnight { background: #0B0F1A; border: 1px solid #1E2536; }
.tp-art.midnight .a { background: #8B7CFF; }
.tp-art.midnight .b { background: linear-gradient(120deg, #312E81, #6D28D9); }
.tp-art.midnight .c { background: #161C2B; box-shadow: inset -14px 0 0 #F59E0B; }
.tp-art.photo { background: linear-gradient(rgba(10, 12, 20, .35), rgba(10, 12, 20, .75)), url('/assets/portal/banners/friends-thumb.jpg') center / cover; }
.tp-art.photo .a { background: #fff; }
.tp-art.photo .b { background: rgba(255, 255, 255, .18); backdrop-filter: blur(2px); }
.tp-art.photo .c { background: rgba(255, 255, 255, .9); box-shadow: inset -14px 0 0 #F59E0B; }
.logo-pick { display: flex; gap: 12px; align-items: center; }
.lp-img { width: 56px; height: 56px; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--faint); }
.lp-img img { width: 100%; height: 100%; object-fit: contain; }
.lp-img svg { width: 22px; height: 22px; }
.lp-actions { display: grid; gap: 6px; min-width: 0; }
.color-field { display: flex; gap: 6px; }
.color-field input[type=color] { width: 36px; height: 34px; flex: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; background: var(--surface-2); cursor: pointer; }
.color-field .input { min-width: 0; text-transform: uppercase; }
.banner-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.bp { position: relative; display: grid; gap: 5px; padding: 5px 5px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: inherit; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.bp[hidden] { display: none; }
.bp:hover { border-color: var(--line-2); }
.bp.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.bp img, .bp .bp-none { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.bp .bp-none svg { width: 18px; height: 18px; }
.bp > span:last-child { font-size: 10.5px; font-weight: 500; color: var(--text-2); padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-up { border-style: dashed; }
.bp-up:disabled { opacity: .55; cursor: wait; }
@media (max-width: 1180px) { .portal-editor { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 960px) {
  .portal-editor { grid-template-columns: minmax(0, 1fr); }
  .pe-preview { position: static; order: -1; }
  .phone { max-width: 290px; min-height: 0; max-height: 540px; }
}
@media (max-width: 560px) { .tpl-pick { grid-template-columns: minmax(0, 1fr); } .tp-art { height: 70px; } }
.photo-actions { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 4px; }

/* Report template cards: live figures for the last 30 days */
.tpl .tpl-data { display: grid; gap: 6px; padding: 8px 9px; min-width: 0; container-type: inline-size; }
.td-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; min-width: 0; }
.td-l { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl .td-v { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tpl .td-v small { font-size: 9.5px; font-weight: 600; color: var(--muted); margin-right: 3px; letter-spacing: 0; }
.td-d { font-size: 10.5px; flex: none; }
.td-d .delta svg { width: 10px; height: 10px; }
.td-spark { display: block; }
.td-stats { display: grid; grid-auto-flow: column; justify-content: space-between; gap: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.tpl .td-stats b { display: block; font-size: 12.5px; color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.td-split { display: flex; gap: 2px; height: 6px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.td-split i { display: block; min-width: 3px; }
.td-legend, .td-grid { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 10px; color: var(--text-2); }
.td-legend i, .td-grid i, .td-ledger i { display: inline-block; width: 6px; height: 6px; border-radius: 2px; margin-right: 4px; vertical-align: 1px; }
.td-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.td-grid span { display: flex; align-items: center; min-width: 0; }
.tpl .td-grid b { display: inline; font-size: 10px; margin-left: auto; padding-left: 5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.td-bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.td-bars i { flex: 1; border-radius: 2px 2px 0 0; opacity: .85; min-width: 0; }
.td-bars i:last-child { opacity: 1; filter: brightness(1.15); }
.td-axis { display: flex; justify-content: space-between; font-size: 9px; color: var(--faint); margin-top: -3px; }
.td-ledger { display: grid; gap: 4px; }
.td-ledger > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; align-items: center; font-size: 10px; color: var(--text-2); padding: 3px 0; border-bottom: 1px dashed var(--line); }
.td-ledger > div:last-child { border-bottom: 0; }
.td-ledger i { margin: 0; }
.tpl .td-ledger b { font-size: 11px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.td-hbars { display: grid; gap: 5px; }
.td-hbars > div { display: grid; grid-template-columns: minmax(0, 72px) minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 10px; color: var(--text-2); }
.td-track { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.td-track i { display: block; height: 100%; border-radius: 4px; }
.tpl .td-hbars b { font-size: 10.5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.td-tag { font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--muted); }
@container (max-width: 175px) { .td-tag { display: none; } .tpl .td-stats b { font-size: 11.5px; } .tpl .td-v { font-size: 15px; } }

/* ── Real images: brand logos, hardware photos ── */
.glyph { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--g) center / contain no-repeat; mask: var(--g) center / contain no-repeat; }
.logo-tile .glyph { width: 58%; height: 58%; color: #fff; }
.dev-thumb { position: relative; width: 36px; height: 36px; flex: none; display: inline-block; }
.dev-thumb > img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.dev-badge { position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; border-radius: 5px; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.dev-badge .glyph, .dev-badge svg { width: 10px; height: 10px; color: #fff; }
.dev-thumb.lg { width: 52px; height: 52px; }
.dev-thumb.lg > img { border-radius: 11px; }
.dev-thumb.lg .dev-badge { width: 21px; height: 21px; border-radius: 6px; }
.dev-thumb.lg .dev-badge .glyph, .dev-thumb.lg .dev-badge svg { width: 12px; height: 12px; }
.dev-thumb.xl { width: 56px; height: 56px; }
.dev-thumb.xl > img { border-radius: 13px; }
.dev-thumb.xl .dev-badge { width: 22px; height: 22px; border-radius: 6px; }
.dev-thumb.xl .dev-badge .glyph, .dev-thumb.xl .dev-badge svg { width: 12px; height: 12px; }
.vendor-card { align-items: center; }
.vendor-card .dev-thumb { margin: 2px 4px 2px 0; }
.dev-hero { margin: 0 0 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.dev-hero img { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 220px; object-fit: cover; }
.dev-hero figcaption { display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-size: 11px; color: var(--muted); }
.dev-hero figcaption b { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.dev-hero figcaption .logo-tile { width: 28px; height: 28px; }
.logo-tile.img { padding: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.logo-tile.img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Dashboard: getting started */
.start-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); overflow: hidden; margin-bottom: var(--gap); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%), var(--surface); }
.start-card .sc-body { padding: 18px 20px; min-width: 0; }
.start-card h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 2px; }
.start-card .sub { margin: 0 0 12px; }
.sc-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.sc-steps a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; transition: border-color .12s; }
.sc-steps a:hover { border-color: var(--primary); }
.sc-steps .sn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 10.5px; font-weight: 700; border: 1.5px solid var(--line-2); color: var(--muted); }
.sc-steps .sn svg { width: 12px; height: 12px; stroke-width: 3; }
.sc-steps a.done .sn { background: var(--success); border-color: var(--success); color: #fff; }
.sc-steps a.done .st b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.sc-steps .st { flex: 1; min-width: 0; }
.sc-steps .st b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-steps .st span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-steps a > svg { width: 14px; height: 14px; flex: none; }
.start-card .sc-photo { position: relative; min-height: 180px; }
.start-card .sc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; -webkit-mask-image: linear-gradient(to right, transparent, #000 28%); mask-image: linear-gradient(to right, transparent, #000 28%); }
.start-card .sc-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(6px); z-index: 1; }
@media (max-width: 760px) { .start-card { grid-template-columns: minmax(0, 1fr); } .start-card .sc-photo { display: none; } }
.list-rows .lr-side .status-dot { font-size: 10.5px; }
.list-rows a .lr-side { display: grid; justify-items: end; gap: 1px; font-size: 11px; color: var(--muted); }
.list-rows a .lr-side b { font-size: 13px; color: var(--text); }
.canvas-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 2px; }
.rail .empty-img, .card-body .list-rows + .empty .empty-img { width: min(170px, 60%); }
.rail .empty.with-img { padding: 14px 8px 18px; }

/* ── Plans & Billing ── */
.bill-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); overflow: hidden; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%), var(--surface); }
.bill-hero .bh-main { padding: 18px 20px; min-width: 0; }
.bill-hero .bh-top { display: flex; align-items: center; gap: 12px; }
.bill-hero .bh-top h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 1px 0 0; }
.bh-price { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 2px; }
.bh-price b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bh-price b small { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; letter-spacing: 0; }
.bh-price span { color: var(--muted); font-size: 12.5px; }
.bh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.bill-hero .bh-usage { padding: 18px 20px; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.bh-usage h4 { font-size: 12.5px; margin: 0 0 12px; }
.bh-usage .ub { margin-bottom: 12px; }
.ub-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-2); margin-bottom: 5px; }
.ub-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.bill-alert { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; font-size: 12.5px; }
.bill-alert > svg { width: 17px; height: 17px; flex: none; }
.bill-alert > div { flex: 1; min-width: 0; }
.bill-alert b { display: block; font-weight: 650; }
.bill-alert span { display: block; color: var(--text-2); font-size: 12px; margin-top: 1px; }
.bill-alert.warn { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.bill-alert.warn > svg { color: var(--warning); }
.bill-alert.bad { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.bill-alert.bad > svg { color: var(--danger); }
.bill-alert.info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); margin: 12px 0 0; }
.bill-alert.info > svg { color: var(--primary-text); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-opt { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.plan-opt.popular { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan-opt.current { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
.plan-opt .po-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-opt .po-head h3 { font-size: 15px; margin: 0 auto 0 0; }
.plan-opt .po-price { display: flex; align-items: baseline; gap: 5px; }
.plan-opt .po-price b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-opt .po-price b small { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 3px; letter-spacing: 0; }
.plan-opt .po-price span { color: var(--muted); font-size: 12px; }
.plan-opt .list-plain { flex: 1; }
.quote { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.q-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.q-row:last-child { border-bottom: 0; }
.q-row > span { min-width: 0; }
.q-row > span b { display: block; font-weight: 600; }
.q-row > span span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.q-row > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-row.credit > b { color: var(--success); }
.q-row.total { background: var(--surface-2); }
.q-row.total > b, .q-row.total > span b { font-size: 14px; font-weight: 800; }
.phone-field { position: relative; }
.phone-field .input { padding-right: 130px; }
.phone-field > span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11.5px; }
.pay-state { text-align: center; padding: 18px 6px 4px; }
.pay-state .ps-ic svg { width: 44px; height: 44px; }
.pay-state.ok .ps-ic { color: var(--success); }
.pay-state.bad .ps-ic { color: var(--danger); }
.pay-state h2 { font-size: 18px; margin: 12px 0 6px; }
.pay-state p { color: var(--text-2); font-size: 13px; margin: 0 auto 8px; max-width: 42ch; }
.spinner.lg { width: 42px; height: 42px; border-width: 3px; }
#sub-banner { grid-column: 1 / -1; min-width: 0; }
#sub-banner:empty { display: none; }
.sub-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0; border-radius: 12px; font-size: 12.5px; border: 1px solid; }
.sub-banner > svg { width: 17px; height: 17px; flex: none; }
.sub-banner > span { flex: 1; min-width: 0; }
.sub-banner.warn { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.sub-banner.warn > svg { color: var(--warning); }
.sub-banner.bad { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.sub-banner.bad > svg { color: var(--danger); }
.upgrade.past_due .up-chip { background: var(--warning-bg); color: var(--warning); }
.upgrade.suspended .up-chip { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .bill-hero { grid-template-columns: minmax(0, 1fr); } .bill-hero .bh-usage { border-left: 0; border-top: 1px solid var(--line); } .sub-banner { flex-wrap: wrap; } }
.bill-plans .card-head { flex-wrap: wrap; gap: 10px; }
#cycle-seg button { white-space: nowrap; }
.bill-hist .fail-why { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .bill-hist .btn .lbl { display: none; } .bill-hist .btn { padding: 0 8px; } }
/* Phones: long names and emails in table cells truncate instead of widening the table */
@media (max-width: 560px) { .table .cell-main > div { max-width: 130px; } .table .cell-main > div > span { white-space: normal; overflow-wrap: anywhere; } }
