:root {
  --bg: #081012;
  --panel: rgba(15, 28, 30, .86);
  --panel-strong: #122326;
  --line: rgba(185, 219, 215, .12);
  --text: #eef7f4;
  --muted: #8ca6a3;
  --mint: #57e4bf;
  --cyan: #55cad8;
  --gold: #e8bd6b;
  --red: #ef6d72;
  --sidebar: 252px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 8%, rgba(34, 107, 100, .24), transparent 30%),
    linear-gradient(145deg, #071012, #091416 55%, #071012);
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
}
.ambient-a { top: -120px; right: 16%; background: var(--mint); }
.ambient-b { bottom: -190px; left: 20%; background: var(--cyan); }

.eyebrow {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(620px, 100%);
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(150deg, rgba(22, 43, 45, .96), rgba(10, 21, 23, .96));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .38);
}

.login-card h1 { margin: 0; font-size: clamp(38px, 8vw, 66px); letter-spacing: -.06em; }
.login-copy { max-width: 480px; margin: 18px 0 32px; color: #acc0bd; line-height: 1.8; }
.login-card label { display: block; margin-bottom: 9px; color: #cddbd8; font-size: 13px; }
.credential-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.credential-field input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid rgba(176, 216, 210, .2);
  border-radius: 11px;
  outline: none;
  background: rgba(1, 7, 8, .54);
}
.credential-field input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(87, 228, 191, .1); }
.login-submit, .ghost-button {
  padding: 12px 18px;
  color: #062018;
  border: 0;
  border-radius: 11px;
  background: var(--mint);
  font-weight: 760;
}
.login-submit { width: 100%; margin-top: 14px; }
.form-error { min-height: 20px; color: #ff9297; font-size: 13px; }
.hint { margin: 20px 0 0; color: #6f8985; font-size: 12px; }
.hint code { color: #a4c5bf; }

.shell { min-width: 0; min-height: 100vh; }
.nav-backdrop {
  position: fixed;
  z-index: 990;
  inset: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(1, 8, 9, .62);
  backdrop-filter: blur(3px);
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.shell.nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.sidebar {
  position: fixed;
  z-index: 1000;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  visibility: hidden;
  transform: translateX(calc(-100% - 20px));
  pointer-events: none;
  background: rgba(6, 14, 16, .96);
  backdrop-filter: blur(20px);
  box-shadow: 24px 0 70px rgba(0, 0, 0, .34);
  transition: transform .22s ease, visibility 0s linear .22s;
}
.shell.nav-open .sidebar {
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0s;
}
.nav-close {
  position: absolute;
  top: 17px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #abc2be;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  font-size: 25px;
  line-height: 1;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 5px 38px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #08221b;
  border-radius: 11px;
  background: var(--mint);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.nav-label { margin: 23px 12px 8px; color: #55716d; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
nav .nav-link {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  color: #91a9a6;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  transition: .18s ease;
}
nav .nav-link:hover { color: var(--text); background: rgba(255,255,255,.03); }
nav .nav-link.active { color: #ecfffa; border-color: rgba(87, 228, 191, .12); background: rgba(87, 228, 191, .08); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px currentColor; }
.dot-red { background: var(--red); }.dot-gold { background: var(--gold); }.dot-cyan { background: var(--cyan); }
.sidebar-foot { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 14px 10px; color: #829b97; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: #acc0bd; font-size: 11px; }.sidebar-foot small { margin-top: 3px; font-size: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(87,228,191,.08); }

main { width: 100%; min-width: 0; min-height: 100vh; padding: 30px clamp(16px, 1.7vw, 24px) 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; padding-bottom: 28px; }
.topbar-identity { display: flex; min-width: 0; gap: 15px; align-items: center; }
.menu-button {
  flex: none;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 11px 10px;
  align-content: space-between;
  color: var(--text);
  border: 1px solid rgba(185, 219, 215, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}
.menu-button span { display: block; height: 2px; border-radius: 999px; background: currentColor; }
.menu-button:hover, .nav-close:hover { color: var(--mint); border-color: rgba(87, 228, 191, .32); }
.menu-button:focus-visible, .nav-close:focus-visible, .nav-link:focus-visible, .nav-backdrop:focus-visible {
  outline: 3px solid rgba(87, 228, 191, .55);
  outline-offset: 3px;
}
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.045em; }
.top-actions { display: flex; gap: 14px; align-items: center; }
.timestamp { color: #69817e; font-size: 11px; }
.ghost-button { color: #b6cec9; border: 1px solid var(--line); background: rgba(255,255,255,.035); font-size: 12px; }
.ghost-button:hover { color: var(--text); border-color: rgba(87, 228, 191, .28); }
.ghost-button:disabled { opacity: .5; cursor: wait; }
.notice { margin-bottom: 18px; padding: 12px 15px; color: #f5ce87; border: 1px solid rgba(232, 189, 107, .2); border-radius: 10px; background: rgba(232, 189, 107, .07); font-size: 13px; }
.content { min-height: calc(100vh - 210px); }

.workspace-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .18);
}
.workspace-toolbar {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 11px 16px;
  color: #dbe9e6;
  border-bottom: 1px solid var(--line);
  background: #102023;
}
.workspace-toolbar strong, .workspace-toolbar span { display: block; }
.workspace-toolbar strong { margin-bottom: 4px; font-size: 13px; }
.workspace-toolbar div > span { color: #78918d; font-size: 10px; }
.workspace-toolbar > .badge { flex: none; margin: 0; }
.module-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 205px);
  min-height: 720px;
  border: 0;
  background: #fff;
}

.hero-grid, .module-grid, .metric-grid, .split-grid { display: grid; gap: 14px; }
.hero-grid { grid-template-columns: 1.45fr .55fr; margin-bottom: 14px; }
.module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.split-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(20, 39, 41, .82), rgba(12, 24, 26, .82));
  box-shadow: 0 18px 55px rgba(0,0,0,.12);
}
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(87,228,191,.4), transparent); opacity: .45; }
.hero-panel { min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-panel h2 { max-width: 680px; margin: 6px 0 12px; font-size: clamp(25px, 4vw, 43px); line-height: 1.08; letter-spacing: -.045em; }
.hero-panel p { max-width: 650px; margin: 0; color: #98afab; line-height: 1.75; }
.readiness { display: grid; place-content: center; text-align: center; }
.ring { display: grid; width: 108px; height: 108px; margin: 0 auto 14px; place-items: center; border: 1px solid rgba(87,228,191,.25); border-radius: 50%; background: radial-gradient(circle, rgba(87,228,191,.14), transparent 62%); }
.ring strong { font-size: 31px; letter-spacing: -.05em; }
.ring span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.panel-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 20px; }
.panel h2, .panel h3 { margin: 0; }
.panel h3 { font-size: 16px; }
.panel-copy { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.module-card { min-height: 188px; display: flex; flex-direction: column; }
.module-card a { margin-top: auto; color: var(--mint); text-decoration: none; font-size: 12px; }
.module-card a:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 8px; border-radius: 999px; color: #8df0d6; background: rgba(87,228,191,.08); font-size: 10px; font-weight: 760; letter-spacing: .05em; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.offline { color: #d9ad60; background: rgba(232,189,107,.08); }
.badge.unavailable { color: #ef8589; background: rgba(239,109,114,.08); }
.metric { min-height: 122px; }
.metric-label { color: #718c88; font-size: 11px; }
.metric-value { margin-top: 14px; font-size: clamp(20px, 2.2vw, 30px); font-weight: 780; letter-spacing: -.04em; word-break: normal; overflow-wrap: anywhere; }
.metric-note { margin-top: 7px; color: var(--muted); font-size: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: #849e9a; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 11px; }
.tabs a.active, .tabs a:hover { color: #dffcf4; border-color: rgba(87,228,191,.28); background: rgba(87,228,191,.08); }
.tier-tabs { max-width: 790px; }
.data-list { display: grid; gap: 1px; margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--line); }
.data-row { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(0, 1fr); gap: 18px; padding: 12px 14px; background: #102023; }
.data-row dt { color: #738d89; font-size: 11px; }
.data-row dd { margin: 0; color: #d6e6e2; font-size: 12px; word-break: break-word; }
.empty { display: grid; min-height: 340px; place-items: center; color: #758f8b; text-align: center; }
.compact-empty { min-height: 210px; }
.gate-panel { margin-top: 14px; }
.history-panel { margin-top: 14px; padding: 0; }
.history-panel .panel-head { padding: 22px 24px 0; }
.history-scroll { overflow-x: auto; padding: 0 24px 20px; }
.history-table { width: 100%; min-width: 1160px; border-spacing: 0; border-collapse: separate; color: #cfe0dc; font-size: 11px; }
.history-table th { padding: 12px 10px; color: #66827e; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
.history-table td { padding: 13px 10px; border-bottom: 1px solid rgba(185, 219, 215, .08); vertical-align: top; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.history-table tbody tr:hover td { background: rgba(87, 228, 191, .025); }
.history-table strong, .history-table small { display: block; }
.history-table small { margin-top: 5px; color: #66817d; font-size: 9px; }
.number-list { display: flex; flex-wrap: wrap; gap: 4px; width: 230px; }
.number-chip { display: inline-grid; min-width: 23px; height: 23px; padding: 0 5px; place-items: center; color: #8fa7a3; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.02); font-size: 9px; }
.number-chip.matched-number { color: #071b16; border-color: var(--mint); background: var(--mint); font-weight: 850; }
.special-ball { display: inline-grid; width: 30px; height: 30px; place-items: center; color: #eafff9; border: 1px solid rgba(85, 202, 216, .32); border-radius: 50%; background: rgba(85, 202, 216, .1); font-weight: 800; }
.result-label { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.result-hit { color: #8df0d6; background: rgba(87, 228, 191, .1); }
.result-miss { color: #ff979b; background: rgba(239, 109, 114, .1); }
.money-stack { white-space: nowrap; }
.money-stack span { display: block; margin-bottom: 4px; color: #8aa29e; }
.positive { color: #73e2c5; font-weight: 750; white-space: nowrap; }
.negative { color: #f18489; font-weight: 750; white-space: nowrap; }
.scope-label { display: inline-flex; padding: 4px 7px; color: #b6cbc7; border: 1px solid var(--line); border-radius: 6px; font-size: 9px; }
.history-note { margin: -6px 24px 20px; color: #66817d; font-size: 10px; }
.empty strong { display: block; margin-bottom: 9px; color: #b6cac6; font-size: 19px; }
.loading { min-height: 360px; display: grid; place-items: center; color: #7f9995; }
.loading::before { content: ""; width: 26px; height: 26px; margin-right: 12px; border: 2px solid rgba(87,228,191,.16); border-top-color: var(--mint); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 2px 0; color: #4f6965; font-size: 10px; }

.account-label {
  max-width: 180px;
  overflow: hidden;
  color: #a9c0bc;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secondary-button {
  color: #bdd1cd;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
}
.admin-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(420px, 1.25fr); gap: 16px; }
.admin-panel { padding: 24px; }
.admin-panel h2 { margin: 0 0 8px; }
.admin-form { display: grid; gap: 13px; margin-top: 22px; }
.admin-form label { display: grid; gap: 8px; color: #b8ccc8; font-size: 12px; }
.admin-form input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: var(--text);
  border: 1px solid rgba(176, 216, 210, .2);
  border-radius: 10px;
  outline: none;
  background: rgba(1, 7, 8, .54);
}
.admin-form input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(87, 228, 191, .1); }
.subaccount-list { display: grid; gap: 8px; margin-top: 16px; }
.subaccount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .018);
}
.subaccount-row strong, .subaccount-row span { display: block; }
.subaccount-row span { margin-top: 5px; color: #748e8a; font-size: 11px; }
.subaccount-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.subaccount-actions .ghost-button { padding: 8px 10px; font-size: 11px; }
.inline-password {
  min-width: 210px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid rgba(176, 216, 210, .2);
  border-radius: 9px;
  outline: none;
  background: rgba(1, 7, 8, .54);
}
.inline-password:focus { border-color: var(--mint); }
.password-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  border: 1px solid rgba(176, 216, 210, .24);
  border-radius: 16px;
  background: #071315;
  box-shadow: 0 26px 90px rgba(0, 0, 0, .58);
}
.password-dialog::backdrop { background: rgba(0, 8, 9, .76); backdrop-filter: blur(5px); }
.password-form { margin: 0; padding: 24px; }
.password-form h2 { margin: 4px 0 0; }
.dialog-close {
  width: 36px;
  height: 36px;
  color: #bdd1cd;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-actions .login-submit { width: auto; margin-top: 0; }
.dialog-actions .ghost-button { margin-top: 0; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .sidebar { width: min(320px, calc(100vw - 32px)); padding: 22px 16px; }
  .brand { margin-right: 42px; }
  main { padding: 20px 16px; }
  .topbar { align-items: flex-start; }
  .topbar-identity { gap: 11px; }
  .menu-button { width: 40px; height: 40px; padding: 10px 9px; }
  .top-actions { align-items: flex-end; flex-direction: column; }
  .account-label { max-width: 130px; }
  .timestamp { display: none; }
  .credential-fields { grid-template-columns: 1fr; }
  .login-card { padding: 30px 22px; }
  .metric-grid, .split-grid { grid-template-columns: 1fr; }
  .subaccount-row { align-items: flex-start; flex-direction: column; }
  .subaccount-actions { width: 100%; flex-wrap: wrap; }
  .inline-password { min-width: 100%; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .module-frame { height: 78vh; min-height: 650px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-backdrop { transition: none; }
}

/* V35: five-entry shell. The business frames keep their own isolated layout. */
main {
  padding: 10px 12px 16px;
}
.topbar {
  display: grid;
  grid-template-columns: auto minmax(420px, 1fr) auto;
  gap: clamp(12px, 2vw, 34px);
  align-items: center;
  padding: 0 0 10px;
}
.topbar-brand {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: max-content;
  color: var(--text);
  text-decoration: none;
}
.topbar-brand strong,
.topbar-brand small { display: block; }
.topbar-brand strong { font-size: 14px; letter-spacing: .04em; }
.topbar-brand small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.topbar-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.primary-nav {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 22px);
  min-width: 0;
}
.primary-nav a {
  position: relative;
  padding: 9px 10px;
  color: #b8cbc8;
  border-radius: 9px;
  text-decoration: none;
  font-size: clamp(14px, 1.35vw, 18px);
  font-weight: 800;
  white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav a.active { color: #f3fffc; background: rgba(87, 228, 191, .08); }
.primary-nav a.active::after {
  position: absolute;
  right: 10px;
  bottom: 2px;
  left: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--mint);
  content: "";
}
.primary-nav a:focus-visible,
.topbar-brand:focus-visible { outline: 3px solid rgba(87, 228, 191, .55); outline-offset: 2px; }
.topbar-user { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.session-summary { display: grid; gap: 2px; justify-items: end; }
.top-actions { gap: 6px; }
.top-actions .ghost-button { padding: 9px 11px; font-size: 11px; }
.content { min-height: calc(100vh - 104px); }
.workspace-toolbar { min-height: 44px; padding: 7px 12px; }
.workspace-toolbar strong { margin-bottom: 2px; }
.module-frame { height: calc(100vh - 96px); min-height: 620px; }
.overview-head { padding: 16px 4px 12px; }
.overview-head h2 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 40px); }
.overview-head > p:last-child { margin: 0; color: var(--muted); }
.seven-entry-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.seven-entry-grid .module-card { min-height: 220px; }
footer { padding-top: 12px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .topbar-user { min-width: 0; }
}

@media (max-width: 760px) {
  main { padding: 8px; }
  .topbar { gap: 8px; padding-bottom: 8px; }
  .topbar-user { align-items: flex-end; flex-direction: column; gap: 5px; }
  .session-summary { display: none; }
  .top-actions { align-items: center; flex-flow: row wrap; justify-content: flex-end; }
  .top-actions .ghost-button { padding: 7px 8px; font-size: 10px; }
  .primary-nav { gap: 3px; padding-bottom: 2px; }
  .primary-nav a { padding: 7px 8px; font-size: 13px; }
  .workspace-toolbar { min-height: 38px; padding: 6px 9px; align-items: center; flex-direction: row; }
  .workspace-toolbar div > span { display: none; }
  .module-frame { height: calc(100vh - 112px); min-height: 580px; }
}

