/* ========================================
   ADMIN DASHBOARD — Sports Bar AI
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #161622;
  --bg-glass: rgba(255,255,255,0.04);
  --bg-hover: rgba(255,255,255,0.06);
  --bg-active: rgba(74,161,217,0.12);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.14);
  --border-active: rgba(74,161,217,0.3);
  --brand-blue: #4aa1d9;
  --brand-orange: #f39322;
  --accent: #4aa1d9;
  --accent2: #7c3aed;
  --live: #ff3b5c;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font: 'Inter', -apple-system, sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 60px;
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ========================================
   TOPBAR
   ======================================== */
.admin-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text); }

.topbar-brand { display: flex; align-items: center; }
.topbar-logo { height: 24px; width: auto; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-gear {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: var(--transition);
}
.topbar-gear:hover { background: var(--bg-hover); color: var(--text); }

/* Quick Settings Modal */
.qs-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.qs-overlay.open { opacity: 1; pointer-events: auto; }
.qs-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 380px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto; padding: 24px;
  transform: scale(0.95); transition: transform 0.2s ease;
}
.qs-overlay.open .qs-modal { transform: scale(1); }
.qs-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.qs-title svg { color: var(--text-muted); }
.qs-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 8px;
}
.qs-section-title:first-of-type { margin-top: 0; }
.qs-hint { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.qs-actions {
  display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end;
}
.qs-clear {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px; margin-top: 8px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; transition: var(--transition);
}
.qs-clear:hover { background: var(--bg-hover); color: var(--text); }

/* Multi-select dropdown */
.qs-ms { position: relative; }
.qs-ms-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 12px; background: var(--bg-glass);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.85rem; cursor: pointer;
  transition: border-color 0.15s;
}
.qs-ms-trigger:hover, .qs-ms-trigger:focus { border-color: var(--brand-blue); }
.qs-ms-trigger svg { flex-shrink: 0; color: var(--text-muted); }
.qs-ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-ms-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--brand-blue);
  border-radius: var(--radius-sm); margin-top: 4px; z-index: 510;
  max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.qs-ms-dropdown.open { display: block; }
.qs-ms-search-wrap {
  display: flex; align-items: center; padding: 8px; gap: 6px;
  border-bottom: 1px solid var(--border);
}
.qs-ms-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.qs-ms-search {
  flex: 1; background: none; border: none; color: var(--text);
  font-size: 0.85rem; outline: none;
}
.qs-ms-search::placeholder { color: var(--text-muted); }
.qs-ms-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; font-size: 0.85rem;
  transition: background 0.1s;
}
.qs-ms-option:hover { background: var(--bg-hover); }
.qs-ms-cb {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-radius: 3px; flex-shrink: 0; position: relative;
  transition: all 0.15s;
}
.qs-ms-cb.checked {
  background: var(--brand-blue); border-color: var(--brand-blue);
}
.qs-ms-cb.checked::after {
  content: ''; position: absolute; top: 2px; left: 5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.qs-ms-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.qs-ms-bulk { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.qs-ms-bulk-btn { flex: 1; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text-muted); font-size: 0.7rem; cursor: pointer; transition: all 0.15s; }
.qs-ms-bulk-btn:hover { color: var(--text); border-color: var(--accent); background: rgba(74,161,217,0.1); }

/* Custom Calendar */
.af-cal-wrap { position: relative; }
.af-cal-trigger {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 72px; height: 64px; padding: 4px 12px;
  background: var(--bg-glass); border: 2px solid var(--brand-blue);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s;
}
.af-cal-trigger:hover { background: rgba(74,161,217,0.1); }
.af-cal-dayname { font-size: 0.55rem; font-weight: 700; color: var(--brand-blue); text-transform: uppercase; letter-spacing: 0.05em; }
.af-cal-daynum { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1; }
.af-cal-month { font-size: 0.55rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.af-cal-popup {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 8px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); min-width: 280px;
}
.af-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.af-cal-month-label { font-size: 0.85rem; font-weight: 700; }
.af-cal-nav {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; border-radius: 4px; transition: color 0.15s;
}
.af-cal-nav:hover { color: var(--brand-blue); }
.af-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 4px; text-transform: uppercase;
}
.af-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.af-cal-day {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; font-size: 0.8rem;
  cursor: pointer; transition: all 0.1s; margin: 0 auto;
}
.af-cal-day:hover:not(.disabled):not(.empty) { background: var(--bg-hover); }
.af-cal-day.today { color: var(--brand-blue); font-weight: 700; }
.af-cal-day.selected { background: var(--brand-blue); color: #fff; font-weight: 700; }
.af-cal-day.disabled { color: var(--text-muted); opacity: 0.3; cursor: default; }
.af-cal-day.empty { cursor: default; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  min-width: 200px;
  transition: var(--transition);
}
.topbar-search:focus-within { border-color: var(--accent); }
.topbar-search svg { color: var(--text-muted); flex-shrink: 0; }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text);
  font-size: 0.85rem;
}
.topbar-search input::placeholder { color: var(--text-muted); }

/* Profile dropdown */
.topbar-profile { position: relative; }
.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.profile-avatar:hover { opacity: 0.85; }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 4px;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
}
.profile-dropdown.open { display: block; }

.profile-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-info strong { font-size: 0.85rem; }
.profile-info span { font-size: 0.75rem; color: var(--text-muted); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }

/* ========================================
   SIDEBAR
   ======================================== */
.admin-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
  transition: width var(--transition), transform var(--transition);
}

.sidebar-nav {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-item.active { background: var(--bg-active); color: var(--accent); }
.sidebar-item svg { flex-shrink: 0; }
.sidebar-item.active svg { stroke: var(--accent); }

.sidebar-selectors {
  padding: 4px 0 2px;
}
.sidebar-select-group {
  padding: 2px 4px 4px;
}
.sidebar-select-label {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 8px;
  font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sidebar-select-label svg { flex-shrink: 0; width: 14px; height: 14px; }
.sidebar-select {
  width: 100%; padding: 6px 8px;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.8rem;
  cursor: pointer; appearance: auto;
}
.sidebar-select:hover { border-color: var(--border-hover); }
.sidebar-select:focus { border-color: var(--accent); outline: none; }
body.sidebar-collapsed .sidebar-selectors { display: none; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}

/* Sidebar collapsed */
body.sidebar-collapsed .admin-sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar-item span { display: none; }
body.sidebar-collapsed .sidebar-item { justify-content: center; padding: 9px; }
body.sidebar-collapsed .sidebar-divider { margin: 6px 4px; }
body.sidebar-collapsed .admin-main { margin-left: var(--sidebar-w-collapsed); }

/* ========================================
   MAIN CONTENT
   ======================================== */
.admin-main {
  margin-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left var(--transition);
}

.admin-content {
  padding: 24px;
  max-width: 1400px;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00c4cc);
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========================================
   STAT CARDS
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========================================
   DATA TABLE
   ======================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-width: 240px;
}
.table-search:focus-within { border-color: var(--accent); }
.table-search svg { color: var(--text-muted); flex-shrink: 0; }
.table-search input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text);
  font-size: 0.85rem;
}
.table-search input::placeholder { color: var(--text-muted); }

.table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--bg-card); }

.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead {
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.data-table th:hover { color: var(--text-secondary); }
.data-table th.sorted { color: var(--accent); }

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.pagination-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.pagination-btn:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-btn.active { background: var(--bg-active); border-color: var(--accent); color: var(--accent); }

/* ========================================
   BADGES / STATUS
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-active, .badge-published { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-inactive, .badge-draft { background: rgba(100,116,139,0.2); color: var(--text-muted); }
.badge-admin { background: rgba(74,161,217,0.15); color: var(--accent); }
.badge-manager { background: rgba(124,58,237,0.15); color: var(--accent2); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-cancelled, .badge-failed { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-completed, .badge-succeeded { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-live { background: rgba(255,59,92,0.15); color: var(--live); }

/* ========================================
   FORMS / INPUTS
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group label.toggle-wrap {
  display: flex;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 0;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-select {
  appearance: none;
  cursor: pointer;
}
.form-select option { background: var(--bg-card); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 4px;
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle {
  display: block;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}
.toggle-input:checked + .toggle { background: var(--accent); border-color: var(--accent); }
.toggle-input:checked + .toggle::after { left: 18px; background: #fff; }
.toggle-input { display: none; }

/* ========================================
   SLIDE PANEL (Create/Edit)
   ======================================== */
.slide-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.slide-panel-overlay.open { opacity: 1; visibility: visible; }

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 310;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.slide-panel-overlay.open .slide-panel { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title { font-size: 1.1rem; font-weight: 700; }

.panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
}
.panel-close:hover { background: var(--bg-hover); color: var(--text); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ========================================
   CONFIRM MODAL
   ======================================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.open { display: flex; }

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.confirm-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.confirm-text { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 400px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-info { border-left: 3px solid var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo { height: 32px; margin-bottom: 16px; }
.login-title { font-size: 1.25rem; font-weight: 700; }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.login-form .form-group label { display: block; margin-bottom: 5px; }
.login-form .form-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.login-form .form-group input:focus { border-color: var(--accent); }
.login-form .form-group input::placeholder { color: var(--text-muted); }

.login-error {
  color: var(--danger);
  font-size: 0.8rem;
  min-height: 20px;
  margin-bottom: 4px;
}

.login-footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* ========================================
   DETAIL VIEW (used in orders, etc.)
   ======================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.detail-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-muted); }
.detail-row .value { color: var(--text); font-weight: 500; }

/* ========================================
   TABS
   ======================================== */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.admin-tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ========================================
   SKELETON LOADING
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-hover) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row { height: 16px; margin-bottom: 8px; }
.skeleton-row.w60 { width: 60%; }
.skeleton-row.w80 { width: 80%; }
.skeleton-row.w40 { width: 40%; }

/* ========================================
   DETAIL PAGE (Full-page edit views)
   ======================================== */
.detail-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.detail-back:hover { background: var(--bg-hover); color: var(--text); }

.detail-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.detail-page-header .badge { margin-left: 4px; }
.detail-page-header .page-actions { margin-left: auto; }

.detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.detail-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}

.toggle-row .toggle-wrap {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Icon buttons for table actions */
/* Clickable row name links */
.row-link {
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
}
.row-link:hover { color: var(--accent); }

/* Icon buttons for table actions */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }

/* Type badges (colored pills for location types) */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.type-badge-pub { background: rgba(239,68,68,0.15); color: var(--danger); }
.type-badge-bar { background: rgba(100,116,139,0.25); color: var(--text-secondary); }
.type-badge-sports_bar { background: rgba(74,161,217,0.15); color: var(--accent); }
.type-badge-restaurant { background: rgba(243,147,34,0.15); color: var(--brand-orange); }
.type-badge-venue { background: rgba(124,58,237,0.15); color: var(--accent2); }

/* Team member rows */
.team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }

.team-info { flex: 1; min-width: 0; }
.team-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.team-email { font-size: 0.75rem; color: var(--text-muted); }

.team-role-select {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  outline: none;
}
.team-role-select:focus { border-color: var(--accent); }
.team-role-select option { background: var(--bg-card); }

/* Permission override rows */
.perm-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.perm-category-title:first-child { margin-top: 0; }

.perm-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
}

.perm-override-row .label { color: var(--text-secondary); }

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

.perm-vis-btn {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.perm-vis-btn:hover { border-color: var(--border-hover); }
.perm-vis-btn.active-vis { background: rgba(34,197,94,0.15); color: var(--success); border-color: rgba(34,197,94,0.3); }
.perm-vis-btn.hidden-vis { background: rgba(100,116,139,0.15); color: var(--text-muted); border-color: rgba(100,116,139,0.3); }
.perm-vis-btn.paid-vis { background: rgba(245,158,11,0.15); color: var(--warning); border-color: rgba(245,158,11,0.3); }
.perm-vis-btn.admin-vis { background: rgba(239,68,68,0.15); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.perm-vis-btn.inherited-vis { background: rgba(74,161,217,0.1); color: var(--accent); border-color: rgba(74,161,217,0.2); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  body.sidebar-open .admin-sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 85;
  }
  .admin-main { margin-left: 0; }
  body.sidebar-collapsed .admin-main { margin-left: 0; }

  .admin-content { padding: 16px; }

  .topbar-search { display: none; }

  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .slide-panel { width: 100vw; max-width: 100vw; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ---------- Impersonation ---------- */

.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--brand-orange);
  color: #000;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
}
.impersonation-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}
.impersonation-banner-content svg { stroke: #000; flex-shrink: 0; }
.impersonation-stop {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.3);
  color: #000;
  padding: 2px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
}
.impersonation-stop:hover { background: rgba(0,0,0,0.35); }

body.has-impersonation-banner .admin-topbar { top: 34px; }
body.has-impersonation-banner .admin-main { padding-top: calc(56px + 34px); }
body.has-impersonation-banner .admin-sidebar { top: calc(56px + 34px); height: calc(100vh - 56px - 34px); }
body.has-impersonation-banner .slide-panel { top: 34px; }

/* ---------- Autocomplete Dropdown ---------- */
.ac-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: 2000;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border, #2a2a3e);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  margin-top: 2px;
}
.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  color: var(--text, #e0e0e0);
  transition: background 0.1s;
}
.ac-item:hover, .ac-item.ac-active {
  background: var(--brand-blue, #4aa1d9);
  color: #fff;
}
.ac-item img {
  flex-shrink: 0;
}

/* ========================================
   ADMIN FIXTURE CARDS
   Same structure as public fixture cards
   ======================================== */
/* Date Ribbon */
.af-date-ribbon-wrap { display: flex; align-items: center; gap: 4px; padding: 4px 0 8px; }
.af-date-ribbon { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.af-date-ribbon::-webkit-scrollbar { display: none; }
.af-ribbon-chevron { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 32px; height: 64px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--brand-blue); flex-shrink: 0; transition: all 0.15s; }
.af-ribbon-chevron:hover { border-color: var(--brand-blue); background: rgba(74,161,217,0.08); }
.af-ribbon-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; height: 64px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-glass); cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.af-ribbon-day:hover { border-color: rgba(74,161,217,0.4); background: rgba(74,161,217,0.05); }
.af-ribbon-day.selected { border-color: var(--brand-blue); background: rgba(74,161,217,0.12); }
.af-ribbon-day.today .af-ribbon-wday { color: var(--brand-blue); }
.af-ribbon-wday { font-size: 0.55rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.af-ribbon-num { font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.af-ribbon-month { font-size: 0.5rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

/* Sport Rail + League Tray */
.af-filter-row { padding: 0 0 8px; }
.af-slave-filters { min-width: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; }

.af-sport-rail { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.af-sport-rail::-webkit-scrollbar { display: none; }
.af-rail-item { display: flex; flex-direction: column; align-items: center; background: none; border: 2px solid transparent; border-radius: 12px; padding: 4px; cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.af-rail-item:hover { border-color: rgba(255,255,255,0.1); }
.af-rail-item.active { border-color: var(--brand-blue); background: rgba(74,161,217,0.1); }
.af-rail-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--card-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.af-rail-badge img { width: 28px; height: 28px; object-fit: contain; }
.af-rail-badge svg { width: 20px; height: 20px; }
.af-rail-letter { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* League Tray */
.af-league-tray { max-height: 0; overflow: hidden; transition: max-height 0.2s ease; }
.af-league-tray.open { max-height: 56px; overflow-x: auto; scrollbar-width: none; }
.af-league-tray.open::-webkit-scrollbar { display: none; }
.af-league-tray-scroll { display: flex; gap: 6px; padding: 4px 0 0; }
.af-league-pill { width: 36px; height: 36px; border-radius: 50%; background: var(--card-bg); border: 2px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; transition: all 0.15s; padding: 0; }
.af-league-pill:hover { border-color: rgba(255,255,255,0.15); }
.af-league-pill.active { border-color: var(--brand-blue); box-shadow: 0 0 6px rgba(74,161,217,0.3); }
.af-league-pill img { width: 28px; height: 28px; object-fit: contain; }
.af-league-pill svg { width: 18px; height: 18px; }
.af-pill-letter { font-size: 0.6rem; color: var(--text-muted); font-weight: 600; }

@media (max-width: 600px) {
  .af-ribbon-day { min-width: 52px; height: 56px; }
  .af-ribbon-chevron { height: 56px; width: 28px; }
}

.af-edit-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.af-edit-btn:hover { color: var(--brand-blue); background: rgba(74,161,217,0.1); }
.af-edit-btn.danger:hover { color: var(--danger, #e74c3c); background: rgba(231,76,60,0.1); }

.af-list { display: flex; flex-direction: column; gap: 16px; }

.af-league-group { display: flex; flex-direction: column; gap: 2px; }
.af-league-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border);
}
.af-league-header img { flex-shrink: 0; }
.af-league-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.af-league-sport { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }
.af-league-count {
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg-hover); border-radius: 10px; padding: 1px 7px;
}

/* Card — same 5-col grid as public */
.af-card {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.af-card:last-child { border-bottom: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.af-card:hover { background: var(--bg-hover); }
.af-card-live { border-left-color: var(--live); }

.af-card-main {
  display: grid;
  grid-template-columns: 48px 1fr auto 1fr 40px;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
}

/* Motorsport: 3-col */
.af-card-main.af-card-motor {
  grid-template-columns: 48px 1fr 40px;
}

/* League badge column */
.af-league { display: flex; align-items: center; justify-content: center; }
.af-league img { width: 36px; height: 36px; object-fit: contain; }

/* Team columns */
.af-team {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; text-align: center;
}
.af-team img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.af-team-name {
  font-size: 0.55rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.03em;
  line-height: 1.2; max-width: 90px;
  word-wrap: break-word; overflow-wrap: break-word;
}

/* Center column */
.af-center {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-width: 70px;
}
.af-time { font-size: 1rem; font-weight: 700; color: var(--text); }
.af-score { font-size: 1.1rem; font-weight: 800; color: var(--text); letter-spacing: 0.05em; }
.af-score-live { color: var(--live); }
.af-date-sm { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.af-status { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; margin-top: 2px; }
.af-status-live { color: var(--live); }
.af-status-done { color: var(--text-muted); }
.af-status-cancel { color: var(--brand-orange); }
.af-date { font-size: 0.65rem; color: var(--text-secondary); font-weight: 500; }
.af-extra { font-size: 0.6rem; color: var(--text-muted); }
.af-period { font-size: 0.6rem; color: var(--live); font-weight: 600; }

/* Status column — dot + chevron stacked */
.af-status-col {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
}
.af-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.06); position: relative;
}
.af-dot::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
}
.af-dot.live::after { background: var(--live); }
.af-dot.ft::after { background: var(--text-muted); }
.af-dot.cancel::after { background: var(--brand-orange); }
.af-chevron-wrap {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); cursor: pointer;
}
.af-chevron-wrap:hover { background: var(--accent); }
.af-chevron-wrap svg { color: var(--text-muted); width: 12px; height: 12px; }
.af-chevron-wrap:hover svg { color: #000; }
.af-dot.live { animation: af-pulse 1.5s ease-in-out infinite; }
.af-dot.live::after { animation: af-pulse 1.5s ease-in-out infinite; }

@keyframes af-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Motorsport center */
.af-motor-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.af-motor-event { font-size: 0.7rem; font-weight: 700; color: var(--text); letter-spacing: 0.04em; }
.af-motor-info { display: flex; flex-direction: column; align-items: center; }

/* Responsive */
@media (max-width: 768px) {
  .af-card-main { grid-template-columns: 36px 1fr auto 1fr 30px; padding: 8px 10px; gap: 6px; }
  .af-league img { width: 28px; height: 28px; }
  .af-team img { width: 32px; height: 32px; }
  .af-team-name { font-size: 0.45rem; max-width: 70px; }
  .af-time { font-size: 0.85rem; }
  .af-score { font-size: 0.95rem; }
}

/* ---------- Quill Editor Dark Theme ---------- */
.ql-toolbar.ql-snow {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 6px 8px;
}
.ql-container.ql-snow {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-glass);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
}
.ql-editor {
  min-height: 150px;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text);
  line-height: 1.6;
}
.ql-editor.ql-blank::before {
  color: var(--text-muted);
  font-style: normal;
}
/* Toolbar icons */
.ql-snow .ql-stroke { stroke: var(--text-secondary); }
.ql-snow .ql-fill { fill: var(--text-secondary); }
.ql-snow .ql-picker { color: var(--text-secondary); }
.ql-snow .ql-picker-options {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: var(--accent);
}
.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill { fill: var(--accent); }
.ql-snow button:hover,
.ql-snow button.ql-active { color: var(--accent); }
/* Picker label */
.ql-snow .ql-picker-label { border-color: transparent; }
.ql-snow .ql-picker-label:hover { color: var(--accent); }
.ql-snow .ql-picker-label .ql-stroke { stroke: var(--text-secondary); }
.ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--accent); }
/* Editor links */
.ql-editor a { color: var(--accent); }
/* Tooltip */
.ql-snow .ql-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ql-snow .ql-tooltip input[type="text"] {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 8px;
}
.ql-snow .ql-tooltip a.ql-action,
.ql-snow .ql-tooltip a.ql-remove { color: var(--accent); }

/* ─── Flatpickr dark theme ─────────────────── */
.flatpickr-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-family: 'Inter', sans-serif;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after { display: none; }
.flatpickr-months {
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 4px 0;
}
.flatpickr-months .flatpickr-month { color: var(--text); fill: var(--text); height: 36px; }
.flatpickr-current-month { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: var(--bg-secondary);
  color: var(--text);
  border: none;
  font-weight: 600;
}
.flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--bg-card); color: var(--text); }
.flatpickr-current-month input.cur-year {
  color: var(--text);
  font-weight: 600;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month { fill: var(--text-secondary); padding: 6px 10px; }
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover { fill: var(--text); }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: inherit; }
span.flatpickr-weekday {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  background: transparent;
}
.flatpickr-weekdays { background: transparent; }
.flatpickr-day {
  color: var(--text);
  border-radius: 6px;
  border: none;
  font-size: 0.8rem;
}
.flatpickr-day:hover { background: var(--bg-hover); border: none; }
.flatpickr-day.today { background: var(--bg-active); color: var(--accent); }
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--accent);
  color: #fff;
  border: none;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: var(--text-muted); opacity: 0.4; }
.flatpickr-day.flatpickr-disabled { color: var(--text-muted); opacity: 0.2; }
.flatpickr-innerContainer { border-bottom: 1px solid var(--border); }
.flatpickr-rContainer { padding: 0 4px; }
/* Time picker */
.flatpickr-time {
  background: var(--bg-card);
  border: none;
  max-height: 44px;
}
.flatpickr-time input {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus { background: var(--bg-hover); }
.flatpickr-time .flatpickr-time-separator { color: var(--text-muted); }
.flatpickr-time .flatpickr-am-pm {
  color: var(--text);
  background: transparent;
  font-size: 0.8rem;
}
.flatpickr-time .flatpickr-am-pm:hover { background: var(--bg-hover); }
.numInputWrapper span {
  border: none;
  background: transparent;
  opacity: 1;
}
.numInputWrapper span::after {
  border-color: var(--text-secondary) transparent transparent;
  border-width: 6px 5px 0;
}
.numInputWrapper span.arrowUp::after {
  border-color: transparent transparent var(--text-secondary);
  border-width: 0 5px 6px;
}
.numInputWrapper:hover { background: var(--bg-hover); }
.numInputWrapper span:hover::after { border-color: var(--text) transparent transparent; border-width: 6px 5px 0; }
.numInputWrapper span.arrowUp:hover::after { border-color: transparent transparent var(--text); border-width: 0 5px 6px; }

/* ========================================
   SECTION CARDS (for security/settings pages)
   ======================================== */
.section-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.section-card-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.section-card-desc {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px;
}

/* Connected account row */
.provider-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.provider-row:last-child { border-bottom: none; }
.provider-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass);
}
.provider-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.provider-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.provider-status { font-size: 0.75rem; color: var(--text-muted); }
.provider-status.connected { color: var(--success); }
