/* ============================================================
   INFINITY SCRIMS — Design System
   Single CSS file, both themes driven by CSS variables
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root[data-theme="light"] {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-alt: #f6f7fa;
  --border: #e4e6ec;
  --text: #14151a;
  --text-muted: #6c6f7c;
  --sidebar-bg: #0c0d10;
  --sidebar-text: #ffffff;
  --sidebar-text-muted: #9a9ca6;
--sidebar-active-bg: rgba(255,255,255,.06);
--sidebar-active-text: #ffffff;
  --accent: #0c0d10;
  --accent-text: #ffffff;
  --success: #16a34a; --success-bg: #e8f7ee;
  --warning: #d97706; --warning-bg: #fef3e2;
  --danger:  #dc2626; --danger-bg:  #fdeaea;
  --info:    #2563eb; --info-bg:    #eaf1ff;
  --purple:  #7c3aed; --purple-bg:  #f2ebfe;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20,21,35,.06), 0 1px 2px rgba(20,21,35,.04);
  --shadow-lg: 0 12px 28px rgba(20,21,35,.12);
}

:root[data-theme="dark"] {
  --bg: #101114;
  --surface: #1a1b20;
  --surface-alt: #212228;
  --border: #2b2c33;
  --text: #f2f2f4;
  --text-muted: #9a9ca6;
  --sidebar-bg: #0c0d10;
  --sidebar-text: #ffffff;
  --sidebar-text-muted: #8b8d97;
  --sidebar-active-bg: #ffffff;
  --sidebar-active-text: #0c0d10;
  --accent: #ffffff;
  --accent-text: #0c0d10;
  --success: #22c55e; --success-bg: rgba(34,197,94,.14);
  --warning: #f59e0b; --warning-bg: rgba(245,158,11,.14);
  --danger:  #ef4444; --danger-bg:  rgba(239,68,68,.14);
  --info:    #3b82f6; --info-bg:    rgba(59,130,246,.14);
  --purple:  #a78bfa; --purple-bg:  rgba(167,139,250,.14);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.5);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color .25s ease, color .25s ease;
  position: relative;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- Ambient background (subtle premium touch) ---------- */
body::before, body::after {
  content: ''; position: fixed; z-index: 0; border-radius: 50%; pointer-events: none;
  filter: blur(70px); opacity: .5; will-change: transform;
}
body::before {
  width: 520px; height: 520px; top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(37,99,235,.10), transparent 70%);
  animation: ambientDrift1 26s ease-in-out infinite;
}
body::after {
  width: 460px; height: 460px; bottom: -160px; left: 220px;
  background: radial-gradient(circle, rgba(124,58,237,.08), transparent 70%);
  animation: ambientDrift2 32s ease-in-out infinite;
}
:root[data-theme="dark"] body::before { opacity: .35; }
:root[data-theme="dark"] body::after { opacity: .3; }
@keyframes ambientDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.08); }
}
@keyframes ambientDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}
.app, .auth-wrap { position: relative; z-index: 1; }

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 8px 26px; overflow: hidden; gap: 8px; }
.sidebar-logo img, .sidebar-logo svg { height: 36px; width: auto; flex-shrink: 0; }
.sidebar-logo .sidebar-wordmark {
  font-weight: 500; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sidebar-text-muted); white-space: nowrap;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; position: relative;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text-muted); font-size: 13px; font-weight: 500;
  transition: background-color .15s, color .15s;
  white-space: nowrap;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a .label { transition: opacity .15s ease, max-width .28s cubic-bezier(.4,0,.2,1); overflow: hidden; max-width: 160px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.sidebar-nav a .badge { margin-left: auto; }
.sidebar-help {
  background: rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 16px; margin-top: 16px;
}
.sidebar-help p { font-size: 12px; color: var(--sidebar-text-muted); margin: 4px 0 12px; }
.sidebar-help strong { font-size: 13px; }
.sidebar-help .btn { width: 100%; }

/* ---------- Sidebar collapsed (icon-only rail) — desktop only, toggled via hamburger ---------- */
@media (min-width: 769px) {
  html.sidebar-collapsed .sidebar { width: 84px; }
  html.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 6px 0 22px; }
  html.sidebar-collapsed .sidebar-logo img, html.sidebar-collapsed .sidebar-logo svg { height: 26px; }
  html.sidebar-collapsed .sidebar-logo .sidebar-wordmark { opacity: 0; max-width: 0; height: 0; }
  html.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 12px 0; }
  html.sidebar-collapsed .sidebar-nav a .label { opacity: 0; max-width: 0; }
  html.sidebar-collapsed .sidebar-nav a .badge { position: absolute; top: 6px; right: 14px; margin-left: 0; }
  html.sidebar-collapsed .sidebar-help { padding: 12px 8px; text-align: center; }
  html.sidebar-collapsed .sidebar-help p, html.sidebar-collapsed .sidebar-help strong { display: none; }
  html.sidebar-collapsed .main { margin-left: 84px; }
  html.sidebar-collapsed .hamburger { transform: rotate(180deg); }
}

/* ---------- Main area ---------- */
.main { flex: 1; min-width: 0; margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .28s cubic-bezier(.4,0,.2,1); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--bg); position: sticky; top: 0; z-index: 50;
}
.hamburger {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 6px; width: auto;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.hamburger svg { width: 22px; height: 22px; color: var(--text); }
.topbar-logo { display: none; align-items: center; gap: 8px; }
.topbar-logo img { height: 24px; width: auto; }
.topbar-logo span { font-weight: 700; font-size: 14px; letter-spacing: .2px; color: var(--text); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  border: 1px solid var(--border); overflow: hidden;
}
.user-chip .name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .role { font-size: 11px; color: var(--text-muted); }
.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 8px; display: none; z-index: 200;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 13px; background: none; border: none; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-alt); }
.dropdown .danger { color: var(--danger); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* Small pill dropdown trigger (e.g. leaderboard period filter) */
.chip-select {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip-select:hover { background: var(--border); }
.lb-period-option.active { background: var(--surface-alt); font-weight: 700; }

/* ---------- Breadcrumb / page header ---------- */
.page-content { padding: 0 28px 40px; position: relative; min-height: 200px; min-width: 0; }
.page-content > *:not(.page-loading-overlay) { visibility: hidden; }
.page-content.is-ready > *:not(.page-loading-overlay) { visibility: visible; }
.page-content.is-ready { animation: fadeUp .35s ease; }

/* ---------- Premium page-load skeleton overlay ---------- */
.page-loading-overlay {
  position: absolute; inset: 0; padding-top: 4px; z-index: 5;
  animation: fadeUp .2s ease;
}
.page-loading-overlay .sk-title { height: 26px; width: 260px; margin-bottom: 10px; border-radius: 8px; }
.page-loading-overlay .sk-sub { height: 14px; width: 340px; margin-bottom: 22px; border-radius: 6px; }
.page-loading-overlay .sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.page-loading-overlay .sk-row .skeleton { height: 90px; }
.page-loading-overlay .sk-blocks { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.page-loading-overlay .sk-blocks .skeleton { height: 220px; }
@media (max-width: 1080px) { .page-loading-overlay .sk-blocks { grid-template-columns: 1fr; } }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb .current { color: var(--text); font-weight: 600; }
.page-title { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

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

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: transform .15s ease, box-shadow .15s ease;
}
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Stat cards grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .icon {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); color: var(--text);
}
.stat-card .icon svg { width: 17px; height: 17px; }
.stat-card .icon.icon-blue   { background: var(--info-bg);    color: var(--info); }
.stat-card .icon.icon-green  { background: var(--success);    color: #fff; }
.stat-card .icon.icon-orange { background: var(--warning);    color: #fff; }
.stat-card .icon.icon-purple { background: var(--purple-bg);  color: var(--purple); }
.stat-card .icon.icon-dark   { background: var(--accent);     color: var(--accent-text); }
.stat-card .label { font-size: 12px; color: var(--text-muted); }
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card .sub { font-size: 11px; color: var(--text-muted); }

/* ---------- Leaderboard (dashboard) ---------- */
.dash-panel-card { display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.dash-panel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dash-panel-viewport { min-height: 0; overflow-y: auto; }
.leaderboard-viewport { max-height: 260px; overflow-y: hidden; } /* small, compact — scroll is driven by JS (auto-scroll ticker) */
.leaderboard-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { width: 22px; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 13px; color: var(--text-muted); }
.leaderboard-rank-top {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
}
.leaderboard-rank-top.rank-gold   { background: linear-gradient(135deg, #f6c744, #d89b1c); }
.leaderboard-rank-top.rank-silver { background: linear-gradient(135deg, #d7dbe0, #9aa1ab); }
.leaderboard-rank-top.rank-bronze { background: linear-gradient(135deg, #d38a54, #a8622f); }
.leaderboard-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
  flex-shrink: 0; border: 1px solid var(--border);
}
.leaderboard-name { flex: 1; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.leaderboard-delta { display: inline-flex; align-items: center; gap: 1px; font-size: 11px; font-weight: 700; }
.leaderboard-delta.up { color: var(--success); }
.leaderboard-delta.down { color: var(--danger); }
.leaderboard-points { text-align: right; font-size: 13px; font-weight: 700; white-space: nowrap; }
.leaderboard-points .pts-label { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.lb-view-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text); transition: background-color .15s;
}
.lb-view-all:hover { background: var(--surface-alt); }
.full-lb-row { padding: 14px 10px; border-radius: 10px; }
.full-lb-row.is-me { background: var(--surface-alt); border-bottom-color: transparent; }

/* Activity / list row icon chip */
.row-icon {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.row-icon svg { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-text); border: none;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: transform .1s ease, opacity .15s ease; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- Badges / status pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-purple  { background: var(--purple-bg);  color: var(--purple); }
.badge-muted   { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Text color utilities (used across pages) ---------- */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.req { color: var(--danger); }
.section-title { font-size: 14px; font-weight: 700; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* File dropzone */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 24px;
  text-align: center; cursor: pointer; background: var(--surface-alt); transition: border-color .15s;
}
.dropzone:hover { border-color: var(--text-muted); }
.dropzone svg { width: 22px; height: 22px; margin: 0 auto 8px; color: var(--text-muted); }
.dropzone .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.dropzone.has-file { border-style: solid; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; color: var(--text-muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface-alt); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Slot grid ---------- */
.slot-legend { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.slot-legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.slot-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.slot-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; margin-bottom: 18px; }
.slot {
  aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer; border: 1px solid transparent;
  transition: transform .1s ease;
}
.slot:active { transform: scale(.92); }
.slot.available { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.slot.selected  { background: var(--warning); color: #fff; }
.slot.booked    { background: var(--danger-bg); color: var(--danger); cursor: not-allowed; opacity: .7; }
.slot.locked    { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }

/* ---------- Countdown ---------- */
.countdown-box {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--info-bg); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}
.countdown-box .timer { font-size: 22px; font-weight: 700; color: var(--info); }
.countdown-box.danger { background: var(--danger-bg); }
.countdown-box.danger .timer { color: var(--danger); }

/* ---------- Chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: 60vh; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 4px; }
.msg { max-width: 70%; display: flex; gap: 8px; }
.msg .bubble { background: var(--surface-alt); border-radius: 14px; padding: 9px 13px; font-size: 13px; }
.msg .meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-text); }
.msg.system { align-self: center; }
.msg.system .bubble { background: var(--info-bg); color: var(--info); font-size: 11px; padding: 6px 12px; }
.chat-input { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: 13px; min-width: 240px;
  animation: slideIn .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none;
  align-items: center; justify-content: center; z-index: 900; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 420px; }
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; }

/* ---------- Notifications drawer ---------- */
.notif-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1200;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.notif-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.notif-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  z-index: 1201; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.notif-drawer.open { transform: translateX(0); }
.notif-drawer-head {
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.notif-drawer-head h3 { font-size: 16px; margin: 0 0 2px; }
.notif-drawer-head p { font-size: 12px; color: var(--text-muted); margin: 0; }
.notif-drawer-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px;
  display: flex; border-radius: 8px; flex-shrink: 0;
}
.notif-drawer-close:hover { background: var(--surface-alt); color: var(--text); }
.notif-drawer-close svg { width: 18px; height: 18px; }
.notif-drawer-tabs {
  display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--border);
  overflow-x: auto; flex-shrink: 0;
}
.notif-drawer-actions { padding: 10px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.notif-drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px; }
.notif-drawer-body .notif-item { padding: 14px 0; }
.notif-drawer-footer {
  padding: 12px 20px; border-top: 1px solid var(--border); text-align: center;
  font-size: 11px; color: var(--text-muted); flex-shrink: 0;
}
@media (max-width: 480px) { .notif-drawer { width: 100%; max-width: 100vw; } }

/* ---------- Skeleton loaders ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-card { height: 90px; }
.skeleton-line { height: 14px; margin-bottom: 8px; }

/* ---------- Auth pages (login / signup) — split-screen w/ animated border ---------- */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.authx-shell { min-height: 100vh; display: flex; background: var(--bg); }
.authx-wrap {
  position: relative; display: flex; width: 100%; min-height: 100vh;
  background: var(--surface); overflow: hidden;
}
.authx-wrap::before {
  content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit;
  background: conic-gradient(from var(--border-angle), transparent 0%, transparent 70%, var(--info) 82%, var(--accent) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: authx-border-spin 5s linear infinite;
  pointer-events: none; z-index: 5;
}
@keyframes authx-border-spin { to { --border-angle: 360deg; } }

.authx-side {
  flex: 1; padding: 40px; display: flex; flex-direction: column; align-items: center;
  background:
    radial-gradient(circle at 25% 15%, rgba(12,13,16,.06), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(12,13,16,.04), transparent 50%),
    var(--sidebar-bg, #0c0d10);
  color: #fff; border-right: 1px solid var(--border);
}
:root[data-theme="dark"] .authx-side { background: radial-gradient(circle at 25% 15%, rgba(255,255,255,.06), transparent 55%), radial-gradient(circle at 80% 85%, rgba(255,255,255,.04), transparent 50%), #08090a; }
.authx-side-inner { width: 100%; max-width: 380px; display: flex; flex-direction: column; flex: 1; }
.authx-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.authx-logo img { height: 30px; width: auto; }
.authx-logo span { font-weight: 800; font-size: 15px; letter-spacing: .2px; }

.authx-tagline { font-size: 24px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em; }
.authx-subtext { color: rgba(255,255,255,.55); font-size: 13px; line-height: 1.6; margin: 0 0 28px; max-width: 300px; }

.authx-illustration { position: relative; flex: 1; min-height: 190px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.authx-illustration svg { max-width: 260px; width: 100%; height: auto; }

.authx-features { display: flex; flex-direction: column; gap: 16px; margin-top: auto; }
.authx-feature { display: flex; align-items: center; gap: 12px; }
.authx-feature .fi {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.authx-feature .fi svg { width: 17px; height: 17px; stroke-width: 1.75; fill: none; }
.authx-feature strong { display: block; font-size: 13px; font-weight: 600; }
.authx-feature span { display: block; font-size: 11.5px; color: rgba(255,255,255,.5); }

.authx-form-side { flex: 1; padding: 40px 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.authx-form-inner { width: 100%; max-width: 400px; }
.authx-form-logo { display: none; text-align: center; margin-bottom: 28px; }
.authx-form-logo img { height: 26px; }
.authx-form-side h2 { font-size: 26px; font-weight: 700; margin: 0 0 4px; text-align: center; }
.authx-desc { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 28px; }

.authx-field { margin-bottom: 16px; }
.authx-field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.authx-field label { font-size: 13px; color: var(--text-muted); }
.authx-field-row a { font-size: 12px; color: var(--info); font-weight: 500; }

.authx-input-wrap { position: relative; }
.authx-input-wrap .leading-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); stroke-width: 1.75; fill: none; pointer-events: none;
}
.authx-input-wrap input { padding-left: 38px; }
.authx-input-wrap.invalid input { border-color: var(--danger) !important; }
.authx-input-wrap .toggle-visibility {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; display: flex;
}
.authx-input-wrap .toggle-visibility svg { width: 16px; height: 16px; stroke-width: 1.75; fill: none; }

.authx-checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin: 4px 0 20px; }
.authx-checkbox-row input { margin-top: 2px; accent-color: var(--accent); cursor: pointer; }

.authx-footer-text { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 22px; }
.authx-footer-text a { color: var(--info); font-weight: 600; }
.authx-copyright { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 20px; opacity: .7; }

.authx-error {
  display: none; background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger);
  font-size: 12.5px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px;
}
.authx-error.show { display: block; }
.authx-field-error { display: none; color: var(--danger); font-size: 12px; margin-top: 6px; line-height: 1.4; }
.authx-field-error.show { display: block; }

.authx-btn-spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; margin-right: 8px; vertical-align: middle;
  animation: authx-btn-spin .6s linear infinite;
}
@keyframes authx-btn-spin { to { transform: rotate(360deg); } }

/* ---------- OTP step ---------- */
.authx-otp-card { display: none; animation: authx-otp-fade-in .35s ease; }
.authx-otp-card.show { display: block; }
@keyframes authx-otp-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.authx-otp-icon {
  width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--info));
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.authx-otp-icon svg { width: 28px; height: 28px; stroke: var(--accent-text); fill: none; stroke-width: 1.8; }
.authx-otp-email { color: var(--info); font-weight: 600; word-break: break-all; }
.authx-otp-row { display: flex; gap: 10px; margin: 24px 0 8px; }
.authx-otp-box {
  width: 100%; aspect-ratio: 1/1; text-align: center; font-size: 22px; font-weight: 600; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface-alt); color: var(--text);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease; font-family: inherit;
}
.authx-otp-box:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgba(37,99,235,.15); transform: translateY(-1px); }
.authx-otp-box.filled { border-color: var(--accent); }
.authx-otp-box.error { border-color: var(--danger); background: var(--danger-bg); animation: authx-otp-shake .3s ease; }
.authx-otp-box.success { border-color: var(--success); background: var(--success-bg); box-shadow: 0 0 0 3px rgba(34,197,94,.15); animation: authx-otp-pop .35s ease; }
@keyframes authx-otp-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes authx-otp-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.authx-otp-meta { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; font-size: 13px; }
.authx-otp-resend { background: none; border: none; color: var(--info); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }
.authx-otp-resend:disabled { color: var(--text-muted); cursor: default; }
.authx-otp-timer { color: var(--text-muted); }
.authx-otp-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; margin-top: 18px; background: none; border: none; padding: 0; }
.authx-otp-back:hover { color: var(--text); }
.authx-otp-success { display: none; color: var(--success); font-size: 13px; margin-top: 10px; }
.authx-otp-success.show { display: block; }

@media (max-width: 860px) {
  .authx-wrap { flex-direction: column; }
  .authx-side { border-right: none; border-bottom: 1px solid var(--border); padding: 28px; }
  .authx-illustration { min-height: 150px; margin-bottom: 16px; }
  .authx-illustration svg { max-width: 190px; }
  .authx-features { flex-direction: row; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
  .authx-feature { flex: 1 1 45%; }
  .authx-form-side { padding: 32px 28px; }
}
@media (max-width: 480px) {
  .authx-side { display: none; }
  .authx-form-side { padding: 40px 22px; justify-content: flex-start; }
  .authx-form-logo { display: block; }
}

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.scrim-card { overflow: hidden; padding: 0; }
.scrim-card img { width: 100%; height: 120px; object-fit: cover; }
.scrim-card-body { padding: 14px; }
.scrim-card-body .badge { margin-bottom: 8px; }
.scrim-card-body h4 { font-size: 14px; margin-bottom: 4px; }
.scrim-card-body .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.scrim-card-body .price-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 12px; }
.scrim-card-body .price { font-weight: 700; font-size: 14px; }
/* Simplified explore card: banner -> title -> total slots only */
.scrim-card-body-simple { padding: 14px; }
.scrim-card-body-simple h4 { font-size: 14px; margin-bottom: 6px; }
.scrim-card-body-simple .scrim-slots-line { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.scrim-card-body-simple .scrim-slots-line b { color: var(--text); font-weight: 700; }

/* ---------- Premium scrim card (dark, professional) — used for Explore Upcoming Scrims and Upcoming Bookings ---------- */
.premium-card { padding: 0; overflow: hidden; background: var(--sidebar-bg); border: none; color: #fff; }
.premium-card-media { position: relative; height: 132px; }
.premium-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.premium-card-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 8px; border-radius: 6px; z-index: 2;
}
.premium-card-badge { position: absolute; top: 10px; right: 10px; z-index: 2; }
.premium-card-info { padding: 14px 16px 16px; }
.premium-card-info h4 { color: #fff; font-size: 15px; margin-bottom: 6px; line-height: 1.3; }
.premium-card-meta { color: rgba(255,255,255,.55); font-size: 12px; margin-bottom: 2px; }
.premium-card-divider { height: 1px; background: rgba(255,255,255,.12); margin: 12px 0; }
.premium-card-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,.7); margin-bottom: 12px; }
.premium-card-price { color: #fff; font-weight: 700; font-size: 15px; }
.premium-card-actions { display: flex; gap: 8px; }
.premium-card-actions .btn { flex: 1; }
.btn-outline-light { background: transparent; border: 1px solid rgba(255,255,255,.28); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.08); }
.btn-light { background: #fff; color: #0c0d10; }
.btn-light:hover { opacity: .9; }
.premium-wishlist-btn { flex: 0 0 auto !important; width: 36px; padding: 0 !important; }
.grid-cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .5; }

/* ---------- Donut chart (pure CSS conic-gradient) ---------- */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut {
  width: 130px; height: 130px; border-radius: 50%; position: relative; flex-shrink: 0;
}
.donut::after {
  content: ''; position: absolute; inset: 18px; background: var(--surface); border-radius: 50%;
}
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1;
}
.donut-center .num { font-size: 22px; font-weight: 700; }
.donut-center .lbl { font-size: 10px; color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend .item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.donut-legend .item span:last-child { margin-left: auto; font-weight: 700; }

/* ---------- Simple bar/line chart (CSS only) ---------- */
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.trend-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trend-bar { width: 100%; max-width: 28px; background: var(--accent); border-radius: 6px 6px 0 0; transition: height .3s ease; min-height: 3px; }
.trend-label { font-size: 10px; color: var(--text-muted); }

/* ---------- Multi-step form (Create Scrim) ---------- */
.form-section { margin-bottom: 26px; }
.form-section-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.radio-card input { width: auto; margin-top: 2px; }
.radio-card .title { font-weight: 600; font-size: 13px; }
.radio-card .desc { font-size: 11px; color: var(--text-muted); }

/* ---------- Sidebar premium box (owner) ---------- */
.premium-box {
  background: linear-gradient(135deg, #1a1a1c, #0b0b0c); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius); padding: 16px; margin-top: 16px; color: #fff;
}
.premium-box .crown { color: #fbbf24; margin-bottom: 8px; }
.premium-box .crown svg { width: 22px; height: 22px; }
.premium-box strong { display: block; font-size: 13px; margin-bottom: 4px; }
.premium-box p { font-size: 11px; color: #9a9aa0; margin-bottom: 10px; }

/* ---------- Progress bar (level, slot usage) ---------- */
.progress-track { height: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

/* ---------- Theme toggle switch ---------- */
.theme-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; }
.switch { width: 38px; height: 22px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; }
.switch::after { content: ''; width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
[data-theme="dark"] .switch { background: var(--accent); }
[data-theme="dark"] .switch::after { transform: translateX(16px); }

/* ---------- Generic toggle (settings switches, independent of page theme) ---------- */
.toggle { width: 38px; height: 22px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; border: none; flex-shrink: 0; transition: background-color .2s ease; }
.toggle::after { content: ''; width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row .settings-row-label { font-weight: 600; font-size: 13px; }
.settings-row .settings-row-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .topbar { padding: 14px 16px; position: sticky; }
  .topbar-logo { display: flex; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .topbar-logo span { display: none; }
  .topbar-logo img { height: 28px; }
  .page-content { padding: 0 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-5 .stat-card:nth-child(5) { grid-column: 1 / -1; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .slot-grid { grid-template-columns: repeat(5, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .user-chip .name, .user-chip .role { display: none; }
  .user-menu { display: none; }
  table { font-size: 12px; }
}

@media (max-width: 420px) {
  .grid-cards { grid-template-columns: 1fr; }
  .grid-cards-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Sidebar overlay for mobile drawer */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; }
.sidebar-overlay.open { display: block; }

/* ============================================================
   USER PANEL — additional components
   ============================================================ */

/* ---------- Underlined tabs (scrim details / profile) ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  background: none; border: none; padding: 10px 2px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .2s ease; }

/* ---------- Toolbar (search + filters row) ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search-field { position: relative; flex: 1; min-width: 200px; }
.toolbar .search-field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.toolbar .search-field input { padding-left: 36px; }
.toolbar select { min-width: 130px; cursor: pointer; }

/* ---------- Chip filter row ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer; color: var(--text); flex-shrink: 0;
}
.chip .chip-count { opacity: .6; font-weight: 500; }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Scrim card overlays (browse grid) ---------- */
.scrim-card { position: relative; }
.scrim-card .badge-overlay { position: absolute; top: 10px; left: 10px; z-index: 2; }
.wishlist-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #111; border: none; padding: 0;
}
.wishlist-btn svg { width: 15px; height: 15px; }
.wishlist-btn.active { color: var(--danger); }
.tag-pill {
  display: inline-block; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px;
}

/* ---------- Pagination ---------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.page-btns { display: flex; gap: 6px; align-items: center; }
.page-btns button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 12px; color: var(--text); display: flex; align-items: center; justify-content: center;
}
.page-btns button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.page-btns button:disabled { opacity: .4; cursor: not-allowed; }
.page-btns .dots { border: none; background: none; cursor: default; }

/* ---------- Radio card (payment method) ---------- */
.radio-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.radio-card:hover { border-color: var(--text-muted); }
.radio-card.selected { border-color: var(--text); background: var(--surface-alt); }
.radio-card .radio-left { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.radio-card input[type="radio"] { width: 16px; height: 16px; accent-color: var(--text); }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }

/*====Scrime++++*/
/* ---------- Scrim product card (ecommerce-style, theme-aware) ---------- */
/* Uses --surface / --border / --text tokens so it flips correctly with
   [data-theme="dark"] automatically — no hardcoded colors except the
   green/red slot-status dots, which stay success/danger in both themes
   since they're status indicators, not brand color. */
.scrim-product-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 640px) { .scrim-product-list { grid-template-columns: 1fr; } }
.scrim-product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; padding: 0; display: block; transition: transform .18s ease, box-shadow .18s ease;
}
.scrim-product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.scrim-product-media {
  position: relative; background: var(--surface-alt);
  height: 100px; overflow: hidden;
}
.scrim-product-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  display: block;
}
.scrim-product-tag {
  position: absolute; top: 12px; left: 14px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; color: var(--info);
}
.scrim-product-badge { position: absolute; top: 10px; right: 10px; }
.scrim-product-body { padding: 12px 14px 14px; }
.scrim-product-title { font-size: 16px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.scrim-product-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.scrim-product-slots-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.slot-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface);
  margin-left: -6px; flex-shrink: 0; box-shadow: 0 0 0 1px var(--border);
}
.slot-dot:first-child { margin-left: 0; }
.slot-dot.is-open { background: var(--success); }
.slot-dot.is-booked { background: var(--danger); }
.scrim-product-slots-count { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.scrim-product-slots-count.is-urgent { color: var(--danger); font-weight: 800; }
.scrim-product-slots-count.is-urgent::before { content: "🔥 "; }
.scrim-product-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.scrim-product-price-label { font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }
.scrim-product-price { font-size: 19px; font-weight: 800; color: var(--text); }
/* CTA reuses the site's own accent token — same black-in-light /
   white-in-dark flip every other primary .btn on the site already uses,
   so it never clashes with either theme. */
.scrim-product-cta {
  background: var(--accent); color: var(--accent-text); border: none; border-radius: 999px;
  padding: 10px 22px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: opacity .15s ease, transform .1s ease;
}
.scrim-product-cta:hover { opacity: .88; }
.scrim-product-cta:active { transform: scale(.96); }
.scrim-product-cta.is-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.scrim-product-cta.is-disabled { background: var(--surface-alt); color: var(--text-muted); pointer-events: none; }

/* ---------- Live countdown badge (ticks every second, smooth) ---------- */
.scrim-countdown-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.scrim-countdown-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0;
  animation: countdownPulse 1.4s ease-in-out infinite;
}
.scrim-countdown-dot.is-closing { background: var(--warning); }
.scrim-countdown-dot.is-closed { background: var(--danger); animation: none; }
@keyframes countdownPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.75); } }
.scrim-countdown-text { font-size: 11.5px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.scrim-countdown-text.is-closing { color: var(--warning); }
.scrim-countdown-text.is-closed { color: var(--danger); }

/* ---------- Team card ---------- */
.team-logo {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #0b0b0c; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.avatar-stack { display: flex; }
.avatar-stack img, .avatar-stack .avatar-sm {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -8px;
  background: var(--surface-alt); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
  object-fit: cover;
}
.avatar-stack :first-child { margin-left: 0; }

/* ---------- Notification list ---------- */
.notif-item {
  display: flex; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--border); position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; margin-top: 6px; }

/* ---------- Profile hero ---------- */
.profile-hero {
  background: linear-gradient(135deg, #1c1d21, #0b0b0c); border-radius: var(--radius); padding: 60px 26px 24px;
  color: #fff; position: relative; margin-bottom: 46px;
}
.profile-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; background: #000; border: 4px solid var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; color: #fff;
  position: absolute; left: 26px; bottom: -40px; overflow: hidden;
}
.profile-avatar-edit {
  position: absolute; left: 92px; bottom: -12px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: #111; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.profile-avatar-edit svg { width: 14px; height: 14px; }
.profile-hero-stats { display: flex; gap: 32px; margin-top: 18px; flex-wrap: wrap; }
.profile-hero-stats .stat { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.75); }
.profile-hero-stats .stat b { color: #fff; font-size: 15px; }
.profile-body-top { padding-left: 118px; }

/* ---------- Small progress bar ---------- */
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; margin-top: 6px; }
.progress-track > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- Definition list (About Me / details rows) ---------- */
.dl-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dl-row:last-child { border-bottom: none; }
.dl-row .k { color: var(--text-muted); }
.dl-row .v { font-weight: 600; }

/* ---------- Copy field (JazzCash number etc.) ---------- */
.copy-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
.copy-field button { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.copy-field button:hover { color: var(--text); }
/* ---------- AI Support Widget ---------- */
.support-fab {
  position: fixed !important; bottom: 22px !important; right: 22px !important; left: auto !important; top: auto !important;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg);
  z-index: 2147483000; transition: transform .18s ease;
}
.support-fab:hover { transform: scale(1.06); }
.support-fab svg { width: 24px; height: 24px; }
.support-fab img { width: 26px; height: 26px; object-fit: contain; }
@media (max-width: 768px) { .support-fab { bottom: 84px !important; right: 16px !important; } }

#support-widget-mount { position: static; display: contents; }
.support-fab.is-open { background: var(--danger); }
.support-footer {
  text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.support-footer strong { color: var(--text); font-weight: 700; }

.support-panel {
  position: fixed !important; bottom: 88px !important; right: 22px !important; left: auto !important; top: auto !important;
  width: 360px; max-width: calc(100vw - 32px);
  height: min(500px, 68vh); max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 2147483000; display: none;
  flex-direction: column; overflow: hidden; animation: fadeUp .2s ease;
}
.support-panel.open { display: flex; }
@media (max-width: 480px) {
  .support-fab { bottom: 16px !important; right: 16px !important; }
  .support-panel {
    bottom: 78px !important; right: 10px !important; left: 10px !important;
    width: auto; max-width: none;
    height: min(60vh, 460px); max-height: calc(100vh - 130px);
    border-radius: 16px;
  }
}
.support-header {
  padding: 14px 16px; background: var(--accent); color: var(--accent-text); display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0;
}
.support-header .title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.support-header button { background: none; border: none; color: inherit; cursor: pointer; padding: 4px; display: flex; }
.support-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.support-msg-row { display: flex; gap: 8px; align-items: flex-end; }
.support-msg-row.user { flex-direction: row-reverse; }
.support-msg-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.support-msg-bubble {
  max-width: 78%; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px;
  padding: 9px 13px; font-size: 13px; line-height: 1.5; white-space: pre-line;
}
.support-msg-row.user .support-msg-bubble { background: var(--accent); color: var(--accent-text); border-radius: 14px 14px 4px 14px; border-color: transparent; }
.support-typing { display: flex; gap: 4px; padding: 6px 2px; }
.support-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: supportTyping 1.2s infinite ease-in-out; }
.support-typing span:nth-child(2) { animation-delay: .15s; }
.support-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes supportTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.support-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.support-input-row input { flex: 1; }
.support-whatsapp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; background: #25D366; color: #fff;
  border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
  text-decoration: none; margin: 4px 16px 12px;
}