/* SENTINEL TERMINAL — shared shell
   Tokens derived from the trading-terminal design system (dark, dense, instrumental).
   Reused across all five Sentinel pages so navigating between them feels like one instrument. */

:root {
  /* neutrals, the base of a dense UI */
  --bg-base: #0a0e14;
  --bg-surface: #11161f;
  --bg-elevated: #1a212e;
  --border-subtle: #1f2733;
  --border-strong: #2a3441;

  --text-primary: #d8dee9;
  --text-secondary: #8b97a7;
  --text-muted: #5a6573;

  /* status semantics — repurposed from quote up/down/flat */
  --status-green: #4ec9a8;
  --status-yellow: #d4a72c;
  --status-red: #e06c75;
  --status-flat: #8b97a7;

  /* accent, used sparingly */
  --accent: #c9924e;

  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-ui: 'Inter', system-ui, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
}

/* === Top bar — persistent across all five pages === */
.st-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.st-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}
.st-back {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: 16px;
  padding-right: 16px;
  border-right: 1px solid var(--border-subtle);
  transition: color 0.12s;
}
.st-back:hover { color: var(--text-primary); }
.st-logo .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-green);
  margin-right: 8px;
  box-shadow: 0 0 6px var(--status-green);
}

.st-tabs {
  display: flex;
  gap: 2px;
}
.st-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 2px;
  transition: background 0.12s, color 0.12s;
}
.st-tab:hover { background: var(--bg-elevated); color: var(--text-primary); }
.st-tab.active {
  background: var(--bg-elevated);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.st-clock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* === Page shell === */
.st-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px;
}

.st-page-head {
  margin-bottom: 16px;
}
.st-page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.st-page-title {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.st-page-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 640px;
  line-height: 1.6;
}

/* === Panel grid === */
.st-grid {
  display: grid;
  gap: 1px;
  background: var(--border-subtle);
}

.st-panel {
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.st-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.st-panel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.st-panel-status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.st-panel-status.live { color: var(--status-green); background: rgba(78,201,168,0.12); }
.st-panel-status.pending { color: var(--text-muted); background: rgba(90,101,115,0.2); }
.st-panel-status.alert { color: var(--status-red); background: rgba(224,108,117,0.14); }

.st-panel-body {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}

/* === Data rows === */
.st-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}
.st-row:last-child { border-bottom: none; }
.st-row-label {
  color: var(--text-secondary);
  flex: 1;
  padding-right: 8px;
}
.st-row-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}
.st-row-value.up { color: var(--status-green); }
.st-row-value.down { color: var(--status-red); }
.st-row-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* === Placeholder panel (unverified source, not yet wired) === */
.st-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 140px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}
.st-placeholder-icon {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-muted);
  opacity: 0.6;
}
.st-placeholder-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.st-placeholder-note {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* === Loading / error states === */
.st-loading, .st-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 16px 0;
  text-align: center;
}
.st-error { color: var(--status-red); }

/* === Footer === */
.st-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* === Sponsored banner (rotating affiliate, weighted pick from /affiliates.json) === */
.st-banner {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--accent);
  padding: 12px 16px;
  margin-top: 1px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.st-banner.is-visible { display: flex; }
.st-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.st-banner-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.st-banner-subtext {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.st-banner-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg-base);
  background: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 2px;
  white-space: nowrap;
  transition: opacity 0.12s;
}
.st-banner-link:hover { opacity: 0.85; }

@media (max-width: 900px) {
  .st-tabs { flex-wrap: wrap; }
  .st-grid { grid-template-columns: 1fr !important; }
}
