/* ============================================================
   ValueBet Dashboard — Design System
   Dark mode professionale con badge semantici per stato modello
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Custom Properties ── */
:root {
  --bg-base:       #0d1117;
  --bg-card:       #161b22;
  --bg-card-hover: #1c2333;
  --bg-input:      #21262d;
  --border:        #30363d;
  --border-muted:  #21262d;

  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #484f58;

  /* Semantic colours */
  --green:         #238636;
  --green-light:   #2ea043;
  --green-glow:    rgba(35,134,54,0.15);
  --yellow:        #b08800;
  --yellow-light:  #d29922;
  --yellow-glow:   rgba(176,136,0,0.15);
  --red:           #b61e2e;
  --red-light:     #da3633;
  --red-glow:      rgba(182,30,46,0.15);
  --orange:        #bb5a00;
  --orange-light:  #ff8c00;
  --orange-glow:   rgba(187,90,0,0.18);
  --blue:          #1158a7;
  --blue-light:    #388bfd;
  --blue-glow:     rgba(56,139,253,0.12);
  --grey:          #30363d;
  --grey-light:    #6e7681;

  --accent:        #388bfd;
  --accent-hover:  #58a6ff;

  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 0 3px rgba(56,139,253,0.25);

  --font-mono: 'JetBrains Mono', monospace;
  --font-base: 'Inter', sans-serif;

  --transition: 150ms ease;
}

/* ── Reset + Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Layout ── */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  padding: 32px 0 64px;
}

/* ── Header / Navbar ── */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--green-light), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.navbar-brand .brand-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--bg-input); color: var(--text-primary); }
.nav-link.active { color: var(--text-primary); background: var(--bg-input); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px 24px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid transparent;
}

.badge-green   { background: var(--green-glow);  color: #3fb950; border-color: rgba(63,185,80,0.25); }
.badge-yellow  { background: var(--yellow-glow); color: #d29922; border-color: rgba(210,153,34,0.25); }
.badge-red     { background: var(--red-glow);    color: #f85149; border-color: rgba(248,81,73,0.35); }
.badge-orange  { background: var(--orange-glow); color: #ff9f43; border-color: rgba(255,159,67,0.3); }
.badge-blue    { background: var(--blue-glow);   color: #79c0ff; border-color: rgba(121,192,255,0.25); }
.badge-grey    { background: rgba(48,54,61,0.5); color: var(--grey-light); border-color: var(--border); }

/* Label → badge mapping helpers — applied via JS class */
.badge-BET_CANDIDATA { background: var(--green-glow);  color: #3fb950; border-color: rgba(63,185,80,0.25); }
.badge-LEAN          { background: var(--yellow-glow); color: #d29922; border-color: rgba(210,153,34,0.25); }
.badge-COINFLIP      { background: rgba(48,54,61,0.5); color: var(--grey-light); border-color: var(--border); }
.badge-NO_BET        { background: var(--red-glow);    color: #f85149; border-color: rgba(248,81,73,0.35); }
.badge-NO_ODDS       { background: rgba(48,54,61,0.5); color: var(--grey-light); border-color: var(--border); }

/* ── Chip (smaller, inline-block) ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid;
}
.chip-official    { background: rgba(35,134,54,0.12); color: #3fb950; border-color: rgba(35,134,54,0.3); }
.chip-incomplete  { background: rgba(255,143,67,0.12); color: #ff9f43; border-color: rgba(255,143,67,0.35); }
.chip-nd          { background: rgba(70,79,90,0.3); color: var(--grey-light); border-color: var(--border); }

/* ── WARNING BANNER ── */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,143,67,0.35);
  background: rgba(187,90,0,0.10);
  margin-bottom: 20px;
}

.warning-banner.critical {
  border-color: rgba(248,81,73,0.4);
  background: rgba(182,30,46,0.10);
}

.warning-banner .warn-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-banner .warn-title {
  font-size: 13px;
  font-weight: 600;
  color: #ff9f43;
  margin-bottom: 3px;
}
.warning-banner.critical .warn-title { color: #f85149; }

.warning-banner .warn-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.warning-banner .warn-list {
  margin-top: 6px;
  padding-left: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Filters / Controls ── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-input, .filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-family: var(--font-base);
  font-size: 13px;
  min-width: 140px;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-light);
  color: #fff;
  border-color: var(--green-light);
}
.btn-primary:hover { background: #3fb950; }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-input); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 4px 8px;
  font-size: 12px;
}

/* ── Table ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 13px 14px;
  vertical-align: middle;
  font-size: 13px;
}

/* ── Probability bars ── */
.prob-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 96px;
}

.prob-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.prob-label {
  width: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.prob-bar-wrap {
  flex: 1;
  background: var(--bg-input);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.prob-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.prob-bar.p1 { background: linear-gradient(90deg, #238636, #3fb950); }
.prob-bar.px { background: linear-gradient(90deg, #6e7681, #8b949e); }
.prob-bar.p2 { background: linear-gradient(90deg, #1158a7, #388bfd); }

.prob-val {
  width: 32px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

/* ── Delta-S indicator ── */
.delta-s {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.delta-s.positive { color: #3fb950; }
.delta-s.negative { color: #f85149; }
.delta-s.neutral  { color: var(--grey-light); }

/* ── Value coefficients ── */
.coeff-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.coeff-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.coeff-label { color: var(--text-muted); width: 18px; }
.coeff-val { color: var(--text-primary); }
.coeff-val.best {
  color: #3fb950;
  font-weight: 700;
  background: rgba(35,134,54,0.1);
  padding: 0 4px;
  border-radius: 3px;
}
.coeff-val.null { color: var(--text-muted); font-style: italic; }

/* ── Model incomplete indicator in rows ── */
.incomplete-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--red-glow);
  border: 1px solid rgba(248,81,73,0.35);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #f85149;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-value.green { color: #3fb950; }
.stat-value.yellow { color: #d29922; }
.stat-value.red { color: #f85149; }

/* ── Match Detail Specific ── */
.match-header-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30,40,55,0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.team-block {
  text-align: center;
  flex: 1;
}

.team-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.team-side-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.vs-divider {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 16px;
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.meta-icon { font-size: 14px; }

/* ── Status bar (prominent, always visible) ── */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-key {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.status-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* ── Diagnostic section ── */
.diagnostic-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.diagnostic-header {
  padding: 16px 24px;
  background: rgba(56,139,253,0.06);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagnostic-header .diag-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.diagnostic-header .diag-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
}

.diagnostic-col {
  padding: 20px 24px;
}

.diagnostic-col:first-child {
  border-right: 1px solid var(--border-muted);
}

.diag-team-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-muted);
}
.diag-row:last-child { border-bottom: none; }

.diag-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.diag-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.diag-val.nd {
  color: var(--text-muted);
  font-style: italic;
}

.diag-val.present { color: #3fb950; }
.diag-val.missing { color: #f85149; }

/* ── Glicko block ── */
.glicko-block {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border-muted);
}

.glicko-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.glicko-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glicko-key {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.glicko-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

.glicko-val.nd {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Contribution bars ── */
.contrib-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.contrib-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contrib-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contrib-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contrib-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

.contrib-bar-wrap {
  background: var(--bg-input);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}

.contrib-bar {
  height: 100%;
  border-radius: 3px;
}
.contrib-bar.g { background: linear-gradient(90deg, #238636, #3fb950); }
.contrib-bar.f { background: linear-gradient(90deg, #1158a7, #388bfd); }
.contrib-bar.h { background: linear-gradient(90deg, #6e4200, #d29922); }

/* ── Section cards ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}

.section-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card-header .icon { font-size: 15px; }
.section-card-header .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-card-body { padding: 20px; }

/* ── Delta-S big display ── */
.delta-display {
  text-align: center;
  padding: 28px 0;
}

.delta-number {
  font-size: 48px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 8px;
}

.delta-number.positive { color: #3fb950; }
.delta-number.negative { color: #f85149; }
.delta-number.neutral  { color: var(--grey-light); }

.delta-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.s-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.s-row:last-child { border-bottom: none; }
.s-key { color: var(--text-secondary); }
.s-val { color: var(--text-primary); font-weight: 600; }

/* ── Odds table ── */
.odds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.odds-cell {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border-muted);
  transition: border-color var(--transition);
}

.odds-cell.best-value {
  border-color: rgba(63,185,80,0.5);
  background: rgba(35,134,54,0.08);
}

.odds-outcome {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.odds-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.odds-implied {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.odds-model {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}

.odds-coeff {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.odds-coeff.value     { background: var(--green-glow); color: #3fb950; }
.odds-coeff.no-value  { background: var(--red-glow);   color: #f85149; }
.odds-coeff.neutral   { background: rgba(48,54,61,0.5); color: var(--grey-light); }

/* ── Loading & empty states ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  color: var(--text-secondary);
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state .empty-desc  { font-size: 13px; }

.error-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--red-glow);
  border: 1px solid rgba(248,81,73,0.3);
  margin: 20px 0;
}

.error-icon { font-size: 18px; flex-shrink: 0; }
.error-msg { font-size: 13px; color: var(--text-secondary); }

/* ── Back button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  padding: 6px 0;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--text-primary); }

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #3d444d;
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; }
  .page-content { padding: 20px 0 48px; }
  .container { padding: 0 16px; }

  .diagnostic-grid {
    grid-template-columns: 1fr;
  }
  .diagnostic-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-muted);
  }

  .odds-grid { grid-template-columns: 1fr; }
  .match-teams { flex-direction: column; gap: 12px; }
  .stats-row { grid-template-columns: 1fr 1fr; }

  .filter-bar { flex-direction: column; }
  .filter-input, .filter-select { min-width: auto; width: 100%; }
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.25s ease forwards; }

/* ── Utility ── */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-secondary); }
.text-dim   { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Last Update Status Bar ── */
.last-update-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.update-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-light);
  flex-shrink: 0;
}

.update-dot.status-operational {
  background: #3fb950;
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
}

.update-dot.status-error {
  background: #f85149;
  box-shadow: 0 0 6px rgba(248, 81, 73, 0.5);
}

.update-dot.status-stale {
  background: #d29922;
  box-shadow: 0 0 6px rgba(210, 153, 34, 0.4);
}

.update-dot.status-never {
  background: var(--grey-light);
}

.update-label {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.update-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.update-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

.update-value.dim {
  color: var(--text-muted);
}

/* ── Pipeline Status Panel ── */
.pipeline-status-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.ps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.ps-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ps-header-right {
  display: flex;
  align-items: center;
}

.ps-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grey-light);
  flex-shrink: 0;
}

.ps-dot-healthy {
  background: #3fb950;
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.6);
}

.ps-dot-warning {
  background: #d29922;
  box-shadow: 0 0 8px rgba(210, 153, 34, 0.5);
}

.ps-dot-stale {
  background: var(--grey-light);
}

.ps-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.ps-overall-label {
  font-size: 10px;
}

.ps-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* Scope cards grid */
.ps-scopes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.ps-scope-card {
  padding: 0;
  border-bottom: 1px solid var(--border-muted);
  position: relative;
}

.ps-scope-card:first-child {
  border-right: 1px solid var(--border-muted);
}

/* Colored left accent bar based on health */
.ps-scope-card[data-health="healthy"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3fb950;
}

.ps-scope-card[data-health="warning"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #d29922;
}

.ps-scope-card[data-health="stale"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--grey-light);
}

.ps-scope-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
}

.ps-scope-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ps-scope-badge {
  font-size: 10px;
}

.ps-scope-body {
  padding: 0 18px 14px;
}

.ps-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.ps-metric-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.ps-metric-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.ps-metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-muted);
}

.ps-metric-sm .ps-metric-label {
  font-size: 10px;
  color: var(--text-muted);
}

.ps-metric-sm .ps-metric-value {
  font-size: 13px;
  font-weight: 700;
}

.ps-metric-sm {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Footer metrics row */
.ps-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.ps-footer-item {
  font-size: 11px;
  color: var(--text-secondary);
}

.ps-footer-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ps-footer-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* Responsive: stack scope cards on mobile */
@media (max-width: 768px) {
  .ps-scopes {
    grid-template-columns: 1fr;
  }
  .ps-scope-card:first-child {
    border-right: none;
  }
  .ps-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ps-footer-sep {
    display: none;
  }
}

/* ── Pipeline Status Alerts ── */
.ps-alerts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-alert-item {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.ps-alert-healthy {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.2);
}

.ps-alert-warning {
  background: rgba(210, 153, 34, 0.1);
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.2);
}

.ps-alert-stale {
  background: rgba(139, 148, 158, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(139, 148, 158, 0.2);
}


/* ── Shortlist First UX ── */

.shortlist-section {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.sh-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.sh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sh-table th {
  background: rgba(48, 54, 61, 0.5);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.sh-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.sh-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sh-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.sh-table .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.sh-table .flag {
  margin-right: 6px;
  font-size: 14px;
}
