/* ops.css — focused ops/public dashboard. Re-skinned to the BID design system.
   Loaded after styles.css (which defines the tokens + primitives). */

body.ops { max-width: 1500px; padding: 12px 20px; }

/* ─── Public site tab nav ────────────────────────────────────────────── */
.pub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.pub-tab {
  display: inline-block;
  padding: 9px 20px;
  font: 600 11px/1.6 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pub-tab:hover { color: var(--ink); }
.pub-tab.active { color: var(--lime); border-bottom-color: var(--lime); }

/* ─── Team summary cards (public leaderboard) ────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .team-grid { grid-template-columns: 1fr; } }
.team-card-pub {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 22px;
  transition: border-color 0.15s;
}
.team-card-pub:hover { border-color: var(--ink-mute); }
.team-card-pub.team-custom { border-left: 3px solid var(--lime); }
.team-card-pub.team-hosted { border-left: 3px solid var(--warn); }
.team-card-pub h3 { margin: 0 0 10px; font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.team-card-pub .team-pnl { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-bottom: 6px; }
.team-card-pub .team-meta { font-size: 12px; color: var(--ink-mute); display: flex; gap: 12px; flex-wrap: wrap; }
.team-card-pub .team-meta span { color: var(--ink-dim); }

/* ─── Public leaderboard table filters ──────────────────────────────── */
.lb-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lb-filter-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.lb-filter-pill:hover { color: var(--ink); border-color: var(--ink-mute); }
.lb-filter-pill.active { color: var(--lime); border-color: var(--lime); background: rgba(200,250,75,0.06); }
.lb-stats { margin-left: auto; font-size: 11px; color: var(--ink-mute); }

/* ─── Ops header ─────────────────────────────────────────────────────── */
.ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.ops-header .brand,
.ops-header h1.brand {
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-weight: 700;
}
.ops-header .diamond {
  display: inline-block; width: 18px; height: 18px;
  background: var(--lime);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  flex-shrink: 0;
}
.ops-header .user {
  margin-left: auto;
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 10px;
  border: 1px solid var(--line);
}

.ops-main { display: flex; flex-direction: column; gap: 22px; }

.breadcrumb { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.breadcrumb a { color: var(--lime); text-decoration: none; }
.breadcrumb a:hover { color: var(--lime-soft); }
.breadcrumb span { color: var(--ink); }

/* ─── Overview grid (page 1) ─────────────────────────────────────── */
.agents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 1000px) { .agents-grid { grid-template-columns: 1fr; } }

/* ─── Agent card (shared between overview + detail) ───────────────── */
.agent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
a.agent-card:hover { border-color: var(--lime); transform: translateY(-1px); }
.agent-card.detail { gap: 18px; }
.agent-card.error { border-color: var(--red); }

.agent-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.agent-head h2,
.agent-head h1 {
  color: var(--ink);
  margin: 0 0 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.agent-head h2 { font-size: 20px; }
.agent-head h1 { font-size: 22px; }
.agent-head h2 .muted,
.agent-head h1 .muted { color: var(--ink-mute); font-size: 13px; font-weight: normal; margin-left: 6px; font-family: 'JetBrains Mono', monospace; }
.agent-head code { font-size: 11px; }
.agent-head .small { font-size: 11px; }

.agent-head .status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot.running { background: var(--green); box-shadow: 0 0 6px rgba(91,227,154,0.6); animation: pulse 2s infinite; }
.dot.paused  { background: var(--warn); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.big-pnl {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.big-pnl .unit { font-size: 13px; color: var(--ink-mute); font-weight: normal; margin-left: 4px; }

.ours-pnl { text-align: right; }
.ours-pnl .big { font-size: 22px; font-weight: 700; }

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stat-row.three-col { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.stat .big { font-size: 17px; font-weight: 600; }
.stat .muted { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-row.three-col .stat:first-child .big,
.agents-grid .stat-row .stat:nth-child(1) .big { color: var(--ink); }

/* Last decision strip */
.last-decision {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 9px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.last-decision.compact { font-size: 12px; padding: 7px 12px; }
.last-decision .badge { flex-shrink: 0; }
.last-decision .size { font-weight: 700; color: var(--ink); }
.last-decision .reason { color: var(--ink-dim); }
.last-decision .ago { margin-left: auto; }

/* Sparkline (overview) */
.spark-wrap { padding-top: 4px; }
.spark { display: block; width: 100%; height: 50px; }

.card-cta {
  margin-top: auto;
  text-align: right;
  color: var(--lime);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
a.agent-card:hover .card-cta { color: var(--lime); }

/* ─── Range pills (detail page) ────────────────────────────────────── */
.range-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-pills .label { margin-right: 4px; }
.pill {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  height: 28px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.pill:hover { border-color: var(--ink-mute); color: var(--ink); }
.pill.active { border-color: var(--lime); color: var(--lime); background: rgba(200,250,75,0.06); }

/* Strategy filter pills */
.strategy-pills { margin-top: 8px; flex-wrap: wrap; }
.strategy-pill-wrap { display: inline-flex; align-items: center; gap: 2px; }
.strat-info-link {
  color: var(--ink-mute);
  font-size: 11px;
  text-decoration: none;
  padding: 2px 4px;
  transition: color 0.15s;
  line-height: 1;
}
.strat-info-link:hover { color: var(--lime); }

/* Decision matrix */
.matrix-table { border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.matrix-table th, .matrix-table td { padding: 7px 14px; border: 1px solid var(--line); text-align: center; }
.matrix-table th { color: var(--ink-mute); font-weight: normal; text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.matrix-regime { color: var(--ink-dim); font-weight: 600; text-align: right !important; padding-right: 16px !important; }
.matrix-cell { font-weight: 600; }
.action-buy-half  { background: rgba(91,227,154,0.14);  color: var(--green); }
.action-snipe     { background: rgba(200,250,75,0.2);   color: var(--lime); }
.action-sell-half { background: rgba(255,179,71,0.16);  color: var(--warn); }
.action-sell-all  { background: rgba(242,106,106,0.18); color: var(--red); }
.action-hold      { background: rgba(120,120,120,0.12); color: var(--ink-dim); }
.matrix-legend { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.matrix-legend span { padding: 3px 10px; font-size: 11px; font-weight: 600; }
.matrix-legend .action-buy-half  { background: rgba(91,227,154,0.14);  color: var(--green); }
.matrix-legend .action-snipe     { background: rgba(200,250,75,0.2);   color: var(--lime); }
.matrix-legend .action-sell-half { background: rgba(255,179,71,0.16);  color: var(--warn); }
.matrix-legend .action-sell-all  { background: rgba(242,106,106,0.18); color: var(--red); }
.matrix-legend .action-hold      { background: rgba(120,120,120,0.12); color: var(--ink-dim); }

/* Strategy rationale */
.strategy-rationale { font-size: 13px; line-height: 1.7; color: var(--ink-dim); max-width: 720px; white-space: pre-wrap; }

.range-custom-wrap { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.range-custom-input {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  height: 28px;
  padding: 0 10px;
  font: 500 11px/1 'JetBrains Mono', monospace;
  width: 90px;
  text-align: center;
}
.range-custom-input:focus {
  outline: none;
  border-color: var(--lime);
  color: var(--ink);
}
.range-custom-input::placeholder { color: var(--ink-mute); }
/* hide spinner arrows */
.range-custom-input::-webkit-inner-spin-button,
.range-custom-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.range-custom-input[type=number] { -moz-appearance: textfield; }

/* Chart wraps */
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.large { height: 360px; }

/* Chart legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: var(--ink-dim);
  padding: 2px 4px;
}
.lg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.lg-dot.price     { background: #7AB8FF; }
.lg-dot.our-buy   { background: var(--green); }
.lg-dot.our-sell  { background: var(--red); }
.lg-dot.other-buy { background: rgba(91,227,154,0.3); border: 1px solid rgba(91,227,154,0.5); }
.lg-dot.other-sell{ background: rgba(242,106,106,0.3); border: 1px solid rgba(242,106,106,0.5); }
.lg-dot.feedback  { background: #E879F9; transform: rotate(45deg); border-radius: 0; }

/* ─── Controls (detail page) ───────────────────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.btn {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px;
  font: 600 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--lime); }
.btn.pause { border-color: var(--warn); color: var(--warn); }
.btn.pause:hover { background: rgba(255,179,71,0.1); }
.btn.resume { border-color: var(--lime); color: var(--lime); }
.btn.resume:hover { background: rgba(200,250,75,0.1); }
.btn.skip { border-color: var(--red); color: var(--red); }
.btn.skip:hover { background: rgba(242,106,106,0.1); }
.btn.join { border-color: var(--lime); color: var(--lime); }
.btn.join:hover { background: rgba(200,250,75,0.1); }
.btn.small { padding: 6px 12px; font-size: 10px; }
.btn.ghost { background: transparent; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-mute); }

.stake-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 280px;
}
.stake-control label { font-size: 11px; white-space: nowrap; color: var(--ink-dim); }
.stake-input {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 10px;
  width: 90px;
  font: 500 13px/1 'JetBrains Mono', monospace;
}
.stake-input:focus { outline: none; border-color: var(--lime); }

.control-meta { width: 100%; margin-top: 4px; }

/* ─── Tables ───────────────────────────────────────────────────────── */
.battles-section h2 {
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th { color: var(--ink-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.us { background: rgba(200,250,75,0.05); }
tr.us td { border-bottom-color: rgba(200,250,75,0.15); }
table a { color: var(--lime); text-decoration: none; }
table a:hover { color: var(--lime-soft); }

/* ─── Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.buy   { background: rgba(91,227,154,0.15); color: var(--green); }
.badge.sell  { background: rgba(242,106,106,0.15); color: var(--red); }
.badge.hold  { background: rgba(120,120,120,0.15); color: var(--ink-dim); }

/* ─── Chart controls bar (range input + stat chips) ─────────────────── */
.chart-controls-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0 6px;
  border-top: 1px solid var(--line);
}
.chart-range { display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding-top: 2px; }

/* Stat chips */
.cstat-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
}
.cstat-chip {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 12px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 70px;
}
.cstat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  font-weight: 600;
  white-space: nowrap;
}
.cstat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.cstat-sub {
  font-size: 9px;
  color: var(--ink-mute);
  margin-top: 1px;
}
/* W/L chip row */
.cstat-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.cstat-slash { color: var(--ink-mute); font-weight: normal; }
.cstat-pct   { font-size: 11px; font-weight: normal; color: var(--ink-dim); margin-left: auto; }
/* W/L progress bar */
.wl-bar {
  height: 3px;
  background: rgba(242,106,106,0.25);
  margin-top: 3px;
  overflow: hidden;
}
.wl-bar-w {
  height: 100%;
  background: var(--lime);
  transition: width 0.35s ease;
  min-width: 2px;
}

/* ─── Active strategy strip ─────────────────────────────────────────── */
.active-strategy-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(200,250,75,0.04);
  border: 1px solid rgba(200,250,75,0.15);
  padding: 8px 14px;
  font-size: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.active-strat-left { display: flex; align-items: center; gap: 0; }
.active-strat-name { color: var(--lime); font-weight: 600; font-size: 13px; }

/* Strategy pill vertical layout (pill + deploy date stacked) */
.strat-pill-col { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.strat-deploy-date { font-size: 9px; color: var(--ink-mute); letter-spacing: 0.02em; white-space: nowrap; }

/* Strategy badge in battles table */
.strat-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
}

/* Color helpers */
.g, td.g { color: var(--green); }
.r, td.r { color: var(--red); }
.muted { color: var(--ink-dim); }
.small { font-size: 11px; }
