:root {
  color-scheme: dark;
  --ground: #05070c;
  --ground-raised: #090d15;
  --panel: rgba(14, 20, 31, 0.82);
  --panel-solid: #0e141f;
  --panel-hover: #131b29;
  --line: rgba(177, 206, 235, 0.13);
  --line-strong: rgba(177, 222, 246, 0.24);
  --ink: #f3f7ff;
  --muted: #a7b4c8;
  --muted-strong: #c1cbd9;
  --accent: #83ecff;
  --violet: #9474ff;
  --success: #71e6b1;
  --warning: #ffc76b;
  --danger: #ff7890;
  --info: #9aafff;
  --font-display: "Syne", sans-serif;
  --font-ui: "Commissioner", "Segoe UI", sans-serif;
  --sidebar-width: 248px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.34), 0 5px 18px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--ground); scrollbar-color: var(--accent) var(--ground); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--ground); }
body::-webkit-scrollbar-thumb { background: #213345; border: 2px solid var(--ground); border-radius: 999px; }
::selection { color: #031015; background: var(--accent); }
button, input, select { font: inherit; }
button { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
svg { display: block; width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }
.skip-link { position: fixed; z-index: 1000; top: .75rem; left: .75rem; padding: .7rem 1rem; background: var(--accent); color: #061116; font-weight: 700; border-radius: 8px; transform: translateY(-150%); transition: transform 180ms var(--ease-out); }
.skip-link:focus { transform: translateY(0); }

.prototype-flag {
  position: fixed;
  z-index: 100;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .8rem;
  border: 1px solid rgba(131, 236, 255, .2);
  border-radius: 999px;
  background: rgba(6, 10, 17, .76);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
  backdrop-filter: blur(16px);
  color: #cfdae7;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.prototype-flag span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px rgba(131, 236, 255, .75); }

/* Authentication */
.auth-shell {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, #0d1824 0, #060a11 44%, #030508 78%);
  background-size: 48px 48px, 48px 48px, auto;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.auth-shell.is-leaving { opacity: 0; transform: scale(.985); pointer-events: none; }
.auth-atmosphere { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-atmosphere::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(131, 236, 255, .07);
  border-radius: 48%;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 72%, transparent);
}
.auth-atmosphere i { position: absolute; display: block; border-radius: 50%; opacity: .42; filter: blur(80px); transform: translate3d(0,0,0); }
.auth-atmosphere i:nth-child(1) { width: 38vw; height: 38vw; left: -12vw; top: 10%; background: rgba(80, 211, 255, .22); animation: aurora-a 18s var(--ease-in-out) infinite alternate; }
.auth-atmosphere i:nth-child(2) { width: 30vw; height: 30vw; right: -8vw; bottom: 4%; background: rgba(148, 116, 255, .2); animation: aurora-b 22s var(--ease-in-out) infinite alternate; }
.auth-atmosphere i:nth-child(3) { width: 18vw; height: 18vw; left: 46%; top: 30%; background: rgba(131, 236, 255, .08); animation: aurora-c 16s var(--ease-in-out) infinite alternate; }
@keyframes aurora-a { to { transform: translate3d(11vw, 7vh, 0) scale(1.12); opacity: .6; } }
@keyframes aurora-b { to { transform: translate3d(-12vw, -5vh, 0) scale(.9); opacity: .55; } }
@keyframes aurora-c { to { transform: translate3d(-7vw, 10vh, 0) scale(1.2); opacity: .32; } }

.auth-stage { width: min(92vw, 470px); padding: 3.8rem 0 1.5rem; }
.auth-brand { display: flex; align-items: baseline; justify-content: center; margin-bottom: 1.8rem; font-family: var(--font-display); }
.brand-word { font-size: 1.45rem; font-weight: 800; letter-spacing: -.05em; }
.brand-dot { width: .38rem; height: .38rem; margin-left: .2rem; background: var(--accent); box-shadow: 0 0 18px rgba(131, 236, 255, .9); }
.auth-brand small { margin-left: .7rem; color: var(--muted); font-family: var(--font-ui); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.context-line, .topbar-copy p { display: none; }

.auth-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  min-height: 625px;
  overflow: hidden;
  border: 1px solid rgba(174, 223, 247, .22);
  border-radius: 26px;
  background:
    radial-gradient(480px circle at var(--mx) var(--my), rgba(131, 236, 255, .12), transparent 42%),
    linear-gradient(145deg, rgba(21, 31, 46, .88), rgba(8, 13, 22, .76));
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255,255,255,.08), 0 0 80px rgba(69, 203, 255, .06);
  backdrop-filter: blur(24px) saturate(115%);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255,255,255,.045) 48%, transparent 58%);
  transform: translateX(-110%);
  animation: glass-sheen 8s linear infinite;
}
@keyframes glass-sheen { 0%, 68% { transform: translateX(-110%); } 86%, 100% { transform: translateX(110%); } }
.security-orbit { position: absolute; top: 26px; right: 28px; width: 50px; height: 50px; border: 1px solid rgba(131, 236, 255, .14); border-radius: 50%; }
.security-orbit::before { content: ""; position: absolute; inset: -5px; border-top: 1px solid var(--accent); border-right: 1px solid transparent; border-radius: 50%; animation: orbit 7s linear infinite; }
.security-orbit span { position: absolute; inset: 8px; display: grid; place-items: center; border-radius: 50%; background: rgba(6, 12, 20, .72); color: var(--accent); }
.security-orbit svg { width: 16px; height: 16px; }
@keyframes orbit { to { transform: rotate(360deg); } }

.auth-panel, .auth-success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 4.35rem 2.35rem 1.8rem;
  opacity: 0;
  transform: translate3d(24px, 0, 0) scale(.985);
  pointer-events: none;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.auth-panel.is-active, .auth-success.is-active { opacity: 1; transform: translate3d(0,0,0) scale(1); pointer-events: auto; }
.auth-panel.is-exiting { opacity: 0; transform: translate3d(-24px, 0, 0) scale(.985); }
.auth-panel header { margin-bottom: 1.6rem; padding-right: 3rem; }
.context-line { margin-bottom: .55rem; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-panel h1, .auth-panel h2, .auth-success h2 { margin-bottom: .55rem; font-size: 2rem; line-height: 1.12; letter-spacing: -.035em; }
.auth-panel header > p:last-child, .auth-success p { max-width: 38ch; margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.field { display: grid; gap: .5rem; margin-bottom: 1rem; color: var(--muted-strong); font-size: .76rem; font-weight: 600; }
.field > input, .input-wrap {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 7, 13, .55);
  color: var(--ink);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.field > input { padding: 0 .9rem; }
.field > input:focus, .input-wrap:focus-within { border-color: rgba(131, 236, 255, .55); background: rgba(5, 12, 20, .78); box-shadow: 0 0 0 3px rgba(131, 236, 255, .08), 0 10px 24px rgba(0,0,0,.18); outline: none; }
.input-wrap { display: flex; align-items: center; }
.input-wrap input { flex: 1; min-width: 0; height: 48px; padding: 0 .9rem; border: 0; outline: 0; background: transparent; color: var(--ink); }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.icon-button:active { transform: scale(.96); }
.input-wrap .icon-button { margin-right: .35rem; }
.turnstile-row {
  display: grid;
  min-height: 65px;
  margin: -.1rem 0 .9rem;
  place-items: center;
}
.turnstile-row:empty::before {
  content: "Preparing security check…";
  color: var(--muted);
  font-size: .7rem;
}
.form-row, .otp-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .1rem 0 1.25rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .75rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.text-button { padding: .2rem 0; border: 0; background: transparent; color: var(--accent); font-size: .75rem; font-weight: 600; cursor: pointer; text-underline-offset: 3px; }
.text-button:hover { text-decoration: underline; }
.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(204, 250, 255, .55);
  border-radius: 12px;
  background: linear-gradient(100deg, var(--accent), #78c8ff);
  box-shadow: 0 12px 28px rgba(65, 190, 239, .19), inset 0 1px 0 rgba(255,255,255,.72);
  color: #061016;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), filter 160ms ease, box-shadow 160ms ease;
}
.primary-button svg { width: 17px; height: 17px; }
.primary-button:active { transform: scale(.975); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.primary-button i { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: #fff; transform: translateX(-101%); }
.primary-button.is-loading i { animation: button-progress 600ms var(--ease-out) forwards; }
.primary-button.is-loading svg { animation: nudge 600ms var(--ease-out); }
@keyframes button-progress { to { transform: translateX(0); } }
@keyframes nudge { 45% { transform: translateX(5px); } }
.form-note { display: flex; align-items: flex-start; gap: .5rem; margin: 1rem 0 0; color: #8190a5; font-size: .68rem; line-height: 1.45; }
.form-note svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; color: var(--success); }
.back-button { align-self: flex-start; margin: -1.85rem 0 1.2rem; padding: .4rem 0; border: 0; background: transparent; color: var(--muted); font-size: .78rem; cursor: pointer; }
.back-button span::before { content: "←"; margin-right: .45rem; }
.otp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; margin: .7rem 0 1rem; }
.otp-grid input { width: 100%; aspect-ratio: .78; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 7, 13, .58); color: var(--ink); font-size: 1.45rem; font-weight: 700; text-align: center; caret-color: var(--accent); transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out); }
.otp-grid input:focus { border-color: var(--accent); background: rgba(9, 20, 31, .95); box-shadow: 0 0 0 3px rgba(131,236,255,.09), 0 13px 26px rgba(0,0,0,.18); outline: none; transform: translateY(-3px); }
.otp-grid input.has-value { border-color: rgba(148, 116, 255, .6); background: rgba(19, 15, 39, .7); }
.otp-meta { margin-bottom: 1.3rem; color: var(--muted); font-size: .72rem; }
.otp-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.auth-card.is-enrolling { min-height: 770px; }
.mfa-enrollment { display: grid; grid-template-columns: 132px 1fr; gap: 1rem; align-items: center; margin: -.4rem 0 1.25rem; padding: .85rem; border: 1px solid rgba(131, 236, 255, .16); border-radius: 16px; background: rgba(6, 13, 23, .58); }
.mfa-enrollment[hidden] { display: none; }
.mfa-qr { display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; padding: .45rem; border-radius: 12px; background: #fff; }
.mfa-qr img { display: block; width: 100%; height: 100%; }
.mfa-enrollment strong { display: block; margin-bottom: .3rem; color: var(--ink); font-size: .82rem; }
.mfa-enrollment p { margin: 0 0 .45rem; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.mfa-enrollment code { display: block; overflow-wrap: anywhere; margin-top: .45rem; padding: .45rem .55rem; border-radius: 8px; background: rgba(0, 0, 0, .32); color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .65rem; letter-spacing: .04em; }
.form-error { margin: .8rem 0 0; padding: .7rem .8rem; border: 1px solid rgba(255, 119, 145, .2); border-radius: 10px; background: rgba(104, 24, 45, .17); color: #ff9bae; font-size: .74rem; line-height: 1.45; }
.form-error[hidden] { display: none; }
.auth-success { align-items: center; justify-content: center; padding: 3rem; text-align: center; }
.success-mark { display: grid; width: 82px; height: 82px; margin-bottom: 1.5rem; place-items: center; border: 1px solid rgba(113,230,177,.45); border-radius: 50%; background: rgba(113,230,177,.1); color: var(--success); box-shadow: 0 16px 38px rgba(0,0,0,.3), 0 0 46px rgba(113,230,177,.12); }
.success-mark svg { width: 34px; height: 34px; stroke-width: 2.2; stroke-dasharray: 32; stroke-dashoffset: 32; }
.auth-success.is-active .success-mark svg { animation: draw-check 440ms var(--ease-out) 80ms forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.auth-footer { margin: 1.2rem 0 0; color: #69778a; font-size: .65rem; letter-spacing: .08em; text-align: center; text-transform: uppercase; }

/* Application shell */
.app-shell { display: none; min-height: 100svh; background: radial-gradient(circle at 90% 0, rgba(112, 95, 255, .055), transparent 35%), var(--ground); }
.app-shell.is-active { display: flex; animation: app-enter 300ms var(--ease-out) backwards; }
@keyframes app-enter { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: translate3d(0,0,0); } }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 16, 25, .98), rgba(6, 10, 17, .98));
  box-shadow: 18px 0 48px rgba(0,0,0,.18);
  transition: width 240ms var(--ease-out);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 0 1.1rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.side-brand, .mobile-brand { display: flex; align-items: baseline; color: var(--ink); text-decoration: none; white-space: nowrap; }
.side-brand > span, .mobile-brand > span { font-family: var(--font-display); font-weight: 800; letter-spacing: -.055em; }
.side-brand > i, .mobile-brand > i { width: 6px; height: 6px; margin-left: .22rem; background: var(--accent); box-shadow: 0 0 14px rgba(131,236,255,.8); }
.side-brand > small, .mobile-brand > small { margin-left: .58rem; color: var(--muted); font-size: .65rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-toggle { background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.sidebar-toggle svg { transition: transform 240ms var(--ease-out); }
.side-nav { position: relative; display: grid; gap: .3rem; padding: 1.1rem .8rem; }
.nav-item { position: relative; z-index: 1; display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 44px; padding: 0 .85rem; border: 0; border-radius: 10px; background: transparent; color: #91a0b5; font-size: .82rem; font-weight: 500; text-align: left; cursor: pointer; transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.nav-item svg { flex: 0 0 auto; width: 17px; height: 17px; }
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.025); }
.nav-item:active { transform: scale(.985); }
.nav-item.is-active { color: var(--ink); background: linear-gradient(90deg, rgba(131,236,255,.09), rgba(148,116,255,.055)); }
.nav-indicator { position: absolute; z-index: 2; top: 1.1rem; left: .78rem; width: 2px; height: 44px; border-radius: 9px; background: linear-gradient(var(--accent), var(--violet)); box-shadow: 0 0 16px rgba(131,236,255,.8), 5px 0 22px rgba(148,116,255,.35); pointer-events: none; transition: transform 220ms var(--ease-in-out), height 180ms var(--ease-out); }
.sidebar-foot { display: grid; gap: .8rem; margin-top: auto; padding: .9rem; border-top: 1px solid var(--line); }
.access-card, .profile-button { display: flex; align-items: center; min-width: 0; border-radius: 11px; }
.access-card { gap: .65rem; padding: .7rem .8rem; background: rgba(113,230,177,.045); border: 1px solid rgba(113,230,177,.12); }
.access-pulse { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(113,230,177,.6); }
.access-card div, .profile-copy { display: grid; min-width: 0; }
.access-card strong, .profile-button strong { color: #dfe7f3; font-size: .73rem; font-weight: 600; white-space: nowrap; }
.access-card small, .profile-button small { color: #75859a; font-size: .65rem; white-space: nowrap; }
.profile-button { width: 100%; gap: .65rem; padding: .55rem; border: 0; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background-color 160ms ease; }
.profile-button:hover { background: rgba(255,255,255,.035); }
.profile-button > svg { width: 16px; height: 16px; margin-left: auto; }
.avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(131,236,255,.18); border-radius: 10px; background: linear-gradient(145deg, rgba(131,236,255,.15), rgba(148,116,255,.16)); color: var(--ink); font-size: .68rem; font-weight: 700; }
.sidebar.is-collapsed { width: 78px; }
.sidebar.is-collapsed .side-brand small, .sidebar.is-collapsed .nav-item span, .sidebar.is-collapsed .access-card div, .sidebar.is-collapsed .profile-copy, .sidebar.is-collapsed .profile-button > svg { display: none; }
.sidebar.is-collapsed .sidebar-head { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sidebar-toggle { position: absolute; right: -16px; background: var(--panel-solid); }
.sidebar.is-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.is-collapsed .side-nav { padding-inline: .65rem; }
.sidebar.is-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.is-collapsed .nav-indicator { left: .63rem; }
.sidebar.is-collapsed .sidebar-foot { padding-inline: .65rem; }
.sidebar.is-collapsed .access-card, .sidebar.is-collapsed .profile-button { justify-content: center; padding-inline: 0; }

.workspace { flex: 1; min-width: 0; margin-left: var(--sidebar-width); transition: margin-left 240ms var(--ease-out); }
.sidebar.is-collapsed + .workspace { margin-left: 78px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 2rem; min-height: 84px; padding: .9rem clamp(1.1rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); background: rgba(5,7,12,.8); backdrop-filter: blur(18px) saturate(120%); }
.mobile-brand { display: none; }
.topbar-copy { min-width: 160px; }
.topbar-copy p { margin: 0 0 .12rem; color: var(--muted); font-size: .66rem; font-weight: 600; letter-spacing: .055em; }
.topbar-copy h1 { margin: 0; font-size: 1.16rem; line-height: 1.2; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; margin-left: auto; }
.period-select, .command-button { display: flex; align-items: center; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: rgba(15,21,32,.72); color: var(--muted-strong); }
.period-select { gap: .5rem; padding: 0 .35rem 0 .7rem; }
.period-select svg, .command-button svg { width: 15px; height: 15px; }
.period-select select { height: 100%; border: 0; outline: 0; background: transparent; color: var(--muted-strong); font-size: .73rem; cursor: pointer; }
.period-select option { background: #0c121d; }
.command-button { gap: .55rem; padding: 0 .7rem; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.command-button:hover { border-color: var(--line-strong); background: var(--panel-hover); }
.command-button span { font-size: .73rem; }
.command-button kbd { padding: .12rem .35rem; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.035); color: #74849a; font-family: var(--font-ui); font-size: .6rem; }
.sync-state { display: flex; align-items: center; gap: .6rem; min-width: 142px; padding-left: .4rem; }
.sync-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(113,230,177,.55); }
.sync-state div { display: grid; }
.sync-state strong { font-size: .68rem; font-weight: 600; }
.sync-state small { color: #718197; font-size: .62rem; }

.workspace-content { width: min(100%, 1560px); margin: 0 auto; padding: 1.25rem clamp(1rem, 3vw, 2.2rem) 3rem; }
.data-banner { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; padding: .72rem .9rem; border: 1px solid rgba(154,175,255,.14); border-radius: 10px; background: rgba(106,123,192,.055); color: var(--muted); }
.data-banner > svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--info); }
.data-banner p { margin: 0; font-size: .72rem; }
.data-banner strong { color: #dfe7f3; }
.data-banner button { margin-left: auto; padding: .1rem .35rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.data-banner.is-hidden { display: none; }
.view { transition: opacity 170ms var(--ease-out), transform 170ms var(--ease-out), filter 170ms ease; }
.view.is-transitioning { opacity: 0; transform: translate3d(0, 7px, 0); filter: blur(2px); }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: .2rem 0 1.1rem; }
.view-heading h2 { margin-bottom: .28rem; font-size: 1.35rem; letter-spacing: -.035em; }
.view-heading p { max-width: 65ch; margin: 0; color: var(--muted); font-size: .78rem; }
.legend { display: flex; flex-wrap: wrap; gap: .45rem; }
.status-chip { display: inline-flex; align-items: center; gap: .36rem; min-height: 24px; padding: .2rem .52rem; border: 1px solid var(--line); border-radius: 999px; font-size: .61rem; font-weight: 650; letter-spacing: .025em; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.confirmed { color: var(--success); background: rgba(113,230,177,.045); }
.status-chip.estimated { color: var(--warning); background: rgba(255,199,107,.04); }
.status-chip.unavailable { color: #8e9baf; background: rgba(142,155,175,.035); }
.status-chip.mock { color: var(--info); background: rgba(154,175,255,.045); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: .85rem; }
.metric-card, .panel, .game-card, .quality-item {
  --mx: 50%;
  --my: 0%;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 15px 42px rgba(0,0,0,.17), inset 0 1px 0 rgba(255,255,255,.025);
}
.metric-card::after, .game-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(280px circle at var(--mx) var(--my), rgba(131,236,255,.075), transparent 46%); opacity: 0; transition: opacity 180ms ease; }
.metric-card { min-height: 138px; padding: 1rem; border-radius: 13px; }
.metric-card header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.metric-card header span:first-child { color: var(--muted); font-size: .7rem; font-weight: 600; }
.metric-value { margin: 1rem 0 .3rem; font-size: 1.6rem; line-height: 1; font-weight: 650; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-foot { display: flex; align-items: center; gap: .45rem; color: #74849a; font-size: .65rem; }
.metric-change { color: var(--success); font-weight: 650; }
.metric-change.negative { color: var(--danger); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(280px, .78fr); gap: .85rem; }
.panel { border-radius: 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .75rem; }
.panel-head h3 { margin-bottom: .22rem; font-size: .87rem; letter-spacing: -.018em; }
.panel-head p { margin: 0; color: var(--muted); font-size: .66rem; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.16); }
.segmented button { padding: .34rem .55rem; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: .62rem; cursor: pointer; transition: color 160ms ease, background-color 160ms ease; }
.segmented button.is-active { background: rgba(131,236,255,.095); color: var(--ink); }
.chart-wrap { min-height: 262px; padding: .6rem 1rem 1rem; }
.line-chart { width: 100%; height: 230px; overflow: visible; }
.chart-grid-line { stroke: rgba(188,211,236,.075); stroke-width: 1; }
.chart-area { fill: url(#chart-fill); opacity: .5; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 8px rgba(92,220,255,.28)); stroke-dasharray: 1100; stroke-dashoffset: 1100; animation: draw-line 720ms var(--ease-out) forwards; }
.chart-dot { fill: #071018; stroke: var(--accent); stroke-width: 2; opacity: 0; animation: dot-in 240ms var(--ease-out) forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }
.chart-axis { fill: #6f8095; font-family: var(--font-ui); font-size: 9px; }
.donut-layout { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 1rem; padding: .7rem 1rem 1.2rem; }
.donut { position: relative; width: 126px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--accent) 0 53%, var(--violet) 53% 82%, var(--warning) 82% 94%, #273346 94%); box-shadow: 0 13px 34px rgba(0,0,0,.24), 0 0 26px rgba(131,236,255,.06); transform: rotate(-65deg); }
.donut::after { content: ""; position: absolute; inset: 23px; border-radius: 50%; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line); }
.donut-center { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; transform: rotate(65deg); }
.donut-center strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.donut-center span { color: var(--muted); font-size: .56rem; }
.breakdown-list { display: grid; gap: .62rem; }
.breakdown-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; font-size: .65rem; }
.breakdown-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--swatch); }
.breakdown-item span { color: var(--muted); }
.breakdown-item strong { font-variant-numeric: tabular-nums; }
.wide-panel { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .7rem; }
.data-table th { padding: .72rem 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #708095; font-size: .59rem; font-weight: 650; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: .78rem 1rem; border-bottom: 1px solid rgba(177,206,235,.075); color: var(--muted-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table tbody tr { transition: background-color 150ms ease; }
.data-table tbody tr:hover { background: rgba(131,236,255,.025); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-product { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 600; }
.product-mark { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: linear-gradient(145deg, var(--mark-a), var(--mark-b)); color: #fff; font-size: .58rem; font-weight: 750; box-shadow: 0 7px 16px rgba(0,0,0,.22); }
.quality-grid, .game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.quality-grid { margin-top: .85rem; }
.quality-item { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-radius: 12px; }
.quality-item svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--accent); }
.quality-item div { display: grid; }
.quality-item strong { font-size: .75rem; }
.quality-item span { color: var(--muted); font-size: .64rem; }
.game-card { min-height: 240px; padding: 1rem; border-radius: 14px; }
.game-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.game-identity { display: flex; align-items: center; gap: .7rem; }
.game-identity .product-mark { width: 38px; height: 38px; border-radius: 11px; }
.game-identity h3 { margin-bottom: .12rem; font-size: .87rem; }
.game-identity p { margin: 0; color: var(--muted); font-size: .62rem; }
.game-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-top: 1.3rem; }
.game-metric { padding: .7rem; border: 1px solid rgba(177,206,235,.085); border-radius: 10px; background: rgba(0,0,0,.12); }
.game-metric span { display: block; margin-bottom: .3rem; color: #76869b; font-size: .58rem; }
.game-metric strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.empty-state { display: grid; min-height: 270px; place-content: center; padding: 2rem; text-align: center; }
.empty-state .empty-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 1rem; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
.empty-state h3 { margin-bottom: .35rem; font-size: .9rem; }
.empty-state p { max-width: 48ch; margin: 0 auto; color: var(--muted); font-size: .7rem; }
.spark-bars { display: flex; align-items: flex-end; gap: 4px; height: 32px; }
.spark-bars i { width: 5px; border-radius: 2px 2px 0 0; background: linear-gradient(var(--accent), rgba(131,236,255,.15)); opacity: .8; transform-origin: bottom; animation: bar-grow 420ms var(--ease-out) both; }
@keyframes bar-grow { from { transform: scaleY(.15); opacity: .2; } }

.search-overlay { position: fixed; z-index: 90; inset: 0; display: grid; place-items: start center; padding-top: 16vh; background: rgba(1,3,6,.68); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease-out); }
.search-overlay.is-open { opacity: 1; pointer-events: auto; }
.search-dialog { width: min(92vw, 560px); border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(12,18,28,.97); box-shadow: 0 28px 80px rgba(0,0,0,.52); transform: translate3d(0,-10px,0) scale(.97); transition: transform 200ms var(--ease-out); }
.search-overlay.is-open .search-dialog { transform: translate3d(0,0,0) scale(1); }
.search-input { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.search-input svg { color: var(--accent); }
.search-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-results { padding: .65rem; }
.search-result { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .7rem .8rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.search-result:hover { background: rgba(131,236,255,.05); color: var(--ink); }
.search-result small { color: #65768c; }

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover { filter: brightness(1.07); box-shadow: 0 15px 34px rgba(65,190,239,.25), inset 0 1px 0 rgba(255,255,255,.75); }
  .icon-button:hover { color: var(--ink); background: rgba(255,255,255,.05); }
  .metric-card:hover::after, .game-card:hover::after { opacity: 1; }
  .metric-card:hover, .game-card:hover { border-color: rgba(131,236,255,.18); }
}

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .wide-panel { grid-column: auto; }
  .game-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quality-grid { grid-template-columns: 1fr; }
  .sync-state { display: none; }
}

@media (max-width: 800px) {
  :root { --sidebar-width: 0px; }
  .prototype-flag { top: auto; right: .7rem; bottom: 5.2rem; max-width: calc(100vw - 1.4rem); }
  .sidebar { inset: auto 0 0 0; width: 100%; height: 66px; border-top: 1px solid var(--line); border-right: 0; }
  .sidebar-head, .sidebar-foot { display: none; }
  .side-nav { display: flex; height: 100%; align-items: center; justify-content: space-around; gap: 0; padding: .35rem; }
  .nav-item { flex: 1; width: auto; min-width: 0; min-height: 54px; flex-direction: column; justify-content: center; gap: .18rem; padding: .2rem; font-size: .56rem; }
  .nav-item:nth-of-type(n+6) { display: none; }
  .nav-indicator { top: auto; left: 0; bottom: 0; width: 20%; height: 2px; transition: transform 220ms var(--ease-in-out), width 180ms var(--ease-out); }
  .workspace, .sidebar.is-collapsed + .workspace { margin-left: 0; padding-bottom: 66px; }
  .topbar { min-height: 74px; gap: .9rem; padding-inline: 1rem; }
  .mobile-brand { display: flex; }
  .topbar-copy p { display: none; }
  .topbar-copy h1 { font-size: 1rem; }
  .topbar-actions { gap: .4rem; }
  .command-button span, .command-button kbd, .period-select svg { display: none; }
  .period-select { padding-left: .3rem; }
  .workspace-content { padding-inline: .8rem; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .game-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-stage { width: min(94vw, 440px); padding-top: 3.8rem; }
  .auth-card { min-height: 625px; border-radius: 21px; }
  .auth-panel { padding: 4.15rem 1.35rem 1.35rem; }
  .auth-panel h1, .auth-panel h2 { font-size: 1.7rem; }
  .otp-grid { gap: .34rem; }
  .otp-grid input { border-radius: 9px; font-size: 1.15rem; }
  .auth-card.is-enrolling { min-height: 810px; }
  .mfa-enrollment { grid-template-columns: 105px 1fr; gap: .75rem; padding: .7rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 122px; }
  .topbar { flex-wrap: wrap; padding-block: .65rem; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .period-select { flex: 1; }
  .period-select select { width: 100%; }
  .chart-wrap { min-height: 220px; }
  .line-chart { height: 190px; }
  .donut-layout { grid-template-columns: 104px 1fr; }
  .donut { width: 104px; }
  .donut::after { inset: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
  .auth-atmosphere i, .auth-card::before, .security-orbit::before { animation: none !important; }
  .auth-panel, .view, .app-shell, .search-dialog { transform: none !important; filter: none !important; }
}
