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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f4f6f8;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-actions { display: flex; gap: 10px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: #2d6cf0; color: #fff; }
.btn-secondary{ background: #e2e8f0; color: #1a1a2e; }

/* ── Season info bar ─────────────────────────────────────────────────────── */
.season-bar {
  background: #1e293b;
  color: #cbd5e1;
  padding: 8px 24px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.season-bar-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.season-bar-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 500;
}
.season-bar-link:hover { text-decoration: underline; }

#season-bar-divisions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.div-pill {
  background: #334155;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: #94a3b8;
}
.div-pill strong { color: #e2e8f0; }

/* ── Banners ─────────────────────────────────────────────────────────────── */
.success-banner {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
  padding: 10px 24px;
  font-weight: 500;
}
.success-banner.warn {
  background: #fff7ed;
  border-color: #f97316;
  color: #7c2d12;
}
.success-banner.error {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d;
}

.conflict-section {
  background: #fff8f1;
  border-left: 4px solid #f97316;
  padding: 14px 24px;
  margin: 0;
}
.conflict-section h2 {
  font-size: 1rem;
  color: #c2410c;
  margin-bottom: 10px;
}
.conflict-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
#tabs-container {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 16px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  position: relative;
  bottom: -2px;
  transition: color 0.1s, border-color 0.1s;
}
.tab-btn:hover { color: #1a1a2e; }
.tab-btn.active {
  color: #2d6cf0;
  border-color: #e2e8f0 #e2e8f0 #fff;
  background: #fff;
}

/* ── Filter row ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-bottom: none;
  padding: 10px 16px;
}

.filter-row label {
  font-weight: 500;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row select {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
}

.game-count {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
#schedule-table-wrapper {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

#schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#schedule-table th {
  background: #f8fafc;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

#schedule-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

#schedule-table tr:last-child td { border-bottom: none; }

#schedule-table tbody tr:hover { background: #f8fafc; }

.team-cell { font-weight: 500; }
.team-cell.home { color: #1d4ed8; }
.team-cell.away { color: #374151; }

.center { text-align: center; }

.address {
  color: #94a3b8;
  font-size: 12px;
  max-width: 200px;
}

/* Rematch rows */
.rematch-row td { background: #fefce8; }
.rematch-row:hover td { background: #fef9c3 !important; }
.game-id-cell { color: #6b7280; font-size: 12px; font-weight: 600; white-space: nowrap; }

.no-games {
  text-align: center;
  padding: 32px;
  color: #94a3b8;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-style: italic;
}

/* ── View bar ────────────────────────────────────────────────────────────── */
.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  padding: 8px 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.view-btns {
  display: flex;
  gap: 4px;
}

.view-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.view-btn:hover { background: #f1f5f9; color: #1a1a2e; }
.view-btn.active { background: #2d6cf0; color: #fff; border-color: #2d6cf0; }

.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.view-controls label {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-controls select {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
}

/* ── View panels ─────────────────────────────────────────────────────────── */
.view-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  margin-bottom: 24px;
}

/* ── Teams view ──────────────────────────────────────────────────────────── */
#teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.team-card {
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
  font-size: 12px;
}

.team-card-header {
  background: #f8fafc;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.team-card-name {
  font-weight: 700;
  font-size: 13px;
  color: #1a1a2e;
}

.team-card-meta {
  font-size: 11px;
  color: #94a3b8;
}

.team-card table {
  width: 100%;
  border-collapse: collapse;
}

.team-card td {
  padding: 5px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.team-card tr:last-child td { border-bottom: none; }

.ha-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.ha-badge.home { background: #dbeafe; color: #1d4ed8; }
.ha-badge.away { background: #f1f5f9; color: #475569; }

.opp-name { font-weight: 500; color: #1a1a2e; }
.field-small { color: #94a3b8; font-size: 11px; }
.wk-num { color: #94a3b8; font-size: 11px; min-width: 28px; }

/* ── Matrix view ─────────────────────────────────────────────────────────── */
.matrix-scroll {
  overflow-x: auto;
}

.matrix-table {
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.matrix-table th, .matrix-table td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
  vertical-align: middle;
}

.matrix-corner { background: #f8fafc; }

.matrix-col-head {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 10px;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-row-head {
  background: #f8fafc;
  font-weight: 600;
  color: #1a1a2e;
  text-align: left;
  white-space: nowrap;
}

.matrix-cell { min-width: 52px; }
.matrix-self { background: #f1f5f9; }
.matrix-zero { color: #cbd5e1; }

.matrix-count {
  font-weight: 700;
  font-size: 13px;
  display: block;
  line-height: 1.2;
}

.matrix-ha {
  font-size: 10px;
  color: #64748b;
}

/* intensity shading */
.matrix-i1 { background: #eff6ff; }
.matrix-i2 { background: #dbeafe; }
.matrix-i3 { background: #bfdbfe; }
.matrix-i4 { background: #93c5fd; color: #1e3a8a; }

/* ── Stats view ──────────────────────────────────────────────────────────── */
.stats-scroll { overflow-x: auto; }

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

.stats-table th {
  background: #f8fafc;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
  white-space: nowrap;
}

.stats-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}

.stats-table tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover td { background: #f8fafc; }

.stats-team-name { text-align: left; font-weight: 500; color: #1a1a2e; }
.stat-total { font-weight: 700; }
.stat-warn { background: #fff7ed !important; color: #c2410c; font-weight: 600; }
.stat-zero { color: #cbd5e1; }

.stats-note {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Top nav ─────────────────────────────────────────────────────────────── */
#top-nav {
  background: #1e293b;
  padding: 0 24px;
  display: flex;
  gap: 2px;
}

.top-nav-btn {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.top-nav-btn:hover { color: #e2e8f0; }
.top-nav-btn.active { color: #fff; border-bottom-color: #2d6cf0; }

/* ── Page section ────────────────────────────────────────────────────────── */
.page-section {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
}

/* ── Teams roster page ───────────────────────────────────────────────────── */
.teams-division-section {
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.teams-division-header {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.teams-div-count {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}

.teams-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.teams-table th {
  background: #f8fafc;
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.teams-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.teams-table tr:last-child td { border-bottom: none; }
.teams-table tbody tr:hover td { background: #f8fafc; }

.teams-table-name { font-weight: 600; color: #1a1a2e; }

.unconfirmed-row td { color: #94a3b8; }

.confirmed-badge {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.unconfirmed-badge {
  display: inline-block;
  background: #fee2e2;
  color: #7f1d1d;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.blackout-cell {
  font-size: 11px;
  color: #94a3b8;
  max-width: 200px;
}

/* ── Game row interaction ─────────────────────────────────────────────────── */
.game-row { cursor: pointer; }
.game-row:hover td { background: #eff6ff !important; }

/* ── Edit Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  margin: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: #1a1a2e; }

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.modal-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  flex: 1;
  min-width: 140px;
}

.modal-row label select,
.modal-row label input {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
}

.modal-row label select:focus,
.modal-row label input:focus {
  outline: 2px solid #2d6cf0;
  outline-offset: 1px;
}

.edit-violations {
  margin: 0 20px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: #7f1d1d;
}

.edit-violations ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.edit-violations li { margin-bottom: 3px; }

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}

.btn-warn {
  background: #f97316;
  color: #fff;
  border: none;
}

/* ── Notify panel (shown in modal after successful save) ─────────────────── */
.notify-panel { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.notify-saved-banner { background: #dcfce7; border: 1px solid #86efac; border-radius: 6px; padding: 9px 14px; font-size: 13px; font-weight: 600; color: #166534; }
.notify-changes-list { display: flex; flex-direction: column; gap: 4px; }
.notify-change-row { font-size: 12px; color: #475569; display: flex; gap: 6px; align-items: baseline; }
.notify-change-field { font-weight: 700; color: #1e293b; min-width: 60px; }
.notify-change-from { color: #94a3b8; text-decoration: line-through; }
.notify-change-arrow { color: #94a3b8; }
.notify-change-to { color: #1d4ed8; font-weight: 600; }
.notify-team-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notify-team-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.notify-team-role { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 4px; }
.notify-team-name { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.notify-team-contact { font-size: 11px; color: #475569; display: flex; flex-direction: column; gap: 2px; }
.notify-team-contact a { color: #2d6cf0; text-decoration: none; }
.notify-team-contact a:hover { text-decoration: underline; }
.notify-no-contact { font-size: 12px; color: #94a3b8; font-style: italic; }
@media (max-width: 480px) { .notify-team-cards { grid-template-columns: 1fr; } }

/* ── Changes page ─────────────────────────────────────────────────────────── */
.changes-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.changes-toolbar-title { font-size: 14px; font-weight: 700; color: #1e293b; }
.changes-empty { text-align: center; padding: 48px 24px; color: #94a3b8; font-size: 14px; }
.change-entry { border-bottom: 1px solid #f1f5f9; padding: 14px 20px; }
.change-entry:last-child { border-bottom: none; }
.change-entry-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.change-ts { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.change-game-badge { font-size: 11px; font-weight: 700; background: #e0e7ff; color: #3730a3; border-radius: 4px; padding: 2px 7px; }
.change-div-badge { font-size: 11px; background: #f1f5f9; color: #475569; border-radius: 4px; padding: 2px 7px; }
.change-forced-badge { font-size: 10px; background: #fff7ed; color: #c2410c; border-radius: 4px; padding: 2px 6px; font-weight: 600; }
.change-fields { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.change-field-pill { font-size: 11px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 3px 8px; color: #475569; }
.change-field-pill strong { color: #1e293b; }
.change-field-pill .pill-from { color: #94a3b8; text-decoration: line-through; }
.change-field-pill .pill-to { color: #1d4ed8; font-weight: 600; }
.change-teams { display: flex; gap: 12px; flex-wrap: wrap; }
.change-team-info { font-size: 11px; color: #64748b; }
.change-team-info strong { color: #1e293b; }
.change-team-info a { color: #2d6cf0; text-decoration: none; }
.change-team-info a:hover { text-decoration: underline; }
.change-resend { font-size: 11px; color: #2d6cf0; text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; }
.change-resend:hover { text-decoration: underline; }
.change-entry-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ── Season Editor ───────────────────────────────────────────────────────── */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.editor-toolbar-title { font-size: 1rem; font-weight: 700; color: #1a1a2e; }

.editor-division-section { margin: 20px 24px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; overflow: hidden; }
.editor-division-header { padding: 10px 16px; background: #f1f5f9; font-weight: 700; font-size: 13px; color: #1a1a2e; border-bottom: 1px solid #e2e8f0; }

.editor-team { border-bottom: 1px solid #f1f5f9; }
.editor-team:last-child { border-bottom: none; }

.editor-team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.editor-team-row:hover { background: #f8fafc; }
.editor-team-row.open  { background: #f0f4ff; }

.editor-team-name  { font-weight: 600; flex: 2; min-width: 140px; }
.editor-team-coach { flex: 2; color: #475569; min-width: 120px; }
.editor-team-field { flex: 2; color: #64748b; font-size: 12px; min-width: 120px; }
.editor-chevron    { margin-left: auto; color: #94a3b8; font-size: 18px; transition: transform 0.15s; }
.editor-team-row.open .editor-chevron { transform: rotate(90deg); }

.editor-team-form { padding: 16px; background: #f8fafc; border-top: 1px solid #e2e8f0; }

.editor-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.editor-form-bottom { display: flex; gap: 16px; align-items: flex-start; }
.editor-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.editor-label input,
.editor-label select,
.editor-label textarea {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #1a1a2e;
  width: 100%;
}
.editor-label textarea { resize: vertical; font-family: monospace; }
.editor-hint { font-weight: 400; color: #94a3b8; }

.editor-label-wide { flex: 1; }

.editor-form-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  min-width: 160px;
}

.editor-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.editor-form-actions { display: flex; gap: 8px; }

.editor-status { font-size: 12px; font-weight: 600; min-height: 16px; }
.editor-status.saved { color: #16a34a; }
.editor-status.error { color: #dc2626; }

/* ── Calendar View ───────────────────────────────────────────────────────── */
.cal-controls { padding: 12px 16px; display: flex; align-items: center; gap: 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.cal-controls label { font-size: 13px; font-weight: 600; color: #475569; display: flex; align-items: center; gap: 8px; }
.cal-controls select { font-size: 13px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; }

#calendar-wrapper { padding: 16px 24px; display: flex; flex-direction: column; gap: 24px; }

.cal-month { }
.cal-month-label { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }

.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-table thead th {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  padding: 4px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-table td { vertical-align: top; padding: 0; border: 1px solid #e2e8f0; height: 80px; width: 14.28%; }
.cal-empty           { background: #f8fafc; }
.cal-day             { background: #fff; padding: 6px; }
.cal-has-game        { background: #eff6ff; border-color: #bfdbfe; }
.cal-blackout        { background: #fff1f2; border-color: #fecdd3; }
.cal-global-blackout { background: #fff7ed; border-color: #fed7aa; }
/* Game takes visual priority over blackout */
.cal-has-game.cal-blackout        { background: #eff6ff; border-color: #bfdbfe; }
.cal-has-game.cal-global-blackout { background: #eff6ff; border-color: #bfdbfe; }

.cal-day-num {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 4px;
}
.cal-has-game .cal-day-num        { color: #1d4ed8; }
.cal-blackout .cal-day-num        { color: #e11d48; }
.cal-global-blackout .cal-day-num { color: #ea580c; }

.cal-game {
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cal-game.cal-rematch { border-left: 2px solid #f59e0b; padding-left: 3px; }
.cal-opp  { font-weight: 600; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-meta { color: #64748b; font-size: 10px; }

.cal-ha-label {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 2px;
}
.cal-ha-label.home { background: #dbeafe; color: #1d4ed8; }
.cal-ha-label.away { background: #f3e8ff; color: #7e22ce; }

/* Calendar legend */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0 4px;
  font-size: 12px;
  color: #475569;
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  display: inline-block;
}
.cal-swatch-game     { background: #eff6ff; border-color: #bfdbfe; }
.cal-swatch-blackout { background: #fff1f2; border-color: #fecdd3; }
.cal-swatch-rematch  { border-left: 3px solid #f59e0b; background: #fff; }
.cal-swatch-global   { background: #fff7ed; border-color: #fed7aa; }

/* ── Division target games editor ────────────────────────────────────────── */
.editor-division-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.div-target-wrap { margin-left: auto; display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 12px; color: #64748b; }
.div-target-input { width: 52px; padding: 3px 6px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 4px; text-align: center; }
.div-target-hint { color: #94a3b8; }

/* ── Field editor ────────────────────────────────────────────────────────── */
.field-editor-form { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin: 0 0 16px; overflow: hidden; }
.field-form-inner { padding: 20px; }
.field-form-inner h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: #1e293b; }
.field-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field-form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #374151; }
.field-form-row input { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }
.field-form-hint { font-weight: 400; color: #94a3b8; }
.field-form-actions { display: flex; gap: 8px; margin-top: 16px; }
.field-form-error { color: #dc2626; font-size: 12px; margin-top: 8px; padding: 6px 10px; background: #fef2f2; border-radius: 5px; }

.fields-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; font-size: 13px; }
.fields-table th { background: #f8fafc; padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; border-bottom: 1px solid #e2e8f0; }
.fields-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.fields-table tr:last-child td { border-bottom: none; }
.fields-table tbody tr:hover { background: #f8fafc; }
.field-wknd-badge { display: inline-block; font-size: 10px; background: #ede9fe; color: #6d28d9; border-radius: 3px; padding: 1px 6px; margin-left: 6px; font-weight: 600; }
.field-row-actions { display: flex; gap: 6px; }
.field-used-badge { font-size: 10px; color: #94a3b8; background: #f1f5f9; border-radius: 3px; padding: 1px 6px; }
@media (max-width: 600px) { .field-form-row { grid-template-columns: 1fr; } }

/* ── Help modal ──────────────────────────────────────────────────────────── */
.help-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.help-modal { background: #fff; border-radius: 14px; max-width: 540px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.help-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0; }
.help-modal-header h2 { font-size: 17px; font-weight: 700; color: #1e293b; }
.help-modal-close { background: none; border: none; font-size: 22px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 0 4px; }
.help-modal-close:hover { color: #374151; }
.help-modal-body { padding: 18px 20px 24px; }
.help-section { margin-bottom: 20px; }
.help-section:last-child { margin-bottom: 0; }
.help-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin-bottom: 10px; }
.help-item { display: flex; gap: 10px; margin-bottom: 10px; }
.help-icon { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.help-item-body { flex: 1; }
.help-item-body strong { display: block; font-size: 13px; color: #1e293b; margin-bottom: 2px; }
.help-item-body p { font-size: 12px; color: #64748b; line-height: 1.5; }
.help-btn { margin-left: 6px; background: none; border: 1px solid #cbd5e1; border-radius: 5px; padding: 2px 8px; font-size: 11px; color: #374151; cursor: pointer; vertical-align: middle; }
.help-btn:hover { background: #f1f5f9; }
