body {
  margin: 0;
  background: #0d1321;
  color: #f5f7ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #151f30;
  border: 1px solid #2e3b58;
  border-radius: 12px;
  padding: 18px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.login-grid input,
.login-grid button {
  background: #11192a;
  border: 1px solid #2e3b58;
  color: #f5f7ff;
  border-radius: 6px;
  padding: 10px;
}

.login-grid button {
  background: #223050;
  border: 1px solid #5a74b6;
  cursor: pointer;
}

.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.muted {
  color: #a5b1d1;
  margin: 0;
  font-size: 13px;
}

.auth-card {
  min-width: 420px;
  padding: 10px;
  border: 1px solid #2e3b58;
  border-radius: 10px;
  background: #131c2d;
}

.auth-inline {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  margin-top: 8px;
}

.auth-inline input,
.auth-inline button {
  background: #0d1321;
  border: 1px solid #2e3b58;
  color: #f5f7ff;
  border-radius: 6px;
  padding: 8px;
}

.auth-inline button {
  cursor: pointer;
  background: #223050;
  border: 1px solid #5a74b6;
}

.auth-row-actions {
  margin-top: 6px;
}

.auth-toggle-btn {
  border: 1px solid #2e3b58;
  background: #0f1726;
  color: #d2dbf5;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.auth-message {
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
  color: #9fb0dc;
}

.auth-message.success {
  color: #4ade80;
}

.auth-message.error {
  color: #f87171;
}

.auth-message.info {
  color: #93c5fd;
}

.hidden {
  display: none;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid #2e3b58;
  background: #11192a;
  color: #d2dbf5;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.tab-btn.active {
  background: #223050;
  border-color: #5a74b6;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  background: #151f30;
  border: 1px solid #2e3b58;
  border-radius: 10px;
  margin: 12px 0;
  padding: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.stats h2 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9fb0dc;
}

.stats p {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

/* PnL: green gains, red losses */
.stats p.pnl-value {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
}

.stats p.pnl-profit {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.12);
}

.stats p.pnl-loss {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
}

.data-table td.pnl-profit,
.data-table td.pnl-loss {
  font-weight: 600;
  border-radius: 6px;
}

.data-table td.pnl-profit {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.45);
}

.data-table td.pnl-loss {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.45);
}

/* Executed / successful trades: Colin = orange, Chris = hot pink */
.trade-legend {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.trade-legend.trade-success-colin {
  background: rgba(251, 146, 60, 0.35);
  color: #fff7ed;
}

.trade-legend.trade-success-chris {
  background: rgba(255, 20, 147, 0.35);
  color: #fff7ed;
}

.data-table tbody tr.trade-row-executed.trade-success-colin td {
  background: rgba(251, 146, 60, 0.14);
  box-shadow: inset 3px 0 0 #fb923c;
}

.data-table tbody tr.trade-row-executed.trade-success-chris td {
  background: rgba(255, 20, 147, 0.12);
  box-shadow: inset 3px 0 0 #ff1493;
}

.placed-bets-list {
  min-height: 2.5em;
  max-height: 260px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.placed-trade-row {
  padding: 6px 8px;
  margin-bottom: 5px;
  border-radius: 6px;
  color: #e8edff;
  border: 1px solid #2e3b58;
}

.placed-trade-row.trade-row-executed.trade-success-colin {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.45);
  box-shadow: inset 3px 0 0 #fb923c;
}

.placed-trade-row.trade-row-executed.trade-success-chris {
  background: rgba(255, 20, 147, 0.14);
  border-color: rgba(255, 20, 147, 0.45);
  box-shadow: inset 3px 0 0 #ff1493;
}

.action-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 8px;
}

.actions input,
.actions button {
  padding: 9px 12px;
  border: 1px solid #2e3b58;
  background: #11192a;
  color: #f5f7ff;
  border-radius: 6px;
}

.actions button {
  border: 1px solid #5a74b6;
  background: #223050;
  cursor: pointer;
}

.withdraw-info {
  margin: 8px 0 0;
  font-size: 12px;
  color: #c4d0ef;
  line-height: 1.45;
}

.eod-tooltip {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #11192a;
  border: 1px solid #2e3b58;
  border-radius: 8px;
  color: #c4d0ef;
  font-size: 12px;
  line-height: 1.45;
}

.cycle-tooltip {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #11192a;
  border: 1px solid #2e3b58;
  border-radius: 8px;
  color: #c4d0ef;
  font-size: 12px;
  line-height: 1.45;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.period-grid h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #a5b1d1;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 8px;
  border-bottom: 1px solid #2e3b58;
  text-align: left;
}

.data-table th {
  color: #9fb0dc;
  font-weight: 600;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.charts-grid h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #a5b1d1;
}

.chart-caption {
  margin: 0 0 8px;
  font-size: 12px;
  color: #9fb0dc;
}

.data-table tbody tr.cycle-candidate-trade td {
  background: rgba(96, 165, 250, 0.1);
}

.data-table tbody tr.ledger-row-win td {
  background: rgba(52, 211, 153, 0.08);
}

.data-table tbody tr.ledger-row-loss td {
  background: rgba(248, 113, 113, 0.08);
}

.admin-stack {
  display: grid;
  gap: 10px;
}

.admin-card {
  background: #11192a;
  border: 1px solid #2e3b58;
  border-radius: 8px;
  padding: 10px;
}

.admin-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #d2dbf5;
}

.admin-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #9fb0dc;
}

.inline-status {
  margin: 6px 0 0;
  min-height: 16px;
  font-size: 12px;
  color: #9fb0dc;
}

.inline-status.success {
  color: #4ade80;
}

.inline-status.error {
  color: #f87171;
}

.one-time-password {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: #fef08a;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-user-grid {
  grid-template-columns: 1fr 1fr 1fr 140px auto;
}

.admin-active-grid {
  grid-template-columns: 1fr auto;
}

.admin-transfer-grid {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.admin-security-grid {
  grid-template-columns: 1fr auto auto auto;
}

.admin-audit-grid {
  grid-template-columns: auto;
  margin-bottom: 0;
}

canvas {
  width: 100%;
  max-width: 100%;
  background: #0f1726;
  border: 1px solid #2e3b58;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 8px;
  margin-bottom: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.token-grid {
  grid-template-columns: 1fr auto auto auto;
}

.audit-grid {
  grid-template-columns: auto;
}

.bank-grid {
  grid-template-columns: 1fr auto;
}

.paypal-topup-block {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #2e3b58;
}

.panel-subhead {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #d2dbf5;
}

#user-bank-panel > h2 {
  margin-top: 4px;
}

.topup-webhook-grid {
  grid-template-columns: minmax(130px, 160px) 1fr auto;
}

.topup-webhook-grid select {
  min-height: 38px;
  cursor: pointer;
}

.deposit-grid {
  grid-template-columns: 1fr 1fr auto;
}

.deposit-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.deposit-admin-target-grid {
  grid-template-columns: minmax(100px, 140px) 1fr;
  margin-bottom: 10px;
}

.deposit-admin-target-grid label {
  align-self: center;
  color: #b8c3e6;
  font-size: 13px;
}

.form-grid input,
.form-grid select {
  background: #11192a;
  border: 1px solid #2e3b58;
  color: #f5f7ff;
  border-radius: 6px;
  padding: 8px;
}

.form-grid button {
  border: 1px solid #5a74b6;
  background: #223050;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 8px 12px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  background: #0f1726;
  border-radius: 8px;
  padding: 10px;
}

details > summary {
  cursor: pointer;
  color: #d2dbf5;
  font-weight: 600;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
  }
  .auth-card {
    min-width: 0;
    width: 100%;
  }
  .auth-inline {
    grid-template-columns: 1fr;
  }
  .period-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-row,
  .split,
  .charts-grid,
  .admin-user-grid,
  .admin-active-grid,
  .admin-transfer-grid,
  .admin-security-grid,
  .form-grid,
  .bank-grid,
  .topup-webhook-grid,
  .deposit-admin-target-grid {
    grid-template-columns: 1fr;
  }
}

.domain-research-panel {
  margin-top: 8px;
}

.domain-research-root {
  font-size: 13px;
  line-height: 1.45;
}

.domain-research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.domain-research-category {
  background: #0f1726;
  border: 1px solid #2e3b58;
  border-radius: 10px;
  padding: 12px 14px;
}

.domain-research-category h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #f5f7ff;
}

.domain-research-group {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa3d6;
}

.domain-research-group:first-child {
  margin-top: 0;
}

.domain-research-list {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: disc;
  color: #c9d4f5;
}

.domain-research-list li {
  margin: 4px 0;
}

.domain-research-list a {
  color: #9bd4ff;
  text-decoration: underline;
  text-decoration-color: rgba(155, 212, 255, 0.35);
}

.domain-research-list a:hover {
  color: #c8ebff;
}

/* Campy, colorful comic-arcade theme */
:root {
  --camp-ink: #0d1b3d;
  --camp-muted: #1f3768;
  --camp-hot-pink: #ff4fa3;
  --camp-bubblegum: #ff8fd0;
  --camp-sun: #ffd84d;
  --camp-orange: #ff9f45;
  --camp-lime: #80e85f;
  --camp-cyan: #5ed7ff;
  --camp-violet: #9c6bff;
  --camp-cream: #fffaf0;
}

body {
  color: var(--camp-ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 216, 77, 0.35), transparent 27%),
    radial-gradient(circle at 82% 10%, rgba(94, 215, 255, 0.3), transparent 32%),
    linear-gradient(180deg, #ffe2f2 0%, #ffd0ea 32%, #d8e9ff 68%, #c8f5ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 22% 24%, rgba(255, 255, 255, 0.3), transparent 56%),
    radial-gradient(ellipse at 74% 36%, rgba(255, 255, 255, 0.24), transparent 50%),
    linear-gradient(transparent 0, rgba(255, 255, 255, 0.075) 50%, transparent 100%);
  background-size: 100% 100%, 100% 100%, 100% 7px;
  opacity: 0.55;
  z-index: 0;
}

main,
.dashboard,
.login-page,
.login-shell {
  position: relative;
  z-index: 1;
}

.dashboard-surface,
.login-card,
.auth-card,
.panel,
.admin-card,
.mission-control,
.panel-nav,
.domain-research-category,
.charts-grid > div {
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 241, 228, 0.97));
  border: 2px solid rgba(159, 107, 255, 0.62);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    0 0 0 2px rgba(255, 79, 163, 0.26),
    0 10px 0 rgba(69, 37, 126, 0.22),
    0 14px 28px rgba(66, 35, 118, 0.22);
}

.dashboard-surface {
  border-radius: 14px;
}

h1,
h2,
h3,
.ux-section-title,
.panel-subhead {
  color: #8f2bde;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 8px rgba(255, 79, 163, 0.25);
}

.muted,
.admin-hint,
.inline-status,
.withdraw-info,
.chart-caption,
.ux-section-copy,
.domain-research-root,
.domain-research-list {
  color: var(--camp-muted);
}

.tabs .tab-btn,
.panel-nav-btn,
button,
.auth-toggle-btn {
  border: 2px solid rgba(143, 43, 222, 0.6);
  background: linear-gradient(180deg, rgba(255, 244, 178, 0.95), rgba(255, 214, 76, 0.96));
  color: #5b2a00;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 3px 0 rgba(170, 108, 18, 0.5),
    0 0 9px rgba(255, 79, 163, 0.25);
}

.tabs .tab-btn.active,
.panel-nav-btn.active {
  border-color: rgba(255, 79, 163, 0.9);
  background: linear-gradient(180deg, rgba(255, 129, 196, 0.98), rgba(255, 79, 163, 0.99));
  color: #fff5fb;
  box-shadow:
    0 3px 0 rgba(139, 27, 95, 0.58),
    0 0 12px rgba(255, 79, 163, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

input,
select,
textarea,
.actions input,
.form-grid input,
.form-grid select,
.auth-inline input,
.login-grid input {
  color: #3e2a62;
  border: 2px solid rgba(94, 215, 255, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 251, 255, 0.98));
}

input::placeholder,
textarea::placeholder {
  color: #8e7bb2;
}

.stats > div,
.mission-pill {
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 238, 220, 0.98));
  border: 2px solid rgba(255, 159, 69, 0.58);
}

.stats h2,
.mission-pill .mission-label,
.mission-control-head {
  color: #1f3768;
}

.stats p,
.mission-pill .mission-value {
  color: #0d1b3d;
}

.data-table th {
  background: rgba(240, 224, 255, 0.96);
  color: #0f295c;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(189, 150, 234, 0.56);
}

pre,
.eod-tooltip,
.cycle-tooltip,
.placed-bets-list {
  border: 2px dashed rgba(159, 107, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(250, 239, 255, 0.98));
  color: #142e5e;
}

.trade-legend.trade-success-colin {
  background: rgba(128, 232, 95, 0.42);
  color: #1e5a0c;
}

.trade-legend.trade-success-chris {
  background: rgba(94, 215, 255, 0.34);
  color: #19506f;
}

.auth-message.success,
.inline-status.success {
  color: #1f9b40;
}

.auth-message.error,
.inline-status.error {
  color: #d22859;
}

.auth-message.info {
  color: #1b376b;
}

/* At-a-glance: campy mission control cards */
#mission-control.mission-control {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 216, 77, 0.22), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(94, 215, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 228, 0.98), rgba(252, 238, 255, 0.97));
  border: 2px solid rgba(255, 79, 163, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(156, 107, 255, 0.2),
    0 12px 20px rgba(62, 30, 112, 0.18);
  border-radius: 16px;
}

#mission-control .mission-control-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 159, 69, 0.55);
  background: linear-gradient(180deg, rgba(255, 232, 161, 0.95), rgba(255, 210, 88, 0.95));
  color: #6a3100;
  font-size: 11px;
  font-weight: 800;
}

#mission-control .mission-control-head::before {
  content: "🎮";
}

#mission-control .mission-control-grid {
  gap: 10px;
}

#mission-control .mission-pill {
  position: relative;
  border: 2px solid rgba(156, 107, 255, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 241, 255, 0.97));
  box-shadow:
    0 4px 0 rgba(108, 62, 179, 0.35),
    0 10px 16px rgba(58, 34, 102, 0.14);
  transform: translateY(0);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

#mission-control .mission-pill:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 rgba(108, 62, 179, 0.33),
    0 14px 20px rgba(58, 34, 102, 0.2);
}

#mission-control .mission-pill .mission-label {
  color: #7a56b7;
  font-weight: 800;
}

#mission-control .mission-pill .mission-value {
  color: #102a5a;
  font-size: 15px;
  font-weight: 900;
}

#mission-control .mission-pill .mission-sub {
  color: #3f5f8d;
  font-weight: 600;
}

#mission-control .mission-pill::after {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 14px;
  opacity: 0.88;
}

#mission-control #mc-pill-bankroll::after {
  content: "💰";
}
#mission-control #mc-pill-positions::after {
  content: "📌";
}
#mission-control #mc-pill-traders::after {
  content: "🧠";
}
#mission-control #mc-pill-cycle::after {
  content: "⏱️";
}
#mission-control #mc-pill-trading::after {
  content: "⚡";
}
#mission-control #mc-pill-legal::after {
  content: "🛡️";
}
#mission-control #mc-pill-kalshi::after {
  content: "📈";
}
#mission-control #mc-pill-compliance::after {
  content: "✅";
}

#mission-control .mission-pill.mc-ok {
  border-color: rgba(85, 189, 89, 0.8);
  background: linear-gradient(180deg, rgba(235, 255, 232, 0.98), rgba(216, 250, 211, 0.97));
}

#mission-control .mission-pill.mc-warn {
  border-color: rgba(255, 168, 48, 0.85);
  background: linear-gradient(180deg, rgba(255, 248, 228, 0.99), rgba(255, 235, 197, 0.98));
}

#mission-control .mission-pill.mc-bad {
  border-color: rgba(232, 76, 129, 0.86);
  background: linear-gradient(180deg, rgba(255, 234, 242, 0.99), rgba(255, 214, 232, 0.98));
}

