/* ============================================================
   Make It Happen - Black & Gold Enterprise Design System
   Primary: #0a0a0a (Black) | Secondary: #d4a843 (Gold)
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;
  --primary: #0a0a0a;
  --primary-light: #1a1a1a;
  --primary-dark: #000000;
  --secondary: #d4a843;
  --secondary-light: #e0c06e;
  --secondary-dark: #b8922e;
  --accent: #c9952e;
  --success: #10b981;
  --info: #3b82f6;
  --warning: #d4a843;
  --danger: #ef4444;
  --bg-body: #f5f2ec;
  --bg-card: #ffffff;
  --bg-sidebar: #0a0a0a;
  --bg-topbar: #ffffff;
  --text-primary: #111111;
  --text-secondary: #444444;
  --text-muted: #777777;
  --border-color: #e0dbd0;
  --border-light: #f0ebe0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --gold-gradient: linear-gradient(135deg, #d4a843 0%, #f0d78c 50%, #b8922e 100%);
  --dark-gradient: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
  --dropdown-bg: #ffffff;
  --input-bg: #ffffff;
  --table-stripe: rgba(0,0,0,0.02);
}

.dark {
  --bg-body: #111111;
  --bg-card: #1c1c1c;
  --bg-sidebar: #000000;
  --bg-topbar: #1c1c1c;
  --text-primary: #f0ede5;
  --text-secondary: #b8b5a8;
  --text-muted: #888878;
  --border-color: #333330;
  --border-light: #292925;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow: 0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.7);
  --dropdown-bg: #262626;
  --input-bg: #262626;
  --table-stripe: rgba(212,168,67,0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--secondary-dark); }

/* ========== LOADING OVERLAY ========== */
#jms-loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: var(--dark-gradient);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#jms-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  width: 80px; height: 80px;
  background: var(--gold-gradient);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderPulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(212,168,67,0.5);
}
.loader-logo i {
  font-size: 36px;
  color: #0a0a0a;
}
.loader-text {
  color: #d4a843;
  margin-top: 20px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.loader-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(212,168,67,0.2);
  border-top-color: #d4a843;
  border-radius: 50%;
  animation: loaderSpin 0.8s linear infinite;
  margin-top: 16px;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* ========== APP LAYOUT ========== */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  display: flex; flex-direction: column;
  transition: var(--transition);
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid rgba(212,168,67,0.15);
}
.app-sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.app-sidebar.collapsed .brand-text,
.app-sidebar.collapsed .nav-link span,
.app-sidebar.collapsed .user-info { display: none; }
.app-sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.app-sidebar.collapsed .nav-icon { margin: 0; font-size: 20px; }
.app-sidebar.collapsed .brand-link { justify-content: center; padding: 16px; }

.brand-link {
  display: flex; align-items: center;
  padding: 20px 20px; color: #fff; text-decoration: none;
  gap: 12px;
  border-bottom: 1px solid rgba(212,168,67,0.15);
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--gold-gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; color: #000;
  overflow: hidden;
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; display: block; }
.brand-sub { font-size: 11px; color: rgba(212,168,67,0.5); font-weight: 400; }

.sidebar-nav { padding: 12px; flex: 1; }
.sidebar-nav .nav-link {
  color: rgba(255,255,255,0.55);
  padding: 12px 16px; border-radius: 12px;
  transition: var(--transition);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 12px; margin-bottom: 2px;
}
.sidebar-nav .nav-link:hover { color: #d4a843; background: rgba(212,168,67,0.08); }
.sidebar-nav .nav-link.active {
  color: #000;
  background: var(--gold-gradient);
  box-shadow: 0 4px 15px rgba(212,168,67,0.3);
  font-weight: 700;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(212,168,67,0.15); }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--gold-gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #000; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(212,168,67,0.6); }

.app-main { margin-left: var(--sidebar-width); flex: 1; transition: var(--transition); min-width: 0; }
.app-main.expanded { margin-left: var(--sidebar-collapsed-width); }

.app-topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 1030;
  transition: background 0.3s ease;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--text-secondary); transition: var(--transition); font-size: 22px;
}
.btn-icon:hover { background: var(--border-light); color: var(--text-primary); transform: scale(1.05); }
.topbar-avatar {
  width: 44px; height: 44px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #000;
}

/* Profile Menu Button (user avatar with initials) */
.profile-menu-btn {
  width: 48px; height: 48px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  transition: var(--transition); cursor: pointer;
  padding: 0;
}
.profile-menu-btn:hover {
  background: var(--border-light);
  transform: scale(1.05);
}
.profile-avatar {
  width: 40px; height: 40px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #000;
}

/* Mobile bottom navigation bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-topbar);
  border-top: 1px solid var(--border-color);
  z-index: 1030;
  padding: 4px 8px;
  padding-bottom: env(safe-area-inset-bottom, 4px);
  justify-content: space-around;
  align-items: center;
}
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  gap: 2px;
  border-radius: 10px;
  transition: var(--transition);
}
.mobile-bottom-nav a i {
  font-size: 18px;
}
.mobile-bottom-nav a.active {
  color: #d4a843;
  background: rgba(212,168,67,0.1);
}
.mobile-bottom-nav a:hover {
  color: #d4a843;
}

.badge-dot { width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 6px; right: 6px; }

.app-content { padding: 24px; }
.app-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-color);
  font-size: 13px; color: var(--text-muted); background: var(--bg-card);
}

/* ========== CARDS ========== */
.card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
  transition: var(--transition);
  color: var(--text-primary);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px; font-weight: 600;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  color: var(--text-primary);
}

/* ========== STAT CARDS ========== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px; display: flex; align-items: center; gap: 16px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute;
  width: 100px; height: 100px; border-radius: 50%;
  top: -20px; right: -20px; opacity: 0.06;
}
.stat-card.primary::after { background: #0a0a0a; }
.stat-card.success::after { background: var(--success); }
.stat-card.info::after { background: var(--info); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger::after { background: var(--danger); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d4a843; }

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #000; flex-shrink: 0;
}
.stat-icon.bg-primary-g { background: var(--gold-gradient); }
.stat-icon.bg-success-g { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-icon.bg-info-g { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-icon.bg-warning-g { background: linear-gradient(135deg, #d4a843, #f0d78c); }
.stat-icon.bg-danger-g { background: linear-gradient(135deg, #ef4444, #f87171); }

.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ========== BUTTONS ========== */
.btn {
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-weight: 600; font-size: 14px; transition: var(--transition); letter-spacing: 0.2px;
}
.btn-primary {
  background: #0a0a0a; border: 2px solid #d4a843; color: #d4a843;
}
.btn-primary:hover {
  background: #d4a843; border-color: #d4a843; color: #000;
  transform: translateY(-1px); box-shadow: 0 4px 15px rgba(212,168,67,0.35);
}
.btn-outline-primary {
  border: 2px solid #d4a843; color: #d4a843; background: transparent;
}
.btn-outline-primary:hover {
  background: #d4a843; color: #000;
}
.btn-success { background: #10b981; border-color: #10b981; color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-warning { background: #d4a843; border-color: #d4a843; color: #000; }

/* ========== TABLES ========== */
.table {
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-hover-bg: rgba(212,168,67,0.05);
  --bs-table-striped-bg: var(--table-stripe);
}
.table th {
  font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  padding: 14px 16px; border-bottom: 2px solid #d4a843;
  background: var(--bg-card);
}
.table td {
  padding: 12px 16px; vertical-align: middle; font-size: 14px;
  border-color: var(--border-color);
  color: var(--text-primary);
  background: transparent;
}
.table-hover tbody tr:hover { background-color: rgba(212,168,67,0.05); }

/* Bootstrap dark mode table overrides */
.dark .table,
.dark .dataTable {
  --bs-table-color: #f0ede5;
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(212,168,67,0.08);
}
.dark .table td,
.dark .dataTable td {
  color: #f0ede5;
}
.dark .table th,
.dark .dataTable th {
  color: #b8b5a8;
}

/* DataTables specific overrides for dark mode */
.dark .dataTables_wrapper .dataTables_length,
.dark .dataTables_wrapper .dataTables_filter,
.dark .dataTables_wrapper .dataTables_info,
.dark .dataTables_wrapper .dataTables_paginate {
  color: var(--text-secondary);
}
.dark .dataTables_wrapper .dataTables_length select,
.dark .dataTables_wrapper .dataTables_filter input {
  background: var(--input-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.dark .page-link {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.dark .page-item.active .page-link {
  background: #d4a843;
  border-color: #d4a843;
  color: #000;
}
.dark .page-item.disabled .page-link {
  background: var(--bg-card);
  color: var(--text-muted);
}

/* ========== FORMS ========== */
.form-control {
  border-radius: 10px; border: 1px solid var(--border-color);
  padding: 10px 16px; font-size: 14px;
  background: var(--input-bg); color: var(--text-primary); transition: var(--transition);
}
.form-control:focus {
  border-color: #d4a843; box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
  background: var(--input-bg); color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-weight: 600; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.form-select {
  border-radius: 10px; border: 1px solid var(--border-color);
  padding: 10px 16px;
  background-color: var(--input-bg); color: var(--text-primary);
}
.form-select:focus {
  border-color: #d4a843; box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}
.dark .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4a843' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.form-check-label { color: var(--text-primary); }
.input-group-text {
  background: var(--bg-topbar);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

/* ========== BADGES ========== */
.badge { font-weight: 600; padding: 6px 12px; border-radius: 8px; font-size: 11px; }
.badge.bg-primary { background: #0a0a0a !important; color: #d4a843; }
.badge.bg-success { background: #10b981 !important; color: #fff; }
.badge.bg-warning { background: #d4a843 !important; color: #000; font-weight: 700; }
.badge.bg-info { background: #3b82f6 !important; color: #fff; }
.badge.bg-dark { background: var(--border-color) !important; color: var(--text-primary) !important; }
.badge.bg-secondary { background: var(--border-light) !important; color: var(--text-secondary) !important; }
.dark .badge.bg-secondary { background: rgba(255,255,255,0.12) !important; color: #f0ede5 !important; }

/* ========== DROPDOWNS ========== */
.dropdown-menu {
  background: var(--dropdown-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}
.dropdown-item {
  color: var(--text-primary);
  transition: var(--transition);
}
.dropdown-item:hover {
  background: rgba(212,168,67,0.1);
  color: #d4a843;
}
.dropdown-item.text-danger { color: #ef4444 !important; }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { border-color: var(--border-color); }
.dropdown-header { color: var(--text-secondary); }
.text-muted { color: var(--text-muted) !important; }

/* ========== MODALS ========== */
.modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header, .modal-footer { border-color: var(--border-color); }
.modal-title { color: var(--text-primary); font-weight: 700; }
.dark .btn-close { filter: invert(1); }

/* Themed Cards & Responsive Dark/Light Elements */
.card.bg-dark {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}
.card.bg-dark .text-white {
  color: var(--text-primary) !important;
}
.card.bg-dark .text-muted {
  color: var(--text-muted) !important;
}

/* Nav Pills Theme Adaptation */
.nav-pills .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-pills .nav-link.active {
  background: var(--gold-gradient);
  color: #0a0a0a !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(212,168,67,0.3);
}
.nav-pills .nav-link:hover:not(.active) {
  background: var(--border-light);
  color: var(--text-primary);
}

/* Alert Boxes Theme Adaptation */
.dark .alert-info { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.dark .alert-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.dark .alert-warning { background: rgba(212, 168, 67, 0.15); border-color: rgba(212, 168, 67, 0.3); color: #fde68a; }
.dark .alert-danger { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Table Headers for Light and Dark Modes */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table thead.table-light th,
[data-bs-theme="dark"] .obs-table-head th {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-bs-theme="light"] .table-light,
[data-bs-theme="light"] .table thead.table-light th,
[data-bs-theme="light"] .obs-table-head th {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

/* Stage Contestant Cards in OBS Setup */
.stage-contestant-card {
  transition: all 0.2s ease;
  cursor: pointer;
}
[data-bs-theme="dark"] .stage-contestant-card:not(.active-stage-card) {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .stage-contestant-card:not(.active-stage-card):hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}
[data-bs-theme="light"] .stage-contestant-card:not(.active-stage-card) {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-bs-theme="light"] .stage-contestant-card:not(.active-stage-card):hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
.stage-contestant-card.active-stage-card {
  background: rgba(212, 175, 55, 0.16) !important;
  border-color: #d4af37 !important;
}

.stage-contestant-title {
  color: var(--text-primary);
}
[data-bs-theme="dark"] .stage-contestant-title {
  color: #f8fafc !important;
}
[data-bs-theme="light"] .stage-contestant-title {
  color: #0f172a !important;
}

.stage-contestant-sub {
  color: #d4af37;
}
[data-bs-theme="light"] .stage-contestant-sub {
  color: #b45309;
}

/* Top Quick Status Cards in OBS Setup */
[data-bs-theme="dark"] .obs-status-card {
  background: rgba(30, 41, 59, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="light"] .obs-status-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}
[data-bs-theme="dark"] .stage-status-title {
  color: #ffffff !important;
}
[data-bs-theme="light"] .stage-status-title {
  color: #0f172a !important;
}

/* Form Controls & Select Inputs */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1c1c1c;
  border-color: #333330;
  color: #f0ede5;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #242424;
  border-color: #d4a843;
  color: #ffffff;
  box-shadow: 0 0 0 0.25rem rgba(212, 168, 67, 0.25);
}
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
  background-color: #ffffff;
  border-color: #e0dbd0;
  color: #111111;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
  background-color: #18181b;
  border: 1px solid #27272a;
  color: #f4f4f5;
}
[data-bs-theme="light"] .modal-content {
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  color: #09090b;
}

/* Badges */
[data-bs-theme="dark"] .badge.bg-dark {
  background-color: #27272a !important;
  color: #f4f4f5 !important;
}
[data-bs-theme="light"] .badge.bg-dark {
  background-color: #09090b !important;
  color: #ffffff !important;
}

/* ========== BREADCRUMB ========== */
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ========== RANK BADGES ========== */
.rank-badge {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.rank-1 { background: var(--gold-gradient); color: #000; font-size: 20px; font-weight: 800; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; font-size: 18px; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; font-size: 16px; }

/* Score badges */
.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 50px; padding: 6px 14px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.score-high { background: rgba(16,185,129,0.1); color: var(--success); }
.score-mid { background: rgba(212,168,67,0.15); color: #b8922e; }
.score-low { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Judge scoring page landscape photo */
.judge-scoring-photo {
  width: 130px; height: 90px; border-radius: 14px; object-fit: cover;
  border: 3px solid #d4a843; box-shadow: var(--shadow-sm);
}

/* Contestant photo */
.contestant-photo {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover;
  border: 2px solid #d4a843;
}
.contestant-photo-lg {
  width: 160px; height: 160px; border-radius: 24px; object-fit: cover;
  border: 3px solid #d4a843; box-shadow: var(--shadow);
}

/* Event banner */
.event-banner { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-lg); }
.event-banner-sm { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; }

/* Chart containers */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { width: 100% !important; }

/* Notifications dropdown */
.notif-dropdown { min-width: 320px; max-height: 400px; overflow-y: auto; }
.notif-list .notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}
.notif-list .notif-item:hover { background: rgba(212,168,67,0.05); }
.notif-list .notif-item.unread { background: rgba(212,168,67,0.08); }
.notif-item .notif-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease-out; }
.animate-card { animation: fadeIn 0.5s ease-out; }
.animate-card:nth-child(2) { animation-delay: 0.1s; }
.animate-card:nth-child(3) { animation-delay: 0.2s; }
.animate-card:nth-child(4) { animation-delay: 0.3s; }

/* Mobile loader scaling */
@media (max-width: 575.98px) {
  .loader-logo { width: 60px; height: 60px; border-radius: 16px; }
  .loader-logo i { font-size: 26px; }
  .loader-text { font-size: 14px; margin-top: 14px; letter-spacing: 1.5px; }
  .loader-spinner { width: 36px; height: 36px; margin-top: 12px; border-width: 2px; }
}

/* Dark mode toggle - gold accent */
.dark-toggle {
  border: 2px solid transparent;
  border-radius: 25px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
}
.dark-toggle:hover {
  border-color: #d4a843;
  background: rgba(212,168,67,0.08);
  color: #d4a843;
  box-shadow: 0 0 12px rgba(212,168,67,0.15);
}
.dark .dark-toggle {
  color: #f0ede5;
}
.dark .dark-toggle:hover {
  background: rgba(212,168,67,0.12);
  box-shadow: 0 0 16px rgba(212,168,67,0.25);
  color: #d4a843;
}

/* Dark mode: code elements */
.dark code { color: #d4a843; background: rgba(212,168,67,0.1); padding: 2px 6px; border-radius: 4px; }

/* Dark mode: text-muted bootstrap override */
.dark .text-muted { color: #888878 !important; }

/* Dark mode: Swal2 popup */
.dark .swal2-popup {
  background: var(--bg-card);
  color: var(--text-primary);
}
.dark .swal2-title { color: var(--text-primary); }
.dark .swal2-html-container { color: var(--text-secondary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1199.98px) {
  .stat-card { padding: 20px; }
  .stat-value { font-size: 24px; }
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); width: var(--sidebar-width); z-index: 1050; }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .sidebar-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 1045; }
  .app-topbar { padding: 0 16px; z-index: 1060; position: relative; }
  .app-content { padding: 20px; }
  .sidebar-toggle { z-index: 1065; position: relative; }
  .stat-card { padding: 18px 16px; gap: 14px; }
  .stat-value { font-size: 22px; }
  .stat-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
  .event-banner { height: 140px; }
  .contestant-photo { width: 56px; height: 56px; }
  .contestant-photo-lg { width: 120px; height: 120px; }
  .table-responsive { overflow-x: auto; }
  .topbar-left .breadcrumb { display: none; }
  .notif-dropdown { min-width: 280px; }
  .card-header { font-size: 15px; padding: 14px 16px; }
  h2 { font-size: 22px; }
}

@media (max-width: 767.98px) {
  .app-content { padding: 12px; }
  .app-topbar { padding: 0 10px; height: 56px; }
  .app-topbar .topbar-left, .app-topbar .topbar-right { gap: 6px; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .stat-label { font-size: 11px; }
  .card { border-radius: var(--radius); }
  .card-header { padding: 12px 14px; font-size: 14px; flex-wrap: wrap; gap: 8px; }
  .card-header > *:not(.btn) { /* allow text to wrap */ }
  .btn { padding: 8px 14px; font-size: 13px; border-radius: 6px; }
  .btn-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
  .profile-menu-btn { width: 36px; height: 36px; border-radius: 10px; }
  .profile-avatar { width: 32px; height: 32px; font-size: 13px; border-radius: 10px; }
  .event-banner { height: 120px; border-radius: var(--radius); }
  .contestant-photo { width: 48px; height: 48px; border-radius: 10px; }
  .contestant-photo-lg { width: 100px; height: 100px; border-radius: 18px; }
  .topbar-left .breadcrumb { display: none; }
  .app-footer { padding: 10px 12px; font-size: 11px; text-align: center; }
  .app-footer .float-end { float: none !important; display: block; }
  h2 { font-size: 20px; }
  h5 { font-size: 16px; }
  .table th, .table td { padding: 8px 10px; font-size: 12px; }
  .stat-card .stat-value { font-size: 18px; }
  .score-badge { padding: 4px 10px; font-size: 13px; min-width: 40px; }
  .rank-badge { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
  .rank-1 { font-size: 16px; }
  .rank-2 { font-size: 14px; }
  .rank-3 { font-size: 13px; }
  .modal-dialog { margin: 8px; }
  .modal-content { border-radius: var(--radius); }
  .form-control { padding: 8px 12px; font-size: 13px; }
  .form-select { padding: 8px 12px; font-size: 13px; }
  .form-label { font-size: 12px; margin-bottom: 4px; }
  .notif-dropdown { min-width: 260px; font-size: 13px; }
}

@media (max-width: 575.98px) {
  .app-content { padding: 8px; }
  .app-topbar { padding: 0 8px; height: 52px; }
  .topbar-left, .topbar-right { gap: 2px; }
  .btn-icon { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
  .stat-card { padding: 12px; flex-direction: column; text-align: center; gap: 8px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .btn { padding: 7px 12px; font-size: 12px; }
  .contestant-photo { width: 40px; height: 40px; border-radius: 8px; }
  .contestant-photo-lg { width: 80px; height: 80px; border-radius: 14px; }
  .event-banner { height: 100px; border-radius: var(--radius-sm); }
  .d-flex.justify-content-between { flex-direction: column; gap: 10px; }
  .d-flex.justify-content-between .btn { width: 100%; }
  h2 { font-size: 18px; }
  .card-header { font-size: 13px; flex-direction: column; gap: 8px; padding: 10px 12px; }
  .card-header > div:last-child { width: 100%; }
  .card-header .btn { width: 100%; }
  .dark-toggle { padding: 3px 8px; font-size: 12px; border-radius: 20px; }
  .profile-menu-btn { width: 30px; height: 30px; border-radius: 8px; }
  .profile-avatar { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
  .table th, .table td { padding: 6px 8px; font-size: 11px; }
  .table th { font-size: 10px; letter-spacing: 0.3px; }
  .topbar-avatar { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }
  .modal-dialog { margin: 4px; }
  .notif-dropdown { min-width: 230px; font-size: 12px; position: fixed; right: 4px; top: 52px; }
  .sidebar-nav .nav-link { padding: 10px 12px; font-size: 13px; border-radius: 10px; }
}

/* Eliminate DataTables per-page dropdowns and pagination controls (scroll-through experience) */
.dataTables_length,
.dataTables_paginate,
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_paginate {
  display: none !important;
}

div.dataTables_wrapper div.dataTables_info {
  display: none !important;
}

