:root {
  color-scheme: dark;
  --color-primary: #d97706;
  --color-primary-strong: #f59e0b;
  --color-on-primary: #fff;
  --color-accent: #6366f1;
  --color-background: #0b1120;
  --color-background-raised: #101827;
  --color-sidebar: #0d1422;
  --color-surface: #131d2d;
  --color-surface-soft: #182437;
  --color-surface-hover: #1c2940;
  --color-foreground: #f8fafc;
  --color-text: #e6edf6;
  --color-muted: #9aa9bc;
  --color-faint: #718096;
  --color-border: rgba(255,255,255,.09);
  --color-border-strong: rgba(255,255,255,.15);
  --color-success: #22c98b;
  --color-warning: #f4b740;
  --color-danger: #f0525d;
  --color-danger-soft: rgba(240,82,93,.12);
  --color-ring: #f59e0b;
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.14);
  --shadow-md: 0 10px 28px rgba(0,0,0,.18);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.28);
  --ease: cubic-bezier(.2,.8,.2,1);
  --sidebar-width: 248px;
  --z-nav: 20;
  --z-alert: 30;
  --z-toast: 50;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --color-background: #f4f6fa;
  --color-background-raised: #fff;
  --color-sidebar: #fff;
  --color-surface: #fff;
  --color-surface-soft: #f5f7fb;
  --color-surface-hover: #eef2f8;
  --color-foreground: #111827;
  --color-text: #253044;
  --color-muted: #59677a;
  --color-faint: #78859a;
  --color-border: rgba(15,23,42,.10);
  --color-border-strong: rgba(15,23,42,.17);
  --color-danger-soft: rgba(220,38,38,.08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 10px 30px rgba(15,23,42,.07);
  --shadow-lg: 0 25px 60px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--color-background); scroll-behavior: smooth; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; min-height: 100dvh; overflow-x: clip; background: var(--color-background); color: var(--color-text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .52; }
svg { display: block; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--color-muted); }
.support-text { font-size: .75rem; }
.skip-link { position: fixed; left: 16px; top: -64px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--color-primary-strong); color: #1d1102; font-weight: 800; transition: top 180ms var(--ease); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 3px; }

.eyebrow { margin: 0 0 5px; color: var(--color-primary-strong); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { overflow-wrap: break-word; }
h1 { margin: 0; color: var(--color-foreground); font-size: clamp(1.65rem, 2.4vw, 2.15rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0; color: var(--color-foreground); font-size: .98rem; line-height: 1.35; letter-spacing: -.01em; }
.page-subtitle { margin: 8px 0 0; color: var(--color-muted); font-size: .86rem; }

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-lockup > div { display: grid; min-width: 0; }
.brand-lockup strong { color: var(--color-foreground); font-size: .93rem; letter-spacing: -.015em; }
.brand-lockup small { color: var(--color-muted); font-size: .65rem; }
.brand-mark { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(245,158,11,.38); border-radius: 13px; background: linear-gradient(145deg,#fbbf24,#d97706); box-shadow: 0 8px 25px rgba(217,119,6,.22), inset 0 1px rgba(255,255,255,.3); color: #241304; font-size: 1.15rem; font-weight: 900; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }

/* Login */
.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 1.1fr) minmax(420px, .9fr); background: var(--color-background); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(40px,7vw,100px); background: radial-gradient(circle at 70% 25%,rgba(99,102,241,.28),transparent 34%), radial-gradient(circle at 20% 80%,rgba(217,119,6,.18),transparent 30%), #0b1120; }
.login-visual:before { content:""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.13) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.13) 1px,transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to bottom,transparent,black 18%,black 75%,transparent); }
.login-visual-copy { position: relative; z-index: 1; max-width: 580px; }
.signal-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.06); color: #d9e4f2; font-size: .75rem; backdrop-filter: blur(10px); }
.signal-chip span { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 13px #34d399; }
.login-visual h2 { margin: 24px 0 15px; color: #fff; font-size: clamp(2.7rem,5.2vw,5.4rem); font-weight: 750; line-height: .99; letter-spacing: -.065em; }
.login-visual-copy p { color: #a9b8ca; font-size: 1rem; }
.preview-orbit { position: relative; z-index: 1; width: 300px; height: 230px; margin: 48px auto 0; }
.preview-ring { position: absolute; inset: 12px auto auto 52px; width: 175px; aspect-ratio: 1; display: grid; place-content: center; border-radius: 50%; background: radial-gradient(circle,#111a2b 55%,transparent 56%), conic-gradient(#f59e0b 72.4%,rgba(255,255,255,.12) 0); box-shadow: 0 30px 80px rgba(0,0,0,.38); text-align: center; }
.preview-ring strong { color: #fff; font-size: 2.65rem; font-variant-numeric: tabular-nums; line-height: 1; }
.preview-ring span { margin-top: 5px; color: #a9b8ca; font-size: .72rem; }
.preview-pill { position: absolute; padding: 9px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(17,26,43,.9); box-shadow: var(--shadow-md); color: #e6edf6; font-size: .72rem; }
.preview-pill.one { right: 0; top: 12px; }
.preview-pill.two { left: 0; bottom: 16px; }
.login-panel { display: grid; place-items: center; padding: 38px; background: var(--color-background-raised); }
.login-card { width: min(420px,100%); }
.login-card > .brand-lockup { margin-bottom: clamp(50px,8vh,90px); }
.login-heading { margin-bottom: 28px; }
.login-heading h1 { font-size: 2rem; }
.login-heading > p:last-child { margin: 11px 0 0; color: var(--color-muted); font-size: .88rem; }
.login-card form { display: grid; }
label { margin: 0 0 7px; color: var(--color-text); font-size: .78rem; font-weight: 680; }
input, textarea { width: 100%; min-height: 46px; border: 1px solid var(--color-border-strong); border-radius: 10px; background: var(--color-surface-soft); color: var(--color-foreground); padding: 11px 13px; outline: none; transition: border-color 180ms var(--ease),box-shadow 180ms var(--ease),background 180ms var(--ease); }
input { margin-bottom: 18px; }
input:hover, textarea:hover { border-color: color-mix(in srgb,var(--color-primary) 38%,var(--color-border-strong)); }
input:focus, textarea:focus { border-color: var(--color-primary-strong); box-shadow: 0 0 0 3px rgba(245,158,11,.14); background: var(--color-surface); }
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.primary, .secondary, .ghost, .icon-button, .nav-button, .mobile-nav-button, .delete-note, .member-action { cursor: pointer; transition: background 180ms var(--ease),color 180ms var(--ease),border-color 180ms var(--ease),opacity 180ms var(--ease),box-shadow 180ms var(--ease),transform 180ms var(--ease); }
.primary, .secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font-weight: 760; }
.primary { border: 1px solid #f59e0b; background: linear-gradient(135deg,#f59e0b,#d97706); color: #211203; box-shadow: 0 8px 20px rgba(217,119,6,.18); }
.primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 10px 28px rgba(217,119,6,.28); }
.primary:active:not(:disabled),.secondary:active:not(:disabled),.icon-button:active:not(:disabled) { transform: scale(.97); }
.primary.compact { width: auto; }
.button-content { justify-content: space-between; margin-top: 5px; width: 100%; padding-inline: 17px; }
.button-arrow { font-size: 1.2rem; }
.secondary { border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); }
.secondary:hover:not(:disabled) { background: var(--color-surface-hover); border-color: var(--color-primary); }
.secondary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form-error { min-height: 22px; margin: 9px 0 0; color: var(--color-danger); font-size: .78rem; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 24px 0 0; color: var(--color-muted); font-size: .7rem; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); }

/* App shell */
.app { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: var(--z-nav); width: var(--sidebar-width); display: flex; flex-direction: column; padding: 22px 16px 16px; border-right: 1px solid var(--color-border); background: var(--color-sidebar); }
.sidebar-brand { padding: 0 8px 21px; border-bottom: 1px solid var(--color-border); }
.primary-nav { display: grid; gap: 6px; margin-top: 21px; }
.nav-button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; padding: 0 13px; background: transparent; color: var(--color-muted); text-align: left; font-size: .82rem; font-weight: 660; }
.nav-button svg,.icon-button svg,.mobile-nav-button svg,.alert-icon svg,.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-button:first-child svg { fill: currentColor; stroke: none; }
.nav-button:hover { background: var(--color-surface-soft); color: var(--color-foreground); }
.nav-button.active { background: linear-gradient(90deg,rgba(217,119,6,.16),rgba(217,119,6,.05)); box-shadow: inset 3px 0 var(--color-primary-strong); color: var(--color-primary-strong); }
.sidebar-status { margin-top: auto; padding: 16px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-soft); }
.sidebar-status > div { display: flex; align-items: center; gap: 10px; }
.sidebar-status > div > div { display: grid; }
.sidebar-status strong { color: var(--color-text); font-size: .72rem; }
.sidebar-status small { color: var(--color-muted); font-size: .62rem; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 13px 7px 0; border-top: 1px solid var(--color-border); }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: rgba(99,102,241,.16); color: #a5b4fc; font-size: .75rem; font-weight: 800; }
.user-details { min-width: 0; flex: 1; display: grid; }
.user-details strong { overflow: hidden; color: var(--color-foreground); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.user-details small { color: var(--color-muted); font-size: .62rem; }
.icon-button { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-soft); color: var(--color-muted); }
.icon-button:hover { border-color: var(--color-border-strong); background: var(--color-surface-hover); color: var(--color-foreground); }
.sidebar-footer .icon-button { width: 38px; height: 38px; border-color: transparent; background: transparent; }
.mobile-topbar,.mobile-nav { display: none; }
.content { min-height: 100dvh; margin-left: var(--sidebar-width); padding: 32px clamp(20px,3vw,44px) 64px; background: radial-gradient(circle at 12% 0,rgba(217,119,6,.055),transparent 22%),var(--color-background); }
.page { width: min(1500px,100%); margin: 0 auto; animation: page-in 260ms var(--ease) both; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.heading-actions { display: flex; align-items: center; gap: 11px; }
.refresh { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-muted); font-size: .72rem; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 10px color-mix(in srgb,var(--color-success) 70%,transparent); }
.global-alert { position: sticky; top: 0; z-index: var(--z-alert); min-height: 56px; margin-left: var(--sidebar-width); display: flex; align-items: center; justify-content: center; gap: 11px; padding: 9px 22px; border-bottom: 1px solid rgba(240,82,93,.45); background: color-mix(in srgb,var(--color-danger) 86%,#3b0a0f); color: #fff; box-shadow: 0 10px 28px rgba(100,10,20,.2); }
.global-alert > div { display: flex; align-items: baseline; gap: 10px; }
.global-alert strong { font-size: .82rem; }
.global-alert span { font-size: .75rem; }
.alert-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.14); }
.alert-icon svg { width: 16px; height: 16px; }

/* Cards and overview */
.card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color 200ms var(--ease),box-shadow 200ms var(--ease),background 200ms var(--ease); }
.card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.card-title { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--color-border); }
.card-title > div { display: grid; gap: 2px; }
.card-kicker { color: var(--color-muted); font-size: .62rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; max-width: 50%; overflow: hidden; padding: 5px 9px; border: 1px solid rgba(245,158,11,.22); border-radius: 999px; background: rgba(217,119,6,.11); color: var(--color-primary-strong); font-size: .62rem; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.tag.neutral { border-color: var(--color-border); background: var(--color-surface-soft); color: var(--color-muted); }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(350px,.75fr); gap: 16px; }
.hero-grid > *,.insight-grid > *,.metric-grid > *,.notes-grid > *,.admin-grid > * { min-width: 0; }
.quota-card { position: relative; min-height: 360px; }
.quota-card:before { content:""; position:absolute; inset: 0 auto 0 0; width: 3px; background: var(--state-color,var(--color-faint)); }
.quota-body { min-height: 294px; display: grid; grid-template-columns: 220px minmax(0,1fr); align-items: center; gap: clamp(28px,4vw,58px); padding: 28px clamp(26px,4vw,54px); }
.gauge-wrap { display: grid; justify-items: center; gap: 16px; }
.gauge { --gauge-value: 0; --state-color: var(--color-faint); width: 194px; aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(from 220deg,var(--state-color) calc(var(--gauge-value)*1%),var(--color-surface-soft) 0 78%,transparent 0); filter: drop-shadow(0 14px 24px color-mix(in srgb,var(--state-color) 15%,transparent)); transition: background 300ms var(--ease); }
.gauge:before { content:""; position:absolute; inset: 15px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); }
.gauge:after { content:""; position:absolute; inset: 5px; border-radius: 50%; border: 1px solid color-mix(in srgb,var(--state-color) 32%,transparent); }
.gauge > div { z-index: 1; display: grid; text-align: center; }
.gauge strong,.metric-card strong,td:nth-child(n+2),dd { font-variant-numeric: tabular-nums; }
.gauge strong { color: var(--color-foreground); font-size: 3.35rem; line-height: 1; letter-spacing: -.06em; }
.gauge span { margin-top: 7px; color: var(--color-muted); font-size: .72rem; }
.threshold-legend { display: flex; gap: 12px; font-size: .62rem; }
.threshold-legend span { display: flex; align-items: center; gap: 5px; color: var(--color-muted); }
.threshold-legend span:before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.threshold-legend .healthy { color: var(--color-success); }.threshold-legend .warning{color:var(--color-warning)}.threshold-legend .danger{color:var(--color-danger)}
.quota-copy { min-width: 0; }
.status-line { display: flex; align-items: center; gap: 9px; }
.status-line strong { color: var(--color-foreground); font-size: 1.05rem; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid color-mix(in srgb,var(--state-color) 35%,transparent); border-radius: 50%; background: var(--state-color,var(--color-faint)); box-shadow: 0 0 13px color-mix(in srgb,var(--state-color) 68%,transparent); }
.quota-copy > p { max-width: 56ch; margin: 9px 0 21px; color: var(--color-muted); font-size: .8rem; line-height: 1.65; }
.quota-scale { position: relative; height: 7px; overflow: hidden; border-radius: 99px; background: linear-gradient(90deg,var(--color-danger) 0 20%,var(--color-warning) 20% 30%,var(--color-success) 30%); }
.quota-scale span { position: absolute; inset: 0 auto 0 0; width: calc(var(--remaining,0) * 1%); border-right: 2px solid var(--color-foreground); background: rgba(255,255,255,.16); }
.quota-scale i { position:absolute; top:-3px; width:1px; height:13px; background:var(--color-background); }.threshold-20{left:20%}.threshold-30{left:30%}
.scale-labels { display: flex; justify-content: space-between; margin-top: 5px; color: var(--color-faint); font-size: .57rem; }
.quota-copy dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 23px 0 0; }
.quota-copy dl > div { min-width:0; padding: 12px 12px 11px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-soft); }
dt { display: flex; align-items:center; gap:6px; margin-bottom: 5px; color: var(--color-muted); font-size: .62rem; }
dt svg { width: 13px; height: 13px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
dd { margin: 0; color:var(--color-foreground); font-size:.71rem; font-weight:750; line-height:1.35; overflow-wrap:anywhere; }
.state-healthy { --state-color: var(--color-success); }.state-warning{--state-color:var(--color-warning)}.state-danger{--state-color:var(--color-danger)}.state-unknown{--state-color:var(--color-faint)}
.state-danger { border-color: color-mix(in srgb,var(--color-danger) 52%,var(--color-border)); box-shadow: 0 0 0 1px var(--color-danger-soft),0 18px 50px rgba(120,10,20,.11); }
.metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.metric-card { container-type: inline-size; min-height: 172px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
.metric-card > div { width: 100%; min-width: 0; display: grid; align-content: start; }
.metric-card span:not(.metric-icon) { max-width: 100%; color: var(--color-muted); font-size: .69rem; font-weight: 650; overflow-wrap: anywhere; }
.metric-card strong { max-width: 100%; margin: 7px 0 4px; color: var(--color-foreground); font-size: clamp(1.25rem,12cqi,2rem); line-height: 1.05; letter-spacing: -.045em; overflow-wrap: anywhere; word-break: break-word; }
.metric-card small { max-width: 100%; color: var(--color-faint); font-size: .59rem; line-height: 1.35; overflow-wrap: anywhere; }
.metric-icon { width: 37px; height: 37px; flex: 0 0 auto; display:grid; place-items:center; border-radius:10px; }
.metric-icon svg { width:18px;height:18px }.metric-icon.amber{background:rgba(217,119,6,.13);color:#f59e0b}.metric-icon.indigo{background:rgba(99,102,241,.14);color:#818cf8}.metric-icon.green{background:rgba(34,201,139,.13);color:#34d399}.metric-icon.blue{background:rgba(37,99,235,.13);color:#60a5fa}
.insight-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(310px,.7fr); gap:16px; margin-top:16px; }
.trend-content { min-height: 250px; padding: 17px 20px 14px; }
.trend-summary { min-height: 24px; color:var(--color-muted);font-size:.7rem; }
.trend-chart { width:100%;height:170px;overflow:visible; }
.chart-grid line { stroke:var(--color-border);stroke-width:1; }
.chart-area { fill:url(#trendGradient);stroke:none; }
.chart-line { fill:none;stroke:var(--color-primary-strong);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke; }
.chart-points circle { fill:var(--color-surface);stroke:var(--color-primary-strong);stroke-width:2;vector-effect:non-scaling-stroke; }
.trend-axis { display:flex;justify-content:space-between;color:var(--color-faint);font-size:.58rem; }
.device-list { padding: 8px 16px; }
.device-item { min-height: 62px; display:flex;align-items:center;gap:11px;border-bottom:1px solid var(--color-border); }
.device-item:last-child{border:0}.device-icon{width:35px;height:35px;display:grid;place-items:center;border-radius:10px;background:var(--color-surface-soft);color:var(--color-primary-strong);font-size:.72rem;font-weight:850}.device-info{min-width:0;flex:1;display:grid}.device-info strong{overflow:hidden;color:var(--color-foreground);font-size:.75rem;text-overflow:ellipsis;white-space:nowrap}.device-info small{color:var(--color-muted);font-size:.62rem}.device-state{display:flex;align-items:center;gap:6px;color:var(--color-muted);font-size:.6rem}.online-dot{width:7px;height:7px;border-radius:50%;background:var(--color-faint)}.online-dot.online{background:var(--color-success);box-shadow:0 0 9px color-mix(in srgb,var(--color-success) 75%,transparent)}
.member-card { margin-top:16px; }.table-wrap{width:100%;overflow-x:auto;overscroll-behavior-inline:contain}.table-wrap:focus-visible{outline-offset:-3px}table{width:100%;border-collapse:collapse;font-size:.72rem}th,td{padding:13px 18px;border-bottom:1px solid var(--color-border);text-align:left;white-space:nowrap}th{color:var(--color-faint);background:color-mix(in srgb,var(--color-surface-soft) 58%,transparent);font-size:.59rem;font-weight:760;letter-spacing:.07em;text-transform:uppercase}td{color:var(--color-muted)}td strong{color:var(--color-foreground)}tbody tr:last-child td{border:0}tbody tr{transition:background 160ms var(--ease)}tbody tr:hover{background:var(--color-surface-soft)}.usage-share{display:flex;align-items:center;gap:8px;min-width:120px}.usage-share-bar{width:70px;height:5px;overflow:hidden;border-radius:99px;background:var(--color-surface-soft)}.usage-share-bar i{display:block;height:100%;border-radius:inherit;background:var(--color-accent)}
.empty-state { padding:36px 20px;color:var(--color-muted);font-size:.75rem;text-align:center; }

/* Secondary pages */
.data-card{min-height:260px}.notes-grid,.admin-grid{display:grid;grid-template-columns:minmax(330px,.7fr) minmax(0,1.3fr);gap:16px}.composer-card form,.stack-form{padding:20px}.composer-card form{display:grid}.form-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px}.note-list{display:grid;align-content:start;gap:12px}.note-item{padding:17px 18px}.note-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;color:var(--color-muted);font-size:.65rem}.note-body{color:var(--color-text);font-size:.81rem;line-height:1.7;white-space:pre-wrap}.delete-note{min-width:44px;min-height:36px;border:0;border-radius:8px;background:transparent;color:var(--color-danger);font-size:.7rem}.delete-note:hover{background:var(--color-danger-soft)}.stack-form{display:grid}.stack-form input{margin-bottom:15px}.field-help{margin:-7px 0 17px;color:var(--color-muted);font-size:.65rem}.field-help strong{color:var(--color-foreground)}.account-card{width:min(620px,100%)}.admin-members{padding:8px 17px}.admin-member{min-height:76px;display:flex;align-items:center;gap:14px;padding-block:9px;border-bottom:1px solid var(--color-border)}.admin-member:last-child{border:0}.member-identity{min-width:120px;flex:1;display:grid}.admin-member strong{color:var(--color-foreground);font-size:.76rem}.admin-member small{color:var(--color-muted);font-size:.63rem}.member-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.member-action{min-height:36px;border:1px solid var(--color-border-strong);border-radius:9px;background:var(--color-surface-soft);color:var(--color-text);padding:6px 9px;font-size:.65rem;font-weight:700}.member-action:hover{border-color:var(--color-primary);background:rgba(217,119,6,.1);color:var(--color-primary-strong)}.member-action.danger{color:var(--color-danger)}.member-action.danger:hover{border-color:var(--color-danger);background:var(--color-danger-soft)}
.admin-devices-card{margin-top:16px}.compatibility-badge{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border-radius:99px;font-size:.61rem;font-weight:760}.compatibility-badge.compatible{background:color-mix(in srgb,var(--color-success) 14%,transparent);color:var(--color-success)}.compatibility-badge.update_required{background:var(--color-danger-soft);color:var(--color-danger)}.compatibility-badge.unknown{background:var(--color-surface-soft);color:var(--color-muted)}.maintenance-action.clear{color:var(--color-success)}.maintenance-action.attention{color:var(--color-warning);font-weight:720}td small{color:var(--color-faint);font-size:.6rem}
.setup-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.72fr);gap:16px}.setup-card{position:relative;min-height:330px;padding:25px;overflow:hidden}.setup-card:after{content:"";position:absolute;width:190px;height:190px;right:-78px;top:-88px;border-radius:50%;background:radial-gradient(circle,rgba(245,158,11,.13),transparent 68%);pointer-events:none}.setup-step{display:inline-flex;min-height:25px;align-items:center;border-radius:99px;padding:3px 9px;background:rgba(217,119,6,.12);color:var(--color-primary-strong);font-size:.62rem;font-weight:800}.setup-card-icon{width:48px;height:48px;display:grid;place-items:center;margin:24px 0 17px;border-radius:14px;background:rgba(217,119,6,.14);color:var(--color-primary-strong)}.setup-card-icon.indigo{background:rgba(99,102,241,.15);color:#a5b4fc}.setup-card-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.setup-card h2{font-size:1.12rem}.setup-card>p{max-width:590px;margin:9px 0 20px;color:var(--color-muted);font-size:.76rem;line-height:1.65}.download-options{display:grid;gap:10px}.download-option{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--color-border);border-radius:12px;background:var(--color-surface-soft)}.download-option.recommended{border-color:color-mix(in srgb,var(--color-primary) 45%,var(--color-border));background:color-mix(in srgb,var(--color-primary) 7%,var(--color-surface-soft))}.platform-badge{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:var(--color-surface);color:var(--color-primary-strong);font-size:.72rem;font-weight:850}.download-option>div:nth-child(2){min-width:0;display:grid}.download-option strong{color:var(--color-foreground);font-size:.73rem}.download-option small,.download-option code{overflow:hidden;color:var(--color-muted);font-size:.58rem;text-overflow:ellipsis;white-space:nowrap}.download-option code{color:var(--color-faint)}.download-link{text-decoration:none;white-space:nowrap}.download-link svg,.enrollment-code-panel svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}.release-hint{color:var(--color-faint);font-size:.59rem}.setup-loading,.setup-error{padding:18px;border:1px dashed var(--color-border-strong);border-radius:11px;color:var(--color-muted);font-size:.7rem;text-align:center}.enrollment-card .primary{align-self:flex-start}.enrollment-code-panel{display:grid;gap:8px;margin-top:16px;padding:14px;border:1px solid color-mix(in srgb,var(--color-success) 35%,var(--color-border));border-radius:12px;background:color-mix(in srgb,var(--color-success) 8%,var(--color-surface-soft))}.enrollment-code-panel>span,.enrollment-code-panel small{color:var(--color-muted);font-size:.62rem}.enrollment-code-panel>div{display:flex;align-items:center;gap:10px}.enrollment-code-panel code{min-width:0;flex:1;color:var(--color-foreground);font-size:clamp(1rem,2.2vw,1.35rem);font-weight:850;letter-spacing:.08em}.setup-guide-card,.my-devices-card{margin-top:16px}.install-guide{counter-reset:step;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;padding:20px;list-style:none}.install-guide li{position:relative;min-height:112px;display:grid;align-content:start;gap:7px;padding:16px 16px 16px 50px;border:1px solid var(--color-border);border-radius:12px;background:var(--color-surface-soft)}.install-guide li:before{counter-increment:step;content:counter(step);position:absolute;left:14px;top:15px;width:25px;height:25px;display:grid;place-items:center;border-radius:8px;background:rgba(217,119,6,.15);color:var(--color-primary-strong);font-size:.66rem;font-weight:850}.install-guide strong{color:var(--color-foreground);font-size:.74rem}.install-guide span{color:var(--color-muted);font-size:.66rem;line-height:1.6}.setup-security-note{margin:0 20px 20px;padding:12px 14px;border-radius:10px;background:color-mix(in srgb,var(--color-success) 8%,var(--color-surface-soft));color:var(--color-muted);font-size:.64rem}.my-device-list{padding:8px 17px}.my-device-item{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;border-bottom:1px solid var(--color-border)}.my-device-item:last-child{border:0}.my-device-item>div{min-width:0;display:grid}.my-device-item strong{overflow:hidden;color:var(--color-foreground);font-size:.74rem;text-overflow:ellipsis;white-space:nowrap}.my-device-item small{color:var(--color-muted);font-size:.61rem}
.toast{position:fixed;right:24px;bottom:24px;z-index:var(--z-toast);max-width:min(420px,calc(100vw - 32px));padding:12px 16px;border:1px solid color-mix(in srgb,var(--color-success) 38%,var(--color-border));border-radius:11px;background:color-mix(in srgb,var(--color-success) 12%,var(--color-surface));box-shadow:var(--shadow-lg);color:var(--color-foreground);font-size:.76rem;animation:toast-in 220ms var(--ease)}
.compliance-footer{min-height:52px;display:flex;align-items:center;justify-content:center;gap:16px;padding:14px 20px;border-top:1px solid var(--color-border);background:var(--color-background);text-align:center}
.compliance-footer a{color:var(--color-muted);font-size:.72rem;text-decoration:none;transition:color 180ms var(--ease)}
.compliance-footer a:hover{color:var(--color-primary-strong);text-decoration:underline;text-underline-offset:3px}

@keyframes page-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

@media (max-width:1180px){
  :root{--sidebar-width:220px}.hero-grid{grid-template-columns:1fr}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card{min-height:130px;padding:18px;gap:10px}.insight-grid{grid-template-columns:minmax(0,1fr) minmax(260px,320px)}.quota-card{min-height:330px}
}
@media (min-width:901px) and (max-width:1320px){.quota-copy dl{grid-template-columns:1fr 1fr}.quota-copy dl>div:last-child{grid-column:1/-1}.quota-body{grid-template-columns:190px minmax(0,1fr);gap:28px;padding-inline:28px}.gauge{width:174px}.metric-card{padding:16px}.metric-icon{width:34px;height:34px}}
@media (max-width:900px){
  :root{--sidebar-width:0px}.sidebar{display:none}.mobile-topbar{position:sticky;top:0;z-index:var(--z-nav);min-height:64px;display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid var(--color-border);background:color-mix(in srgb,var(--color-background-raised) 92%,transparent);backdrop-filter:blur(16px)}.content{margin-left:0;padding:24px 16px 100px}.global-alert{top:64px;margin-left:0}.mobile-nav{position:fixed;inset:auto 12px 10px;z-index:var(--z-nav);min-height:66px;display:flex;align-items:stretch;justify-content:space-around;padding:7px;border:1px solid var(--color-border-strong);border-radius:17px;background:color-mix(in srgb,var(--color-background-raised) 94%,transparent);box-shadow:var(--shadow-lg);backdrop-filter:blur(18px)}.mobile-nav-button{min-width:52px;min-height:50px;display:grid;place-items:center;align-content:center;gap:3px;border:0;border-radius:11px;background:transparent;color:var(--color-muted);font-size:.6rem;font-weight:700}.mobile-nav-button svg{width:19px;height:19px}.mobile-nav-button:first-child svg{fill:currentColor;stroke:none}.mobile-nav-button.active{background:rgba(217,119,6,.12);color:var(--color-primary-strong)}.heading-actions .theme-toggle{display:none}.metric-grid{grid-template-columns:1fr 1fr}.insight-grid,.notes-grid,.admin-grid,.setup-grid{grid-template-columns:1fr}.device-card{min-height:auto}.login-shell{grid-template-columns:1fr}.login-visual{display:none}.login-panel{min-height:100dvh;padding:28px 22px}.login-card>.brand-lockup{margin-bottom:64px}.toast{bottom:92px}.compliance-footer{padding-bottom:92px}
}
@media (max-width:600px){
  body{font-size:16px}.content{padding:20px 12px 96px}.page-heading{align-items:flex-start;margin-bottom:20px}.heading-actions{margin-top:3px}.refresh{padding:0 9px}.hero-grid,.metric-grid,.insight-grid{gap:12px}.metric-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.metric-card{min-height:124px;padding:15px;gap:9px}.quota-card{min-height:auto}.quota-body{grid-template-columns:minmax(0,1fr);gap:21px;padding:24px 18px}.gauge{width:170px}.gauge strong{font-size:2.9rem}.quota-copy dl{grid-template-columns:1fr}.quota-copy dl>div{display:flex;align-items:center;justify-content:space-between;gap:12px}.quota-copy dl dt{margin:0}.card-title{min-height:61px;padding:12px 15px}.quota-card>.card-title{align-items:flex-start}.quota-card>.card-title .tag{max-width:46%}.trend-content{padding-inline:15px}.trend-chart{height:145px}.member-card .card-title{align-items:flex-start}.support-text{max-width:130px;text-align:right}.global-alert{height:auto;min-height:68px;align-items:flex-start;justify-content:flex-start;padding:11px 14px}.global-alert>div{min-width:0;display:grid;gap:1px}.global-alert strong{font-size:.76rem}.global-alert span{font-size:.66rem;line-height:1.45}.form-actions{align-items:flex-end}.notes-grid,.admin-grid,.setup-grid{gap:12px}.setup-card{min-height:auto;padding:19px}.download-option{grid-template-columns:auto minmax(0,1fr)}.download-option>.primary,.download-option>.secondary{grid-column:1/-1;width:100%}.install-guide{grid-template-columns:1fr;padding:14px}.my-device-item{grid-template-columns:auto minmax(0,1fr) auto}.my-device-item>.compatibility-badge{grid-column:2/-1;justify-self:start}th,td{padding:12px 14px}.toast{right:16px;left:16px;max-width:none}.login-card>.brand-lockup{margin-bottom:52px}
}
@media (max-width:520px){.admin-member{align-items:flex-start;flex-direction:column}.member-actions{width:100%;justify-content:flex-start}.member-action{flex:1 1 calc(50% - 7px)}.mobile-nav-button{min-width:46px}}
@media (max-width:380px){.mobile-topbar{padding-inline:12px}.mobile-nav{inset-inline:8px}.mobile-nav-button{min-width:42px;font-size:.55rem}.metric-card{padding:13px}.metric-card strong{font-size:clamp(1.1rem,12cqi,1.35rem)}.refresh span:last-child{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media (orientation:landscape) and (max-height:520px) and (max-width:900px){.mobile-topbar{position:relative}.global-alert{top:0}.content{padding-top:18px}.mobile-nav{min-height:58px}.mobile-nav-button{min-height:44px}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.alert-light,.live-dot{box-shadow:none!important}}
