:root {
  --bg: #f0f4f8;
  --bg-raised: #ffffff;
  --card: #ffffff;
  --card-hover: #f7f9fc;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-soft: #d1fae5;
  --text: #1a2233;
  --text-secondary: #5a6a7a;
  --border: #dfe4ea;
  --border-light: #edf0f4;
  --danger: #dc2626;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #0369a1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Login ── */
#login-view, #invite-view {
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #10b981 100%);
}
.login-card {
  background: #fff; padding: 48px 40px; border-radius: 20px;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.login-logo {
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 28px;
}
.login-logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: white; letter-spacing: -0.5px;
}
.login-logo-text {
  margin-left: 10px; font-size: 1.05rem; font-weight: 700; color: #1a2233;
  line-height: 1.2;
}
.login-logo-text span { display: block; font-size: 0.72rem; font-weight: 500; color: #6b7a90; letter-spacing: 0.02em; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; font-weight: 700; color: #1a2233; }
.login-card p { color: #6b7a90; margin-bottom: 28px; font-size: 0.9rem; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.85rem; color: #6b7a90; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; background: #f5f7fa;
  border: 1px solid #dfe4ea; border-radius: var(--radius-sm);
  font-size: 0.95rem; color: #1a2233; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.12); }
.form-group input::placeholder { color: #a0aec0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border: none; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, #059669, #10b981); color: white; width: 100%; }
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
.btn-sm { padding: 7px 14px; font-size: 0.78rem; width: auto; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.btn-danger:hover { opacity: 0.92; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 10px; display: none; }
.error-msg.visible { display: block; }
.success-msg { color: var(--success); font-size: 0.85rem; margin-top: 10px; font-weight: 500; }

/* ── Header ── */
.header {
  background: #ffffff; border-bottom: 1px solid var(--border);
  padding: 14px 0; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.header-inner {
  max-width: 1900px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; position: relative;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-brand { display: flex; align-items: center; gap: 9px; }
.header-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; color: white; letter-spacing: -0.5px;
}
.header-wordmark { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.15; }
.header-wordmark span {
  display: block; font-size: 0.62rem; font-weight: 500;
  color: var(--text-secondary); letter-spacing: 0.06em; text-transform: uppercase;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.user-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-secondary);
  background: #f5f7fa; padding: 4px 10px;
  border-radius: 20px; border: 1px solid var(--border);
}

/* ── Header Toolbar ── */
.header-toolbar {
  max-width: 1900px; margin: 0 auto; padding: 8px 24px 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.toolbar-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.search-input {
  padding: 8px 14px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  color: var(--text); min-width: 240px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.1); }
.search-input::placeholder { color: #a0aec0; }
.count-badge {
  background: var(--primary-soft); padding: 5px 12px; border-radius: 20px;
  font-size: 0.78rem; color: var(--primary); border: 1px solid rgba(5,150,105,0.15);
  font-weight: 600;
}

/* View selector */
.view-selector {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); font-size: 0.8rem; color: var(--text);
  outline: none; cursor: pointer; font-family: inherit;
}
.view-selector:focus { border-color: var(--primary); }

/* ── Dark Mode ── */
body.dark {
  --bg: #0f172a; --bg-raised: #1e293b; --card: #1e293b; --card-hover: #253449;
  --primary: #34d399; --primary-hover: #10b981; --primary-soft: #064e3b;
  --text: #f1f5f9; --text-secondary: #94a3b8;
  --border: #334155; --border-light: #2d3a4d;
  --danger: #ef4444; --success: #22c55e; --warning: #f59e0b; --info: #06b6d4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}
body.dark .header { background: #1e293b; }
body.dark .login-card { background: #1e293b; }
body.dark .login-card h1 { color: #f1f5f9; }
body.dark .login-card p { color: #94a3b8; }
body.dark .login-logo-text { color: #f1f5f9; }
body.dark .login-logo-text span { color: #94a3b8; }
body.dark .form-group input, body.dark .form-group select { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .form-group input::placeholder { color: #475569; }
body.dark .form-group label { color: #94a3b8; }
body.dark th { background: #0f172a; }
body.dark td { color: #cbd5e1; }
body.dark .search-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .search-input::placeholder { color: #475569; }
body.dark .count-badge { background: #064e3b; color: #34d399; border-color: rgba(52,211,153,0.2); }
body.dark .btn-ghost:hover { background: #0f172a; color: #f1f5f9; }
body.dark .user-badge { background: #0f172a; border-color: #334155; }
body.dark .view-selector { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .modal-dialog { background: #1e293b; }
body.dark .overflow-menu { background: #1e293b; border-color: #334155; }
body.dark .overflow-menu-item:hover { background: #0f172a; }
body.dark .overflow-menu-btn { background: #1e293b; border-color: #334155; }
body.dark #login-view, body.dark #invite-view { background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%); }
body.dark .detail-panel-v2 { background: #141e30; }
body.dark .detail-section { border-bottom-color: #1e293b; }
body.dark .detail-match-header { border-bottom-color: #334155; }
body.dark .detail-match-kickoff { border-left-color: #334155; }
body.dark .bookings-table th { background: #0f172a; }
body.dark .bookings-table td { color: #cbd5e1; }

/* ── Table ── */
.container { max-width: 1900px; margin: 0 auto; padding: 20px 24px; }
.table-wrapper {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th {
  background: #f8f9fb; text-align: left; padding: 11px 14px;
  font-weight: 600; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-secondary);
  white-space: nowrap; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2; cursor: pointer; user-select: none;
}
th:hover { color: var(--primary); }
th.sort-active { color: var(--primary); }
.sort-arrow { font-size: 0.6rem; margin-left: 3px; opacity: 0.4; }
th.sort-active .sort-arrow { opacity: 1; color: var(--primary); }
td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; color: #3d4f65; transition: background 0.15s;
}
tr:hover td { background: var(--card-hover); }
tr.row-expanded { background: var(--primary-soft); }
tr.row-expanded td { border-bottom-color: var(--primary); }

/* Detail row */
tr.detail-row { display: none; }
tr.detail-row.open { display: table-row; }
tr.detail-row td {
  padding: 0; border-bottom: 1px solid var(--border); background: #f5f7fa;
}
body.dark tr.detail-row td { background: #141e30; }
.detail-panel {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.detail-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); margin-bottom: 4px; font-weight: 600;
}
.detail-value {
  font-size: 0.82rem; color: #2d3a4d; word-break: break-all; line-height: 1.5;
}
body.dark .detail-value { color: #e2e8f0; }
.detail-value:empty::after { content: "\2014"; color: #a0aec0; }

/* Editable cells */
td.editable { cursor: pointer; position: relative; }
td.editable:hover { background: var(--primary-soft); }
td.editable::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 12px; height: 12px; opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23059669'%3E%3Cpath d='M12.146.854a.5.5 0 0 1 .708 0l2.292 2.292a.5.5 0 0 1 0 .708L5.854 13.146a.5.5 0 0 1-.243.137l-3.5 1a.5.5 0 0 1-.617-.617l1-3.5a.5.5 0 0 1 .137-.243L12.146.854z'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
  transition: opacity 0.15s;
}
td.editable:hover::after { opacity: 0.6; }

/* Inline edit input */
.inline-edit {
  width: 100%; padding: 6px 8px; border: 2px solid var(--primary);
  border-radius: 4px; font-size: 0.8rem; outline: none;
  background: var(--card); color: var(--text); font-family: inherit;
}

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.badge-default { background: #edf0f4; color: #6b7a90; border: 1px solid #dfe4ea; }
body.dark .badge-default { background: #1e293b; color: #94a3b8; border-color: #33415540; }

/* ── Toasts ── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 500;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease-out;
  max-width: 340px; position: relative; overflow: hidden;
}
.toast.toast-success { background: #16a34a; }
.toast.toast-error { background: #dc2626; }
.toast.toast-warning { background: #d97706; }
.toast.toast-info { background: #2563eb; }
.toast.toast-out { animation: toastOut 0.2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: rgba(255,255,255,0.4); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  animation: toastProgress linear forwards;
}
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center;
}
.modal-dialog {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px; max-width: 480px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.15s ease-out;
  max-height: 90vh; overflow-y: auto;
}
.modal-wide { max-width: 640px; }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  color: var(--text-secondary); cursor: pointer; padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--card-hover); color: var(--text); }

/* Invite link box */
.invite-link-box {
  display: flex; gap: 8px; margin: 16px 0;
}
.invite-link-box input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.8rem;
  font-family: 'Fira Code', monospace; background: #f5f7fa; color: var(--text);
}
body.dark .invite-link-box input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
.invite-link-note { font-size: 0.78rem; color: var(--text-secondary); }

/* ── Admin ── */
.admin-section { margin-bottom: 32px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.admin-header h2 { font-size: 1.1rem; font-weight: 700; }
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
}
.role-admin { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.role-limited { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
body.dark .role-admin { background: #422006; color: #fbbf24; border-color: #92400e; }
body.dark .role-limited { background: #082f49; color: #38bdf8; border-color: #0369a1; }
.status-active { color: var(--success); font-weight: 600; font-size: 0.78rem; }
.status-pending { color: var(--warning); font-weight: 600; font-size: 0.78rem; }

/* ── Skeleton ── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skel-row td { padding: 12px 14px; }
.skel-bar {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
}
.skel-bar.w60 { width: 60%; }
.skel-bar.w40 { width: 40%; }
.skel-bar.w80 { width: 80%; }
.skel-badge { height: 22px; width: 70px; border-radius: 20px; }

/* ── Mobile Cards ── */
.card-list { display: none; flex-direction: column; gap: 10px; }
.match-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: background 0.15s;
  box-shadow: var(--shadow-sm);
}
.match-card:hover { background: var(--card-hover); }
body.dark .match-card { background: #1e293b; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.card-title { font-weight: 700; font-size: 0.88rem; }
.card-meta { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px; }
.card-detail { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.78rem; }
.card-detail.open { display: block; }
.card-detail-field { margin-bottom: 8px; }
.card-detail-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.04em; }
.card-detail-val { color: #2d3a4d; word-break: break-all; }
body.dark .card-detail-val { color: #e2e8f0; }

/* ── Mobile Overflow Menu ── */
.overflow-menu-btn {
  display: none;
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); flex-shrink: 0;
}
.overflow-menu-btn:hover { background: var(--card-hover); }
.overflow-menu {
  display: none; position: absolute; top: 100%; right: 16px; z-index: 200;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 0;
  min-width: 200px; box-shadow: var(--shadow-lg);
  animation: popIn 0.12s ease-out;
}
.overflow-menu.visible { display: block; }
.overflow-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer; font-size: 0.82rem;
  color: var(--text); transition: background 0.1s; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.overflow-menu-item:hover { background: var(--card-hover); }
.ov-danger { color: #dc2626 !important; }

/* ── Logo / image cells ── */
.cell-logo {
  height: 28px; width: 28px; object-fit: contain;
  border-radius: 3px; vertical-align: middle;
}

/* ── Column Width Hints ── */
th:first-child, td:first-child { width: 80px; min-width: 80px; } /* Kick Off */
th:nth-child(2), td:nth-child(2) { min-width: 280px; } /* Match */

/* ── Matchup Cell ── */
.matchup-cell {
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.matchup-logo {
  height: 22px; width: 22px; object-fit: contain;
  border-radius: 3px; flex-shrink: 0;
}
.matchup-team {
  font-weight: 600; font-size: 0.82rem; color: var(--text);
}
.matchup-vs {
  font-size: 0.65rem; color: var(--text-secondary);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0 2px; opacity: 0.7;
}

/* ── Kickoff Cell ── */
.kickoff-cell {
  display: flex; flex-direction: column; line-height: 1.3;
}
.kickoff-date {
  font-size: 0.78rem; font-weight: 600; color: var(--text);
}
.kickoff-time {
  font-size: 0.7rem; color: var(--text-secondary); font-weight: 500;
  font-family: 'Fira Code', monospace; letter-spacing: 0.02em;
}

/* ── Bookings Counter Badge ── */
.bookings-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
  background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc;
  cursor: pointer;
}
body.dark .bookings-badge { background: #082f49; color: #38bdf8; border-color: #0369a1; }

/* ── Detail Panel V2 ── */
.detail-panel-v2 {
  padding: 20px 24px;
  animation: slideDown 0.2s ease-out;
}
.detail-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.detail-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.detail-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.detail-section-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary);
  margin-bottom: 10px;
}
.detail-section-header .detail-section-title { margin-bottom: 0; }
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 20px;
}

/* ── Bookings Sub-Table ── */
.bookings-table-wrapper {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bookings-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.bookings-table th {
  background: var(--bg); text-align: left; padding: 8px 12px;
  font-weight: 600; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); position: static; cursor: default;
}
.bookings-table th:hover { color: var(--text-secondary); }
.bookings-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  color: var(--text); font-size: 0.8rem;
}
.bookings-table tr:last-child td { border-bottom: none; }
.bookings-table tr:hover td { background: var(--card-hover); }
.bookings-td-station { font-weight: 600; }
.bookings-td-srt { font-family: 'Fira Code', monospace; font-size: 0.72rem; }

/* ── Booking Status Badges ── */
.booking-status {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
  background: #edf0f4; color: #6b7a90; border: 1px solid #dfe4ea;
}
.booking-status-confirmed, .booking-status-ready, .booking-status-active, .booking-status-done {
  background: #dcfce7; color: #166534; border: 1px solid #86efac;
}
.booking-status-pending, .booking-status-in-progress, .booking-status-processing {
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
}
.booking-status-cancelled, .booking-status-canceled, .booking-status-rejected {
  background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
}
body.dark .booking-status { background: #1e293b; color: #94a3b8; border-color: #334155; }
body.dark .booking-status-confirmed, body.dark .booking-status-ready, body.dark .booking-status-active, body.dark .booking-status-done { background: #052e16; color: #4ade80; border-color: #166534; }
body.dark .booking-status-pending, body.dark .booking-status-in-progress, body.dark .booking-status-processing { background: #422006; color: #fbbf24; border-color: #92400e; }
body.dark .booking-status-cancelled, body.dark .booking-status-canceled, body.dark .booking-status-rejected { background: #450a0a; color: #f87171; border-color: #991b1b; }

/* ── Detail Match Header ── */
.detail-match-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.detail-match-title {
  display: flex; align-items: center; gap: 20px;
}
.detail-match-title .matchup-cell {
  font-size: 0.95rem;
}
.detail-match-title .matchup-logo {
  height: 28px; width: 28px;
}
.detail-match-title .matchup-team {
  font-size: 0.95rem; font-weight: 700;
}
.detail-match-kickoff {
  color: var(--text-secondary); font-size: 0.82rem;
  padding-left: 16px; border-left: 1px solid var(--border);
}
.detail-match-kickoff .kickoff-cell {
  flex-direction: row; gap: 6px; align-items: baseline;
}
.detail-match-kickoff .kickoff-date { font-size: 0.82rem; }
.detail-match-kickoff .kickoff-time { font-size: 0.78rem; }

/* ── Delete / Danger Buttons ── */
.btn-icon-danger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: none; border: 1px solid transparent;
  color: var(--text-secondary); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; line-height: 1;
}
.btn-icon-danger:hover {
  background: #fee2e2; color: #dc2626; border-color: #fca5a5;
}
body.dark .btn-icon-danger:hover {
  background: #450a0a; color: #f87171; border-color: #991b1b;
}

/* ── Text Muted helper ── */
.text-muted { color: var(--text-secondary); font-size: 0.8rem; }
.bookings-empty, .bookings-loading { padding: 12px 0; font-style: italic; }

/* ── Select badges (colored) ── */
.badge-select {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
  background: #edf0f4; color: #6b7a90; border: 1px solid #dfe4ea;
}
body.dark .badge-select { background: #1e293b; color: #94a3b8; border-color: #33415540; }

/* ── Multi-select inline edit ── */
.multi-select-edit {
  position: absolute; z-index: 20; background: var(--card);
  border: 2px solid var(--primary); border-radius: 6px;
  padding: 8px; min-width: 200px; max-height: 260px;
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.ms-search {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 0.78rem; margin-bottom: 6px;
  outline: none; background: var(--bg); color: var(--text); font-family: inherit;
}
.ms-search:focus { border-color: var(--primary); }
.ms-list { max-height: 160px; overflow-y: auto; }
.ms-option {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 2px; font-size: 0.78rem; cursor: pointer;
  color: var(--text); user-select: none;
}
.ms-option:hover { background: var(--card-hover); border-radius: 3px; }
.ms-option input[type="checkbox"] {
  accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer;
}
.ms-done {
  display: block; width: 100%; margin-top: 6px; padding: 6px 0;
  background: var(--primary); color: #fff; border: none;
  border-radius: 4px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ms-done:hover { opacity: 0.9; }
.ms-checkboxes {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.ms-checkboxes .ms-option {
  padding: 3px 6px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px;
}

/* ── Scrollable checkbox list (linked records in forms) ── */
.ms-checkboxes-scrollable {
  max-height: 180px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; background: var(--bg);
}
body.dark .ms-checkboxes-scrollable { background: #0f172a; border-color: #334155; }
.ms-search-form {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  margin-bottom: 6px; outline: none; background: var(--bg);
  color: var(--text); font-family: inherit;
}
.ms-search-form:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.1); }
body.dark .ms-search-form { background: #0f172a; border-color: #334155; color: #f1f5f9; }

/* ── Checkbox form group ── */
.form-group-checkbox {
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.form-group-checkbox label { margin-bottom: 0; }
.form-group-checkbox input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer;
}

/* ── Textarea inline edit ── */
textarea.inline-edit {
  min-height: 60px; resize: vertical; line-height: 1.4;
}

/* ── Form textarea ── */
.form-group textarea {
  width: 100%; padding: 12px 14px; background: #f5f7fa;
  border: 1px solid #dfe4ea; border-radius: var(--radius-sm);
  font-size: 0.95rem; color: #1a2233; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit; min-height: 80px; resize: vertical; line-height: 1.4;
}
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.12); }
body.dark .form-group textarea { background: #0f172a; border-color: #334155; color: #f1f5f9; }

/* ── Focus states ── */
.btn:focus-visible, .search-input:focus-visible, .view-selector:focus-visible,
.overflow-menu-btn:focus-visible, .overflow-menu-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .header-inner { padding: 8px 16px; }
  .header-actions { display: none !important; }
  .overflow-menu-btn { display: flex; }
  .header-toolbar { padding: 4px 16px 0; }
  .search-input { min-width: auto; flex: 1; font-size: 0.8rem; padding: 6px 10px; }
  .count-badge { display: none; }
  .container { padding: 12px; }
  .table-wrapper { display: none !important; }
  .card-list { display: flex !important; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .modal-dialog { padding: 20px 16px; width: 95%; }
}
