/* FC Richmond Roster Generator — stylesheet */

/* ── Reset / base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f7fa;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Header / nav ───────────────────────────────────────────────────────── */
header {
  background: #1a3d6b;
  color: #fff;
  padding: 1rem 1.5rem;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.nav-bar a {
  color: #1a3d6b;
  text-decoration: none;
  font-weight: 500;
}

.nav-bar a:hover { text-decoration: underline; }

/* ── Upload form ────────────────────────────────────────────────────────── */
.upload-card {
  background: #fff;
  border: 1px solid #d4dbe8;
  border-radius: 8px;
  padding: 2rem;
  max-width: 480px;
  margin-top: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.upload-card label {
  display: block;
  font-weight: 500;
  margin-bottom: .5rem;
  color: #1a3d6b;
}

.upload-card input[type="file"] {
  display: block;
  width: 100%;
  padding: .4rem;
  border: 1px solid #c0cad8;
  border-radius: 5px;
  background: #f9fbfd;
  margin-bottom: 1.2rem;
  cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn,
button[type="submit"] {
  display: inline-block;
  background: #1a3d6b;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: .55rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn:hover,
button[type="submit"]:hover { background: #15325a; }

.btn-download {
  display: inline-block;
  background: #1a3d6b;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: .55rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn-download:hover { background: #15325a; }

/* ── Error ──────────────────────────────────────────────────────────────── */
.error {
  background: #fff0f0;
  border: 1px solid #f5a5a5;
  border-left: 4px solid #e53e3e;
  border-radius: 5px;
  padding: .8rem 1rem;
  color: #c53030;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

/* ── Warnings ───────────────────────────────────────────────────────────── */
.warnings {
  background: #fffbeb;
  border: 1px solid #f6d860;
  border-left: 4px solid #d4a017;
  border-radius: 5px;
  padding: .8rem 1rem;
  margin-bottom: 1.5rem;
  color: #7a4f00;
}

.warnings summary {
  font-weight: 600;
  cursor: pointer;
  list-style: disclosure-closed;
}

details[open] .warnings summary,
.warnings details[open] > summary {
  list-style: disclosure-open;
}

.warnings ul {
  margin-top: .6rem;
  padding-left: 1.4rem;
}

.warnings li { margin-bottom: .25rem; }

/* ── Division / package section ─────────────────────────────────────────── */
.division {
  background: #fff;
  border: 1px solid #d4dbe8;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: hidden;
}

.division > summary {
  background: #1a3d6b;
  color: #fff;
  padding: .75rem 1.2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.division > summary::before {
  content: "▶";
  font-size: .75rem;
  transition: transform .2s;
}

details[open].division > summary::before { transform: rotate(90deg); }

.division-body { padding: 1rem 1.2rem; }

/* ── Outcomes bar ───────────────────────────────────────────────────────── */
.outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  background: #f0f4fa;
  border: 1px solid #cdd7e8;
  border-radius: 6px;
  padding: .6rem 1rem;
  margin-bottom: 1rem;
  font-size: .82rem;
}

.outcomes .outcome-item {
  display: flex;
  align-items: center;
  gap: .25rem;
  color: #2a4a7a;
}

.outcomes .outcome-label { color: #555; }

.outcomes .outcome-value {
  font-weight: 700;
  color: #1a3d6b;
}

/* ── Team card ──────────────────────────────────────────────────────────── */
.team-card {
  border: 1px solid #d4dbe8;
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.team-card-header {
  background: #e8eef7;
  padding: .55rem 1rem;
  display: flex;
  align-items: baseline;
  gap: .8rem;
  border-bottom: 1px solid #d4dbe8;
}

.team-card-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: #1a3d6b;
  margin: 0;
}

.team-meta {
  font-size: .82rem;
  color: #555;
}

.team-card-body { padding: .6rem 1rem; }

.team-warning-banner {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  border-left: 4px solid #d4a017;
  border-radius: 5px;
  padding: .5rem .8rem;
  margin-bottom: .6rem;
  font-size: .85rem;
  color: #7a4f00;
}

.team-warning-banner strong { color: #b3760e; }

.team-warning-banner ul {
  margin: .25rem 0 0 1.2rem;
  padding: 0;
}

.team-warning-banner li { margin-bottom: .15rem; }

.coach-line {
  font-size: .85rem;
  margin-bottom: .4rem;
  color: #333;
}

.coach-line strong { color: #1a3d6b; }

/* ── Player table ───────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin-top: .5rem;
}

thead tr {
  background: #1a3d6b;
  color: #fff;
}

thead th {
  padding: .45rem .7rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #f4f7fc; }

tbody td {
  padding: .38rem .7rem;
  border-bottom: 1px solid #e5eaf3;
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }

/* ── Roster Builder landing + loading ───────────────────────────── */
.rb-body {
  font-family: 'DM Sans', sans-serif;
  background: #f2f4f7;
  color: #1a2332;
  min-height: 100vh;
  margin: 0;
}

.rb-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px 16px;
}

.rb-logo-area { text-align: center; }
.rb-logo-lg { width: 90px; height: auto; margin: 0 auto 12px; display: block; }
.rb-logo-sm { width: 40px; height: 40px; object-fit: contain; }
.rb-tagline { font-size: 14px; color: #6b7a8d; margin-top: 4px; }

.rb-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 480px;
  max-width: 100%;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  border: 1px solid #e8eaef;
}

.rb-card-narrow { width: 440px; padding: 40px 48px; }

.rb-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a2332;
  margin-bottom: 6px;
}

.rb-card-desc {
  font-size: 13px;
  color: #6b7a8d;
  margin-bottom: 24px;
  line-height: 1.5;
}

.rb-drop-zone {
  border: 2px dashed #d1d9e6;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}

.rb-drop-zone-drag {
  border-color: #0d3d26;
  background: #f0f7f3;
}

.rb-drop-zone-filled {
  border-color: #2ecc71;
  background: #f0fff6;
}

.rb-drop-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }
.rb-drop-title { font-size: 14px; font-weight: 600; color: #4a5568; }
.rb-drop-hint { font-size: 12px; color: #9aa3b0; margin-top: 4px; }

.rb-drop-check { font-size: 28px; margin-bottom: 8px; color: #1a7a40; }
.rb-drop-filename { font-size: 14px; font-weight: 600; color: #1a7a40; }
.rb-drop-replace { font-size: 12px; color: #9aa3b0; margin-top: 4px; }

.rb-generate-btn {
  margin-top: 24px;
  width: 100%;
  padding: 13px 0;
  background: #d1d9e6;
  color: #9aa3b0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
  letter-spacing: 0.2px;
  transition: all 0.2s;
  font-family: inherit;
}

.rb-generate-btn:not(:disabled) {
  background: #0d3d26;
  color: #fff;
  cursor: pointer;
}

.rb-generate-btn:not(:disabled):hover { background: #0a2f1d; }

.rb-csv-columns {
  margin-top: 18px;
  border-top: 1px solid #e8edf2;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rb-csv-col-label {
  font-size: 10px;
  font-weight: 700;
  color: #9aa3b0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.rb-csv-col-list { display: flex; flex-wrap: wrap; gap: 5px; }
.rb-csv-col {
  font-size: 11px;
  background: #f0f4f8;
  color: #1a2332;
  border-radius: 5px;
  padding: 2px 8px;
  border: 1px solid #e2e8f0;
}

.rb-footer {
  font-size: 12px;
  color: #b0b9c6;
  text-align: center;
}

.rb-gen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.rb-gen-title { font-size: 16px; font-weight: 700; color: #1a2332; }
.rb-gen-subtitle { font-size: 12px; color: #9aa3b0; }

.rb-progress {
  height: 6px;
  background: #f0f2f5;
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.rb-progress-bar {
  height: 100%;
  background: #0d3d26;
  border-radius: 3px;
  width: 0%;
  transition: width 0.35s ease;
}

.rb-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rb-step {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s;
}

.rb-step-pending { opacity: 0.3; }

.rb-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e8eaef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  transition: background 0.3s;
}

.rb-step-dot-done { background: #2ecc71; }
.rb-step-dot-active { background: #0d3d26; }

.rb-step-label {
  font-size: 13px;
  color: #4a5568;
}

.rb-step-active .rb-step-label {
  color: #0d3d26;
  font-weight: 600;
}

/* ───────────────────────────────────────────────────────────────────
   Roster App SPA (results page)
   ─────────────────────────────────────────────────────────────────── */

.rb-body-app {
  background: #f2f4f7;
  color: #1a2332;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.rb-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.rb-error-host {
  position: fixed;
  inset: 16px;
  bottom: auto;
  background: #fff0f0;
  border: 1px solid #f5a5a5;
  border-left: 4px solid #e53e3e;
  color: #c53030;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 200;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.rb-sidebar {
  width: 240px;
  background: #0d1f2d;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  color: #fff;
}

.rb-side-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rb-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rb-side-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.rb-side-brand-name { font-size: 13px; font-weight: 700; color: #fff; }
.rb-side-brand-sub  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 1px; }

.rb-side-stats {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.rb-side-stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 7px 10px;
}

.rb-side-stat-value { font-size: 16px; font-weight: 700; color: #fff; }
.rb-side-stat-label { font-size: 10px; color: rgba(255,255,255,0.4); }

.rb-side-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.rb-side-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 6px 10px 8px;
}

.rb-side-item {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  margin-bottom: 2px;
  transition: all 0.15s;
}

.rb-side-item:hover { background: rgba(255, 255, 255, 0.04); }

.rb-side-item-active {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.25);
  border-left: 3px solid #2ecc71;
  padding-left: 7px;
}

.rb-side-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rb-side-item-name {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rb-side-item-active .rb-side-item-name {
  color: #2ecc71;
  font-weight: 600;
}

.rb-coach-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  cursor: help;
  flex-shrink: 0;
}

.rb-side-item-count {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 2px 6px;
}

.rb-side-item-active .rb-side-item-count {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.12);
}

.rb-side-item-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

.rb-side-nav {
  padding: 8px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rb-side-nav-item {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  transition: all 0.15s;
}

.rb-side-nav-item:hover { background: rgba(255, 255, 255, 0.06); }

.rb-side-nav-active {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.25);
  border-left: 3px solid #2ecc71;
  padding-left: 7px;
  color: #2ecc71;
  font-weight: 600;
}

.rb-side-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
}

/* ── Main pane ────────────────────────────────────────────────────── */
.rb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rb-main-page {
  flex: 1;
  min-height: 0;
  padding: 32px;
  overflow-y: auto;
  background: #f2f4f7;
}

.rb-main-page .rb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.rb-main-page .rb-page-header .rb-outcomes-search {
  margin-left: auto;
  margin-right: 12px;
  width: 280px;
}

.rb-main-page .rb-page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a2332;
  margin: 0;
}

/* ── Top bar ──────────────────────────────────────────────────────── */
.rb-topbar {
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.rb-top-title-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a2332;
}

.rb-top-title-area {
  font-size: 12px;
  color: #9aa3b0;
  margin-left: 10px;
}

.rb-top-spacer { flex: 1; }

.rb-top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f8fa;
  border: 1px solid #e8eaef;
  border-radius: 8px;
  padding: 6px 12px;
  width: 240px;
}

.rb-top-search-icon { font-size: 13px; color: #9aa3b0; }

.rb-top-search-input {
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
  width: 100%;
  color: #1a2332;
  font-family: inherit;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.rb-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.rb-btn-primary {
  background: #0d3d26;
  color: #fff;
}

.rb-btn-primary:hover { background: #0a2f1d; }

.rb-btn-ghost {
  background: transparent;
  color: #4a5568;
  border-color: #e8eaef;
}

.rb-btn-ghost:hover {
  border-color: #b0b9c6;
  color: #1a2332;
}

/* ── Stats row ────────────────────────────────────────────────────── */
.rb-stats-row {
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  padding: 0 24px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.rb-stat {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.rb-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #1a2332;
}

.rb-stat-warn { color: #e05555; }

.rb-stat-label {
  font-size: 12px;
  color: #9aa3b0;
}

.rb-stat-filter-note {
  font-size: 12px;
  color: #9aa3b0;
  margin-left: auto;
}

/* ── Grid ─────────────────────────────────────────────────────────── */
.rb-grid {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-content: start;
}

.rb-grid-empty {
  text-align: center;
  padding: 60px 0;
  color: #9aa3b0;
}

.rb-grid-empty-icon { font-size: 32px; margin-bottom: 12px; }
.rb-grid-empty-title { font-size: 15px; font-weight: 600; }
.rb-grid-empty-sub { font-size: 13px; margin-top: 4px; }

/* ── Day group header ─────────────────────────────────────────────── */
.rb-day-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  margin-top: 4px;
}

.rb-day-rule {
  flex: 1;
  height: 1px;
  background: #e8eaef;
}

/* ── Night pills ──────────────────────────────────────────────────── */
.rb-night-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  background: #f0f0f0;
  color: #555;
}

.rb-night-Mon { background: #e3f0ff; color: #1565c0; }
.rb-night-Tue { background: #fff3e0; color: #e65100; }
.rb-night-Wed { background: #e8f5e9; color: #2e7d32; }
.rb-night-Thu { background: #f3e5f5; color: #7b1fa2; }
.rb-night-Fri { background: #fce4ec; color: #c62828; }

.rb-pill-row {
  display: inline-flex;
  gap: 4px;
}

/* ── Avatar ───────────────────────────────────────────────────────── */
.rb-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Team card ────────────────────────────────────────────────────── */
.rb-team-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8eaef;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.05s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.rb-team-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.rb-team-card:active { transform: translateY(1px); }

.rb-team-card-active {
  position: relative;
  z-index: 45;
  border-color: #0d3d26;
  background: #f0faf4;
  box-shadow: 0 0 0 3px rgba(13, 61, 38, 0.18), 0 6px 24px rgba(13, 61, 38, 0.14);
}

.rb-team-card-warn {
  border-color: #ffe08a;
}

.rb-team-card-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rb-team-card-title-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.rb-team-card-id-block { min-width: 0; flex: 1; }

.rb-team-card-id {
  font-size: 13px;
  font-weight: 700;
  color: #1a2332;
}

.rb-team-no-coach-flag,
.rb-team-no-ac-flag {
  color: #e05555;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 500;
}

.rb-loc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: #eef0f3;
  color: #6b7a8d;
  vertical-align: middle;
}

.rb-loc-north { background: #e3f0ff; color: #1565c0; }
.rb-loc-south { background: #ffe9d6; color: #c2410c; }
.rb-loc-cross { background: #f3e5f5; color: #7b1fa2; }

.rb-team-card-coach {
  font-size: 12px;
  color: #4a5568;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-coach-none { color: #9aa3b0; }
.rb-coach-block { display: flex; flex-direction: column; gap: 2px; }
.rb-coach-ac { font-size: 0.82em; color: #6b7280; }
.rb-coach-nights { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }

.rb-promote-btn {
  margin-top: 6px;
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
}

.rb-coach-assign-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.rb-coach-assign-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7a8d;
  white-space: nowrap;
}

.rb-coach-assign-select {
  width: auto !important;
  max-width: 160px !important;
  flex: 1;
}

body[data-theme="dark"] .rb-coach-assign-label { color: #94a3b8; }

.rb-coach-move-link {
  font-size: 11px;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

.rb-coach-move-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  font-size: 12px;
}

.rb-team-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.rb-team-card-count {
  font-size: 11px;
  color: #9aa3b0;
  font-weight: 500;
}

.rb-team-card-warn-banner {
  background: #fff3cd;
  border-top: 1px solid #ffe08a;
  border-bottom: 1px solid #ffe08a;
  color: #7a4f00;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 16px;
}

.rb-team-card-footer {
  padding: 6px 16px 10px;
  display: flex;
  justify-content: center;
  font-size: 11px;
  color: #b0b9c6;
  font-weight: 500;
}

.rb-team-card-active .rb-team-card-footer {
  color: #0d3d26;
}

.rb-muted { color: #9aa3b0; }

/* ── Drawer ───────────────────────────────────────────────────────── */
.rb-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.08);
}

.rb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  z-index: 50;
  background: #fff;
  border-left: 1px solid #e8eaef;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
  animation: rbDrawerSlide 0.2s ease;
}

@keyframes rbDrawerSlide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.rb-drawer-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f2f5;
  flex-shrink: 0;
}

.rb-drawer-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rb-drawer-id-block {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.rb-drawer-team-id {
  font-size: 15px;
  font-weight: 700;
  color: #1a2332;
}

.rb-drawer-coach-line {
  font-size: 12px;
  color: #6b7a8d;
  margin-top: 2px;
}

.rb-drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e8eaef;
  background: #f7f8fa;
  cursor: pointer;
  font-size: 16px;
  color: #6b7a8d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  flex-shrink: 0;
}

.rb-drawer-close:hover { color: #1a2332; border-color: #b0b9c6; }

.rb-drawer-meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rb-drawer-warnings {
  margin: 12px 20px 0;
  background: #fff3cd;
  border: 1px solid #ffe08a;
  border-left: 4px solid #d4a017;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #7a4f00;
}

.rb-drawer-warnings-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.rb-drawer-warnings ul {
  margin: 0;
  padding-left: 18px;
}

.rb-drawer-warnings li { margin-bottom: 2px; }

.rb-drawer-players {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
}

.rb-drawer-player-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
}

.rb-drawer-player-last { border-bottom: none; }

.rb-drawer-player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rb-drawer-player-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rb-drawer-player-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rb-drawer-player-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: #1a2332;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rb-drawer-req-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
  color: #4a5568;
}

.rb-drawer-req-label {
  color: #6b7280;
  font-weight: 500;
  margin-right: 2px;
}

.rb-drawer-no-req-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #9aa3b0;
  font-style: italic;
  opacity: 0;
  transition: opacity 120ms ease;
}

.rb-drawer-player-no-req:hover .rb-drawer-no-req-hint {
  opacity: 1;
}

.rb-drawer-player-parent {
  font-size: 11px;
  color: #9aa3b0;
  font-weight: 400;
  margin-top: 1px;
}

.rb-drawer-player-gender {
  font-size: 13px;
  color: #9aa3b0;
  font-weight: 500;
  margin-right: 4px;
}

.rb-move-select {
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  flex-shrink: 0;
  /* Static width so the player name keeps room. Native <select> popovers
     size to the longest option independently of this width, so long team
     names stay fully visible when the dropdown opens. */
  width: 90px;
  max-width: 90px;
}

.rb-move-select:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
}

.rb-reupload-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #1e40af;
  font-size: 13px;
}

/* ── Page tables (requests, unassigned) ───────────────────────────── */
.rb-warnings-panel {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  border-left: 4px solid #d4a017;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #7a4f00;
  font-size: 13px;
}

.rb-warnings-panel-title {
  font-weight: 700;
}

.rb-warnings-panel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.rb-warnings-panel-toggle:hover .rb-warnings-panel-title {
  text-decoration: underline;
}

.rb-warnings-panel-caret {
  font-size: 11px;
  width: 12px;
  display: inline-block;
}

.rb-warnings-panel ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

.rb-warnings-panel li { margin-bottom: 2px; }

.rb-table-wrap {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.rb-requests-table,
.rb-unassigned-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.rb-requests-table thead th,
.rb-unassigned-table thead th {
  background: #f7f8fa;
  color: #4a5568;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid #e8eaef;
}

.rb-requests-table tbody td,
.rb-unassigned-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f2f5;
  color: #1a2332;
  vertical-align: top;
}

.rb-requests-table tbody tr:nth-child(even),
.rb-unassigned-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.rb-requests-totals td {
  background: #f0f4fa !important;
  font-weight: 700;
  border-top: 2px solid #d4dbe8;
}

/* ── Request outcomes detail ──────────────────────────────────────── */
.rb-outcomes-summary {
  margin-bottom: 28px;
}

.rb-outcomes-div-section {
  margin-bottom: 28px;
}

.rb-outcomes-div-heading {
  font-size: 13px;
  font-weight: 700;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px 0;
}

.rb-outcomes-div-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.rb-outcomes-div-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.rb-outcomes-player-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.rb-outcomes-player-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.rb-outcome-yes {
  color: #15803d;
  font-weight: 600;
}

.rb-outcome-no {
  color: #b91c1c;
  font-weight: 600;
}

.rb-outcome-detail {
  font-size: 11px;
  font-weight: 400;
  color: inherit;
  opacity: 0.85;
}

.rb-outcome-chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
}

.rb-outcome-chip-yes {
  background: #dcfce7;
  color: #15803d;
}

.rb-outcome-chip-no {
  background: #fee2e2;
  color: #b91c1c;
}

.rb-outcome-chip-warn {
  background: #fef9c3;
  color: #92400e;
}

.rb-unassigned-note {
  background: #fff8ee;
  border: 1px solid #ffd9b3;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #b3540a;
}

.rb-empty {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  color: #9aa3b0;
  font-size: 14px;
}

/* ── Move-confirmation modal ───────────────────────────────────────── */
.rb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
}

.rb-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  background: #fff;
  border-radius: 12px;
  width: min(620px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.rb-modal-header {
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 700;
  color: #1a2332;
  border-bottom: 1px solid #eef0f4;
}

.rb-modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rb-modal-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.rb-modal-arrow {
  font-size: 22px;
  color: #6b7280;
  text-align: center;
}

.rb-modal-section {
  background: #f7f8fa;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #1a2332;
}

.rb-modal-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 6px;
}

.rb-modal-team-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.rb-modal-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.rb-modal-row-label {
  color: #6b7280;
  font-weight: 500;
}

.rb-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #eef0f4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Modal header title + close ──────────────────────────────────────── */
.rb-modal-header { display: flex; align-items: center; justify-content: space-between; }
.rb-modal-title { font-size: 16px; font-weight: 700; color: #1a2332; }

/* ── Add Players modal ───────────────────────────────────────────────── */
.rb-add-players-modal { width: min(560px, 94vw); }

.rb-add-tabs {
  display: flex;
  border-bottom: 1px solid #e8edf2;
  padding: 0 22px;
  gap: 0;
}
.rb-add-tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: #6b7a8d; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.12s;
}
.rb-add-tab:hover { color: #1a2332; }
.rb-add-tab-active { color: #0d3d26 !important; border-bottom-color: #0d3d26; font-weight: 700; }

.rb-add-tab-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.rb-add-manual-body { gap: 10px; }

.rb-add-drop-zone {
  border: 2px dashed #c8d4e0; border-radius: 8px; padding: 20px;
  text-align: center; cursor: pointer; transition: border-color 0.15s;
}
.rb-add-drop-zone:hover { border-color: #0d3d26; }
.rb-add-drop-filled { border-color: #0d3d26; background: #f0faf4; }
.rb-add-drop-label { font-size: 13px; font-weight: 600; color: #1a2332; }
.rb-add-drop-hint { font-size: 11px; color: #9aa3b0; margin-top: 4px; }

.rb-add-result {
  margin: 0 22px; padding: 8px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 600;
}
.rb-add-result-ok  { background: #e7f3ec; color: #0d3d26; }
.rb-add-result-error { background: #fdeaea; color: #b91c1c; }

.rb-add-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rb-add-label { font-size: 11px; font-weight: 600; color: #6b7a8d; text-transform: uppercase; letter-spacing: 0.4px; }
.rb-add-input { padding: 7px 10px; border: 1px solid #d1d9e0; border-radius: 7px; font-size: 13px; font-family: inherit; }
.rb-add-input:focus { outline: none; border-color: #0d3d26; }
.rb-add-select { padding: 7px 10px; border: 1px solid #d1d9e0; border-radius: 7px; font-size: 13px; font-family: inherit; width: 100%; }
.rb-add-select-sm { width: auto; }
.rb-add-row { display: flex; gap: 12px; }
.rb-add-nights { margin-top: 2px; }
.rb-add-divider { border: none; border-top: 1px solid #e8edf2; margin: 4px 0; }
.rb-add-optional-label { font-size: 11px; font-weight: 600; color: #9aa3b0; text-transform: uppercase; letter-spacing: 0.4px; }


/* ── Dark theme ─────────────────────────────────────────────────────────
   Activated by setting data-theme="dark" on <body> (the SPA toggles
   this via the sidebar moon/sun button and persists the choice in
   localStorage). The block overrides background + border colors on the
   main surfaces; the sidebar itself is already dark in the light theme.
*/
body[data-theme="dark"] { background: #0f1722; color: #e6edf3; }

body[data-theme="dark"] .rb-main,
body[data-theme="dark"] .rb-main-page { background: #0f1722; color: #e6edf3; }

body[data-theme="dark"] .rb-topbar {
  background: #182231;
  border-bottom-color: #1f2a3a;
  color: #e6edf3;
}
body[data-theme="dark"] .rb-top-title-name { color: #e6edf3; }
body[data-theme="dark"] .rb-top-search {
  background: #0f1722; border-color: #2a3850;
}
body[data-theme="dark"] .rb-top-search-input { color: #e6edf3; }

body[data-theme="dark"] .rb-main-page .rb-page-header h2 { color: #e6edf3; }

body[data-theme="dark"] .rb-stats-row {
  background: #182231; border-color: #1f2a3a; color: #cbd5e1;
}
body[data-theme="dark"] .rb-stat-value { color: #e6edf3; }
body[data-theme="dark"] .rb-stat-label { color: #94a3b8; }
body[data-theme="dark"] .rb-stat-filter-note { color: #64748b; }

/* Top bar */
body[data-theme="dark"] .rb-top-title-area { color: #64748b; }
body[data-theme="dark"] .rb-top-search-icon { color: #64748b; }

/* Location badges */
body[data-theme="dark"] .rb-loc-badge { background: #1f2a3a; color: #94a3b8; }
body[data-theme="dark"] .rb-loc-north { background: #1e3a5f; color: #60a5fa; }
body[data-theme="dark"] .rb-loc-south { background: #431407; color: #fb923c; }
body[data-theme="dark"] .rb-loc-cross { background: #3b0764; color: #c084fc; }

/* Night pill default (non-day-specific) */
body[data-theme="dark"] .rb-night-pill { background: #1f2a3a; color: #94a3b8; }

/* Team card warn banner (yellow) */
body[data-theme="dark"] .rb-team-card-warn-banner {
  background: #2a2410; border-color: #5b4513; color: #f1d896;
}

/* Drawer */
body[data-theme="dark"] .rb-drawer-backdrop { background: rgba(0, 0, 0, 0.45); }
body[data-theme="dark"] .rb-drawer-close {
  background: #1f2a3a; border-color: #334155; color: #94a3b8;
}
body[data-theme="dark"] .rb-drawer-close:hover { color: #e6edf3; border-color: #64748b; }
body[data-theme="dark"] .rb-drawer-coach-line { color: #94a3b8; }
body[data-theme="dark"] .rb-drawer-player-gender { color: #64748b; }
body[data-theme="dark"] .rb-drawer-player-parent { color: #64748b; }
body[data-theme="dark"] .rb-drawer-warnings {
  background: #2a2410; border-color: #5b4513; border-left-color: #d4a017; color: #f1d896;
}
body[data-theme="dark"] .rb-drawer-warnings-title { color: #f1d896; }

/* Modal arrow */
body[data-theme="dark"] .rb-modal-arrow { color: #64748b; }

/* Coach move link + warn */
body[data-theme="dark"] .rb-coach-move-link { color: #60a5fa; }
body[data-theme="dark"] .rb-coach-move-warn {
  background: #2d1507; border-color: #7c2d12; color: #fdba74;
}

/* Unassigned note */
body[data-theme="dark"] .rb-unassigned-note {
  background: #2d1507; border-color: #7c2d12; color: #fdba74;
}

/* Error host */
body[data-theme="dark"] .rb-error-host {
  background: #1a0505; border-color: #7f1d1d; color: #f87171;
}

/* Grid empty */
body[data-theme="dark"] .rb-grid-empty { color: #64748b; }

body[data-theme="dark"] .rb-night-Mon { background: #1e3a5f; color: #60a5fa; }
body[data-theme="dark"] .rb-night-Tue { background: #431407; color: #fb923c; }
body[data-theme="dark"] .rb-night-Wed { background: #14532d; color: #4ade80; }
body[data-theme="dark"] .rb-night-Thu { background: #3b0764; color: #c084fc; }
body[data-theme="dark"] .rb-night-Fri { background: #450a0a; color: #f87171; }

body[data-theme="dark"] .rb-team-card {
  background: #182231;
  border-color: #1f2a3a;
  color: #e6edf3;
}
body[data-theme="dark"] .rb-team-card-id { color: #e6edf3; }
body[data-theme="dark"] .rb-team-card-coach { color: #cbd5e1; }
body[data-theme="dark"] .rb-team-card-footer {
  border-top-color: #1f2a3a; color: #94a3b8; background: #0f1722;
}
body[data-theme="dark"] .rb-team-card-active {
  background: #0e2118;
  border-color: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18), 0 6px 24px rgba(46, 204, 113, 0.1);
}

body[data-theme="dark"] .rb-drawer {
  background: #182231; border-left-color: #1f2a3a; color: #e6edf3;
}
body[data-theme="dark"] .rb-drawer-header { border-bottom-color: #1f2a3a; }
body[data-theme="dark"] .rb-drawer-team-id,
body[data-theme="dark"] .rb-drawer-player-name { color: #e6edf3; }
body[data-theme="dark"] .rb-drawer-player-row { border-bottom-color: #1f2a3a; }

body[data-theme="dark"] .rb-modal {
  background: #182231; color: #e6edf3;
}
body[data-theme="dark"] .rb-modal-header { border-bottom-color: #1f2a3a; }
body[data-theme="dark"] .rb-modal-footer { border-top-color: #1f2a3a; }
body[data-theme="dark"] .rb-modal-section {
  background: #0f1722; border-color: #1f2a3a; color: #e6edf3;
}
body[data-theme="dark"] .rb-modal-team-name { color: #e6edf3; }
body[data-theme="dark"] .rb-modal-label,
body[data-theme="dark"] .rb-modal-row-label,
body[data-theme="dark"] .rb-muted { color: #94a3b8; }
body[data-theme="dark"] .rb-modal-title { color: #e6edf3; }
body[data-theme="dark"] .rb-add-tabs { border-color: #1f2a3a; }
body[data-theme="dark"] .rb-add-tab { color: #64748b; }
body[data-theme="dark"] .rb-add-tab:hover { color: #cbd5e1; }
body[data-theme="dark"] .rb-add-drop-zone { border-color: #334155; }
body[data-theme="dark"] .rb-add-drop-filled { background: #0e2118; border-color: #2ecc71; }
body[data-theme="dark"] .rb-add-drop-label { color: #e6edf3; }
body[data-theme="dark"] .rb-add-input,
body[data-theme="dark"] .rb-add-select { background: #0f1722; border-color: #334155; color: #e6edf3; }
body[data-theme="dark"] .rb-add-divider { border-color: #1f2a3a; }

body[data-theme="dark"] .rb-table-wrap {
  background: #182231; border-color: #1f2a3a;
}
body[data-theme="dark"] .rb-requests-table,
body[data-theme="dark"] .rb-unassigned-table { background: #182231; color: #e6edf3; }
body[data-theme="dark"] .rb-requests-table tbody td,
body[data-theme="dark"] .rb-unassigned-table tbody td {
  color: #e6edf3; border-bottom-color: #1f2a3a;
}
body[data-theme="dark"] .rb-requests-table thead th,
body[data-theme="dark"] .rb-unassigned-table thead th {
  background: #182231; color: #cbd5e1; border-bottom-color: #1f2a3a;
}
body[data-theme="dark"] .rb-requests-table tbody tr,
body[data-theme="dark"] .rb-unassigned-table tbody tr {
  border-bottom-color: #1f2a3a;
}
body[data-theme="dark"] .rb-requests-table tbody tr:nth-child(even),
body[data-theme="dark"] .rb-unassigned-table tbody tr:nth-child(even) {
  background: #1a2536;
}

body[data-theme="dark"] .rb-warnings-panel {
  background: #2a2410; border-color: #5b4513; border-left-color: #d4a017;
  color: #f1d896;
}

body[data-theme="dark"] .rb-warnings-panel-title { color: #f1d896; }

body[data-theme="dark"] .rb-empty {
  background: #182231; border-color: #1f2a3a; color: #94a3b8;
}

body[data-theme="dark"] .rb-day-header { color: #cbd5e1; }
body[data-theme="dark"] .rb-day-rule { border-top-color: #1f2a3a; }

body[data-theme="dark"] .rb-outcomes-div-heading { color: #cbd5e1; }
body[data-theme="dark"] .rb-outcomes-player-link,
body[data-theme="dark"] .rb-outcomes-div-link { color: inherit; }
body[data-theme="dark"] .rb-outcomes-player-link:hover,
body[data-theme="dark"] .rb-outcomes-div-link:hover { color: #60a5fa; }

/* Totals row — light theme uses a pale-blue bar; darken it. */
body[data-theme="dark"] .rb-requests-totals td {
  background: #1a2536 !important;
  border-top-color: #2a3850;
}

/* Yes/no/warn text — brighten so it reads on the dark surface. */
body[data-theme="dark"] .rb-outcome-yes  { color: #4ade80; }
body[data-theme="dark"] .rb-outcome-no   { color: #f87171; }
body[data-theme="dark"] .rb-outcome-warn { color: #fbbf24; }

/* Outcome chips — saturated dark fills instead of pale pastels. */
body[data-theme="dark"] .rb-outcome-chip-yes  { background: #14532d; color: #4ade80; }
body[data-theme="dark"] .rb-outcome-chip-no   { background: #450a0a; color: #f87171; }
body[data-theme="dark"] .rb-outcome-chip-warn { background: #422006; color: #fbbf24; }

/* Re-upload info banner. */
body[data-theme="dark"] .rb-reupload-banner {
  background: #0f2540; border-color: #1e3a5f; border-left-color: #3b82f6;
  color: #93c5fd;
}

body[data-theme="dark"] .rb-btn-ghost {
  background: transparent; border-color: #334155; color: #e6edf3;
}
body[data-theme="dark"] .rb-btn-ghost:hover {
  background: #1f2a3a;
}

body[data-theme="dark"] .rb-move-select {
  background: #0f1722; border-color: #334155; color: #e6edf3;
}

body[data-theme="dark"] .rb-coach-block,
body[data-theme="dark"] .rb-coach-ac { color: #cbd5e1; }
body[data-theme="dark"] .rb-coach-none { color: #94a3b8; }

body[data-theme="dark"] .rb-drawer-no-req-hint { color: #64748b; }
body[data-theme="dark"] .rb-drawer-req-row { color: #cbd5e1; }
body[data-theme="dark"] .rb-drawer-req-label { color: #94a3b8; }

/* ── Landing page dark theme ─────────────────────────────────────────────
   Same key as the SPA: body[data-theme="dark"].  Applied by the inline
   script in index.html which reads localStorage on first paint.
*/
body[data-theme="dark"].rb-body {
  background: #0f1722;
  color: #e6edf3;
}

body[data-theme="dark"] .rb-tagline { color: #64748b; }
body[data-theme="dark"] .rb-footer  { color: #475569; }

body[data-theme="dark"] .rb-card {
  background: #182231;
  border-color: #1f2a3a;
  color: #e6edf3;
}

body[data-theme="dark"] .rb-card-title { color: #e6edf3; }
body[data-theme="dark"] .rb-card-desc  { color: #94a3b8; }
body[data-theme="dark"] .rb-csv-columns { border-color: #1f2a3a; }
body[data-theme="dark"] .rb-csv-col { background: #0f1722; border-color: #1f2a3a; color: #cbd5e1; }

body[data-theme="dark"] .rb-drop-zone {
  border-color: #334155;
  background: #0f1722;
}

body[data-theme="dark"] .rb-drop-zone-drag {
  border-color: #2ecc71;
  background: #0d1f14;
}

body[data-theme="dark"] .rb-drop-title { color: #cbd5e1; }
body[data-theme="dark"] .rb-drop-hint  { color: #64748b; }

body[data-theme="dark"] .rb-generate-btn:disabled {
  background: #1f2a3a;
  color: #4a5568;
}

/* Loading page elements */
body[data-theme="dark"] .rb-gen-title    { color: #e6edf3; }
body[data-theme="dark"] .rb-gen-subtitle { color: #94a3b8; }
body[data-theme="dark"] .rb-progress     { background: #1f2a3a; }
body[data-theme="dark"] .rb-step-dot     { background: #1f2a3a; }
body[data-theme="dark"] .rb-step-label   { color: #cbd5e1; }
body[data-theme="dark"] .rb-step-active .rb-step-label { color: #2ecc71; }
body[data-theme="dark"] .rb-step-pending { opacity: 0.25; }

/* Landing page drop-zone filled state */
body[data-theme="dark"] .rb-drop-zone-filled {
  border-color: #2ecc71; background: #0d1f14;
}

/* Landing-page theme toggle (top-right corner) */
.rb-landing-theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 10;
}

/* Theme toggle button in the sidebar footer. */
.rb-theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rb-theme-toggle:hover { background: rgba(255, 255, 255, 0.14); }

.rb-side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Field Sorting page — full design ──────────────────────────────────── */

/* Layout */
.fs-topbar { gap: 10px; flex-wrap: wrap; min-height: 58px; height: auto; }
.fs-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.fs-no-sort { margin: 40px; }

/* Night tabs */
.fs-night-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.fs-night-tab {
  padding: 5px 12px; border-radius: 7px; border: 1px solid #e8eaef;
  background: transparent; font-size: 13px; font-weight: 500;
  color: #4a5568; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.fs-night-tab:hover { background: #f0f2f5; }
.fs-night-tab-active { font-weight: 700; border-color: transparent; }

/* Stats bar */
.fs-stats-bar {
  background: #fff; border-bottom: 1px solid #e8eaef;
  padding: 0 24px; min-height: 42px; display: flex;
  align-items: center; gap: 24px; flex-shrink: 0; flex-wrap: wrap;
}
.fs-stat { display: flex; gap: 6px; align-items: baseline; }
.fs-stat-val { font-size: 15px; font-weight: 700; color: #1a2332; }
.fs-stat-label { font-size: 12px; color: #9aa3b0; }

/* Night body */
.fs-night-body { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* TBD tray */
.fs-tbd-tray {
  border-radius: 14px; border: 1.5px dashed #e2e6ec;
  padding: 13px 16px 15px; background: #fff; transition: border-color 0.15s;
}
.fs-tbd-has-teams { background: #fff7ed; border-color: #f0cfa0; }
.fs-tbd-tray.fs-pitch-hover { border-color: #2ecc71; background: rgba(46,204,113,0.05); }
.fs-tbd-header { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.fs-tbd-has-teams .fs-tbd-header { margin-bottom: 11px; }
.fs-tbd-label { font-size: 13px; font-weight: 700; color: #9aa3b0; }
.fs-tbd-has-teams .fs-tbd-label { color: #b06a10; }
.fs-tbd-count {
  font-size: 11px; font-weight: 700; color: #fff;
  background: #c8cdd8; border-radius: 10px; padding: 1px 8px;
}
.fs-tbd-count-warn { background: #e08c1a; }
.fs-tbd-hint { font-size: 11px; color: #b0916a; }
.fs-tbd-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Field card */
.fs-field-card {
  background: #fff; border-radius: 14px; border: 1px solid #e8eaef;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05); overflow: hidden;
}
.fs-field-card-over { border-color: #f0b8b8; }
.fs-card-header {
  padding: 13px 16px 12px; border-bottom: 1px solid #f0f2f5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.fs-card-header-left { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.fs-card-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-card-name { font-size: 15px; font-weight: 700; color: #1a2332; white-space: nowrap; }
.fs-card-slots-label { font-size: 11px; color: #9aa3b0; }
.fs-cap-chip { font-size: 9.5px; color: #9aa3b0; border: 1px solid #e8eaef; border-radius: 4px; padding: 1px 4px; }
.fs-shared-badge { font-size: 10.5px; font-weight: 700; color: #0d3d26; background: #e7f3ec; padding: 2px 8px; border-radius: 5px; }
.fs-over-badge { font-size: 10.5px; font-weight: 700; color: #e05555; background: #fdeaea; padding: 2px 8px; border-radius: 5px; }
.fs-open-badge { font-size: 10.5px; font-weight: 600; color: #b0b9c6; }
.fs-single-badge { font-size: 10.5px; font-weight: 600; color: #6b7a8d; }
.fs-loc-chip { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; letter-spacing: 0.4px; white-space: nowrap; }
.fs-card-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 12px; }

/* Slot lane */
.fs-slot-lane { display: flex; flex-direction: column; gap: 6px; }
.fs-slot-header { display: flex; align-items: center; gap: 8px; }
.fs-slot-label { font-size: 10px; font-weight: 600; color: #6b7a8d; letter-spacing: 0.5px; }
.fs-slot-cap { font-size: 10px; color: #9aa3b0; font-weight: 500; }
.fs-over { color: #e05555 !important; font-weight: 700; }

/* Pitch (green field) */
.fs-pitch {
  position: relative; border-radius: 10px; padding: 10px;
  min-height: 74px; display: flex; gap: 8px; align-items: stretch;
  background: linear-gradient(160deg, #3f9d63, #2f8a52);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
  outline: 2px dashed transparent; outline-offset: -5px;
  transition: outline-color 0.15s;
}
.fs-pitch.fs-pitch-hover { outline-color: rgba(255,255,255,0.9); }
.fs-pitch.fs-pitch-hover-invalid { outline-color: rgba(239,68,68,0.9); cursor: not-allowed; }
.fs-tbd-tray.fs-pitch-hover-invalid { border-color: #ef4444; }
.fs-pitch-line-v {
  position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px;
  background: rgba(255,255,255,0.30); transform: translateX(-1px); pointer-events: none;
}
.fs-pitch-circle {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;
  border: 2px solid rgba(255,255,255,0.30); border-radius: 50%;
  transform: translate(-50%,-50%); pointer-events: none;
}
.fs-pitch-open {
  flex: 1 1 0; min-width: 120px; border-radius: 8px;
  border: 1.5px dashed rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); font-size: 11px; font-weight: 600;
}
.fs-pitch-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); font-size: 11.5px; font-weight: 600;
}

/* Team chip */
.fs-chip {
  flex: 1 1 0; min-width: 120px;
  background: #fff; border-radius: 8px; cursor: grab; user-select: none;
  border: 1px solid #e8eaef; box-shadow: 0 1px 3px rgba(0,0,0,0.10);
  overflow: hidden; transition: opacity 0.15s;
}
.fs-chip:active { cursor: grabbing; }
.fs-chip-bar { height: 4px; }
.fs-chip-body { padding: 7px 9px 8px; }
.fs-chip-name { font-size: 12px; font-weight: 700; color: #1a2332; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-chip-sub { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.fs-fmt-badge { font-size: 10px; font-weight: 500; padding: 1px 5px; border-radius: 4px; background: #1a2332; color: #fff; letter-spacing: 0.3px; }

/* Editor bar */
.fs-editor-bar { flex-shrink: 0; border-bottom: 1px solid #e8eaef; background: #fff; }
.fs-editor-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: transparent; border: 0; padding: 10px 24px;
  font: inherit; font-size: 13px; font-weight: 600; color: #4a5568;
  text-align: left; cursor: pointer;
}
.fs-editor-toggle:hover { background: #f7f8fa; }
.fs-editor-panel { padding: 16px 24px 20px; }

/* Save message */
.fs-save-msg { font-size: 12px; color: #4ade80; font-weight: 600; }

/* Week matrix */
.fs-matrix-wrap { padding: 24px; overflow: auto; }
.fs-matrix {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  background: #fff; border-radius: 14px; border: 1px solid #e8eaef;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.fs-matrix-th {
  text-align: left; padding: 12px 8px; font-size: 11px; font-weight: 700;
  color: #6b7a8d; text-transform: uppercase; letter-spacing: 0.5px;
  background: #f7f8fa; border-bottom: 1px solid #e8eaef;
}
.fs-matrix-field-th { width: 160px; padding-left: 16px; }
.fs-matrix-night-pill { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 6px; display: inline-block; }
.fs-matrix-field-cell { padding: 10px 16px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.fs-matrix-cell {
  padding: 8px; border-bottom: 1px solid #f0f2f5; border-left: 1px solid #f3f5f8;
  vertical-align: top; transition: filter 0.1s;
}
.fs-matrix-cell:hover { filter: brightness(0.96); }
.fs-matrix-count { font-size: 11px; font-weight: 700; color: #3a4a5a; }
.fs-matrix-fmts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.fs-matrix-fmt-badge { font-size: 9px; font-weight: 600; border-radius: 4px; padding: 1px 4px; }
.fs-matrix-empty { font-size: 11px; color: #c4cad4; display: block; text-align: center; padding: 8px 0; }
.fs-matrix-hint { font-size: 12px; color: #9aa3b0; margin-top: 12px; text-align: center; }

/* ── Week grid popover ──────────────────────────────────────────────────── */
.fs-popover-backdrop {
  position: fixed; inset: 0; z-index: 290;
  background: rgba(0,0,0,0.18);
}
.fs-popover-panel {
  position: fixed; z-index: 291;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  min-width: 320px; max-width: 480px; width: 90vw;
  max-height: 80vh; overflow-y: auto;
}
.fs-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #f0f2f5;
}
.fs-popover-location { display: flex; align-items: center; gap: 4px; }
.fs-popover-field-name { font-size: 13px; font-weight: 700; color: #1a2332; }
.fs-popover-close {
  background: none; border: 1px solid #d1d9e0; border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 16px;
  color: #6b7a8d; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.fs-popover-close:hover { background: #f5f7fa; color: #1a2332; }
.fs-popover-body { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.fs-popover-empty { font-size: 13px; color: #9aa3b0; }
.fs-popover-team-card {
  border: 1px solid #e8edf2; border-radius: 10px; padding: 14px 16px;
}
.fs-popover-team-title { font-size: 16px; font-weight: 700; color: #1a2332; margin-bottom: 3px; }
.fs-popover-team-coaches { font-size: 12px; color: #6b7a8d; margin-bottom: 12px; }
.fs-popover-team-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.fs-popover-meta-group { display: flex; flex-direction: column; gap: 4px; }
.fs-popover-meta-label { font-size: 10px; font-weight: 600; color: #9aa3b0; letter-spacing: 0.5px; text-transform: uppercase; }
.fs-popover-meta-val { display: flex; align-items: center; gap: 6px; }
.fs-popover-age-range { font-size: 12px; color: #4a5568; }
.fs-popover-players { font-size: 18px; font-weight: 700; color: #1a2332; }
.fs-popover-nights { margin-top: 10px; }
.fs-popover-nights-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* ── Practices/week settings ─────────────────────────────────────────────── */
.fs-ppw-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e8edf2; }
.fs-ppw-title { font-size: 11px; font-weight: 700; color: #6b7a8d; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; }
.fs-ppw-rows { display: flex; flex-direction: column; gap: 8px; }
.fs-ppw-row { display: flex; align-items: center; gap: 10px; }
.fs-ppw-label { font-size: 13px; font-weight: 600; color: #1a2332; width: 70px; }
.fs-ppw-unit { font-size: 12px; color: #6b7a8d; }

/* ── Field Sorting page ─────────────────────────────────────────────────── */

.rb-fields-section {
  margin-bottom: 32px;
}

.rb-fields-hint {
  font-size: 13px;
  color: #6b7a8d;
  margin-bottom: 12px;
}

.rb-fields-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rb-fields-msg {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #22c55e;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #166534;
}

.rb-fields-table-wrap {
  overflow-x: auto;
}

.rb-fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.rb-fields-table thead th {
  background: #f7f8fa;
  color: #4a5568;
  text-align: left;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid #e8eaef;
  white-space: nowrap;
}

.rb-fields-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
  color: #1a2332;
}

.rb-fields-table tbody tr:nth-child(even) { background: #fafbfc; }
.rb-fields-table tbody tr:last-child td { border-bottom: none; }

.rb-fields-input {
  border: 1px solid #d1d9e6;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  background: #fff;
  color: #1a2332;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.rb-fields-num {
  width: 56px;
}

.rb-fields-select {
  border: 1px solid #d1d9e6;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 12px;
  background: #fff;
  color: #1a2332;
  font-family: inherit;
}

.rb-fields-center { text-align: center; }

.rb-fields-checkbox { cursor: pointer; width: 16px; height: 16px; }

.rb-fields-night-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.rb-fields-night-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #4a5568;
  cursor: pointer;
  white-space: nowrap;
}

/* Visualization */
.rb-fields-vis-block {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.rb-fields-tbd-block {
  border-color: #ffe08a;
  background: #fffbeb;
}

.rb-fields-vis-field-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a2332;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rb-fields-night-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.rb-fields-night-col {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}

.rb-fields-night-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rb-fields-cap {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8f5e9;
  color: #2e7d32;
}

.rb-fields-cap-warn {
  background: #fff3cd;
  color: #7a4f00;
}

.rb-fields-team-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rb-fields-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: #f7f8fa;
  border-radius: 5px;
  font-size: 11px;
}

.rb-fields-team-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1a2332;
}

.rb-fields-team-fmt {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #6b7a8d;
  background: #eef0f3;
  border-radius: 3px;
  padding: 1px 5px;
}

/* Field visualization drag-drop */
.rb-fields-vis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rb-fields-draggable { cursor: grab; }
.rb-fields-draggable:active { cursor: grabbing; }
.rb-fields-dragging { opacity: 0.4; }

.rb-fields-drag-handle {
  color: #b0b9c6;
  font-size: 13px;
  margin-right: 4px;
  flex-shrink: 0;
  cursor: grab;
}

.rb-fields-drop-zone-list {
  min-height: 36px;
  border-radius: 5px;
  transition: background 0.15s, border-color 0.15s;
}

.rb-fields-drop-over {
  background: rgba(46, 204, 113, 0.08) !important;
  outline: 2px dashed #2ecc71;
}

.rb-fields-drop-placeholder {
  font-size: 11px;
  color: #b0b9c6;
  text-align: center;
  padding: 8px 4px;
  border: 1px dashed #e8eaef;
  border-radius: 5px;
}

body[data-theme="dark"] .rb-fields-drag-handle { color: #475569; }
body[data-theme="dark"] .rb-fields-drop-placeholder { color: #475569; border-color: #334155; }

/* Remove-field button */
.rb-fields-remove-btn {
  background: transparent;
  border: 1px solid #f5a5a5;
  color: #c53030;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.rb-fields-remove-btn:hover { background: #fff0f0; }

body[data-theme="dark"] .rb-fields-remove-btn {
  border-color: #7f1d1d; color: #f87171;
}
body[data-theme="dark"] .rb-fields-remove-btn:hover { background: #450a0a; }

/* Drawer field tag */
.rb-fields-drawer-tag {
  font-size: 12px;
  color: #4a5568;
  background: #eef0f3;
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── Field Sorting dark theme (fs- classes) ─────────────────────────────── */
body[data-theme="dark"] .fs-stats-bar { background: #182231; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-stat-val { color: #e6edf3; }
body[data-theme="dark"] .fs-night-tab { border-color: #334155; color: #94a3b8; }
body[data-theme="dark"] .fs-night-tab:hover { background: #1f2a3a; }
body[data-theme="dark"] .rb-topbar.fs-topbar { background: #182231; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-tbd-tray { background: #182231; border-color: #334155; }
body[data-theme="dark"] .fs-tbd-has-teams { background: #2d1c08; border-color: #7c4a0a; }
body[data-theme="dark"] .fs-tbd-label { color: #64748b; }
body[data-theme="dark"] .fs-tbd-has-teams .fs-tbd-label { color: #fbbf24; }
body[data-theme="dark"] .fs-field-card { background: #182231; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-field-card-over { border-color: #7f1d1d; }
body[data-theme="dark"] .fs-card-header { border-color: #1f2a3a; }
body[data-theme="dark"] .fs-card-name { color: #e6edf3; }
body[data-theme="dark"] .fs-cap-chip { color: #64748b; border-color: #334155; }
body[data-theme="dark"] .fs-chip { background: #0f1722; border-color: #334155; }
body[data-theme="dark"] .fs-chip-name { color: #e6edf3; }
body[data-theme="dark"] .fs-editor-bar { background: #182231; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-editor-toggle { color: #94a3b8; }
body[data-theme="dark"] .fs-editor-toggle:hover { background: #1f2a3a; }
body[data-theme="dark"] .fs-matrix { background: #182231; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-matrix-th { background: #182231; color: #64748b; border-color: #1f2a3a; }
body[data-theme="dark"] .fs-matrix-field-cell,
body[data-theme="dark"] .fs-matrix-cell { border-color: #1f2a3a; }
body[data-theme="dark"] .fs-matrix-count { color: #cbd5e1; }
body[data-theme="dark"] .fs-card-slots-label,
body[data-theme="dark"] .fs-slot-label,
body[data-theme="dark"] .fs-slot-cap { color: #64748b; }
body[data-theme="dark"] .fs-popover-panel { background: #182231; }
body[data-theme="dark"] .fs-popover-header { border-color: #1f2a3a; }
body[data-theme="dark"] .fs-popover-field-name { color: #e6edf3; }
body[data-theme="dark"] .fs-popover-close { border-color: #334155; color: #94a3b8; }
body[data-theme="dark"] .fs-popover-close:hover { background: #1f2a3a; color: #e6edf3; }
body[data-theme="dark"] .fs-popover-team-card { border-color: #1f2a3a; }
body[data-theme="dark"] .fs-popover-team-title { color: #e6edf3; }
body[data-theme="dark"] .fs-popover-team-coaches { color: #64748b; }
body[data-theme="dark"] .fs-popover-players { color: #e6edf3; }
body[data-theme="dark"] .fs-ppw-section { border-color: #1f2a3a; }
body[data-theme="dark"] .fs-ppw-label { color: #e6edf3; }

/* ── Field Sorting dark theme ───────────────────────────────────────────── */
body[data-theme="dark"] .rb-fields-hint { color: #64748b; }

body[data-theme="dark"] .rb-fields-msg {
  background: #0f2d1a; border-color: #166534; border-left-color: #22c55e; color: #4ade80;
}

body[data-theme="dark"] .rb-fields-table { background: #182231; color: #e6edf3; }
body[data-theme="dark"] .rb-fields-table thead th {
  background: #182231; color: #cbd5e1; border-bottom-color: #1f2a3a;
}
body[data-theme="dark"] .rb-fields-table tbody td {
  color: #e6edf3; border-bottom-color: #1f2a3a;
}
body[data-theme="dark"] .rb-fields-table tbody tr:nth-child(even) { background: #1a2536; }

body[data-theme="dark"] .rb-fields-input {
  background: #0f1722; border-color: #334155; color: #e6edf3;
}
body[data-theme="dark"] .rb-fields-select {
  background: #0f1722; border-color: #334155; color: #e6edf3;
}
body[data-theme="dark"] .rb-fields-night-label { color: #cbd5e1; }

body[data-theme="dark"] .rb-fields-vis-block {
  background: #182231; border-color: #1f2a3a;
}
body[data-theme="dark"] .rb-fields-tbd-block {
  border-color: #5b4513; background: #2a2410;
}
body[data-theme="dark"] .rb-fields-vis-field-name { color: #e6edf3; }
body[data-theme="dark"] .rb-fields-team-row { background: #0f1722; }
body[data-theme="dark"] .rb-fields-team-name { color: #e6edf3; }
body[data-theme="dark"] .rb-fields-team-fmt { color: #94a3b8; background: #1f2a3a; }
body[data-theme="dark"] .rb-fields-drawer-tag { color: #cbd5e1; background: #1f2a3a; }

body[data-theme="dark"] .rb-fields-cap { background: #14532d; color: #4ade80; }
body[data-theme="dark"] .rb-fields-cap-warn { background: #422006; color: #fbbf24; }

/* ── Move night-conflict warning ─────────────────────────────────────────── */
.rb-move-night-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  margin-bottom: 0;
}
body[data-theme="dark"] .rb-move-night-warn {
  background: #2d1507; border-color: #7c2d12; color: #fdba74;
}

/* ── Edit nights button ──────────────────────────────────────────────────── */
.rb-edit-nights-btn {
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  line-height: 1.4;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.rb-edit-nights-btn:hover { background: #2ecc71; border-color: #2ecc71; color: #fff; }
body[data-theme="dark"] .rb-edit-nights-btn {
  background: #1f2a3a; border-color: #334155; color: #cbd5e1;
}
body[data-theme="dark"] .rb-edit-nights-btn:hover {
  background: #2ecc71; border-color: #2ecc71; color: #0b1622;
}

/* ── Edit nights modal ──────────────────────────────────────────────────── */
.rb-enm-modal { width: min(360px, 94vw); }

.rb-enm-days {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.rb-enm-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  user-select: none;
}
.rb-enm-label:has(input:checked) {
  background: #e6f4ea;
  border-color: #2ecc71;
  color: #166534;
  font-weight: 600;
}
.rb-enm-label input { display: none; }
body[data-theme="dark"] .rb-enm-label {
  background: #1f2a3a; border-color: #334155; color: #cbd5e1;
}
body[data-theme="dark"] .rb-enm-label:has(input:checked) {
  background: #0e2118; border-color: #2ecc71; color: #4ade80;
}
