:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --sidebar: #101318;
  --surface: #13171d;
  --surface-2: #181d24;
  --surface-3: #20262f;
  --line: #29313b;
  --line-soft: #20262e;
  --text: #f4f6f8;
  --muted: #8f99a7;
  --muted-2: #687382;
  --accent: #8ef0c2;
  --accent-strong: #48d89a;
  --accent-wash: rgba(72, 216, 154, .1);
  --warning: #f6c65b;
  --warning-wash: rgba(246, 198, 91, .1);
  --danger: #ff7b76;
  --danger-wash: rgba(255, 123, 118, .1);
  --info: #82b5ff;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 14px; }
button, input, select { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 240px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line-soft);
  background: var(--sidebar);
}
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 17px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #08110d; background: var(--accent); font-size: 14px; font-weight: 850; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.environment { display: inline-flex; align-items: center; gap: 7px; margin: 22px 8px 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-wash); }
.nav-list { display: grid; gap: 5px; margin-top: 38px; }
.nav-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; width: 100%; min-height: 43px; padding: 0 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; text-align: left; transition: color .15s, background .15s; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--text); background: var(--surface-3); box-shadow: inset 2px 0 var(--accent); }
.nav-icon { color: var(--muted-2); font: 16px ui-monospace, monospace; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-count { min-width: 22px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; text-align: center; }
.sidebar-foot { display: grid; gap: 18px; }
.privacy-note { display: flex; gap: 10px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.015); }
.privacy-icon { color: var(--accent); font-size: 9px; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { margin-bottom: 3px; font-size: 11px; }
.privacy-note span { color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.sidebar-link { display: flex; justify-content: space-between; padding: 0 8px; color: var(--muted); font-size: 12px; }
.sidebar-link:hover { color: var(--text); }

.workspace { min-height: 100vh; margin-left: 240px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 82px; align-items: center; padding: 14px 32px; border-bottom: 1px solid var(--line-soft); background: rgba(11, 13, 16, .88); backdrop-filter: blur(18px); }
.breadcrumb { display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 10px; }
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.freshness { color: var(--muted-2); font-size: 11px; }
.operator { display: flex; align-items: center; gap: 9px; padding-left: 15px; border-left: 1px solid var(--line); }
.operator > span { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 50%; color: #0b0d10; background: #d6e5dc; font-weight: 800; }
.operator strong, .operator small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator strong { font-size: 11px; }
.operator small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.mobile-menu { display: none; margin-right: 12px; }

.content { width: min(1500px, 100%); margin: 0 auto; padding: 34px 32px 64px; }
.view { display: none; }
.view.active { display: block; animation: view-in .18s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-head h2 { margin: 6px 0 7px; font-size: clamp(28px, 3.3vw, 42px); font-weight: 610; letter-spacing: -.045em; }
.section-head p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.55; }
.overline { color: var(--muted-2); font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .12em; }
.system-badge { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 11px; }
.system-badge.warning .status-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-wash); }
.system-badge.danger .status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-wash); }

.attention-list { display: grid; gap: 8px; margin-bottom: 18px; }
.attention-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.attention-item.warning { border-color: rgba(246,198,91,.3); background: linear-gradient(90deg, var(--warning-wash), var(--surface) 50%); }
.attention-item.danger { border-color: rgba(255,123,118,.3); background: linear-gradient(90deg, var(--danger-wash), var(--surface) 50%); }
.attention-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--warning); font-weight: 800; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { font-size: 12px; }
.attention-item span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-label { color: var(--muted); font-size: 11px; }
.metric-card > strong { display: block; margin: 13px 0 9px; font-size: clamp(28px, 3vw, 40px); font-weight: 620; letter-spacing: -.05em; }
.metric-note { color: var(--muted-2); font-size: 10px; }
.metric-note.positive { color: var(--accent); }
.metric-note.negative { color: var(--danger); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 12px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.traffic-panel, .security-panel, .accounts-preview, .activity-preview { padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h3 { margin: 5px 0 0; font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.segmented button { min-width: 40px; padding: 6px 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; }
.segmented button.active { color: var(--text); background: var(--surface-3); }
.chart-summary { display: flex; gap: 34px; margin: 24px 0 15px; }
.chart-summary strong, .chart-summary span { display: block; }
.chart-summary strong { font-size: 18px; letter-spacing: -.025em; }
.chart-summary span { margin-top: 3px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.chart { position: relative; height: 214px; overflow: hidden; border-bottom: 1px solid var(--line-soft); background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px); background-size: 100% 25%; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .area { fill: url(#traffic-gradient); }
.chart .line { fill: none; stroke: var(--accent-strong); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .error-line { fill: none; stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart-empty { display: grid; height: 100%; place-items: center; color: var(--muted-2); font-size: 11px; }
.chart-legend { display: flex; gap: 18px; margin-top: 12px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 2px; background: var(--accent-strong); }
.chart-legend .legend-errors { background: var(--danger); }
.signal-list { margin-top: 20px; border-top: 1px solid var(--line-soft); }
.signal-row { display: flex; align-items: center; justify-content: space-between; min-height: 43px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.signal-row strong { color: var(--text); font-size: 13px; }
.route-mix { margin-top: 22px; }
.route-bar { display: grid; grid-template-columns: 86px 1fr 36px; align-items: center; gap: 8px; margin-top: 11px; color: var(--muted); font-size: 9px; }
.bar-track { height: 5px; overflow: hidden; border-radius: 9px; background: var(--surface-3); }
.bar-fill { height: 100%; border-radius: inherit; background: var(--info); }
.accounts-preview, .activity-preview { min-height: 300px; }
.compact-list, .timeline { margin-top: 16px; }
.compact-account { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.compact-account:last-child { border-bottom: 0; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #0b0d10; background: #d4dfd9; font-size: 11px; font-weight: 800; }
.compact-account strong, .compact-account span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-account strong { font-size: 11px; }
.compact-account span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.compact-value { color: var(--muted); font: 10px ui-monospace, monospace; }
.text-button { padding: 5px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.text-button:hover { color: var(--accent); }

.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 4px var(--surface-3); }
.timeline-item.security .timeline-dot { background: var(--danger); }
.timeline-item.admin .timeline-dot { background: var(--warning); }
.timeline-copy strong { display: block; font-size: 11px; }
.timeline-copy span { display: block; margin-top: 4px; color: var(--muted-2); font: 9px ui-monospace, monospace; }
.timeline-time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }

.button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 10px; font-weight: 650; transition: border-color .15s, background .15s, color .15s; }
.button:hover:not(:disabled) { border-color: #4d5968; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { border-color: var(--accent-strong); color: #06100c; background: var(--accent-strong); }
.button-primary:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); }
.button-secondary { background: var(--surface-2); }
.button-danger { border-color: rgba(255,123,118,.5); color: var(--danger); background: var(--danger-wash); }
.button-large { min-height: 42px; padding: 0 16px; font-size: 11px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-2); font-size: 17px; }
.pill { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 650 9px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.pill.active, .pill.ok, .pill.used { border-color: rgba(72,216,154,.3); color: var(--accent); background: var(--accent-wash); }
.pill.suspended, .pill.error, .pill.revoked { border-color: rgba(255,123,118,.3); color: var(--danger); background: var(--danger-wash); }
.pill.pending, .pill.warning, .pill.admin { border-color: rgba(246,198,91,.3); color: var(--warning); background: var(--warning-wash); }
.total-badge { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font: 10px ui-monospace, monospace; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-bar label { min-width: 150px; }
.filter-bar .search-field { position: relative; flex: 1; min-width: 220px; }
.search-icon { position: absolute; left: 12px; top: 9px; color: var(--muted-2); }
input, select { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--text); background: var(--bg); font-size: 11px; }
input { padding: 0 11px; }
.search-field input { padding-left: 34px; }
select { padding: 0 30px 0 11px; }
input:focus, select:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-wash); }
input::placeholder { color: var(--muted-2); }
.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted-2); background: rgba(255,255,255,.01); font: 650 9px ui-monospace, monospace; text-align: left; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.data-table td { height: 63px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); color: #cfd5dc; font-size: 11px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-account] { cursor: pointer; }
.data-table tbody tr[data-account]:hover { background: rgba(255,255,255,.018); }
.account-cell { display: flex; min-width: 200px; align-items: center; gap: 10px; }
.account-cell strong, .account-cell span { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-cell strong { color: var(--text); font-size: 11px; }
.account-cell span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.usage-cell strong, .usage-cell span { display: block; }
.usage-cell strong { color: var(--text); }
.usage-cell span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions button { min-width: 28px; min-height: 28px; padding: 0 8px; }
.empty-row { padding: 48px !important; color: var(--muted) !important; text-align: center; }
.pagination { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pagination > div { display: flex; gap: 7px; }

.access-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 12px; margin-bottom: 12px; }
.invite-panel, .access-policy, .invitation-history, .audit-panel, .system-grid > .panel { padding: 22px; }
.invite-panel > p { max-width: 680px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.stack-form { display: grid; grid-template-columns: 1fr 190px auto; align-items: end; gap: 10px; margin-top: 22px; }
.stack-form label > span { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.steps { display: grid; gap: 17px; margin: 20px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 11px; }
.steps li > span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); font: 11px ui-monospace, monospace; }
.steps strong { display: block; font-size: 11px; }
.steps p { margin: 4px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.invitation-history { overflow: hidden; }

.audit-filters input { min-width: 220px; }
.audit-panel { padding-top: 4px; }
.audit-panel .timeline-item { min-height: 58px; align-items: center; }
.audit-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.audit-meta span { padding: 2px 5px; border: 1px solid var(--line-soft); border-radius: 4px; color: var(--muted-2); font: 8px ui-monospace, monospace; }

.system-grid { display: grid; grid-template-columns: .7fr .8fr 1.5fr; gap: 12px; }
.release-version { margin: 18px 0 22px; font-size: 40px; font-weight: 650; letter-spacing: -.055em; }
.definition-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.definition-list strong { color: var(--text); text-align: right; }
.switch-list { margin-top: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 45px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.switch { width: 30px; height: 17px; padding: 3px; border-radius: 99px; background: var(--surface-3); }
.switch::after { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--muted-2); content: ""; }
.switch.on { background: var(--accent-wash); }
.switch.on::after { margin-left: 13px; background: var(--accent-strong); }
.migration-summary { margin-top: 18px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--muted); background: var(--bg); font-size: 10px; line-height: 1.55; }
.migration-list { max-height: 355px; margin-top: 13px; overflow: auto; }
.migration-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: 37px; border-bottom: 1px solid var(--line-soft); font: 9px ui-monospace, monospace; }
.migration-row time { color: var(--muted-2); }

.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; opacity: 0; transition: opacity .18s, visibility .18s; }
.drawer.open { visibility: visible; opacity: 1; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.drawer-panel { position: absolute; inset: 0 0 0 auto; width: min(620px, 100%); overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transform: translateX(30px); transition: transform .2s ease; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: rgba(19,23,29,.94); backdrop-filter: blur(16px); }
.drawer-head h2 { margin: 5px 0 0; font-size: 22px; }
.drawer-content { padding: 24px; }
.drawer-identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.drawer-identity h3 { margin: 0 0 4px; font-size: 20px; }
.drawer-identity p { margin: 0; color: var(--muted); font-size: 11px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.drawer-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.drawer-stat { padding: 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--bg); }
.drawer-stat strong, .drawer-stat span { display: block; }
.drawer-stat strong { font-size: 17px; }
.drawer-stat span { margin-top: 4px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; }
.drawer-section { margin-top: 28px; }
.drawer-section h4 { margin: 0 0 12px; font-size: 12px; }
.detail-row { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.detail-row strong { max-width: 66%; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.device-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.device-row strong, .device-row span { display: block; }
.device-row strong { font-size: 10px; }
.device-row span { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.drawer-loading { display: grid; min-height: 260px; place-items: center; color: var(--muted); }

.confirm-dialog { width: min(440px, calc(100% - 30px)); padding: 25px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.confirm-dialog h2 { margin: 8px 0 10px; font-size: 21px; }
.confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 420px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease both; }
.toast.error { border-color: rgba(255,123,118,.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.loading-state { display: grid; min-height: calc(100vh - 82px); place-items: center; align-content: center; color: var(--muted); }
.loading-state p { margin: 14px 0 0; font-size: 11px; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 28px; color: var(--muted); text-align: center; font-size: 11px; }

.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #17201d 0, var(--bg) 38%); }
.login-card { width: min(480px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.brand-dark { padding: 0; }
.login-copy { margin: 58px 0 28px; }
.login-copy h1 { margin: 10px 0; font-size: 34px; letter-spacing: -.045em; }
.login-copy p { margin: 0; color: var(--muted); line-height: 1.6; }
.login-card .button-large { width: 100%; }
.login-note { margin: 18px 0 0; color: var(--muted-2); font-size: 9px; text-align: center; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .system-grid { grid-template-columns: 1fr 1fr; }
  .migration-panel { grid-column: 1 / -1; }
  .stack-form { grid-template-columns: 1fr 160px; }
  .stack-form .button { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .overview-grid, .access-grid { grid-template-columns: 1fr; }
  .traffic-panel { min-height: 420px; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar label { flex: 1; }
  .topbar { padding-inline: 22px; }
  .content { padding-inline: 22px; }
  .freshness { display: none; }
}

@media (max-width: 700px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .workspace { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { min-height: 70px; padding: 11px 14px; }
  .top-actions .button { width: 34px; padding: 0; font-size: 0; }
  .top-actions .button span { font-size: 16px; }
  .operator div { display: none; }
  .operator { padding-left: 10px; }
  .content { padding: 25px 14px 50px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; }
  .chart-summary { gap: 20px; }
  .system-grid { grid-template-columns: 1fr; }
  .migration-panel { grid-column: auto; }
  .stack-form { grid-template-columns: 1fr; }
  .stack-form .button { grid-column: auto; }
  .filter-bar label, .filter-bar .search-field { flex: 1 1 100%; min-width: 100%; }
  .filter-bar .button { flex: 1; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .attention-item { grid-template-columns: 34px minmax(0, 1fr); }
  .attention-item > .button { grid-column: 2; justify-self: start; }
  .chart-summary { justify-content: space-between; gap: 8px; }
  .chart-summary strong { font-size: 15px; }
  .segmented button { min-width: 34px; }
  .login-card { padding: 25px; }
}

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