/* Terminal · Reuters / Eikon
 * Escopo: body.terminal-active — CPM Alerts + desks multi-chart.
 * Tokens = Overview institutional. Sem glow · flat · ângulos retos.
 * REVERTER: remover link no index.html (só CSS).
 */

body.terminal-active {
  --term-steel: #4A8FA0;
  --term-steel-hi: #6ba8b6;
  --term-mint: #3FE3BC;
  --term-cream: #ebe5d8;
  --term-dim: #6a7884;
  --term-faint: #7a8794;
  --term-line: #1a2430;
  --term-bg: #070a0d;
  --term-panel: #0a0e12;
  --term-panel-hi: #0e141a;
  --term-loss: #E85C5C;
  --term-amber: #b07d3a;

  --cyan: var(--term-steel);
  --inst-cyan: var(--term-steel);
  --inst-cyan-muted: rgba(74, 143, 160, 0.45);
  --green: var(--term-mint);
  --inst-green: var(--term-mint);
  --bg0: var(--term-bg);
  --bg1: var(--term-panel);
  --bg2: var(--term-panel-hi);
  --inst-bg: var(--term-bg);
  --inst-panel: var(--term-panel);
  --inst-surface: var(--term-panel-hi);
  --inst-border-dim: var(--term-line);
  --border: var(--term-line);
  --border2: var(--term-line);
  --text: var(--term-cream);
  --text-dim: var(--term-dim);
  --text-faint: var(--term-faint);
  --amber: var(--term-amber);
  --amber-hot: #C8923A;
  --red: var(--term-loss);
  --inst-red: var(--term-loss);
  --inst-mono: var(--font-bloomberg, monospace);
}

/* ── Subtabs ── */
body.terminal-active .term-subtabs {
  background: var(--term-panel) !important;
  border-bottom: 1px solid var(--term-line) !important;
  box-shadow: none !important;
}

body.terminal-active .term-subtab {
  color: var(--term-dim) !important;
  font-family: var(--font-bloomberg, monospace) !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  border-radius: 0 !important;
  border-bottom-width: 2px !important;
}

body.terminal-active .term-subtab:hover {
  color: var(--term-cream) !important;
}

body.terminal-active .term-subtab.active,
body.terminal-active .term-subtab-oms.active {
  color: var(--term-steel) !important;
  border-bottom-color: var(--term-steel) !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ── Desk / Alerts shell ── */
body.terminal-active .imperium-desk-view,
body.terminal-active .term-alerts-view,
body.terminal-active .term-alerts-host,
body.terminal-active #view-alertas {
  background: var(--term-bg) !important;
}

body.terminal-active .imperium-desk-view .desk-toolbar,
body.terminal-active .imperium-desk-view > .desk-toolbar.al-tf-bar,
body.terminal-active #al-toolbar.al-tf-bar,
body.terminal-active #view-alertas.al-alerts-desk #al-toolbar.al-tf-bar {
  background: var(--term-panel) !important;
  border-bottom: 1px solid var(--term-line) !important;
  box-shadow: none !important;
}

body.terminal-active .imperium-desk-view > .desk-toolbar.al-tf-bar .tf-sep,
body.terminal-active #al-toolbar.al-tf-bar .tf-sep {
  background: var(--term-line) !important;
}

/* TF + tools — flat steel active */
body.terminal-active .imperium-desk-view .desk-toolbar .tf-btn,
body.terminal-active .imperium-desk-view .desk-toolbar .tool-btn,
body.terminal-active #al-toolbar .tf-btn,
body.terminal-active #al-toolbar .tool-btn,
body.terminal-active .imperium-desk-view .desk-win-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  color: var(--term-dim) !important;
  font-family: var(--font-bloomberg, monospace) !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
  box-shadow: none !important;
  filter: none !important;
}

body.terminal-active .imperium-desk-view .desk-toolbar .tf-btn:hover,
body.terminal-active .imperium-desk-view .desk-toolbar .tool-btn:hover,
body.terminal-active #al-toolbar .tf-btn:hover,
body.terminal-active #al-toolbar .tool-btn:hover,
body.terminal-active .imperium-desk-view .desk-win-btn:hover {
  border-color: var(--term-line) !important;
  color: var(--term-cream) !important;
}

body.terminal-active .imperium-desk-view .desk-toolbar .tf-btn.active,
body.terminal-active .imperium-desk-view .desk-toolbar .tool-btn.active,
body.terminal-active #al-toolbar .tf-btn.active,
body.terminal-active #al-toolbar .tool-btn.active,
body.terminal-active .imperium-desk-view .desk-win-btn.active {
  background: var(--term-steel) !important;
  border-color: var(--term-steel) !important;
  color: #070a0d !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

body.terminal-active .imperium-desk-view .desk-popout-btn.active {
  background: rgba(74, 143, 160, 0.12) !important;
  border-color: rgba(74, 143, 160, 0.45) !important;
  color: var(--term-steel) !important;
}

/* Search / candle preset slots */
body.terminal-active .al-tf-search-slot .tf-search-wrap,
body.terminal-active .al-tf-candle-slot .candle-preset-wrap {
  border-color: var(--term-line) !important;
}

body.terminal-active .tf-search-input,
body.terminal-active .candle-preset-btn {
  color: var(--term-cream) !important;
  background: transparent !important;
}

/* ── Multi-chart grid cells ── */
body.terminal-active .imperium-desk-view .desk-grid {
  background: var(--term-line) !important;
  gap: 1px !important;
}

body.terminal-active .imperium-desk-view .mt-cell {
  background: var(--term-bg) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.terminal-active .imperium-desk-view .mt-cell-hdr {
  background: var(--term-panel) !important;
  border-bottom: 1px solid var(--term-line) !important;
}

body.terminal-active .imperium-desk-view .mt-cell-sym {
  color: var(--term-steel) !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
}

body.terminal-active .imperium-desk-view .mt-cell-tf,
body.terminal-active .imperium-desk-view .mt-cell-price {
  color: var(--term-dim) !important;
}

body.terminal-active .imperium-desk-view .mt-cell--oms-target .mt-cell-hdr,
body.terminal-active .mtg-card--oms-target .mtg-card-hdr,
body.terminal-active #view-alertas.al-alerts-desk .mtg-card.mt-cell--oms-target .mtg-card-hdr {
  border-color: rgba(74, 143, 160, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(74, 143, 160, 0.35) !important;
}

body.terminal-active .imperium-desk-view .mt-cell--fs-active {
  outline: 1px solid rgba(74, 143, 160, 0.55) !important;
}

/* ── CPM Alerts / MTG cards ── */
body.terminal-active .macro-trend-grid .mtg-card {
  background: var(--term-bg) !important;
  border-color: var(--term-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.terminal-active .macro-trend-grid .mtg-card-hdr,
body.terminal-active #term-alerts-host .mtg-card-hdr {
  background: var(--term-panel) !important;
  border-bottom: 1px solid var(--term-line) !important;
}

body.terminal-active .macro-trend-grid .mtg-symbol,
body.terminal-active .mtg-card--oms-target .mtg-symbol {
  color: var(--term-steel) !important;
  font-weight: 600 !important;
}

body.terminal-active .macro-trend-grid .mtg-chart-host {
  background: #000 !important;
}

body.terminal-active .al-scroll-pages,
body.terminal-active #al-grid.al-mtg-grid {
  background: var(--term-line) !important;
}

/* Badges / labels flat */
body.terminal-active .mtg-badge,
body.terminal-active .mtg-pill {
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.terminal-active .mtg-badge--amber {
  background: rgba(176, 125, 58, 0.14) !important;
  color: var(--term-amber) !important;
  border-color: rgba(176, 125, 58, 0.4) !important;
}

/* Ladder de preço do eixo (CPM Alerts) · âmbar → ciano/steel do sistema (pedido) */
body.terminal-active .mtg-price-badge--amber {
  background: rgba(74, 143, 160, 0.14) !important;
  color: var(--term-steel) !important;
  border-color: rgba(74, 143, 160, 0.4) !important;
}

/* ── Footer / bottom bar (Reuters chrome while Terminal) ── */
body.terminal-active #footer-stack,
body.terminal-active #bottombar {
  background: var(--term-panel) !important;
  border-top-color: var(--term-line) !important;
  box-shadow: none !important;
}

body.terminal-active #bottombar .bb-label {
  color: var(--term-dim) !important;
  letter-spacing: 0.1em !important;
}

body.terminal-active #bottombar .bb-val {
  color: var(--term-cream) !important;
  font-weight: 600 !important;
}

body.terminal-active #bottombar .bb-val.ok,
body.terminal-active #bottombar .bb-val.pos {
  color: var(--term-mint) !important;
}

body.terminal-active #bottombar .bb-val.cyan {
  color: var(--term-steel) !important;
}

body.terminal-active #bottombar .bb-val.neg,
body.terminal-active #bottombar .bb-val.err {
  color: var(--term-loss) !important;
}

/* Gov chips / scrollbars sob Terminal */
body.terminal-active #gov-bar {
  background: var(--term-panel) !important;
  border-color: var(--term-line) !important;
}

body.terminal-active ::-webkit-scrollbar-thumb {
  background: var(--term-line) !important;
  border-radius: 0 !important;
}

body.terminal-active ::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 143, 160, 0.45) !important;
}

/* Left OMS dock when open */
body.terminal-active.monitor-oms-dock #left {
  background: var(--term-bg) !important;
  border-color: var(--term-line) !important;
}
