/* Over 1.5 Scanner — trading-desk terminal.
   Dark OKLCH palette, neutrals tinted toward the pitch-green accent hue (152).
   Color carries meaning only: green = pass/edge/win, red = fail/loss,
   amber = pending/warning. Nothing decorative gets a color. */

:root {
  /* surfaces (depth = lightness, not shadow) */
  --bg: oklch(15.5% 0.009 152);
  --surface: oklch(18.5% 0.01 152);
  --surface-2: oklch(22% 0.011 152);
  --line: oklch(27% 0.012 152);
  --line-strong: oklch(35% 0.014 152);

  /* text */
  --text: oklch(89% 0.008 152);
  --text-dim: oklch(67% 0.014 152);
  --text-faint: oklch(53% 0.014 152);

  /* accent: pitch green — reserved for pass / positive edge / primary action */
  --green: oklch(80% 0.16 152);
  --green-deep: oklch(64% 0.15 152);
  --green-tint: oklch(24% 0.035 152);
  --green-ink: oklch(17% 0.03 152);

  /* semantic */
  --red: oklch(72% 0.15 26);
  --red-tint: oklch(23% 0.035 26);
  --amber: oklch(80% 0.12 85);
  --amber-tint: oklch(24% 0.03 85);

  /* type */
  --font-ui: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Big Shoulders Display', 'Archivo Narrow', 'Arial Narrow', sans-serif;

  /* 4pt spacing scale */
  --sp-2xs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55; /* light-on-dark reads lighter; give it air */
  -webkit-font-smoothing: antialiased;
}

/* ============ header ============ */

.app-header {
  display: flex;
  align-items: stretch;
  gap: var(--sp-xl);
  padding: 0 var(--sp-lg);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 14px 0 12px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
}

.wordmark-sub {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  line-height: 1;
}

.tabs {
  display: flex;
  align-self: flex-end;
  gap: var(--sp-2xs);
}

.tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 14px 10px;
  cursor: pointer;
  transition: color 120ms ease-out;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--green);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.date-stamp {
  margin-left: auto;
  align-self: center;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ============ shell ============ */

main {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-2xl);
}

.tab-panel {
  display: none;
  max-width: 1160px;
  margin: 0 auto;
}

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

.status-bar {
  flex-shrink: 0;
  padding: 7px var(--sp-lg);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ============ controls ============ */

button.primary {
  appearance: none;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  color: var(--green-ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out;
}

button.primary:hover:not(:disabled) {
  background: var(--green-deep);
  border-color: var(--green-deep);
}

button.primary:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text-faint);
  cursor: default;
}

button.primary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

input.text-input,
input.num-input,
input.odds-input,
input.stake-input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 6px 9px;
  transition: border-color 120ms ease-out;
}

input.text-input:hover,
input.num-input:hover,
input.odds-input:hover,
input.stake-input:hover {
  border-color: var(--text-faint);
}

.hidden {
  display: none !important;
}

.muted-note,
.hint {
  color: var(--text-dim);
  font-size: 12px;
}

.empty-hint {
  color: var(--text-dim);
  padding: var(--sp-xl) 0;
  text-align: center;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

/* ============ progress ============ */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex: 1;
  min-width: 0;
}

.progress-bar {
  width: 220px;
  height: 3px;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-msg {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ warnings ============ */

.warning-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-sm);
  background: var(--amber-tint);
  border: 1px solid var(--amber);
  border-radius: 3px;
  color: var(--amber);
  font-size: 12px;
  padding: var(--sp-xs) var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.warning-strip strong {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
}

.warning-strip ul {
  margin: var(--sp-2xs) 0 0;
  padding-left: 18px;
}

.warning-strip .dismiss {
  appearance: none;
  background: none;
  border: none;
  color: var(--amber);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

/* ============ tables ============ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  animation: rise-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  padding: 0 var(--sp-sm) var(--sp-xs);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 9px var(--sp-sm);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:not(.qualify-row):not(.detail-row):hover td {
  background: var(--surface);
}

.col-time {
  white-space: nowrap;
  color: var(--text-dim);
  width: 1%;
}

.col-comp {
  color: var(--text-dim);
  white-space: nowrap;
}

.col-match .team {
  font-weight: 500;
}

.col-match .vs {
  color: var(--text-faint);
  font-size: 11px;
  padding: 0 3px;
}

.col-snapshot {
  color: var(--text-dim);
  font-size: 12px;
}

.col-center {
  text-align: center;
}

.col-filters {
  white-space: nowrap;
  width: 1%;
}

.summary-line {
  color: var(--text-dim);
  margin: 0 0 var(--sp-sm);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.summary-line strong {
  color: var(--green);
  font-weight: 600;
}

/* ============ badges + tags ============ */

.badge {
  display: inline-block;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  margin-right: var(--sp-2xs);
  cursor: default;
}

.badge.pass {
  background: var(--green-tint);
  color: var(--green);
}

.badge.fail {
  background: var(--red-tint);
  color: var(--red);
}

.badge.na {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-faint);
  padding: 2px 6px;
}

.badge.pending {
  background: var(--amber-tint);
  color: var(--amber);
}

.badge.void {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-faint);
  padding: 2px 6px;
}

.tag {
  display: inline-block;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 8px;
}

.tag-pos {
  background: var(--green);
  color: var(--green-ink);
  animation: pop-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tag-none {
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
}

/* ============ Today: qualifying rows ============ */

.qualify-row td {
  background: var(--green-tint);
  border-bottom: none;
}

.qualify-row .team {
  font-weight: 600;
  color: var(--green);
}

.qualify-row .col-time {
  color: var(--green);
}

.detail-row td {
  background: var(--green-tint);
  padding: 0 var(--sp-sm) var(--sp-sm);
}

.detail-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm) var(--sp-sm);
  background: var(--green-ink);
  border-radius: 3px;
}

.detail-stats {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: var(--sp-xs);
}

.detail-odds {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.odds-input {
  width: 110px;
}

.stake-input {
  width: 72px;
}

.edge-out {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
}

.edge-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.edge-invalid {
  color: var(--red);
  font-size: 12px;
}

.break-even {
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--text-dim);
  font-size: 12px;
}

.field-label.stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-2xs);
  color: var(--text);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
}

.check-label input {
  accent-color: var(--green-deep);
}

.final-score {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

/* ============ empty states ============ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-2xl) var(--sp-lg);
  text-align: center;
}

.empty-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1;
}

.empty-body {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 46ch;
}

/* zero qualifiers = the system said no. Make restraint look deliberate. */
.discipline {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-md);
  margin: 0 0 var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  animation: rise-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.discipline-num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--green);
}

.discipline-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.discipline-sub {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

/* ============ Track record ============ */

.stat-cards {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-lg);
}

.stat-card {
  flex: 1 1 160px;
  padding: var(--sp-sm) var(--sp-md) var(--sp-sm) 0;
}

.stat-card + .stat-card {
  padding-left: var(--sp-md);
  border-left: 1px solid var(--line);
}

.stat-label {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: var(--sp-2xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.stat-value.value-pos {
  color: var(--green);
}

.stat-value.value-neg {
  color: var(--red);
}

.claimed {
  display: block;
  font-family: var(--font-ui);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ============ Settings ============ */

.settings-form {
  max-width: 660px;
}

.settings-section {
  padding: var(--sp-md) 0 var(--sp-lg);
  border-top: 1px solid var(--line-strong);
}

.settings-section h2 {
  margin: 0 0 var(--sp-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}

.settings-section .hint {
  margin: var(--sp-xs) 0 0;
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-xs) var(--sp-md);
}

.threshold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm) var(--sp-lg);
}

.save-note {
  color: var(--green);
  font-size: 12px;
}

.save-note.error {
  color: var(--red);
}

/* ============ narrow screens (web/phone) ============ */

.results,
.table-wrap {
  overflow-x: auto;
}

@media (max-width: 720px) {
  .app-header {
    gap: var(--sp-md);
    padding: 0 var(--sp-sm);
  }

  .date-stamp {
    display: none;
  }

  .wordmark,
  .wordmark-sub {
    font-size: 18px;
  }

  .tab-btn {
    padding: 12px 8px 10px;
    letter-spacing: 0.04em;
  }

  main {
    padding: var(--sp-md) var(--sp-sm) var(--sp-xl);
  }

  .data-table th,
  .data-table td {
    padding-left: var(--sp-xs);
    padding-right: var(--sp-xs);
  }
}

/* ============ motion ============ */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============ web login overlay ============ */
/* Used only by the web build (web.html / web-main.ts); the Electron app
   never renders this. Styled purely from the existing design tokens. */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  width: min(320px, calc(100vw - 2 * var(--sp-lg)));
  padding: var(--sp-xl) var(--sp-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  animation: rise-in 240ms ease-out;
}

.login-brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: var(--sp-xs);
}

.login-card .login-password {
  width: 100%;
}

.login-error {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
}
