/* =====================================================================
   Badminton Kemenkeu Satu Sumut — Design System
   Palet: Navy Kemenkeu + Emas Semangat + Hijau Lapangan
   ===================================================================== */

:root {
  /* Brand */
  --navy-950: #061430;
  --navy-900: #0a1f44;
  --navy-800: #0d2a5c;
  --navy-700: #123a7a;
  --blue-600: #1d5fd6;
  --blue-500: #2a73ff;
  --blue-400: #5b94ff;
  --gold-600: #d99a00;
  --gold-500: #f5b400;
  --gold-400: #ffc93c;
  --gold-100: #fff4d1;
  --court-500: #10b981;
  --court-100: #d1fae5;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --orange-500: #f97316;
  --purple-500: #8b5cf6;
  --pink-500: #ec4899;

  /* Surface (light) */
  --bg: #f2f5fb;
  --bg-pattern: rgba(13, 42, 92, .035);
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --border: #e3e9f3;
  --border-strong: #cfd8e7;
  --text: #0f1b33;
  --text-2: #33415c;
  --muted: #6b7a94;
  --primary: var(--blue-600);
  --primary-soft: #e8f0ff;
  --ring: rgba(42, 115, 255, .25);

  /* Typography — proporsional, tidak terlalu besar */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Plus Jakarta Sans', sans-serif;
  --fs-2xs: .6875rem;  /* 11px */
  --fs-xs: .75rem;     /* 12px */
  --fs-sm: .8125rem;   /* 13px */
  --fs-base: .875rem;  /* 14px */
  --fs-md: 1rem;       /* 16px */
  --fs-lg: 1.125rem;   /* 18px */
  --fs-xl: 1.375rem;   /* 22px */
  --fs-2xl: 1.75rem;   /* 28px */

  /* Shape & depth */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(10, 31, 68, .22);
  --shadow-gold: 0 8px 24px rgba(245, 180, 0, .35);
  --shadow-blue: 0 8px 24px rgba(29, 95, 214, .35);

  --sidebar-w: 252px;
  --sidebar-w-collapsed: 78px;
  --topbar-h: 62px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
  --bg: #070f20;
  --bg-pattern: rgba(255, 255, 255, .025);
  --surface: #0f1a30;
  --surface-2: #12203a;
  --surface-3: #172744;
  --border: #1e2e4d;
  --border-strong: #2a3d62;
  --text: #e7edf8;
  --text-2: #c2cde2;
  --muted: #8797b4;
  --primary: var(--blue-400);
  --primary-soft: rgba(91, 148, 255, .14);
  --gold-100: rgba(245, 180, 0, .14);
  --court-100: rgba(16, 185, 129, .15);
  --red-100: rgba(239, 68, 68, .15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .25);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (max-width: 575px) { html { font-size: 15.5px; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, var(--bg-pattern) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--court-500) !important; }
.text-danger { color: var(--red-500) !important; }
.text-gold { color: var(--gold-600) !important; }
[data-theme="dark"] .text-gold { color: var(--gold-400) !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-display { font-family: var(--font-display); letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
::selection { background: var(--gold-400); color: var(--navy-900); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- Layout */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  color: #c9d6f0;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(42, 115, 255, .35) 0%, transparent 55%),
    radial-gradient(90% 50% at 100% 100%, rgba(245, 180, 0, .18) 0%, transparent 60%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  transition: width .3s var(--ease), transform .3s var(--ease);
  overflow: hidden;
}
.sidebar::after { /* garis lapangan dekoratif */
  content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px;
  border: 2px solid rgba(255, 255, 255, .05); border-radius: 50%; pointer-events: none;
}

.brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.1rem 1.15rem; min-height: var(--topbar-h);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-logo {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  box-shadow: var(--shadow-gold);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-text { line-height: 1.15; white-space: nowrap; }
.brand-text strong { display: block; color: #fff; font-size: var(--fs-sm); font-weight: 800; letter-spacing: .02em; }
.brand-text span { font-size: var(--fs-2xs); color: var(--gold-400); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: .9rem .7rem 1rem; }
.nav-label {
  padding: .9rem .75rem .4rem; font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(201, 214, 240, .45); white-space: nowrap;
}
.nav a {
  position: relative; display: flex; align-items: center; gap: .8rem;
  padding: .6rem .8rem; margin: 2px 0; border-radius: 10px;
  color: #c9d6f0; font-weight: 500; font-size: var(--fs-sm); white-space: nowrap;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.nav a i { font-size: 1.15rem; flex: 0 0 22px; text-align: center; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav a.active {
  color: var(--navy-900); font-weight: 700;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  box-shadow: var(--shadow-gold);
}
.nav a.active i { opacity: 1; }

.sidebar-foot {
  margin: .75rem; padding: .85rem; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  font-size: var(--fs-xs); color: #b8c6e3; white-space: nowrap;
}
.sidebar-foot b { color: #fff; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left .3s var(--ease);
}

/* Collapsed sidebar (desktop) */
.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav a span,
.sidebar-collapsed .sidebar-foot { display: none; }
.sidebar-collapsed .nav a { justify-content: center; padding: .7rem; }
.sidebar-collapsed .brand { justify-content: center; padding: 1.1rem .5rem; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: rgba(242, 245, 251, .85); }
  [data-theme="dark"] .topbar { background: rgba(7, 15, 32, .85); }
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: var(--fs-md); margin: 0; }
.topbar-title .crumb { font-size: var(--fs-xs); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 1.1rem; cursor: pointer; transition: all .2s var(--ease);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.user-chip {
  display: flex; align-items: center; gap: .55rem; padding: 4px 10px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  cursor: pointer; position: relative; transition: border-color .2s;
}
.user-chip:hover { border-color: var(--primary); }
.user-chip .meta { line-height: 1.1; }
.user-chip .meta b { display: block; font-size: var(--fs-xs); }
.user-chip .meta small { font-size: var(--fs-2xs); color: var(--muted); text-transform: capitalize; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: .4rem; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: all .18s var(--ease);
}
.dropdown.show { opacity: 1; transform: none; pointer-events: auto; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: 8px;
  color: var(--text-2); font-size: var(--fs-sm); background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.dropdown .danger { color: var(--red-500); }

.content { flex: 1; padding: 1.5rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.footer { padding: 1rem 1.5rem 1.5rem; font-size: var(--fs-xs); color: var(--muted); text-align: center; }

.backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(6, 20, 48, .55);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s;
}

/* Bottom nav (mobile) */
.bottom-nav { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0 !important; }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .backdrop { opacity: 1; pointer-events: auto; }
  .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav a span, .sidebar-collapsed .sidebar-foot { display: revert; }
  .sidebar-collapsed .nav a { justify-content: flex-start; padding: .6rem .8rem; }
  .content { padding: 1.1rem; }
  .topbar { padding: 0 1rem; }
}

@media (max-width: 767px) {
  .user-chip .meta { display: none; }
  .user-chip { padding: 3px; }
  .content { padding: .9rem .85rem 6rem; }
  .footer { padding-bottom: 6rem; }
  .bottom-nav {
    position: fixed; z-index: 50; left: .6rem; right: .6rem; bottom: .6rem;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: 62px; padding: 0 .3rem; border-radius: 20px;
    background: linear-gradient(180deg, var(--navy-800), var(--navy-950));
    box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #a9b9d8; font-size: 10px; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .bottom-nav a i, .bottom-nav button i { font-size: 1.25rem; }
  .bottom-nav a.active { color: var(--gold-400); text-decoration: none; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .fab {
    width: 54px; height: 54px; margin: -26px auto 0; border-radius: 18px;
    display: grid; place-items: center; color: var(--navy-900);
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    box-shadow: var(--shadow-gold), 0 0 0 5px var(--bg);
  }
  .bottom-nav .fab i { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------- Grid utils */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1199px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 991px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
@media (max-width: 420px) { .grid-4 { gap: .65rem; } }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.w-100 { width: 100%; }

/* ---------------------------------------------------------------- Card */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); position: relative;
  animation: rise .45s var(--ease) both;
}
.card-header {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: var(--fs-base); font-weight: 700; }
.card-header .sub { font-size: var(--fs-xs); color: var(--muted); }
.card-header .tools { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.card-body { padding: 1.15rem; }
.card-body.p-0 { padding: 0; }
.card-title-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem;
  background: var(--primary-soft); color: var(--primary);
}
.card-title-icon.gold { background: var(--gold-100); color: var(--gold-600); }
.card-title-icon.green { background: var(--court-100); color: var(--court-500); }
.card-title-icon.red { background: var(--red-100); color: var(--red-500); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.grid > .card:nth-child(2) { animation-delay: .05s; }
.grid > .card:nth-child(3) { animation-delay: .1s; }
.grid > .card:nth-child(4) { animation-delay: .15s; }

/* KPI */
.kpi { padding: 1rem 1.1rem; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi .kpi-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .kpi-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: #fff;
}
.kpi .kpi-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: .45rem; letter-spacing: .01em; }
.kpi .kpi-value small { font-size: .55em; font-weight: 600; color: var(--muted); }
.kpi .kpi-foot { font-size: var(--fs-xs); color: var(--muted); margin-top: .25rem; display: flex; align-items: center; gap: .35rem; }
.kpi::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: currentColor; opacity: .05; pointer-events: none;
}
.kpi.blue { color: var(--blue-600); } .kpi.gold { color: var(--gold-500); } .kpi.green { color: var(--court-500); } .kpi.red { color: var(--red-500); } .kpi.purple { color: var(--purple-500); }
.kpi .kpi-value, .kpi .kpi-label { color: var(--text); }
.kpi .kpi-label { color: var(--muted); }
.kpi.blue .kpi-icon { background: linear-gradient(135deg, var(--blue-400), var(--blue-600)); box-shadow: var(--shadow-blue); }
.kpi.gold .kpi-icon { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); box-shadow: var(--shadow-gold); color: var(--navy-900); }
.kpi.green .kpi-icon { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 8px 22px rgba(16, 185, 129, .35); }
.kpi.red .kpi-icon { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 8px 22px rgba(239, 68, 68, .35); }
.kpi.purple .kpi-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 8px 22px rgba(139, 92, 246, .35); }
.trend-up { color: var(--court-500); font-weight: 700; }
.trend-down { color: var(--red-500); font-weight: 700; }
@media (max-width: 420px) {
  .kpi { padding: .85rem; }
  .kpi .kpi-value { font-size: 1.55rem; }
  .kpi .kpi-icon { width: 34px; height: 34px; font-size: 1rem; }
}

/* Hero banner */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  padding: 1.6rem 1.75rem; margin-bottom: 1.25rem; color: #fff;
  background:
    linear-gradient(100deg, rgba(6, 20, 48, .97) 0%, rgba(13, 42, 92, .9) 45%, rgba(13, 42, 92, .35) 100%),
    url('../img/hero.jpg') center 35% / cover no-repeat;
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}
.hero::before { /* garis lapangan */
  content: ""; position: absolute; inset: 14px; border: 1.5px solid rgba(255, 255, 255, .08); border-radius: 18px; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400) 40%, var(--blue-500) 100%);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px;
  background: rgba(245, 180, 0, .16); color: var(--gold-400); font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; border: 1px solid rgba(245, 180, 0, .35);
}
.hero h2 { color: #fff; font-size: 1.5rem; margin: .65rem 0 .3rem; font-weight: 800; }
.hero h2 .hl { color: var(--gold-400); }
.hero p { color: #c8d5ef; max-width: 560px; font-size: var(--fs-sm); margin-bottom: 1rem; }
.hero .hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .shuttle-float { position: absolute; right: 6%; top: 50%; width: 90px; opacity: .9; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(-50%) rotate(-18deg); } 50% { transform: translateY(-62%) rotate(-8deg); } }
@media (max-width: 767px) {
  .hero { padding: 1.25rem; border-radius: 18px; }
  .hero h2 { font-size: 1.2rem; }
  .hero .shuttle-float { display: none; }
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  --b: var(--surface); --c: var(--text-2); --bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 38px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--bd);
  background: var(--b); color: var(--c); font-family: inherit; font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, filter .2s;
}
.btn i { font-size: 1.05em; }
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--border-strong); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled, .btn.loading { opacity: .65; pointer-events: none; }
.btn-primary { --b: linear-gradient(135deg, var(--blue-500), var(--blue-600)); --c: #fff; --bd: transparent; background: var(--b); box-shadow: var(--shadow-blue); }
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; }
.btn-gold { --c: var(--navy-900); --bd: transparent; background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); box-shadow: var(--shadow-gold); }
.btn-gold:hover { filter: brightness(1.05); border-color: transparent; }
.btn-success { --c: #fff; --bd: transparent; background: linear-gradient(135deg, #34d399, #059669); }
.btn-danger { --c: #fff; --bd: transparent; background: linear-gradient(135deg, #f87171, #dc2626); }
.btn-ghost { --b: transparent; --bd: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-glass { --b: rgba(255, 255, 255, .1); --c: #fff; --bd: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: var(--fs-xs); border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 1.35rem; font-size: var(--fs-base); border-radius: 12px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Forms */
.form-group { margin-bottom: .9rem; }
.form-label { display: block; margin-bottom: .35rem; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.form-label .req { color: var(--red-500); }
.form-hint { font-size: var(--fs-2xs); color: var(--muted); margin-top: .3rem; }
.form-control, .form-select {
  width: 100%; height: 40px; padding: 0 .8rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: var(--fs-sm);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.form-control { height: auto; min-height: 80px; padding: .6rem .8rem; resize: vertical; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a94' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
.form-control-sm, .form-select.form-control-sm { height: 34px; font-size: var(--fs-xs); border-radius: 8px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1rem; pointer-events: none; }
.input-icon .form-control { padding-left: 2.2rem; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon {
  display: grid; place-items: center; padding: 0 .75rem; border: 1px solid var(--border-strong);
  background: var(--surface-3); color: var(--muted); font-size: var(--fs-xs); font-weight: 600;
}
.input-group .addon:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.input-group .addon:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.input-group .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--court-500); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.segmented button, .segmented label {
  border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: var(--fs-xs); font-weight: 600;
  padding: .4rem .75rem; border-radius: 8px; cursor: pointer; transition: all .2s var(--ease); white-space: nowrap;
  user-select: none; display: inline-flex; align-items: center; justify-content: center;
}
.segmented label:hover { color: var(--text); }
.segmented button.active, .segmented input:checked + label, .segmented label:has(input:checked) {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 700;
}
.segmented input[type="radio"], .segmented input[type="checkbox"] { display: none; }

/* Stepper (+/-) */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button {
  width: 40px; height: 42px; border: 0; background: var(--surface-3); color: var(--text-2); font-size: 1.15rem; cursor: pointer; transition: background .15s;
}
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.stepper button:active { transform: scale(.94); }
.stepper input {
  width: 64px; height: 42px; border: 0; text-align: center; background: transparent; color: var(--text);
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; -moz-appearance: textfield;
}
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filter-bar .form-group { margin: 0; min-width: 140px; flex: 1 1 140px; }
.filter-bar .form-group.grow { flex: 2 1 220px; }
.filter-bar .actions { display: flex; gap: .5rem; }
.date-presets { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .65rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 999px;
  font-size: var(--fs-2xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .2s;
}
.chip:hover, .chip.active { border-color: var(--gold-500); background: var(--gold-100); color: var(--navy-900); }
[data-theme="dark"] .chip:hover, [data-theme="dark"] .chip.active { color: var(--gold-400); }

/* ---------------------------------------------------------------- Badge & avatar */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-green { background: var(--court-100); color: #059669; }
.badge-red { background: var(--red-100); color: var(--red-500); }
.badge-purple { background: rgba(139, 92, 246, .12); color: var(--purple-500); }
.badge-pink { background: rgba(236, 72, 153, .12); color: var(--pink-500); }
[data-theme="dark"] .badge-gold { color: var(--gold-400); }
[data-theme="dark"] .badge-green { color: #34d399; }

.avatar {
  --av: var(--blue-600);
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: var(--fs-2xs); letter-spacing: .03em;
  background: linear-gradient(135deg, color-mix(in srgb, var(--av) 75%, #fff), var(--av));
  background-color: var(--av);
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

.player { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.player .info { min-width: 0; line-height: 1.25; }
.player .info b { display: block; font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .info small { color: var(--muted); font-size: var(--fs-2xs); }

/* ---------------------------------------------------------------- Table */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th {
  position: sticky; top: 0; text-align: left; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: .3rem; justify-content: flex-end; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.center, .table th.center { text-align: center; }

/* Responsive table -> cards */
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
  .table-cards td { border: 0; padding: .22rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right !important; }
  .table-cards td::before { content: attr(data-label); font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
  .table-cards td.td-main { display: block; text-align: left !important; padding-bottom: .4rem; }
  .table-cards td.td-main::before { display: none; }
  .table-cards td.td-actions::before { display: none; }
  .table-cards td.td-actions { justify-content: flex-end; padding-top: .45rem; }
}

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.15rem; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); }
.pagination .pages { display: flex; gap: .3rem; }
.pagination .pages button {
  min-width: 32px; height: 32px; padding: 0 .5rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-family: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.pagination .pages button.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pagination .pages button:disabled { opacity: .4; cursor: default; }

/* ---------------------------------------------------------------- Match card */
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 1rem; }
.match {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  animation: rise .4s var(--ease) both;
}
.match:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.match::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue-500); }
.match.j-ganda::before { background: var(--gold-500); }
.match.j-campuran::before { background: var(--pink-500); }
.match-head { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem .7rem 1.2rem; font-size: var(--fs-xs); color: var(--muted); border-bottom: 1px dashed var(--border); }
.match-head .code { font-weight: 700; color: var(--text-2); letter-spacing: .03em; }
.match-head .tools { margin-left: auto; display: flex; gap: .2rem; }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; padding: .9rem 1rem .9rem 1.2rem; }
.team { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.team.right { align-items: flex-end; text-align: right; }
.team.right .player { flex-direction: row-reverse; }
.team .player .info b { font-size: var(--fs-xs); }
.team.win .player .info b { color: var(--text); }
.team.lose { opacity: .62; }
.team .win-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: 10px; font-weight: 800; color: var(--gold-600); letter-spacing: .08em; text-transform: uppercase; }
[data-theme="dark"] .team .win-tag { color: var(--gold-400); }
.scoreline { text-align: center; }
.scoreline .sets { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; letter-spacing: .02em; }
.scoreline .sets .w { color: var(--gold-600); }
[data-theme="dark"] .scoreline .sets .w { color: var(--gold-400); }
.scoreline .sets .sep { color: var(--muted); margin: 0 .2rem; font-weight: 500; }
.scoreline .detail { display: flex; flex-direction: column; gap: 1px; margin-top: .3rem; font-size: var(--fs-2xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.match-foot { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .6rem 1rem .6rem 1.2rem; background: var(--surface-2); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); }
.match-foot b { color: var(--text-2); }
.match-foot .cost { margin-left: auto; font-weight: 700; color: var(--text); }
@media (max-width: 420px) {
  .match-body { gap: .4rem; padding: .8rem .75rem .8rem 1rem; }
  .scoreline .sets { font-size: 1.6rem; }
  .team .avatar { width: 26px; height: 26px; font-size: 9px; }
}

/* ---------------------------------------------------------------- Ranking */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: .75rem; align-items: end; padding: .5rem 0 0; }
.podium .pod { text-align: center; padding: 1rem .5rem .85rem; border-radius: 16px; position: relative; background: var(--surface-2); border: 1px solid var(--border); }
.podium .pod .avatar { margin: 0 auto .5rem; }
.podium .pod b { display: block; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pod small { color: var(--muted); font-size: var(--fs-2xs); }
.podium .pod .pts { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin-top: .2rem; }
.podium .pod .medal { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; box-shadow: var(--shadow-sm); }
.podium .p1 { padding-top: 1.4rem; background: linear-gradient(180deg, var(--gold-100), var(--surface)); border-color: rgba(245, 180, 0, .45); }
.podium .p1 .medal { background: linear-gradient(135deg, #ffd65a, #e0a100); color: var(--navy-900); width: 30px; height: 30px; }
.podium .p2 .medal { background: linear-gradient(135deg, #d9dee7, #9aa5b8); }
.podium .p3 .medal { background: linear-gradient(135deg, #f0b27a, #b86b2a); }

.rank-no { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: var(--fs-xs); background: var(--surface-3); color: var(--text-2); }
.rank-no.r1 { background: linear-gradient(135deg, #ffd65a, #e0a100); color: var(--navy-900); }
.rank-no.r2 { background: linear-gradient(135deg, #e5e9f0, #a9b3c4); color: var(--navy-900); }
.rank-no.r3 { background: linear-gradient(135deg, #f3c08f, #c07733); color: #fff; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--court-500), #34d399); transition: width .6s var(--ease); }
.progress.gold > span { background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); }

.mini-rank { list-style: none; margin: 0; padding: 0; }
.mini-rank li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.mini-rank li:last-child { border-bottom: 0; }
.mini-rank .pts { margin-left: auto; text-align: right; line-height: 1.15; }
.mini-rank .pts b { font-family: var(--font-display); font-size: 1.15rem; }
.mini-rank .pts small { display: block; font-size: var(--fs-2xs); color: var(--muted); }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); padding: 0 1rem; overflow-x: auto; }
.tabs button {
  position: relative; padding: .85rem .9rem; border: 0; background: none; color: var(--muted); font-family: inherit;
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center;
}
.tabs button.active { color: var(--text); }
.tabs button.active::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--gold-500), var(--blue-500)); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: rise .35s var(--ease); }

/* ---------------------------------------------------------------- Modal */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(6, 20, 48, .55); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-dialog {
  width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  transform: translateY(16px) scale(.98); transition: transform .25s var(--ease);
}
.modal.show .modal-dialog { transform: none; }
.modal-lg .modal-dialog { max-width: 820px; }
.modal-header { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: var(--fs-md); }
.modal-header .close { margin-left: auto; }
.modal-body { padding: 1.2rem; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 575px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog { max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .modal-footer { border-radius: 0; }
  .modal-footer .btn { flex: 1; }
}

/* ---------------------------------------------------------------- Empty & loading */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; margin: 0 auto .75rem; border-radius: 20px; display: grid; place-items: center; font-size: 1.8rem; background: var(--surface-3); color: var(--muted); }
.empty b { display: block; color: var(--text-2); margin-bottom: .2rem; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: shimmer 1.3s infinite; }
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

.chart-box { min-height: 300px; }
.chart-box-sm { min-height: 240px; }

/* ---------------------------------------------------------------- Match form */
.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.type-option { position: relative; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-option .box {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center;
  padding: 1rem .6rem; border-radius: 16px; border: 2px solid var(--border); background: var(--surface);
  transition: all .25s var(--ease);
}
.type-option .box .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--surface-3); color: var(--muted); transition: all .25s; }
.type-option .box b { font-size: var(--fs-sm); }
.type-option .box small { font-size: var(--fs-2xs); color: var(--muted); }
.type-option:hover .box { border-color: var(--border-strong); transform: translateY(-2px); }
.type-option input:checked + .box { border-color: var(--gold-500); background: linear-gradient(180deg, var(--gold-100), var(--surface)); box-shadow: var(--shadow-gold); }
.type-option input:checked + .box .ico { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--navy-900); }
@media (max-width: 480px) {
  .type-picker { gap: .45rem; }
  .type-option .box { padding: .75rem .3rem; }
  .type-option .box small { display: none; }
  .type-option .box .ico { width: 38px; height: 38px; font-size: 1.1rem; }
}

.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; position: relative; z-index: 20; }
.versus .vs {
  align-self: center; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--navy-900);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); box-shadow: var(--shadow-gold), 0 0 0 6px var(--surface);
}
.team-panel { border-radius: 16px; padding: 1rem; border: 1px solid var(--border); position: relative; overflow: visible !important; }
.team-panel:focus-within { z-index: 35; }
.team-panel .form-group { position: relative; }
.team-panel .form-group:focus-within { z-index: 45; }
.team-panel.a { background: linear-gradient(160deg, rgba(42, 115, 255, .1), transparent 70%); border-color: rgba(42, 115, 255, .3); }
.team-panel.b { background: linear-gradient(200deg, rgba(239, 68, 68, .09), transparent 70%); border-color: rgba(239, 68, 68, .28); }
.team-panel .team-title { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: var(--fs-sm); margin-bottom: .75rem; letter-spacing: .03em; }
.team-panel .dot { width: 10px; height: 10px; border-radius: 50%; }
.team-panel.a .dot { background: var(--blue-500); box-shadow: 0 0 0 4px rgba(42, 115, 255, .2); }
.team-panel.b .dot { background: var(--red-500); box-shadow: 0 0 0 4px rgba(239, 68, 68, .2); }
@media (max-width: 767px) {
  .versus { grid-template-columns: 1fr; gap: .6rem; }
  .versus .vs { justify-self: center; width: 42px; height: 42px; font-size: 1rem; }
}

.set-grid { display: grid; gap: .6rem; }
.set-row {
  display: grid; grid-template-columns: 74px 1fr auto 1fr 36px; gap: .6rem; align-items: center;
  padding: .6rem .7rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
}
.set-row .set-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.set-row .colon { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--muted); }
.set-row .stepper { width: 100%; justify-content: space-between; }
.set-row .stepper input { flex: 1; width: auto; min-width: 0; }
.set-row.win-a { border-color: rgba(42, 115, 255, .45); }
.set-row.win-b { border-color: rgba(239, 68, 68, .45); }
.set-row.win-a .score-a input, .set-row.win-b .score-b input { color: var(--gold-600); }
[data-theme="dark"] .set-row.win-a .score-a input, [data-theme="dark"] .set-row.win-b .score-b input { color: var(--gold-400); }
.set-row .set-flag { font-size: 10px; text-align: center; }
@media (max-width: 575px) {
  .set-row { grid-template-columns: 1fr auto 1fr 30px; padding: .55rem; gap: .35rem; }
  .set-row .set-label { grid-column: 1 / -1; }
  .set-row .stepper button { width: 32px; }
}

.result-banner {
  display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 14px; margin-top: .9rem;
  background: var(--surface-3); border: 1px dashed var(--border-strong); font-size: var(--fs-sm); color: var(--muted);
}
.result-banner.ok { background: linear-gradient(90deg, var(--gold-100), transparent); border: 1px solid rgba(245, 180, 0, .45); color: var(--text); }
.result-banner i { font-size: 1.4rem; color: var(--gold-500); }

.cost-card {
  border-radius: 18px; padding: 1.15rem; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(80% 80% at 100% 0%, rgba(245, 180, 0, .35), transparent 60%),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow);
}
.cost-card .lbl { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .12em; color: #a9bbdf; font-weight: 700; }
.cost-card .big { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1.1; color: var(--gold-400); }
.cost-card .row { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; font-size: var(--fs-xs); border-bottom: 1px dashed rgba(255, 255, 255, .12); color: #d6e0f5; }
.cost-card .row:last-child { border-bottom: 0; }
.cost-card .row b { color: #fff; }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 20; margin-top: 1rem; padding: .8rem 1rem; border-radius: 16px;
  display: flex; gap: .6rem; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (max-width: 767px) { .sticky-actions { bottom: 78px; } .sticky-actions .btn { flex: 1; } }

/* ---------------------------------------------------------------- Live scoreboard */
.scoreboard {
  position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-950), #020814); color: #fff; user-select: none;
}
.scoreboard.show { display: flex; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sb-top { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sb-top .title { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-xs); color: var(--gold-400); }
.sb-top .set-ind { font-size: var(--fs-xs); color: #a9bbdf; }
.sb-top .btns { margin-left: auto; display: flex; gap: .4rem; }
.sb-court { flex: 1; display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.sb-court::after { content: ""; position: absolute; left: 50%; top: 8%; bottom: 8%; width: 3px; transform: translateX(-50%); background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .5) 0 10px, transparent 10px 18px); }
.sb-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; cursor: pointer; position: relative; transition: background .15s; padding: 1rem; text-align: center; }
.sb-side.a { background: radial-gradient(circle at 50% 60%, rgba(42, 115, 255, .28), transparent 70%); }
.sb-side.b { background: radial-gradient(circle at 50% 60%, rgba(239, 68, 68, .25), transparent 70%); }
.sb-side:active { background-color: rgba(255, 255, 255, .05); }
.sb-side .names { font-size: var(--fs-sm); font-weight: 600; color: #d6e0f5; min-height: 2.4em; }
.sb-side .pts { font-family: var(--font-display); font-size: clamp(5rem, 22vw, 14rem); font-weight: 800; line-height: .9; text-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.sb-side .pts.bump { animation: bump .25s var(--ease); }
@keyframes bump { 50% { transform: scale(1.12); color: var(--gold-400); } }
.sb-side .hint { font-size: var(--fs-2xs); color: #8ea2c8; letter-spacing: .1em; text-transform: uppercase; }
.sb-side .serve { position: absolute; top: 1rem; width: 18px; height: 18px; border-radius: 50%; background: var(--gold-400); box-shadow: 0 0 18px var(--gold-400); opacity: 0; transition: opacity .2s; }
.sb-side.serving .serve { opacity: 1; }
.sb-sets { display: flex; justify-content: center; gap: .5rem; padding: .7rem; border-top: 1px solid rgba(255, 255, 255, .08); flex-wrap: wrap; }
.sb-sets .s { padding: .3rem .7rem; border-radius: 8px; background: rgba(255, 255, 255, .08); font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

/* ---------------------------------------------------------------- Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-visual {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem;
  background: linear-gradient(180deg, rgba(6, 20, 48, .1) 0%, rgba(6, 20, 48, .55) 55%, rgba(6, 20, 48, .97) 100%), url('../img/hero.jpg') center / cover no-repeat;
}
.auth-visual::before { content: ""; position: absolute; inset: 22px; border: 2px solid rgba(255, 255, 255, .12); border-radius: 26px; pointer-events: none; }
.auth-visual .tag { display: inline-flex; align-self: flex-start; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; background: rgba(245, 180, 0, .18); color: var(--gold-400); border: 1px solid rgba(245, 180, 0, .4); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-visual h2 { color: #fff; font-size: 2.1rem; line-height: 1.15; margin: 1rem 0 .6rem; font-weight: 800; max-width: 520px; }
.auth-visual h2 span { color: var(--gold-400); }
.auth-visual p { color: #c8d5ef; max-width: 480px; font-size: var(--fs-sm); }
.auth-stats { display: flex; gap: 1.75rem; margin-top: 1.25rem; }
.auth-stats div b { display: block; font-family: var(--font-display); font-size: 1.8rem; color: #fff; line-height: 1; }
.auth-stats div small { color: #a9bbdf; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .1em; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; position: relative; }
.auth-card { width: 100%; max-width: 380px; animation: rise .5s var(--ease) both; }
.auth-card .brand-logo { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 1.25rem; }
.auth-card .brand-logo svg { width: 32px; height: 32px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-card .lead { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 1.6rem; }
.auth-card .form-control { height: 46px; border-radius: 12px; }
.auth-foot { margin-top: 1.5rem; font-size: var(--fs-2xs); color: var(--muted); text-align: center; }
@media (max-width: 991px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 260px; padding: 1.75rem; }
  .auth-visual h2 { font-size: 1.45rem; }
  .auth-visual p, .auth-stats { display: none; }
  .auth-form { margin-top: -28px; border-radius: 28px 28px 0 0; background: var(--surface); padding-top: 2.2rem; }
}

/* ---------------------------------------------------------------- Profile */
.profile-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 1.5rem; color: #fff; margin-bottom: 1.25rem;
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(245, 180, 0, .3), transparent 60%),
    linear-gradient(135deg, var(--navy-800), var(--navy-950));
  display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow);
}
.profile-hero h2 { color: #fff; margin: 0 0 .25rem; font-size: 1.35rem; }
.profile-hero .meta { display: flex; gap: .5rem; flex-wrap: wrap; }
.profile-hero .meta .badge { background: rgba(255, 255, 255, .12); color: #e3ebfa; }
.profile-hero .stats { margin-left: auto; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.profile-hero .stats div { text-align: center; }
.profile-hero .stats b { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1; color: var(--gold-400); }
.profile-hero .stats small { font-size: var(--fs-2xs); color: #a9bbdf; text-transform: uppercase; letter-spacing: .1em; }
@media (max-width: 767px) { .profile-hero .stats { margin-left: 0; width: 100%; justify-content: space-between; gap: .75rem; } }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: .65rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .end { margin-left: auto; text-align: right; }

/* SweetAlert2 theming */
.swal2-popup { font-family: var(--font) !important; border-radius: 20px !important; font-size: .9rem !important; background: var(--surface) !important; color: var(--text) !important; }
.swal2-title { font-size: 1.2rem !important; color: var(--text) !important; }
.swal2-html-container { color: var(--text-2) !important; font-size: .875rem !important; }
.swal2-styled.swal2-confirm { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)) !important; border-radius: 10px !important; font-weight: 600 !important; box-shadow: var(--shadow-blue) !important; }
.swal2-styled.swal2-cancel { border-radius: 10px !important; font-weight: 600 !important; background: var(--surface-3) !important; color: var(--text-2) !important; }
.swal2-styled.swal2-deny { border-radius: 10px !important; font-weight: 600 !important; }
.swal2-toast { box-shadow: var(--shadow) !important; border: 1px solid var(--border) !important; }

/* Tom Select theming */
.ts-wrapper { position: relative; }
.ts-wrapper.focus, .ts-wrapper.dropdown-active { z-index: 500 !important; }
.ts-wrapper .ts-control { min-height: 40px; border-radius: 10px !important; border: 1px solid var(--border-strong) !important; background: var(--surface) !important; color: var(--text) !important; font-size: var(--fs-sm) !important; padding: 6px 10px !important; box-shadow: none !important; }
.ts-wrapper.focus .ts-control { border-color: var(--primary) !important; box-shadow: 0 0 0 4px var(--ring) !important; }
.ts-wrapper .ts-control input { color: var(--text) !important; font-size: var(--fs-sm) !important; }
.ts-dropdown {
  position: absolute !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: 0 16px 42px rgba(6, 20, 48, .26), 0 4px 12px rgba(0, 0, 0, .08) !important;
  overflow: auto !important;
  max-height: 260px !important;
  font-size: var(--fs-sm) !important;
  z-index: 9999 !important;
}
.ts-dropdown .option { padding: 8px 12px !important; border-bottom: 1px solid var(--border); }
.ts-dropdown .option:last-child { border-bottom: 0; }
.ts-dropdown .active { background: var(--primary-soft) !important; color: var(--text) !important; }
.ts-dropdown .optgroup-header { background: var(--surface-2) !important; color: var(--muted) !important; font-size: var(--fs-2xs) !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ts-wrapper.single .ts-control::after { border-color: var(--muted) transparent transparent !important; }
.ts-opt { display: flex; align-items: center; gap: .55rem; }
.ts-opt small { color: var(--muted); font-size: var(--fs-2xs); }
.ts-opt .avatar { width: 26px; height: 26px; font-size: 9px; box-shadow: none; }

/* ApexCharts theming */
.apexcharts-canvas { font-family: var(--font) !important; }
.apexcharts-tooltip { border-radius: 10px !important; box-shadow: var(--shadow) !important; border: 1px solid var(--border) !important; }
.apexcharts-menu { background: var(--surface) !important; border-color: var(--border) !important; border-radius: 10px !important; }
.apexcharts-menu-item:hover { background: var(--surface-3) !important; }

/* Print */
@media print {
  .sidebar, .topbar, .bottom-nav, .filter-bar, .no-print, .footer { display: none !important; }
  .main { margin: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}
