:root {
  --bg: #090d14;
  --sidebar: #080b12;
  --sidebar-soft: #141c2b;
  --panel: rgba(18, 25, 38, 0.88);
  --panel-soft: rgba(30, 41, 59, 0.78);
  --text: #e8eef8;
  --muted: #8fa0ba;
  --line: rgba(148, 163, 184, 0.18);
  --blue: #2f7bff;
  --blue-dark: #7dd3fc;
  --green: #22c55e;
  --red: #ff5b6e;
  --amber: #f5c84c;
  --cyan: #2dd4bf;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(135deg, #090d14 0%, #101827 48%, #15120b 100%);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.side-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.brand-title { font-size: 17px; font-weight: 800; letter-spacing: 0; }
.brand-subtitle { margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.56); }

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.side-nav a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.side-nav a.active,
.side-nav a:hover {
  color: #fff;
  background: var(--sidebar-soft);
}

.side-foot {
  margin-top: auto;
  color: rgba(255,255,255,.38);
  font-size: 12px;
  padding: 12px 8px 2px;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.page-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.top-actions { display: flex; gap: 10px; align-items: center; }

.shell {
  width: min(1440px, calc(100vw - 292px));
  margin: 22px auto 56px;
}

.loading {
  padding: 24px;
  color: var(--muted);
}

.login-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger, .down { color: var(--red); }
.success, .up { color: var(--green); }
.danger-text { color: var(--red) !important; }

.grid {
  display: grid;
  gap: 16px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-head {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head.flat {
  border-bottom: 0;
  padding: 14px 0 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
}

.card-body { padding: 16px; }

.metric {
  padding: 15px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 7px;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 750;
  color: #344054;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #d5dbe7;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

input, select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 132px;
  padding: 10px;
  resize: vertical;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.10);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-full {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  grid-template-columns: 190px auto;
  gap: 8px;
  align-items: center;
}

button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
}

button.secondary {
  background: #eef2f8;
  color: #1f2a44;
}

button.danger {
  background: #fff1f0;
  color: #b42318;
}

button.ghost {
  background: transparent;
  padding-inline: 8px;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 800;
}

tr:hover td { background: #fbfdff; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf4ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
}

.section-space { margin-top: 16px; }

.notice {
  margin: 12px 16px 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff7f7;
}

.quote-box {
  background: #f8fbff;
  border: 1px dashed #b9c7e4;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.8;
}

.market-console .table-wrap {
  border-top: 0;
}

.kline-card {
  margin: 0 16px 16px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.client-hero {
  background: #0b1220;
  color: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.client-hero h1 {
  margin: 0 0 8px;
  font-size: 25px;
}

.client-hero .muted { color: rgba(255,255,255,.72); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

#app {
  background:
    linear-gradient(180deg, rgba(47, 123, 255, 0.10), transparent 260px),
    linear-gradient(125deg, rgba(45, 212, 191, 0.08), transparent 520px);
}

.sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 18px 0 55px rgba(0,0,0,.26);
}

.side-brand img {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 10px 30px rgba(47,123,255,.22);
}

.side-nav a {
  position: relative;
  overflow: hidden;
}

.side-nav a.active::before,
.side-nav a:hover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(9, 13, 20, 0.78);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(16px);
}

.page-kicker {
  color: var(--cyan);
  letter-spacing: .08em;
}

.topbar h1 {
  color: #f8fbff;
}

.shell {
  width: min(1480px, calc(100vw - 292px));
}

.console-hero {
  position: relative;
  overflow: hidden;
  min-height: 228px;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background:
    linear-gradient(115deg, rgba(11,18,32,.96) 0%, rgba(17,29,49,.92) 54%, rgba(35,31,18,.90) 100%);
  box-shadow: 0 24px 70px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.06);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(480px, .95fr);
  gap: 24px;
}

.console-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.65), transparent 78%);
  pointer-events: none;
}

.console-hero::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
  opacity: .9;
}

.hero-copy,
.hero-readouts {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #b7f9ee;
  background: rgba(45,212,191,.11);
  border: 1px solid rgba(45,212,191,.25);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

.hero-copy h2 {
  margin: 24px 0 12px;
  max-width: 760px;
  color: #fff;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(232,238,248,.72);
}

.hero-subline span {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.48);
}

.hero-readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
}

.readout,
.hero-tape {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(4, 10, 19, 0.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.readout {
  padding: 16px;
}

.readout.primary {
  border-color: rgba(45,212,191,.34);
}

.readout span,
.readout em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.readout b {
  display: block;
  margin: 8px 0 4px;
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.hero-tape {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.tape-item {
  min-width: 0;
  padding: 13px;
  background: rgba(15, 23, 42, .44);
}

.tape-item span,
.tape-item em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tape-item b {
  display: block;
  margin: 7px 0 3px;
  color: #f8fbff;
  font-size: 18px;
}

.card,
.metric,
.login-card {
  background: rgba(18, 25, 38, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(14px);
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
}

.metric-label,
th,
.muted {
  color: var(--muted);
}

.metric-value,
.card-title {
  color: #f8fbff;
}

.card-head {
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent);
}

input,
select {
  color: #eef5ff;
  background: rgba(2, 6, 14, .52);
  border-color: rgba(148, 163, 184, .22);
}

input::placeholder {
  color: rgba(143,160,186,.68);
}

label {
  color: #b8c5d8;
}

button {
  background: linear-gradient(135deg, #1f6dff, #2dd4bf);
  box-shadow: 0 10px 24px rgba(47,123,255,.20);
}

button.secondary {
  color: #dce8fb;
  background: rgba(148,163,184,.14);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: none;
}

button.danger {
  background: rgba(255,91,110,.12);
  color: #ff9aa6;
  border: 1px solid rgba(255,91,110,.25);
  box-shadow: none;
}

th {
  background: rgba(2, 6, 14, .45);
}

td {
  color: #dfe7f3;
}

tr:hover td {
  background: rgba(47,123,255,.06);
}

.pill {
  color: #b7f9ee;
  background: rgba(45,212,191,.10);
  border: 1px solid rgba(45,212,191,.24);
}

.source-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #b7f9ee;
  background: rgba(45,212,191,.09);
  border: 1px solid rgba(45,212,191,.22);
  font-size: 12px;
  font-weight: 750;
}

.notice {
  background: rgba(255,91,110,.08);
}

.quote-box,
.kline-card {
  background: rgba(2, 6, 14, .26);
}

.client-hero {
  background:
    linear-gradient(115deg, rgba(11,18,32,.96), rgba(22,56,98,.88), rgba(35,31,18,.82));
  border: 1px solid rgba(125,211,252,.22);
}

.up { color: #39e58c; }
.down { color: #ff6b7b; }

@media (max-width: 1080px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 14px;
  }

  .side-brand {
    border-bottom: 0;
    padding-bottom: 8px;
  }

  .side-nav,
  .side-foot {
    display: none;
  }

  .shell {
    width: calc(100vw - 24px);
    margin-top: 16px;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding: 14px 16px;
    align-items: flex-start;
  }

  .grid.two, .grid.three, .grid.four, .form-grid, .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .console-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-readouts,
  .hero-tape {
    grid-template-columns: 1fr;
  }
}

/* ===== Toast ===== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.toast-error {
  background: rgba(255, 91, 110, 0.18);
  border: 1px solid rgba(255, 91, 110, 0.35);
}

.toast-info {
  background: rgba(47, 123, 255, 0.18);
  border: 1px solid rgba(47, 123, 255, 0.35);
}

/* ===== Modal ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px 24px;
  min-width: 340px;
  max-width: 460px;
  box-shadow: var(--shadow);
}

.modal-wide {
  max-width: 720px;
}

.confirmation-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.confirmation-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.confirmation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.confirmation-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.54);
}

.confirmation-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.confirmation-grid b {
  color: var(--text);
  font-size: 16px;
}

.modal-box p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-date-input {
  width: 100%;
  margin-bottom: 18px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #1a1a1a;
  padding: 0 12px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== Filter bar ===== */

.filter-bar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.filter-bar select,
.filter-bar input[type="date"] {
  height: 32px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 8px;
}

/* ===== Small button variant ===== */

button.small {
  height: 30px;
  font-size: 12px;
  padding: 0 12px;
}

/* ===== Loading state ===== */

button.loading {
  opacity: 0.6;
  cursor: wait;
}

/* ===== Chart containers ===== */

#navChartContainer {
  padding: 8px 4px 0;
}

#klineChartContainer {
  border-top: 1px solid var(--line);
}

.kline-card {
  margin-top: 16px;
}

/* ===== Details/summary for nav table ===== */

details summary {
  list-style: none;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '▸ ';
}

details[open] summary::before {
  content: '▾ ';
}

/* ===== Status badges (v3) ===== */

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.status-amber {
  color: #f5c84c;
  background: rgba(245,200,76,.12);
  border: 1px solid rgba(245,200,76,.28);
}

.status-blue {
  color: #7dd3fc;
  background: rgba(125,211,252,.10);
  border: 1px solid rgba(125,211,252,.24);
}

.status-green {
  color: #39e58c;
  background: rgba(57,229,140,.10);
  border: 1px solid rgba(57,229,140,.24);
}

.status-red {
  color: #ff6b7b;
  background: rgba(255,107,123,.10);
  border: 1px solid rgba(255,107,123,.24);
}

.status-muted {
  color: var(--muted);
  background: rgba(148,163,184,.08);
  border: 1px solid rgba(148,163,184,.18);
}

/* ===== Danger pill (pending count badge) ===== */

.danger-pill {
  color: #ff6b7b;
  background: rgba(255,91,110,.12);
  border: 1px solid rgba(255,91,110,.25);
}

/* ===== Tab icon (sidebar) ===== */

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(148,163,184,.10);
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  margin-right: 6px;
  flex-shrink: 0;
}

.side-nav a.active .tab-icon {
  background: rgba(45,212,191,.15);
  color: var(--cyan);
}

/* ===== Pending badge (sidebar) ===== */

.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  margin-left: auto;
}

/* ===== Risk metrics grid spacing ===== */

#riskMetricsSection .grid.four {
  margin-bottom: 12px;
}

#riskMetricsSection .notice {
  margin: 0 16px 12px;
}

/* ===== Warning pulse animation ===== */

.warning-pulse {
  animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== Checkbox alignment ===== */

input[type="checkbox"] {
  width: auto;
  height: auto;
  accent-color: var(--cyan);
}

/* ===== Apple-inspired polish (v5) ===== */

:root {
  --bg: #f5f5f7;
  --sidebar: rgba(246, 246, 248, 0.82);
  --sidebar-soft: rgba(0, 113, 227, 0.10);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-soft: rgba(245, 245, 247, 0.72);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --blue: #0071e3;
  --blue-dark: #005bb5;
  --green: #248a3d;
  --red: #d70015;
  --amber: #b26a00;
  --cyan: #0a84ff;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.06);
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 48%, #eef1f5 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  background: transparent;
}

.sidebar {
  background: var(--sidebar);
  color: var(--text);
  border-right: 1px solid rgba(60, 60, 67, 0.12);
  box-shadow: none;
  backdrop-filter: blur(24px) saturate(1.45);
  -webkit-backdrop-filter: blur(24px) saturate(1.45);
}

.side-brand {
  border-bottom: 1px solid rgba(60, 60, 67, 0.10);
}

.side-brand img {
  background: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(0,0,0,.08);
}

.brand-title {
  color: #1d1d1f;
  font-weight: 760;
}

.brand-subtitle,
.side-foot {
  color: #86868b;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: #515154;
  border-radius: 8px;
  font-weight: 650;
}

.side-nav a.active,
.side-nav a:hover {
  color: #1d1d1f;
  background: rgba(0, 113, 227, 0.10);
}

.side-nav a.active::before,
.side-nav a:hover::before {
  display: none;
}

.tab-icon {
  border-radius: 6px;
  background: rgba(118, 118, 128, 0.12);
  color: #6e6e73;
}

.side-nav a.active .tab-icon {
  background: #0071e3;
  color: #fff;
}

.topbar {
  background: rgba(251, 251, 253, 0.78);
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  box-shadow: 0 1px 0 rgba(255,255,255,.75);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.page-kicker {
  color: #6e6e73;
  letter-spacing: 0;
  font-weight: 650;
}

.topbar h1 {
  color: #1d1d1f;
  font-weight: 760;
}

.shell {
  width: min(1480px, calc(100vw - 292px));
  margin-top: 24px;
}

.card,
.metric,
.login-card,
.modal-box {
  background: var(--panel);
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

.card-head {
  background: rgba(255,255,255,.26);
  border-bottom: 1px solid rgba(60, 60, 67, 0.10);
}

.card-title,
.metric-value {
  color: #1d1d1f;
  font-weight: 760;
}

.metric {
  padding: 16px;
}

.metric::before {
  display: none;
}

.metric-label,
.muted,
th {
  color: #6e6e73;
}

.console-hero {
  min-height: 214px;
  border-radius: 8px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(250,250,252,.70));
  box-shadow: var(--shadow);
}

.console-hero::before,
.console-hero::after {
  display: none;
}

.hero-badge {
  height: 28px;
  color: #0066cc;
  background: rgba(0, 113, 227, 0.10);
  border-color: rgba(0, 113, 227, 0.18);
  letter-spacing: 0;
}

.pulse-dot {
  background: #30d158;
  box-shadow: 0 0 0 4px rgba(48, 209, 88, .16);
}

.hero-copy h2 {
  color: #1d1d1f;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 780;
}

.hero-subline {
  color: #6e6e73;
}

.hero-subline span,
.readout,
.hero-tape,
.tape-item {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(60, 60, 67, 0.12);
  box-shadow: none;
}

.readout span,
.readout em,
.tape-item span,
.tape-item em {
  color: #6e6e73;
}

.readout b,
.tape-item b {
  color: #1d1d1f;
  font-weight: 760;
}

.readout.primary {
  border-color: rgba(0, 113, 227, 0.22);
  background: rgba(0, 113, 227, 0.07);
}

label {
  color: #515154;
  font-weight: 650;
}

input,
select,
textarea,
.modal-date-input {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a6;
}

input:focus,
select:focus,
textarea:focus,
.modal-date-input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

button {
  background: #0071e3;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
  font-weight: 650;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

button:hover:not(:disabled) {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 113, 227, 0.22);
}

button.secondary {
  color: #1d1d1f;
  background: rgba(118, 118, 128, 0.12);
  border: 1px solid rgba(60, 60, 67, 0.10);
  box-shadow: none;
}

button.secondary:hover:not(:disabled) {
  background: rgba(118, 118, 128, 0.18);
  box-shadow: none;
}

button.danger {
  color: #d70015;
  background: rgba(255, 59, 48, 0.10);
  border: 1px solid rgba(255, 59, 48, 0.14);
  box-shadow: none;
}

button.danger:hover:not(:disabled) {
  background: rgba(255, 59, 48, 0.15);
  box-shadow: none;
}

table {
  color: #1d1d1f;
}

th {
  background: rgba(245, 245, 247, 0.78);
  font-weight: 650;
}

td {
  color: #1d1d1f;
}

tr:hover td {
  background: rgba(0, 113, 227, 0.045);
}

.pill,
.source-chip {
  color: #0066cc;
  background: rgba(0, 113, 227, 0.10);
  border: 1px solid rgba(0, 113, 227, 0.16);
}

.danger-pill {
  color: #d70015;
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.16);
}

.status-amber {
  color: #946200;
  background: rgba(255, 204, 0, 0.14);
  border-color: rgba(255, 204, 0, 0.22);
}

.status-blue {
  color: #0066cc;
  background: rgba(0, 113, 227, 0.10);
  border-color: rgba(0, 113, 227, 0.16);
}

.status-green {
  color: #248a3d;
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.18);
}

.status-red {
  color: #d70015;
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.16);
}

.status-muted {
  color: #6e6e73;
  background: rgba(118, 118, 128, 0.10);
  border-color: rgba(118, 118, 128, 0.16);
}

.notice {
  color: #8a4b00;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.20);
}

.quote-box,
.kline-card {
  background: rgba(255,255,255,.54);
  border-color: rgba(60, 60, 67, 0.12);
}

#klineChartContainer,
#navChartContainer {
  border-color: rgba(60, 60, 67, 0.12);
}

.client-hero {
  color: #1d1d1f;
  border: 1px solid rgba(60, 60, 67, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(245,245,247,.72));
  box-shadow: var(--shadow);
}

.client-hero h1 {
  color: #1d1d1f;
}

.client-hero .muted {
  color: #6e6e73;
}

.up,
.success {
  color: #248a3d;
}

.down,
.danger,
.danger-text {
  color: #d70015;
}

.modal-overlay {
  background: rgba(232, 232, 237, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.toast {
  color: #1d1d1f;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(60, 60, 67, 0.12);
  box-shadow: 0 14px 36px rgba(0,0,0,.14);
}

.toast-success {
  border-color: rgba(52, 199, 89, 0.24);
}

.toast-error {
  border-color: rgba(255, 59, 48, 0.24);
}

.toast-info {
  border-color: rgba(0, 113, 227, 0.24);
}

.metric-danger {
  border-color: rgba(255, 59, 48, 0.22);
  background: rgba(255, 59, 48, 0.06);
}

.top-product-switch {
  min-width: 240px;
  max-width: 360px;
  height: 38px;
  padding: 0 36px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  color: #1d1d1f;
  background-color: rgba(255,255,255,.72);
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="checkbox"] {
  accent-color: #0071e3;
}

@media (max-width: 1080px) {
  .sidebar {
    background: rgba(251, 251, 253, 0.88);
  }

  .shell {
    width: calc(100vw - 24px);
  }

  .topbar {
    background: rgba(251, 251, 253, 0.86);
  }

  .hero-copy h2 {
    font-size: 28px;
  }
}
