/* Global Design System & Variables */
:root {
  --bg-dark: #0b0f19;
  --bg-card: #131b2e;
  --bg-glass: rgba(19, 27, 46, 0.85);
  --border-color: #23314d;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --gradient-primary: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-sanda: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset & Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #60a5fa;
}

/* Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

main.content-wrapper {
  flex: 1;
  padding: 30px 0 60px 0;
}

/* Navbar System */
.navbar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo .badge-sanda {
  background: var(--gradient-sanda);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-weight: 800;
}

/* Desktop Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #fff;
  background: var(--gradient-blue);
  font-weight: 700;
}

/* User Account Pill Badge */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.user-name-text {
  font-weight: 700;
  color: #fff;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-tag {
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
}

/* Mobile Navigation Toggle Button */
.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Mobile Slide-Over Drawer Navigation (< 1200px) */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -340px;
  width: 310px;
  max-width: 88vw;
  height: 100vh;
  height: 100dvh;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  z-index: 1600;
  padding: 20px 18px calc(30px + env(safe-area-inset-bottom, 0px)) 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  box-sizing: border-box;
}

.mobile-drawer > div:first-child {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.mobile-drawer > div:last-child {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  box-sizing: border-box;
}

.mobile-drawer.active {
  right: 0;
}

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

.mobile-drawer-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: #38bdf8;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #475569;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-warning {
  background: #d97706;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Hero & Header Section */
.hero-banner {
  background: linear-gradient(180deg, rgba(9,13,22,0.4) 0%, rgba(9,13,22,0.8) 100%), var(--hero-bg-url, none) center/cover no-repeat;
  padding: 50px 0 35px 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 24px auto;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Glassmorphism Card System */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* Table System */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.table th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-secondary { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }

.corner-red {
  background: var(--accent-red);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
}

.corner-blue {
  background: var(--accent-blue);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
}

/* Sanda Match Bracket Visualizer */
.bracket-wrapper {
  overflow-x: auto;
  padding: 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.bracket-headers {
  display: flex;
  gap: 52px;
  margin-bottom: 20px;
}

.bracket-header-col {
  min-width: 280px;
  text-align: center;
  font-weight: 800;
  color: #38bdf8;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(30, 41, 59, 0.9);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.bracket-grid {
  display: flex;
  gap: 52px;
  min-height: 540px;
  align-items: stretch;
}

.bracket-round {
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  position: relative;
  padding: 10px 0;
}

.match-pair {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 24px;
  position: relative;
  flex: 1;
}

/* Connector Lines Engine (Right Elbow & Branch Wires) */
.bracket-round:not(:last-child) .match-pair::after {
  content: '';
  position: absolute;
  right: -26px;
  top: 25%;
  bottom: 25%;
  width: 26px;
  border-right: 3px solid #38bdf8;
  border-top: 3px solid #38bdf8;
  border-bottom: 3px solid #38bdf8;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  pointer-events: none;
}

.bracket-round:not(:last-child) .match-pair::before {
  content: '';
  position: absolute;
  right: -52px;
  top: 50%;
  width: 26px;
  height: 3px;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  pointer-events: none;
}

/* Hide trailing connectors on the final round column */
.bracket-round:last-child .match-pair::after,
.bracket-round:last-child .match-pair::before,
.match-pair.single-match-pair::after,
.match-pair.single-match-pair::before {
  display: none !important;
}

.match-card {
  background: var(--bg-card);
  border: 1.5px solid #334155;
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.match-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.match-header {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.match-card.completed-card {
  border-color: rgba(251, 191, 36, 0.6) !important;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.2) !important;
}

.match-card.completed-card .match-corner:not(.winner) {
  opacity: 0.5;
}

.match-corner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

.match-corner.red { border-left-color: var(--accent-red); }
.match-corner.blue { border-left-color: var(--accent-blue); }

.match-corner.winner {
  background: rgba(251, 191, 36, 0.18) !important;
  border-left: 5px solid #fbbf24 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.match-corner.winner .athlete-name {
  color: #fbbf24 !important;
  font-weight: 800 !important;
}

.match-corner.winner .corner-score {
  color: #fbbf24 !important;
  font-weight: 900 !important;
  font-size: 1.15rem !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.athlete-name { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.athlete-club { font-size: 0.72rem; color: var(--text-muted); }
.corner-score { font-size: 1rem; font-weight: 800; }

/* Footer */
.footer {
  background: #050811;
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  margin-top: auto;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); color: #34d399; }
.alert-danger { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: #fbbf24; }

/* RESPONSIVE MEDIA QUERIES (< 1400px & < 768px) */
@media (max-width: 1400px) {
  .nav-menu, .desktop-user-actions {
    display: none !important;
  }
  .mobile-toggle-btn {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .hero-banner { padding: 35px 0 25px 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .card { padding: 16px; }
}

/* -------------------------------------------------------------
   GLOBAL PRINT ENGINE (LIGHT VERSION FOR PRINTER INK & PDF)
   ------------------------------------------------------------- */
@media print {
  @page {
    margin: 8mm;
    size: auto;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: Arial, Helvetica, sans-serif !important;
  }

  /* Force ALL text elements to solid deep black #000000 */
  div, p, span, h1, h2, h3, h4, h5, h6, strong, b, td, th, a, code, i, label {
    color: #000000 !important;
    text-shadow: none !important;
  }

  .navbar, .footer, .sticky-bar, .alert, .btn, button, input[type="submit"], select, form, .mobile-toggle-btn, #panitiaMobileDrawerOverlay, .screen-toolbar {
    display: none !important;
  }

  .card, .container, main {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #64748b !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .card-header, .card-title {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border-bottom: 1px solid #64748b !important;
  }

  .table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .table th {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border: 1.5px solid #475569 !important;
    font-weight: 800 !important;
  }

  .table td {
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .badge {
    border: 1px solid #475569 !important;
    color: #000000 !important;
    background: #f1f5f9 !important;
    font-weight: 800 !important;
  }
}

/* ==========================================================================
   Light / Dark Mode Theme Engine
   ========================================================================== */
body.light-theme, html[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
}

body.light-theme .navbar, html[data-theme="light"] .navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

body.light-theme .nav-link, html[data-theme="light"] .nav-link {
  color: #334155 !important;
}

body.light-theme .nav-link:hover, 
body.light-theme .nav-link.active,
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08) !important;
}

body.light-theme .card, html[data-theme="light"] .card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body.light-theme .card-header, html[data-theme="light"] .card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .card-title, html[data-theme="light"] .card-title {
  color: #0f172a !important;
}

body.light-theme .table, html[data-theme="light"] .table {
  color: #0f172a !important;
  background: #ffffff !important;
}

body.light-theme th, html[data-theme="light"] th {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

body.light-theme td, html[data-theme="light"] td {
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

body.light-theme .form-control,
body.light-theme .form-select,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .user-pill, html[data-theme="light"] .user-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .user-name-text, html[data-theme="light"] .user-name-text {
  color: #0f172a !important;
}

body.light-theme .match-card, html[data-theme="light"] .match-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
}

body.light-theme .match-header, html[data-theme="light"] .match-header {
  color: #64748b !important;
}

body.light-theme .match-corner, html[data-theme="light"] .match-corner {
  background: #f8fafc !important;
}

body.light-theme .match-corner:not(.winner), html[data-theme="light"] .match-corner:not(.winner) {
  background: #f1f5f9 !important;
  opacity: 0.9 !important;
}

body.light-theme .match-corner:not(.winner) .athlete-name, 
html[data-theme="light"] .match-corner:not(.winner) .athlete-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-theme .match-corner:not(.winner) .athlete-club,
html[data-theme="light"] .match-corner:not(.winner) .athlete-club {
  color: #475569 !important;
}

body.light-theme .match-corner.winner, html[data-theme="light"] .match-corner.winner {
  background: #fef3c7 !important;
  border-left: 5px solid #d97706 !important;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.2) !important;
}

body.light-theme .match-corner.winner .athlete-name,
html[data-theme="light"] .match-corner.winner .athlete-name {
  color: #b45309 !important;
  font-weight: 900 !important;
}

body.light-theme .match-corner.winner .athlete-club,
html[data-theme="light"] .match-corner.winner .athlete-club {
  color: #d97706 !important;
  font-weight: 700 !important;
}

body.light-theme .hero-banner, html[data-theme="light"] .hero-banner {
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(248,250,252,0.8) 100%), var(--hero-bg-url, none) center/cover no-repeat !important;
  border-bottom: 1px solid #e2e8f0 !important;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

body.light-theme .hero-tag-pill, html[data-theme="light"] .hero-tag-pill {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12) !important;
}

body.light-theme .hero-title, html[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #2563eb 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  letter-spacing: -0.5px;
  filter: drop-shadow(0 4px 12px rgba(255,255,255,0.9)) !important;
}

body.light-theme .hero-subtitle, html[data-theme="light"] .hero-subtitle {
  color: #1e293b !important;
  font-size: 1.08rem !important;
  font-weight: 600 !important;
  text-shadow: 0 2px 10px rgba(255,255,255,0.9), 0 0 5px rgba(255,255,255,1) !important;
}

body.light-theme .brand-logo, html[data-theme="light"] .brand-logo {
  color: #0f172a !important;
}

body.light-theme .btn-outline, html[data-theme="light"] .btn-outline {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

body.light-theme .btn-outline:hover, html[data-theme="light"] .btn-outline:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #2563eb !important;
}

body.light-theme .stat-card, html[data-theme="light"] .stat-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04) !important;
}

body.light-theme .stat-value, html[data-theme="light"] .stat-value {
  color: #0f172a !important;
}

body.light-theme .stat-label, html[data-theme="light"] .stat-label {
  color: #64748b !important;
}

body.light-theme .alert-warning, html[data-theme="light"] .alert-warning {
  background: #fffbeb !important;
  border-color: #fef3c7 !important;
  color: #92400e !important;
}

body.light-theme .alert-danger, html[data-theme="light"] .alert-danger {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

body.light-theme .alert-success, html[data-theme="light"] .alert-success {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

body.light-theme .footer, html[data-theme="light"] .footer {
  background: #ffffff !important;
  border-top: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-theme .footer p, html[data-theme="light"] .footer p {
  color: #64748b !important;
}

body.light-theme .footer a, html[data-theme="light"] .footer a {
  color: #2563eb !important;
}

body.light-theme .badge-secondary, html[data-theme="light"] .badge-secondary {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

body.light-theme .mobile-drawer, html[data-theme="light"] .mobile-drawer {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-theme .mobile-nav-link, html[data-theme="light"] .mobile-nav-link {
  color: #334155 !important;
}

body.light-theme .bracket-header-col, html[data-theme="light"] .bracket-header-col {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

body.light-theme .hasil-juara-box, html[data-theme="light"] .hasil-juara-box {
  background: #fffbeb !important;
  border-color: #fef3c7 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15) !important;
}

body.light-theme .hasil-juara-title, html[data-theme="light"] .hasil-juara-title {
  color: #b45309 !important;
}

body.light-theme .hasil-juara-text, html[data-theme="light"] .hasil-juara-text {
  color: #1e293b !important;
}

/* Universal Light Mode High Contrast Overrides for Inline Hardcoded White Colors */
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color:#fff"],
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color:#ffffff"],
html[data-theme="light"] [style*="color: #fff"],
html[data-theme="light"] [style*="color:#fff"],
html[data-theme="light"] [style*="color: #ffffff"],
html[data-theme="light"] [style*="color:#ffffff"] {
  color: #0f172a !important;
}

/* Preserve White Text on Buttons, Badges, and Action Elements */
body.light-theme .btn-primary,
body.light-theme .btn-danger,
body.light-theme .badge-danger,
body.light-theme .badge-primary,
body.light-theme .badge-success,
body.light-theme .user-role-tag,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .badge-danger,
html[data-theme="light"] .badge-primary,
html[data-theme="light"] .badge-success,
html[data-theme="light"] .user-role-tag {
  color: #ffffff !important;
}

.theme-toggle-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fbbf24;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

body.light-theme .theme-toggle-btn, html[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

/* Dropdown Menu Support */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-bg);
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
  z-index: 1000;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  top: 100%;
  left: 0;
  overflow: hidden;
}
.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}
.nav-dropdown-content a {
  color: var(--text-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}
.nav-dropdown-content a:last-child {
  border-bottom: none;
}
.nav-dropdown-content a:hover {
  background-color: rgba(255,255,255,0.05);
  color: var(--primary-color);
}
