﻿:root {
  color-scheme: dark;
  --bg: #10151c;
  --panel: #171f28;
  --panel-2: #1d2732;
  --line: #2a3644;
  --text: #edf3f8;
  --muted: #93a4b6;
  --accent: #14b8a6;
  --bad: #f05d5e;
  --good: #58d18c;
  --warn: #f2bd4c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
button, input, select { font: inherit; }
.login-page {
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(20, 184, 166, .12), transparent 42%),
    linear-gradient(180deg, #0f141b, #111923 70%);
}
.login-shell {
  width: min(440px, calc(100vw - 32px));
}
.login-panel {
  border: 1px solid var(--line);
  background: rgba(23, 31, 40, .96);
  padding: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
}
.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(20, 184, 166, .5);
  background: rgba(20, 184, 166, .12);
  color: #b9fff6;
  font-weight: 800;
}
h1, h2, p { margin: 0; }
.brand-block h1 {
  font-size: 21px;
  font-weight: 700;
}
.brand-block p {
  margin-top: 3px;
  color: var(--muted);
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f151c;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .14);
}
.login-form button,
.ghost-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #041312;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}
.login-error {
  border: 1px solid rgba(240, 93, 94, .45);
  background: rgba(240, 93, 94, .1);
  color: #ffc4c4;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.app-page {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(20, 184, 166, .05), transparent 280px),
    var(--bg);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0d131a;
}
.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.side-brand h1 {
  font-size: 17px;
}
.side-brand p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.side-nav {
  flex: 1;
  overflow: auto;
  padding: 12px 10px;
}
.nav-group {
  margin-top: 14px;
}
.nav-parent {
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: #6f8296;
  text-align: left;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-parent::after {
  content: "+";
  float: right;
  color: var(--muted);
}
.nav-group.open .nav-parent::after {
  content: "-";
}
.nav-children {
  display: none;
}
.nav-group.open .nav-children {
  display: block;
}
.nav-subgroup {
  margin-top: 6px;
}
.nav-subparent {
  width: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: #6f8296;
  text-align: left;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-subparent::after {
  content: "+";
  float: right;
  color: var(--muted);
}
.nav-subgroup.open .nav-subparent::after {
  content: "-";
}
.nav-subchildren {
  display: none;
  padding-left: 12px;
}
.nav-subgroup.open .nav-subchildren {
  display: block;
}
.nav-subchildren .nav-item {
  min-height: 32px;
}
.nav-item {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}
.nav-item:hover,
.nav-item.active {
  border-color: rgba(20, 184, 166, .34);
  background: rgba(20, 184, 166, .09);
  color: var(--text);
}
.side-footer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.state-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.state-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}
.state-dot.live::before { background: var(--good); }
.state-dot.bad::before { background: var(--bad); }
.app-main {
  min-width: 0;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 21, 28, .96);
}
.topbar h2 {
  font-size: 18px;
}
.topbar p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.top-live {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, .12), rgba(20, 184, 166, .03)),
    rgba(16, 21, 28, .92);
  padding: 8px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.top-live .state-dot {
  color: var(--text);
  font-weight: 700;
}
.live-separator {
  color: var(--muted);
}
.ghost-button,
.refresh-button {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 34px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}
.refresh-button {
  background: rgba(20, 184, 166, .1);
}
.view {
  display: none;
  width: 100%;
  margin: 0;
  padding: 10px 14px 14px;
}
.view.active { display: block; }
#view-spot.active,
#view-charts.active,
#view-index.active,
#view-futures.active,
#view-futures-flow.active,
#view-others.active,
#view-bilanco.active,
#view-takas.active,
#view-news.active,
#view-flow.active,
#view-portfolio.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  overflow: hidden;
}
#view-flow.active {
  overflow: auto;
}
#view-spot > .panel,
#view-charts > .panel,
#view-index > .panel,
#view-futures > .panel,
#view-futures-flow > .panel,
#view-others > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#view-spot.active::after,
#view-charts.active::after,
#view-index.active::after,
#view-futures.active::after,
#view-futures-flow.active::after,
#view-others.active::after {
  content: "";
  flex: 0 0 64px;
}
.chart-panel {
  gap: 10px;
}
.chart-canvas-wrap {
  flex: 1;
  min-height: 260px;
  border: 1px solid var(--line);
  background: #0b1118;
  overflow: hidden;
}
#chartCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
.chart-table-wrap {
  flex: 0 0 180px;
  min-height: 0;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-height: 34px;
}
.check-label input {
  accent-color: var(--accent);
}
.bilanco-toolbar-panel {
  margin-bottom: 10px;
}
.bilanco-tabs,
.takas-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.bilanco-tab,
.takas-tab {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #101821;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}
.bilanco-tab.active,
.bilanco-tab:hover,
.takas-tab.active,
.takas-tab:hover {
  border-color: rgba(20, 184, 166, .4);
  background: rgba(20, 184, 166, .1);
  color: var(--text);
}
.takas-tab-panel {
  display: none;
}
.takas-tab-panel.active {
  display: block;
}
.bilanco-panel {
  display: none;
  min-height: 0;
  overflow: hidden;
}
.bilanco-panel.active {
  display: block;
}
.takas-content {
  min-height: 0;
  overflow: auto;
  padding-bottom: 64px;
}
#bilancoPanelOverview.active {
  overflow: auto;
  padding-bottom: 64px;
}
#bilancoPanelAnalysis.active,
#bilancoPanelDetail.active,
#takasSymbolPanel.active,
#takasBrokerPanel.active {
  flex: 1;
  min-height: 0;
}
.bilanco-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.bilanco-card,
.bilanco-empty {
  min-width: 0;
  min-height: 106px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}
.bilanco-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bilanco-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bilanco-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: rgba(20, 184, 166, .12);
}
.selected-row {
  background: rgba(20, 184, 166, .16);
}
.sparkline {
  width: 100%;
  height: 34px;
  margin-top: 8px;
}
.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.bilanco-table-wrap {
  max-height: calc(100vh - 286px);
}
.bilanco-table {
  min-width: 1180px;
}
.takas-summary-grid {
  margin-bottom: 10px;
}
.takas-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.takas-change-grid .bilanco-table {
  min-width: 760px;
}
.bilanco-form-panel .panel {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}
.bilanco-form-panel .panel-head {
  min-height: 30px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.bilanco-form-panel .panel-head h2 {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.bilanco-form-panel .panel-head span {
  color: var(--muted);
}
.bilanco-form-panel .bilanco-table-wrap {
  max-height: calc(100vh - 256px);
  border-color: var(--line);
  background: var(--bg);
}
.bilanco-form-panel .bilanco-table {
  min-width: 980px;
  color: var(--text);
  background: var(--bg);
  border-collapse: collapse;
}
.bilanco-form-panel .bilanco-table th {
  background: rgba(20, 184, 166, .08);
  color: #a9d8ff;
  border: 1px solid var(--line);
  font-weight: 600;
  text-transform: none;
}
.bilanco-form-panel .bilanco-table th.bilanco-period-header {
  padding: 2px;
}
.bilanco-form-panel .bilanco-table th.bilanco-period-header select {
  width: 100%;
  min-width: 108px;
  height: 22px;
  border: 1px solid var(--line);
  background: #101821;
  color: var(--text);
  font: inherit;
}
.bilanco-form-panel .bilanco-table td {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}
.bilanco-form-panel .bilanco-table td.num {
  text-align: right;
}
.bilanco-form-panel .bilanco-table td.bilanco-sector-average {
  background: rgba(244, 114, 182, .08);
}
.bilanco-form-panel .bilanco-table td.bilanco-no,
.bilanco-form-panel .bilanco-table td.bilanco-field {
  background: rgba(20, 184, 166, .04);
}
.bilanco-form-panel .bilanco-table tr.bilanco-summary td {
  color: #7dd3fc;
  font-weight: 600;
}
.bilanco-form-panel .bilanco-table tr:hover td {
  background: rgba(20, 184, 166, .12);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.metric {
  min-height: 66px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}
.metric span,
.panel-head span {
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.1;
  min-height: 23px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}
.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.panel h2 {
  font-size: 14px;
  font-weight: 700;
}
.spot-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.filter-label input,
.filter-label select {
  width: 180px;
  border: 1px solid var(--line);
  background: #0f151c;
  color: var(--text);
  min-height: 34px;
  padding: 0 10px;
  outline: none;
}
.filter-label input:focus,
.filter-label select:focus {
  border-color: var(--accent);
}
.field-picker {
  position: relative;
}
.field-picker summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  background: #101821;
}
.field-picker summary::-webkit-details-marker { display: none; }
.field-options {
  position: absolute;
  top: 39px;
  left: 0;
  z-index: 30;
  width: 250px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #0d131a;
  box-shadow: 0 18px 50px rgba(0,0,0,.38);
  padding: 8px;
}
.field-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--muted);
}
.field-options input {
  accent-color: var(--accent);
}
.toolbar-stat {
  margin-left: auto;
  color: var(--muted);
}
#spotQuoteTable {
  min-width: 1260px;
}
#futuresQuoteTable,
#othersQuoteTable {
  min-width: 1260px;
}
.flow-wide-table {
  min-width: 1280px;
}
.flow-decision-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.flow-decision-card {
  min-width: 0;
  min-height: 70px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
}
.flow-decision-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.flow-decision-card strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.flow-decision-card small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.flow-decision-card.good {
  border-color: rgba(88, 209, 140, .36);
}
.flow-decision-card.bad {
  border-color: rgba(240, 93, 94, .36);
}
.flow-decision-card.warn {
  border-color: rgba(242, 189, 76, .42);
}
.flow-signal-panel {
  margin-bottom: 10px;
}
.flow-signals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}
.flow-signal-row {
  min-width: 0;
  border: 1px solid rgba(42, 54, 68, .75);
  background: #121a23;
  padding: 9px;
}
.flow-signal-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
.flow-signal-row span {
  display: block;
  color: #d7e3ef;
  font-size: 12px;
}
.flow-signal-row.good {
  border-color: rgba(88, 209, 140, .32);
}
.flow-signal-row.bad {
  border-color: rgba(240, 93, 94, .32);
}
.flow-signal-row.warn {
  border-color: rgba(242, 189, 76, .34);
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: rgba(20, 184, 166, .1);
}
.drilldown-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}
.drilldown-modal.hidden {
  display: none;
}
.drilldown-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 13, .72);
  backdrop-filter: blur(2px);
}
.drilldown-panel {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
}
.drilldown-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.drilldown-head h2 {
  font-size: 16px;
}
.drilldown-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.drilldown-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 10px;
}
.drilldown-status {
  border: 1px solid rgba(42, 54, 68, .75);
  background: #121a23;
  color: var(--muted);
  padding: 14px;
}
.drilldown-summary .portfolio-mini-grid {
  padding: 0;
}
.drilldown-section {
  min-width: 0;
  border: 1px solid rgba(42, 54, 68, .75);
  background: #121a23;
}
.drilldown-table-wrap {
  max-height: 330px;
}
.news-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 36%) minmax(0, 1fr);
  gap: 10px;
}
.news-list-panel,
.news-detail-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.news-list-wrap {
  flex: 1;
  max-height: none;
}
.news-table {
  min-width: 760px;
}
.news-table tbody tr {
  cursor: pointer;
}
.news-table tbody tr:hover,
.news-table tbody tr.selected {
  background: rgba(20, 184, 166, .1);
}
.news-table .news-title-cell {
  min-width: 260px;
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-detail {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}
.news-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.news-meta-item {
  min-width: 0;
  border: 1px solid rgba(42, 54, 68, .75);
  background: #121a23;
  padding: 8px;
}
.news-meta-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}
.news-meta-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.news-content {
  color: #d7e3ef;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 13px;
}
.portfolio-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 10px;
}
.portfolio-info,
.portfolio-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.portfolio-summary {
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
}
.portfolio-accounts {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(420px, 1fr);
  gap: 10px;
  overflow: auto;
}
.portfolio-card-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: auto;
}
.portfolio-markets {
  display: grid;
  gap: 10px;
}
.portfolio-market {
  border: 1px solid rgba(42, 54, 68, .75);
  background: #121a23;
}
.portfolio-market-spot {
  border-top-color: rgba(32, 209, 143, .75);
}
.portfolio-market-futures {
  border-top-color: rgba(86, 168, 255, .85);
}
.portfolio-market h3 {
  margin: 0;
  padding: 8px 9px;
  border-bottom: 1px solid rgba(42, 54, 68, .75);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.portfolio-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}
.portfolio-section-title {
  padding: 7px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.placeholder-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}
.placeholder-panel h2 {
  font-size: 16px;
  margin-bottom: 6px;
}
.placeholder-panel p {
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  max-height: 300px;
}
.table-wrap { scrollbar-width: thin; scrollbar-color: #2f3e4f transparent; }
.table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: #2f3e4f;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: #3c4f63; background-clip: content-box; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap.status-table {
  max-height: none;
}
.status-table table {
  table-layout: fixed;
}
.status-table th:first-child,
.status-table td:first-child {
  width: 38%;
}
.status-table th:last-child,
.status-table td:last-child {
  width: 62%;
}
.status-table td:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-wrap.market-table {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.news-symbol-cell {
  width: 6ch;
  max-width: 6ch;
  overflow: hidden;
  text-overflow: clip;
}
.table-wrap.tall {
  max-height: 360px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}
th, td {
  border-bottom: 1px solid rgba(42, 54, 68, .42);
  padding: 3px 10px;
  white-space: nowrap;
  line-height: 1.3;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #1a2530, #141d26);
  color: #aebccd;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, .018);
}
tbody tr:hover td {
  background: rgba(20, 184, 166, .08);
}
tbody tr:last-child td {
  border-bottom: none;
}
td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.good { color: var(--good); }
td.bad { color: var(--bad); }
td.warn { color: var(--warn); }
.flash-up,
td.flash-up {
  animation: quote-flash-up .4s ease-out;
}
.flash-down,
td.flash-down {
  animation: quote-flash-down .4s ease-out;
}
.flash-change {
  animation: value-flash .4s ease-out;
}
@keyframes quote-flash-up {
  0% {
    background: rgba(88, 209, 140, .26);
    box-shadow: inset 0 0 0 1px rgba(88, 209, 140, .38);
  }
  100% {
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}
@keyframes quote-flash-down {
  0% {
    background: rgba(240, 93, 94, .24);
    box-shadow: inset 0 0 0 1px rgba(240, 93, 94, .34);
  }
  100% {
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}
@keyframes value-flash {
  0% {
    background: rgba(86, 168, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(86, 168, 255, .25);
  }
  100% {
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}
.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 20px 8px;
}
@media (max-width: 980px) {
  .app-page { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .nav-group { margin-top: 0; grid-column: 1 / -1; }
  .metrics, .grid.two { grid-template-columns: 1fr; }
  .flow-decision-grid,
  .flow-signals { grid-template-columns: 1fr; }
  .view { padding: 10px; }
  .topbar { position: static; }
  #view-spot.active,
  #view-index.active,
  #view-futures.active,
  #view-futures-flow.active,
  #view-others.active,
  #view-news.active,
  #view-flow.active,
  #view-portfolio.active { height: auto; overflow: visible; }
  #view-spot.active::after,
  #view-index.active::after,
  #view-futures.active::after,
  #view-futures-flow.active::after,
  #view-others.active::after { display: none; }
  .spot-toolbar { align-items: stretch; flex-direction: column; }
  .filter-label, .filter-label input, .filter-label select, .field-picker summary { width: 100%; }
  .field-options { position: static; width: 100%; box-shadow: none; }
  .news-layout { grid-template-columns: 1fr; }
  .news-detail-meta { grid-template-columns: 1fr; }
  .portfolio-layout { grid-template-columns: 1fr; }
  .portfolio-accounts { grid-auto-flow: row; grid-auto-columns: auto; }
  .top-live {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}


