/* ── Voltrade shared theme ──────────────────────────────────────────────
   Design tokens + reusable component classes shared by every client page.
   Linked via <link rel="stylesheet" href="/static/theme.css"> right after
   the Google Fonts <link> — page-local <style> blocks should only contain
   page-specific layout, not their own copy of these tokens/components. */

:root {
  --bg: #0a0d0f;
  --bg-elev: #11161a;
  --bg-elev-2: #161c21;
  --border: #1f2830;
  --border-bright: #2f3e4a;
  --text: #d8dde2;
  --text-dim: #7d8a93;
  --text-faint: #4a5560;

  --accent: #e9b04a;      /* amber */
  --accent-dim: #8a6a2c;
  --on-accent: #1a1004;   /* text color for anything painted with --accent */
  --bull: #4ade80;        /* green */
  --bear: #ef4444;        /* red */
  --info: #6ec3f4;
  --halt: #ec8c34;
  --closed: #9aa5b1;

  --accent-soft: rgba(233, 176, 74, 0.10);
  --bull-soft: rgba(74, 222, 128, 0.10);
  --bear-soft: rgba(239, 68, 68, 0.10);
  --info-soft: rgba(110, 195, 244, 0.10);
  --halt-soft: rgba(236, 140, 52, 0.10);

  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --serif: 'Fraunces', Georgia, serif;
}

/* ── focus-visible baseline ──
   !important is deliberate: several existing inputs carry an inline
   style="...outline:none" attribute, which beats any plain stylesheet
   rule regardless of selector specificity. */
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 1px; }
:focus:not(:focus-visible) { outline: none; }

/* ── buttons ──
   .btn base + semantic modifiers. Use with the existing --bull/--bear/etc
   tokens so a button's color always matches the state it represents. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.12s, opacity 0.12s, border-color 0.12s, color 0.12s, background 0.12s;
}
.btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-faint); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 10px; }

.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); color: var(--on-accent); border-color: var(--accent); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border-bright); }

.btn-danger { background: transparent; color: var(--bear); border-color: rgba(239, 68, 68, 0.45); }
.btn-danger:hover:not(:disabled) { background: var(--bear-soft); color: var(--bear); border-color: var(--bear); }

.btn-success { background: var(--bull); color: #062012; border-color: var(--bull); }
.btn-success:hover:not(:disabled) { filter: brightness(1.12); color: #062012; border-color: var(--bull); }

/* ── badges / status pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* State/role are appended as a second class (e.g. class="pill-state OPEN"),
   matching the class-suffix convention already used verbatim by
   leaderboard.html/dashboard.html/join.html's .state-pill and
   dashboard.html's .role-badge — so adopting these needs no JS changes
   anywhere that already does `el.className = "... " + state`. */
.pill-state.PRE_OPEN { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pill-state.OPEN     { color: var(--bull);   border-color: var(--bull);   background: var(--bull-soft); }
.pill-state.HALTED   { color: var(--halt);   border-color: var(--halt);   background: var(--halt-soft); }
.pill-state.CLOSED   { color: var(--bear);   border-color: var(--bear);   background: var(--bear-soft); }

.pill-role.host        { background: var(--accent-soft); color: var(--accent); }
.pill-role.participant { background: var(--info-soft);   color: var(--info); }
.pill-role.spectator   { background: rgba(125, 138, 147, 0.15); color: var(--text-dim); }

/* ── tabs ──
   Default flavor: underline-active, for in-panel content tabs (filter
   tabs, right-side panel tabs, dashboard tabs). .tab-btn-solid is a second,
   intentionally distinct flavor for top-level page navigation (admin
   console's tab switcher) — a filled/pill active state, not a mismatch to
   flatten away, since it plays a different UI role (page nav vs. content
   view switch). */
.tabs { display: flex; gap: 3px; }
.tabs.tabs-wrap { flex-wrap: wrap; }
.tabs.tabs-fill > .tab-btn { flex: 1; }

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-btn.tab-btn-solid {
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  text-transform: none;
}
.tab-btn.tab-btn-solid:hover:not(.active) { color: var(--text); border-color: var(--text-faint); }
.tab-btn.tab-btn-solid.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ── modal ──
   Canonical names (.modal-overlay / .modal / .modal-title / .modal-actions)
   match what trader.html and dashboard.html already use. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
}
.modal-title { font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--accent); margin-bottom: 20px; }
.modal-body { font-size: 12px; color: var(--text); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-error { color: var(--bear); font-size: 11px; min-height: 14px; margin-top: 10px; text-align: center; }

/* ── table reset ── */
.table-reset { width: 100%; border-collapse: collapse; font-size: 11px; }
.table-reset th, .table-reset td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table-reset th { color: var(--text-dim); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; font-size: 10px; }
.table-reset td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-reset tbody tr:hover { background: var(--bg-elev); }
.table-reset.table-zebra tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }

/* ── empty / loading states ──
   Verbatim from dashboard.html's existing implementation — the best
   version of this pattern already in the app. */
.empty-state { text-align: center; padding: 80px 32px; color: var(--text-dim); }
.empty-icon { font-size: 36px; margin-bottom: 20px; opacity: 0.4; }
.empty-title { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 11px; line-height: 1.7; letter-spacing: 0.04em; }
.loading-msg { text-align: center; padding: 60px 0; color: var(--text-dim); font-size: 12px; letter-spacing: 0.12em; }

/* ── toast (behavior in notify.js) ── */
.vt-toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.vt-toast {
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--info);
  border-radius: 2px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  pointer-events: auto;
  animation: vt-toast-in 0.18s ease-out;
}
.vt-toast.success { border-left-color: var(--bull); }
.vt-toast.error { border-left-color: var(--bear); }
.vt-toast.info { border-left-color: var(--info); }
@keyframes vt-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
