:root {
  --brand:      #C8102E;
  --accent:     #B5924C;
  --bg:         #0E1116;
  --surface:    #1A1F26;
  --text:       #F2F2F2;
  --text-muted: #9CA3AF;
  --border:     #2A2F36;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

/* Utility extras */
.text-brand   { color: var(--brand); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.bg-surface   { background: var(--surface); }
.border-app   { border-color: var(--border); }

/* Role badges */
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; }
.role-admin              { background: #C8102E; }
.role-technical_director { background: #B5924C; }
.role-scout              { background: #3B82F6; }
.role-viewer             { background: #6B7280; }

/* Form inputs — consistent dark style */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
}

/* Player card grid */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
  text-decoration: none;
  display: block;
  color: var(--text);
}
.player-card:hover { border-color: var(--accent); }
.photo-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg);
}

/* Position-group badges */
.pos-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}
[data-group="GK"]  .pos-badge, .pos-badge[data-group="GK"]  { background: #F59E0B; color: #000; }
[data-group="CB"]  .pos-badge, .pos-badge[data-group="CB"]  { background: #3B82F6; }
[data-group="FB"]  .pos-badge, .pos-badge[data-group="FB"]  { background: #06B6D4; }
[data-group="DM"]  .pos-badge, .pos-badge[data-group="DM"]  { background: #8B5CF6; }
[data-group="CM"]  .pos-badge, .pos-badge[data-group="CM"]  { background: #10B981; }
[data-group="AM"]  .pos-badge, .pos-badge[data-group="AM"]  { background: #F97316; }
[data-group="WI"]  .pos-badge, .pos-badge[data-group="WI"]  { background: #EC4899; }
[data-group="ST"]  .pos-badge, .pos-badge[data-group="ST"]  { background: #C8102E; }

/* Phase 5c-3: date / number / time input theming so the native widgets
   honor the dark theme. Without this, Chrome and Firefox fall back to
   the OS picker styling — usually a white field that ignores --bg. */
input[type="date"],
input[type="number"],
input[type="time"],
input[type="datetime-local"] {
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  filter: invert(1) opacity(0.6);
}

/* ── Phase 6.2.3: eligibility badge (inline, used across all player surfaces) ── */
.elig-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}
.elig-badge-sm  { font-size: 0.72em; padding: 2px 5px; gap: 3px; }
.elig-badge-md  { font-size: 0.82em; padding: 3px 7px; gap: 4px; }

/* Status colours — dark-theme aware (all using rgba with alpha so they
   blend against --surface and --bg backgrounds) */
.elig-badge[data-status="eligible_now"]    { background: rgba(34,  197,  94, 0.18); color: #4ade80; }
.elig-badge[data-status="eligible_future"] { background: rgba(251, 191,  36, 0.18); color: #fcd34d; }
.elig-badge[data-status="not_eligible"]    { background: rgba(239,  68,  68, 0.18); color: #f87171; }
.elig-badge[data-status="unknown"]         { background: rgba(156, 163, 175, 0.18); color: #9ca3af; }

/* Tiny flag inside the badge */
.elig-badge .elig-flag {
  display: inline-block;
  width: 14px;
  height: 10px;
  line-height: 0;
  vertical-align: middle;
  flex-shrink: 0;
}
.elig-badge .elig-flag svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 1px;
}

/* BFA crest placeholder */
.bfa-crest-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
}

/* ── Phase 7: evaluation role badge ─────────────────────────────
   Drives the `evaluation_role_badge(role)` macro used on history
   cards, latest-eval panels, and the comparison page. Scout role
   intentionally gets no badge (default state for the common case).
   NT badge uses emerald to stay distinct from BFA red/gold. */
.role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
}
.role-badge.role-nt {
  background: #10B981;
  color: #fff;
}
.role-badge.role-admin {
  background: var(--text-muted);
  color: var(--bg);
}

/* ── Phase 9: bulk-import preview colours ─────────────────────
   Drives the row backgrounds + status badges on
   `bulk_import_preview.html` and the summary counts on the
   result page. Colours kept close to the soft-delete /
   eligibility palette so the visual vocabulary stays
   consistent across admin surfaces. */
.bulk-preview-table tr.row-valid     { background: rgba(34, 197, 94, 0.06); }
.bulk-preview-table tr.row-duplicate { background: rgba(181, 146, 76, 0.10); }
.bulk-preview-table tr.row-invalid   { background: rgba(200, 16, 46, 0.08); }

.badge-ok, .badge-warn, .badge-err {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
}
.badge-ok   { background: #22C55E; }
.badge-warn { background: #B5924C; }
.badge-err  { background: #C8102E; }

.bulk-create   { color: #22C55E; }
.bulk-update   { color: #B5924C; }
.bulk-dup      { color: #B5924C; }
.bulk-invalid  { color: #C8102E; }
