/* ibuta-theme.css — shared institutional theme for the 4-tab dashboard
   Tokens + nav + hero + cards lifted verbatim from paper-rapid.html so the
   new HOME/LIVE/DEMO pages match the existing pages pixel-for-pixel. */

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

:root {
  --bg: #000000;
  --bg-card: #0A0A0A;
  --bg-hover: #111111;
  --bg-elevated: #161616;
  --border: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --text: #F5F5F7;
  --text-secondary: rgba(245,245,247,0.62);
  --text-tertiary: rgba(245,245,247,0.5);
  /* Semantic colors are brightened vs the stock palette so small P/L text
     clears a pragmatic contrast bar on the pure-black background. */
  --green: #3DDC6B;
  --red: #FF5C50;
  --blue: #4AA3FF;
  --orange: #FFB23E;
  --purple: #BF5AF2;
  --cyan: #64D2FF;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* Keyboard focus visibility (was missing — only :hover existed) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px;
}

/* Status label — pairs a colored dot with TEXT so status never relies on
   color alone (colorblind-safe). */
.status-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.status-label.up { color: var(--green); }
.status-label.killed { color: var(--red); }
.status-label.off { color: var(--text-tertiary); }

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.8);
}
.nav-left { display: flex; align-items: center; gap: 24px; }
.nav-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.nav-links { display: flex; gap: 2px; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 2px; }
.nav-links a {
  text-decoration: none; padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,0.1); font-weight: 600; }
.nav-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); transition: background 0.3s; }
.status-dot.live { background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.4); }
.status-dot.stale { background: var(--red); box-shadow: 0 0 8px rgba(255,69,58,0.4); }
.status-text { font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }
.status-text.live { color: var(--green); }
.status-text.stale { color: var(--red); }

/* ── Main ── */
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-sub { font-size: 12px; color: var(--text-tertiary); }

/* ── Hero stat strip ── */
.hero { display: grid; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.hero.cols-5 { grid-template-columns: repeat(5, 1fr); }
.hero.cols-4 { grid-template-columns: repeat(4, 1fr); }
.hero-stat { background: var(--bg-card); padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.hero-label { font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 11px; color: var(--text-tertiary); }

/* ── Cards ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.1px; }
.card-body { padding: 16px 20px; }
.card-badge { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Mode + status pills ── */
.pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.pill-live { background: rgba(48,209,88,0.14); color: var(--green); }
.pill-paper { background: rgba(255,159,10,0.16); color: var(--orange); }
.pill-killed { background: rgba(255,69,58,0.16); color: var(--red); }
.pill-stale { background: rgba(255,159,10,0.16); color: var(--orange); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.45); }
.dot-red { background: var(--red); box-shadow: 0 0 8px rgba(255,69,58,0.45); }
.dot-amber { background: var(--orange); box-shadow: 0 0 8px rgba(255,159,10,0.45); }
.dot-grey { background: var(--text-tertiary); }

/* ── Strategy card (LIVE/DEMO) ── */
.strat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; text-decoration: none; color: inherit; display: block;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.strat-card:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-2px); background: var(--bg-hover); }
.strat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.strat-name { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }
.strat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; line-height: 1.35; }
.strat-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.strat-pnl { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; line-height: 1; }
.strat-pnl-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.strat-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 16px; }
.strat-metric { background: var(--bg); padding: 10px 12px; }
.strat-metric .m-label { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; }
.strat-metric .m-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.strat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 11px; color: var(--text-tertiary); }
.strat-cta { color: var(--blue); font-weight: 600; }

/* ── Fleet health row (HOME) ── */
.fleet-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); text-decoration: none; color: inherit; transition: background 0.12s ease; }
.fleet-row:last-child { border-bottom: none; }
.fleet-row:hover { background: var(--bg-hover); }
.fleet-name { font-size: 13px; font-weight: 600; min-width: 180px; display: flex; align-items: center; gap: 9px; }
.fleet-meta { font-size: 11px; color: var(--text-secondary); flex: 1; }
.fleet-pnl { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }

/* ── Value colors ── */
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--text-tertiary); }
.num { font-variant-numeric: tabular-nums; }

/* ── Leakage callout ── */
.leak { background: rgba(255,159,10,0.06); border: 1px solid rgba(255,159,10,0.18); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 11px; color: var(--text-secondary); }
.leak b { color: var(--orange); }

/* ── Notice / empty ── */
.notice { font-size: 11px; color: var(--text-tertiary); padding: 14px 16px; text-align: center; }
.section-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.6px; margin: 4px 0 12px; }

@media (max-width: 900px) {
  .hero.cols-5, .hero.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
