/* ==========================================================================
   TEXAS LOTTERY THEME — Light mode professional + Casino realistic
   Texas flag colors: Navy #002868, Red #BF0A30, White, Gold #D4AF37
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Bebas+Neue&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --tx-navy: #002868;
  --tx-navy-dark: #001a4d;
  --tx-navy-light: #1e3a8a;
  --tx-red: #BF0A30;
  --tx-red-dark: #7f1d1d;
  --tx-red-light: #f87171;
  --tx-gold: #D4AF37;
  --tx-gold-soft: #fef3c7;
  --tx-white: #ffffff;
  --tx-cream: #fafaf7;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,40,104,0.06);
  --shadow-md: 0 4px 12px rgba(0,40,104,0.08);
  --shadow-lg: 0 8px 24px rgba(0,40,104,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--tx-navy); text-decoration: none; transition: color .15s; }
a:hover { color: var(--tx-red); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== NAVBAR ===== */
.navbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.navbar-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.navbar-logo img { width: 100%; height: 100%; object-fit: contain; }
.navbar-brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx-navy);
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.1;
}
.navbar-brand-text p {
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin: 2px 0 0;
  font-weight: 600;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  padding: 6px 0;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--tx-navy); }
.nav-link.active {
  color: var(--tx-navy);
  border-bottom: 2px solid var(--tx-red);
}
.nav-admin-btn {
  background: var(--tx-navy);
  color: white !important;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border-bottom: none !important;
}
.nav-admin-btn:hover { background: var(--tx-navy-dark); color: white !important; }

/* ===== HERO PARALLAX ===== */
.hero {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tx-navy) 0%, var(--tx-red) 100%);
}
.hero.compact { height: 200px; }
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}
.hero-bg.active { opacity: 1; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,40,104,0.85) 0%, rgba(191,10,48,0.65) 100%);
}
.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 0 24px;
}
.hero-decoration-top, .hero-decoration-bottom {
  position: absolute;
  left: 0; right: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 8px;
  text-align: center;
  pointer-events: none;
}
.hero-decoration-top { top: 20px; }
.hero-decoration-bottom { bottom: 20px; }
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 5px;
  opacity: 0.9;
  margin-bottom: 10px;
  font-weight: 600;
}
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  letter-spacing: 4px;
  margin: 0 0 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
  line-height: 1;
}
.hero.compact .hero-title { font-size: 42px; }
.hero-subtitle {
  font-size: 14px;
  opacity: 0.85;
  font-style: italic;
  margin-bottom: 18px;
}
.hero-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 12px;
  font-weight: 500;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(74,222,128,0); }
}
.hero-indicators {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.hero-indicator {
  width: 24px; height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.hero-indicator.active { background: white; width: 36px; }

/* ===== TAB NAVIGATION ===== */
.tab-nav-wrapper {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 18px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tab-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tab-pill {
  background: #1e293b;
  color: white;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.tab-pill:hover { background: #0f172a; transform: translateY(-1px); color: white; }
.tab-pill.active { background: var(--tx-navy); }
.tab-date { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ===== COUNTDOWN BAR ===== */
.countdown-bar {
  background: linear-gradient(90deg, #fef2f2 0%, #fff7ed 50%, #fef2f2 100%);
  border-bottom: 1px dashed #fecaca;
  border-top: 1px solid #fee2e2;
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.countdown-left { display: flex; align-items: center; gap: 12px; }
.countdown-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--tx-red);
  box-shadow: 0 0 8px var(--tx-red);
  animation: pulse-red 1.5s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(191,10,48,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(191,10,48,0); }
}
.countdown-label {
  font-size: 11px;
  color: var(--tx-red-dark);
  letter-spacing: 2px;
  font-weight: 700;
}
.countdown-right { display: flex; align-items: center; gap: 12px; }
.countdown-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--tx-red);
  letter-spacing: 3px;
}
.countdown-secondary { font-size: 10px; color: var(--text-secondary); letter-spacing: 1px; }

/* ===== MAIN CONTENT ===== */
.main {
  padding: 28px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ===== SESSIONS GRID 2x2 ===== */
.sessions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.session-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.session-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.session-header {
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid;
}
.session-header.morning {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border-bottom-color: #fcd34d;
  color: #92400e;
}
.session-header.day {
  background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
  border-bottom-color: #93c5fd;
  color: #1e40af;
}
.session-header.evening {
  background: linear-gradient(90deg, #fed7aa 0%, #fdba74 100%);
  border-bottom-color: #fb923c;
  color: #9a3412;
}
.session-header.night {
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
  border-bottom-color: #334155;
  color: #fbbf24;
}
.session-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-status { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.session-status.completed { color: #16a34a; }
.session-status.upcoming { color: #fb923c; }
.session-body { padding: 20px 22px; }
.session-heading {
  font-size: 19px;
  font-weight: 600;
  color: var(--tx-navy);
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.session-date {
  font-size: 12px;
  color: var(--tx-navy-light);
  margin: 6px 0 16px;
  font-weight: 600;
}

/* ===== 3D LOTTERY BALLS ===== */
.balls-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ball {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  position: relative;
  flex-shrink: 0;
}
.ball::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 14px;
  width: 14px;
  height: 9px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  filter: blur(2.5px);
  pointer-events: none;
}
.ball.red {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, var(--tx-red-light) 30%, var(--tx-red) 70%, var(--tx-red-dark) 100%);
  color: white;
  box-shadow: inset -3px -5px 10px rgba(0,0,0,0.35), 0 4px 10px rgba(191,10,48,0.35);
}
.ball.white {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f1f5f9 30%, #cbd5e1 70%, #94a3b8 100%);
  color: var(--tx-navy);
  box-shadow: inset -3px -5px 10px rgba(0,0,0,0.18), 0 4px 10px rgba(0,40,104,0.2);
}
.ball.blue {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #60a5fa 30%, var(--tx-navy) 70%, var(--tx-navy-dark) 100%);
  color: white;
  box-shadow: inset -3px -5px 10px rgba(0,0,0,0.4), 0 4px 10px rgba(0,40,104,0.35);
}
.ball.placeholder {
  background: #f8fafc;
  border: 2px dashed var(--border-strong);
  color: var(--border-strong);
  box-shadow: none;
  font-size: 28px;
}
.ball.placeholder::before { display: none; }
.ball.small { width: 32px; height: 32px; font-size: 14px; }
.ball.small::before { top: 5px; left: 9px; width: 8px; height: 5px; filter: blur(1.5px); }
.ball.tiny { width: 26px; height: 26px; font-size: 12px; }
.ball.tiny::before { top: 4px; left: 7px; width: 6px; height: 4px; filter: blur(1px); }

.session-mini-countdown { margin-left: auto; text-align: right; }
.session-mini-countdown .label { font-size: 10px; color: var(--text-tertiary); letter-spacing: 1px; }
.session-mini-countdown .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--tx-red);
  margin-top: 2px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.section-header-text .eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--tx-red);
  font-weight: 700;
  margin-bottom: 4px;
}
.section-header-text .title {
  font-size: 22px;
  font-weight: 700;
  color: var(--tx-navy);
  margin: 0;
}
.btn-link {
  font-size: 12px;
  color: var(--tx-navy);
  border: 1px solid var(--border-strong);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  background: white;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}
.btn-link:hover { background: var(--tx-navy); color: white; border-color: var(--tx-navy); }
.btn-link:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== HISTORY TABLE ===== */
.history-table {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.history-row {
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 130px 100px 1fr 80px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.history-row:last-child { border-bottom: none; }
.history-row:not(.head):hover { background: #f8fafc; }
.history-row.head {
  background: var(--tx-navy);
  color: white;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  padding: 10px 20px;
}
.history-cell { font-size: 12px; color: var(--text-secondary); }
.session-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  display: inline-block;
}
.session-badge.morning { background: #fef3c7; color: #92400e; }
.session-badge.day { background: #dbeafe; color: #1e40af; }
.session-badge.evening { background: #fed7aa; color: #9a3412; }
.session-badge.night { background: #1e293b; color: #fbbf24; }

/* ===== FILTER BAR ===== */
.filter-bar {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 11px; color: var(--text-secondary); font-weight: 700; letter-spacing: 0.5px; }
.filter-bar select, .filter-bar input {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  background: white;
}
.filter-bar select:focus, .filter-bar input:focus {
  outline: none;
  border-color: var(--tx-navy);
  box-shadow: 0 0 0 3px rgba(0,40,104,0.1);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.pagination .page-link, .pagination span {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--tx-navy);
  font-weight: 600;
  text-decoration: none;
}
.pagination .active { background: var(--tx-navy); color: white; border-color: var(--tx-navy); }
.pagination .disabled { opacity: 0.4; }

/* ===== CONTENT PAGES (How to Play, About) ===== */
.content-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px;
}
.content-page h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  letter-spacing: 2px;
  color: var(--tx-navy);
  margin: 0 0 12px;
}
.content-page h2 {
  font-size: 22px;
  color: var(--tx-navy);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.content-page h3 {
  font-size: 17px;
  color: var(--tx-navy);
  margin: 24px 0 8px;
}
.content-page p { margin: 0 0 14px; line-height: 1.75; color: var(--text-secondary); }
.content-page ul, .content-page ol { margin: 12px 0 16px 24px; }
.content-page li { margin-bottom: 8px; line-height: 1.7; color: var(--text-secondary); }
.content-page .lead {
  font-size: 17px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 24px;
}
.content-illustration {
  margin: 24px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.content-illustration img { width: 100%; }

.session-times-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.session-time-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border-top: 3px solid;
}
.session-time-card.morning { border-top-color: #fcd34d; }
.session-time-card.day { border-top-color: #60a5fa; }
.session-time-card.evening { border-top-color: #fb923c; }
.session-time-card.night { border-top-color: var(--tx-navy); }
.session-time-card .session-icon { font-size: 28px; margin-bottom: 6px; }
.session-time-card .session-time-name {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--tx-navy);
  margin-bottom: 4px;
}
.session-time-card .session-time-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--tx-navy);
  color: white;
  padding: 36px 32px 16px;
  margin-top: 48px;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/img/decorations/section-pattern.png');
  background-size: 200px;
  opacity: 0.15;
  pointer-events: none;
}
.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 28px;
  position: relative;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-logo { max-width: 280px; }
.footer-logo img { width: 100%; height: auto; filter: brightness(1.05); }
.footer-brand p {
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.7;
  max-width: 320px;
}
.footer-col h4 {
  font-size: 11px;
  letter-spacing: 2px;
  margin: 0 0 12px;
  color: var(--tx-gold);
  font-weight: 700;
}
.footer-col a {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  position: relative;
}
.footer-secret-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  margin: 0 4px;
  cursor: pointer;
  vertical-align: middle;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  border-left: 4px solid;
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #16a34a; }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border-color: var(--tx-red); }
.alert-info { background: #eff6ff; color: var(--tx-navy); border-color: var(--tx-navy); }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--tx-navy);
  color: white;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 18px;
  text-decoration: none;
}
.admin-sidebar .brand-icon {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 6px;
  padding: 4px;
  flex-shrink: 0;
}
.admin-sidebar .brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.admin-sidebar .brand-text h2 {
  font-size: 13px;
  margin: 0;
  letter-spacing: 0.5px;
  color: white;
  font-weight: 700;
}
.admin-sidebar .brand-text p {
  font-size: 9px;
  opacity: 0.6;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.admin-sidebar .menu-section {
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.5;
  margin: 16px 0 8px;
  padding-left: 12px;
  font-weight: 700;
}
.admin-sidebar a, .admin-sidebar button.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2px;
  transition: all 0.15s;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}
.admin-sidebar a:hover, .admin-sidebar button.menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}
.admin-sidebar a.active {
  background: var(--tx-red);
  color: white;
}
.admin-sidebar a .icon, .admin-sidebar button .icon {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}
.admin-main {
  background: var(--bg-page);
  padding: 0 0 32px;
  overflow-y: auto;
}
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.admin-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--tx-navy);
  margin: 0;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.admin-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tx-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.admin-content { padding: 24px 32px; }

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-left: 4px solid;
  box-shadow: var(--shadow-sm);
}
.stat-card.navy { border-left-color: var(--tx-navy); }
.stat-card.red { border-left-color: var(--tx-red); }
.stat-card.gold { border-left-color: var(--tx-gold); }
.stat-card.green { border-left-color: #16a34a; }
.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  font-weight: 700;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--tx-navy);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.stat-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ===== ADMIN CARD ===== */
.admin-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.admin-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx-navy);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-action {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.quick-action:hover {
  border-color: var(--tx-navy);
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.quick-action-icon { font-size: 22px; margin-bottom: 4px; }
.quick-action-label {
  font-size: 11px;
  color: var(--tx-navy);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--tx-navy);
  box-shadow: 0 0 0 3px rgba(0,40,104,0.1);
}
.form-input.numeric {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  font-weight: 700;
}
.form-help {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--tx-red);
  margin-top: 4px;
  font-weight: 500;
}

.btn-primary, .btn-danger, .btn-secondary {
  background: var(--tx-navy);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--tx-navy-dark); transform: translateY(-1px); color: white; }
.btn-danger { background: var(--tx-red); }
.btn-danger:hover { background: var(--tx-red-dark); color: white; }
.btn-secondary { background: white; color: var(--tx-navy); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--bg-page); border-color: var(--tx-navy); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-block { width: 100%; }

/* ===== LOGIN PAGE ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tx-navy) 0%, var(--tx-red) 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.login-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
}
.login-card {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  border-top: 4px solid var(--tx-red);
}
.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: block;
}
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--tx-navy);
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.login-subtitle {
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 600;
}

/* ===== TABLE ===== */
.table-wrapper {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  background: var(--tx-navy);
  color: white;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

.role-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.role-badge.super_admin { background: #fef3c7; color: #92400e; }
.role-badge.admin { background: #dbeafe; color: var(--tx-navy); }
.role-badge.viewer { background: #f1f5f9; color: var(--text-secondary); }

.action-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.action-badge.CREATE { background: #f0fdf4; color: #166534; }
.action-badge.UPDATE { background: #eff6ff; color: var(--tx-navy); }
.action-badge.DELETE { background: #fef2f2; color: var(--tx-red); }
.action-badge.LOGIN { background: #fef3c7; color: #92400e; }
.action-badge.LOGOUT { background: #f1f5f9; color: var(--text-secondary); }

/* ===== PERMISSION MATRIX ===== */
.permission-matrix {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.permission-module {
  border-bottom: 1px solid var(--border);
}
.permission-module:last-child { border-bottom: none; }
.permission-module-header {
  background: #f8fafc;
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--tx-navy);
  border-bottom: 1px solid var(--border);
}
.permission-list {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background 0.1s;
}
.permission-item:hover { background: #f8fafc; }
.permission-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--tx-navy);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx-navy);
  margin-bottom: 4px;
}
.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .navbar { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .navbar-nav { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-link { font-size: 12px; }
  .nav-admin-btn { padding: 6px 12px; font-size: 11px; }
  .navbar-brand-text h1 { font-size: 14px; }

  .hero { height: 280px; }
  .hero-title { font-size: 42px; letter-spacing: 2px; }

  .main { padding: 20px 16px; }
  .sessions-grid { grid-template-columns: 1fr; gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .session-times-grid { grid-template-columns: 1fr 1fr; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -240px;
    z-index: 200;
    transition: left 0.3s;
    width: 240px;
  }
  .admin-sidebar.open { left: 0; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 12px 16px; }

  .history-row { grid-template-columns: 1fr 100px; gap: 8px; font-size: 11px; }
  .history-row > .balls-row { grid-column: 1 / -1; justify-content: center; }
  .history-row.head > span:nth-child(3),
  .history-row.head > span:nth-child(4) { display: none; }
  .history-row > a { display: none; }

  .tab-nav { gap: 6px; width: 100%; }
  .tab-pill { padding: 8px 14px; font-size: 10px; flex: 1; min-width: 80px; text-align: center; }

  .ball { width: 48px; height: 48px; font-size: 22px; }
  .session-heading { font-size: 16px; }
  .countdown-bar { padding: 10px 16px; flex-direction: column; gap: 8px; align-items: flex-start; }

  .filter-bar { gap: 8px; }
  .filter-bar select, .filter-bar input { font-size: 11px; }

  .permission-list { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 10px 12px; }
}
@media (max-width: 600px) {
  .hero { height: 240px; }
  .hero-title { font-size: 32px; }
  .ball { width: 44px; height: 44px; font-size: 20px; }
  .session-times-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 24px; }
}

/* Mobile hamburger */
.admin-mobile-toggle {
  display: none;
  background: var(--tx-navy);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
@media (max-width: 900px) {
  .admin-mobile-toggle { display: inline-flex; align-items: center; gap: 6px; }
}
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}
.admin-overlay.show { display: block; }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.hidden { display: none !important; }
