@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap");

/* ── DESIGN TOKENS ────────────────────────────────── */
:root {
  --bg: #05080f;
  --surface: #0b1120;
  --surface-2: #111928;
  --surface-3: #162035;
  --surface-hover: #1a2847;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-active: rgba(59, 130, 246, 0.25);
  --accent: #005bed;
  --accent-2: #1880ff;
  --accent-3: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --accent-dim: rgba(59, 130, 246, 0.08);
  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.1);
  --danger: #f43f5e;
  --danger-dim: rgba(244, 63, 94, 0.1);
  --gold: #f59e0b;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #4b6178;
  --r: 16px;
  --r-sm: 10px;
  --r-lg: 24px;
  --duration-fast: 0.15s;
  --duration-norm: 0.3s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Responsive card max-width */
  --card-width: 480px;
}

/* Darken scrollbar for better visibility on dark bg */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── RESET ────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent text size inflate on mobile rotation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* ── GRADIENT OVERLAY ─────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 20% 0%,
      rgba(59, 130, 246, 0.12) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 50% 50% at 80% 100%,
      rgba(16, 185, 129, 0.08) 0%,
      transparent 60%
    );
  pointer-events: none;
  animation: gradientShift 12s ease-in-out infinite;
}

/* ── KEYFRAMES ────────────────────────────────────── */
@keyframes gradientShift {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulseBlue {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(0, 91, 237, 0.3);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(0, 91, 237, 0.5),
      inset 0 0 0 3px rgba(0, 91, 237, 0.15);
  }
}
@keyframes pulseGreen {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(16, 185, 129, 0.5),
      inset 0 0 0 3px rgba(16, 185, 129, 0.15);
  }
}
@keyframes pulseGold {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(245, 158, 11, 0.5),
      inset 0 0 0 3px rgba(245, 158, 11, 0.15);
  }
}
@keyframes pulsePurple {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.3);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(167, 139, 250, 0.5),
      inset 0 0 0 3px rgba(167, 139, 250, 0.15);
  }
}

/* ── ANIMATION UTILITIES ──────────────────────────── */
.anim-rise {
  animation: rise 0.4s var(--ease) both;
}
.anim-fade {
  animation: fadeIn 0.3s ease both;
}
.anim-slideup {
  animation: slideUp 0.35s var(--ease) both;
}

/* ── TICKER BAR ───────────────────────────────────── */
.ticker-bar {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ticker-tag {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-viewport {
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  animation: ticker 28s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  padding: 10px 0;
  font-size: 0.78rem;
  color: var(--text-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ticker-item::after {
  content: "—";
  margin: 0 22px;
  color: var(--accent);
  opacity: 0.4;
}

/* ── MAIN CARD ────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(24px, 5vw, 40px) clamp(20px, 5vw, 36px);
  width: min(var(--card-width), calc(100vw - 24px));
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 40px 80px rgba(0, 0, 0, 0.6);
  animation: rise 0.45s var(--ease) both;
  backdrop-filter: blur(10px);
}

/* ── CARD HEADER ──────────────────────────────────── */
.card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.college-logo {
  height: clamp(70px, 14vw, 100px);
  width: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
  margin-bottom: 4px;
  animation: float 3s ease-in-out infinite;
  flex-shrink: 0;
}

.college-name {
  font-weight: 800;
  font-size: clamp(0.78rem, 2.5vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text), var(--text-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.batch-label {
  font-size: clamp(0.65rem, 2vw, 0.78rem);
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Space Mono", monospace;
  font-weight: 600;
}

/* ── DIVIDER ──────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border) 10%,
    var(--border) 90%,
    transparent
  );
  margin: 20px 0;
}

/* ── STATUS BADGE ─────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: var(--accent-dim);
  color: var(--accent-2);
  transition: all var(--duration-norm);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  animation: slideDown 0.4s var(--ease) both;
}
.status-badge.offline {
  border-color: rgba(244, 63, 94, 0.3);
  background: var(--danger-dim);
  color: #fb7185;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.1);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

/* ── BACK BUTTON ──────────────────────────────────── */
.back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--duration-fast);
  cursor: pointer;
  z-index: 2;
}
.back-btn:hover {
  color: var(--accent-2);
  border-color: var(--border-active);
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

/* ── FORM FIELDS ──────────────────────────────────── */
.field {
  text-align: left;
  margin-top: 16px;
}
.field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-family: "Space Mono", monospace;
}
.req {
  color: var(--danger);
  font-weight: 800;
}
.opt {
  color: var(--text-3);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-size: 0.9rem;
  transition: all var(--duration-norm);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder {
  color: var(--text-3);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
select.input option {
  background: var(--surface-2);
  color: var(--text);
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  width: 100%;
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: center;
  transition: all var(--duration-norm);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
  position: relative;
  overflow: hidden;
  /* prevent tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s infinite;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--border-active);
  background: var(--accent-dim);
  color: var(--accent-2);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}
.btn-sm {
  padding: 9px 16px;
  font-size: 0.8rem;
  margin-top: 12px;
}

/* ── BUTTON COLOR VARIANTS ────────────────────────── */
.btn-register {
  background: linear-gradient(135deg, #005bed 0%, #1880ff 100%);
  box-shadow: 0 6px 20px rgba(0, 91, 237, 0.35);
  animation: pulseBlue 2.5s ease-in-out infinite;
  border: none;
}
.btn-register:hover {
  box-shadow: 0 10px 35px rgba(0, 91, 237, 0.5);
  animation: none;
}

.btn-vote {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  animation: pulseGreen 2.5s ease-in-out infinite;
  border: none;
}
.btn-vote:hover {
  box-shadow: 0 10px 35px rgba(16, 185, 129, 0.5);
  animation: none;
}

.btn-results {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  animation: pulseGold 2.5s ease-in-out infinite;
  border: none;
}
.btn-results:hover {
  box-shadow: 0 10px 35px rgba(245, 158, 11, 0.5);
  animation: none;
}

.btn-admin {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.35);
  animation: pulsePurple 2.5s ease-in-out infinite;
  border: none;
}
.btn-admin:hover {
  box-shadow: 0 10px 35px rgba(167, 139, 250, 0.5);
  animation: none;
}

/* Icon slide on hover for action btns */
.btn-register i,
.btn-vote i,
.btn-results i,
.btn-admin i {
  transition: transform var(--duration-norm) var(--ease);
  display: inline-block;
}
.btn-register:hover i,
.btn-vote:hover i,
.btn-results:hover i,
.btn-admin:hover i {
  transform: translateX(4px);
}

/* ── NOTICE / NOTIFICATIONS ───────────────────────── */
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  text-align: left;
  display: none;
  animation: slideUp 0.3s var(--ease) both;
  line-height: 1.5;
  border-left: 4px solid;
}
.notice-success {
  background: var(--success-dim);
  border-color: var(--success);
  color: #6ee7b7;
}
.notice-error {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: #fda4af;
}

/* ── HOME GRID ────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  text-align: center;
  color: inherit;
  transition: all var(--duration-norm);
  cursor: pointer;
  animation: slideUp 0.4s var(--ease) both;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-norm);
  pointer-events: none;
}
.action-card:nth-child(1) {
  animation-delay: 0.05s;
}
.action-card:nth-child(2) {
  animation-delay: 0.12s;
}
.action-card:nth-child(3) {
  animation-delay: 0.19s;
}
.action-card:nth-child(4) {
  animation-delay: 0.26s;
}
.action-card:hover {
  border-color: var(--border-active);
  background: var(--surface-3);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.action-card:hover::before {
  opacity: 1;
}

.action-icon {
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--accent);
  margin-bottom: 4px;
  transition: transform var(--duration-norm);
}
.action-card:hover .action-icon {
  transform: scale(1.1) rotate(5deg);
}

.action-card h3 {
  font-size: clamp(0.82rem, 2.5vw, 0.95rem);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.action-card p {
  font-size: clamp(0.68rem, 2vw, 0.76rem);
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}
.action-card .btn {
  margin-top: 10px;
  font-size: 0.76rem;
  padding: 8px 12px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── STATUS PILL ──────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: 0.63rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
  transition: all var(--duration-norm);
}
.status-pill.open {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}
.status-pill.closed {
  background: var(--danger-dim);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fb7185;
}
.status-pill.loading {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text-3);
}
.status-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.5s ease-in-out infinite;
}

/* ── CANDIDATE GRID ───────────────────────────────── */
.candidate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.candidate-card {
  border: 1.5px solid var(--border-2);
  padding: 18px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--surface-2);
  text-align: left;
  transition: all var(--duration-norm);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.candidate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-norm);
  pointer-events: none;
}
.candidate-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}
.candidate-card:hover::before {
  opacity: 1;
}
.candidate-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow:
    0 0 0 2px var(--accent-dim),
    0 0 20px rgba(59, 130, 246, 0.3);
}
.candidate-card.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  animation: slideDown 0.3s var(--ease);
}
.candidate-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.candidate-card p {
  font-size: 0.74rem;
  color: var(--text-2);
  line-height: 1.4;
  margin: 0;
}

/* ── RESULTS GRID ─────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.result-card {
  border: 1px solid var(--border);
  padding: 20px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  text-align: left;
  animation: slideUp 0.4s var(--ease) both;
  transition: all var(--duration-norm);
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-norm);
  pointer-events: none;
}
.result-card:hover {
  border-color: var(--border-active);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}
.result-card:hover::before {
  opacity: 1;
}
.result-card:first-child {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.06);
}
.result-card .cname {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}
.vote-num {
  font-family: "Space Mono", monospace;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.vote-pct {
  font-size: 0.74rem;
  color: var(--text-3);
  margin-top: 4px;
}
.results-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.results-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.8s var(--ease);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}
.result-card:first-child .results-bar-fill {
  background: linear-gradient(90deg, var(--gold), #fbbf24);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.results-total {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.results-total span {
  color: var(--accent-2);
  font-weight: 800;
}

/* ── SECTION LABEL ────────────────────────────────── */
.section-label {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  margin-top: 20px;
  margin-bottom: 4px;
  font-weight: 700;
}

/* ── SKELETON LOADER ──────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 14px;
  margin: 8px 0;
}

/* ── STATUS BANNERS ───────────────────────────────── */
.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 8px;
  animation: slideUp 0.3s var(--ease) both;
  border-left: 4px solid;
}
.status-banner.closed {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: #fda4af;
}
.status-banner.warning {
  background: var(--warning-dim);
  border-color: var(--warning);
  color: #fcd34d;
}
.status-banner.info {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-2);
}
.status-banner .banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.status-banner strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.87rem;
}

/* ── PAGE LOADER ──────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 20px;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--border-2);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}
.loader-text {
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--accent-2);
  text-transform: uppercase;
}

/* ── SUCCESS / CLOSED STATES ──────────────────────── */
.success-state,
.closed-state {
  padding: 28px 0 10px;
  text-align: center;
  animation: slideUp 0.4s var(--ease) both;
}
.success-icon,
.closed-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
}
.success-state h3,
.closed-state h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.success-state p,
.closed-state p {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── INSTRUCTIONS MODAL ───────────────────────────── */
.instr-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease both;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
}
.modal-backdrop {
  z-index: 200;
}

.instr-modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px);
  width: min(460px, 100%);
  text-align: left;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  animation: rise 0.35s var(--ease) both;
  max-height: 90vh;
  overflow-y: auto;
}
.instr-modal h2 {
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
  background: linear-gradient(135deg, var(--text), var(--text-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.instr-modal .instr-sub {
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 22px;
  font-family: "Space Mono", monospace;
}

.instr-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}
.instr-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.instr-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.instr-step-body strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.instr-step-body p {
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

.instr-rules {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.instr-rules .rule-title {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 700;
}
.instr-rule {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 7px;
}
.instr-rule:last-child {
  margin-bottom: 0;
}
.instr-rule i {
  color: var(--accent-2);
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 0.72rem;
}

/* ── CONFIRM MODAL ────────────────────────────────── */
.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 28px) clamp(16px, 4vw, 24px);
  width: min(380px, 100%);
  text-align: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  animation: rise 0.25s var(--ease) both;
}
.modal h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.modal p {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 16px;
}
.modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 18px;
}
.modal-chip {
  background: var(--accent-dim);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-2);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn {
  margin-top: 0;
  flex: 1;
}

/* ── ADMIN LAYOUT ─────────────────────────────────── */
.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s var(--ease);
  z-index: 630;
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .s-title {
  font-family: "Space Mono", monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 2px;
}
.sidebar-logo .s-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: "Space Mono", monospace;
}

.nav-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.nav-label {
  font-family: "Space Mono", monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  transition:
    background 0.15s,
    color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-2);
  font-weight: 600;
}
.nav-item.active i {
  opacity: 1;
}
.nav-item.danger {
  color: #fb7185;
}
.nav-item.danger:hover {
  background: var(--danger-dim);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.admin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-3);
  margin-bottom: 10px;
}
.admin-badge i {
  color: var(--accent);
}

.admin-main {
  flex: 1;
  padding: 32px 36px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.page-sub {
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: "Space Mono", monospace;
  margin-bottom: 26px;
}

/* ── STAT CARDS ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 14px;
  animation: slideUp 0.4s var(--ease) both;
}
.stat-card:nth-child(1) {
  animation-delay: 0.04s;
}
.stat-card:nth-child(2) {
  animation-delay: 0.08s;
}
.stat-card:nth-child(3) {
  animation-delay: 0.12s;
}
.stat-card:nth-child(4) {
  animation-delay: 0.16s;
}
.stat-card .sc-num {
  font-family: "Space Mono", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .sc-lbl {
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Space Mono", monospace;
}
.stat-card.green .sc-num {
  color: var(--success);
}
.stat-card.gold .sc-num {
  color: var(--gold);
}
.stat-card.red .sc-num {
  color: #fb7185;
}

/* ── PANEL ────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 20px;
  animation: slideUp 0.4s var(--ease) both;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title i {
  color: var(--accent);
  font-size: 0.78rem;
}
.panel-body {
  padding: 18px;
}

/* ── TOGGLE SWITCHES ──────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.toggle-row:first-child {
  padding-top: 0;
}
.toggle-info strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.toggle-info p {
  font-size: 0.74rem;
  color: var(--text-3);
  line-height: 1.4;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  transition: 0.25s;
}
.toggle-track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  left: 3px;
  top: 3px;
  transition: 0.25s var(--ease);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--success);
  border-color: rgba(16, 185, 129, 0.4);
}
.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(20px);
  background: #fff;
}

/* ── TABLE ────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-table th {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: var(--surface-2);
}
.data-table .roll-cell {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  color: var(--text);
}

/* ── TABLE WRAPPER (horizontal scroll on small screens) */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── BADGES ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: "Space Mono", monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge.gray {
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.badge.blue {
  background: var(--accent-dim);
  color: var(--accent-2);
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.badge.red {
  background: var(--danger-dim);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.badge.gold {
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ── TOOLBAR ──────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-size: 0.82rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-input::placeholder {
  color: var(--text-3);
}
.filter-select {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.filter-select option {
  background: var(--surface-2);
}

/* ── ICON BUTTONS ─────────────────────────────────── */
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent-2);
  background: var(--accent-dim);
}
.icon-btn.red:hover {
  border-color: rgba(244, 63, 94, 0.35);
  color: #fb7185;
  background: var(--danger-dim);
}
.icon-btn.green:hover {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--success);
  background: var(--success-dim);
}

/* ── XS BUTTONS ───────────────────────────────────── */
.btn-xs {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.btn-xs:hover {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent-2);
  background: var(--accent-dim);
}
.btn-xs.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-xs.primary:hover {
  opacity: 0.9;
}
.btn-xs.danger {
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}
.btn-xs.danger:hover {
  background: var(--danger-dim);
}

/* ── PAGINATION ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.76rem;
  font-family: "Space Mono", monospace;
  color: var(--text-3);
  flex-wrap: wrap;
}
.page-btn {
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: "Space Mono", monospace;
}
.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}
.page-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-2);
}

/* ── INLINE EDIT FORM ─────────────────────────────── */
.inline-form {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 16px;
  margin-bottom: 14px;
  animation: slideUp 0.3s var(--ease) both;
}
.inline-form .form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.inline-form .form-row:last-child {
  margin-bottom: 0;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}
.form-field label {
  font-size: 0.62rem;
  font-family: "Space Mono", monospace;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-family: "Outfit", "Baloo Da 2", sans-serif;
  font-size: 0.82rem;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.form-field textarea {
  resize: vertical;
  min-height: 60px;
}
.form-field select option {
  background: var(--surface-2);
}

/* ── CONFIG FIELDS ────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.config-field label {
  font-size: 0.62rem;
  font-family: "Space Mono", monospace;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── LOGIN SCREEN ─────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 70%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.4s ease both;
}
#login-screen .card {
  width: min(480px, calc(100vw - 28px));
  animation: rise 0.5s var(--ease) both;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#login-screen .card-header {
  width: 100%;
}

.login-card {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 24px 20px;
  margin-top: 16px;
  animation: slideUp 0.4s var(--ease) both;
  animation-delay: 0.1s;
}
.login-card .field {
  margin-top: 14px;
}
.login-card .field:first-of-type {
  margin-top: 0;
}

#login-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}
#login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}
#login-btn:disabled {
  opacity: 0.6;
}

/* ── MOBILE MENU BUTTON ───────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 650;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-active);
}

/* ── SIDEBAR BACKDROP ─────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 620;
  background: rgba(0, 0, 0, 0.55);
  animation: fadeIn 0.25s ease both;
}
.sidebar-backdrop.active {
  display: block;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════════ */

/* ── TABLET (≤ 900px) ─────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-main {
    padding: 24px 20px;
  }
}

/* ── MOBILE MENU (≤ 768px) ────────────────────────── */
@media (max-width: 768px) {
  body.admin-page {
    align-items: stretch;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }
  .sidebar.active {
    transform: translateX(0);
  }

  /* Push content down so hamburger doesn't overlap page title */
  .admin-main {
    padding: 20px 16px;
    padding-top: 68px;
  }
  .config-grid {
    grid-template-columns: 1fr;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Login screen */
  #login-screen {
    padding: 16px;
  }
  #login-screen .card {
    padding: 28px 18px 24px;
  }
  .login-card {
    padding: 18px 14px;
  }

  /* Public cards */
  .card {
    margin: 28px auto;
  }
}

/* ── SMALL MOBILE (≤ 480px) ───────────────────────── */
@media (max-width: 480px) {
  .card {
    margin: 16px auto;
    border-radius: var(--r);
  }

  /* Home grid: 2 columns but tighter */
  .home-grid {
    gap: 8px;
  }
  .action-card {
    padding: 16px 10px 14px;
    gap: 6px;
  }
  .action-icon {
    font-size: 1.5rem;
  }
  .action-card h3 {
    font-size: 0.82rem;
  }
  .action-card p {
    font-size: 0.66rem;
  }
  .action-card .btn {
    font-size: 0.7rem;
    padding: 7px 8px;
  }

  /* Candidate / results grids */
  .candidate-grid {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }

  /* Admin */
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    top: 12px;
    left: 12px;
  }
  .sidebar {
    width: 260px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-main {
    padding: 14px;
    padding-top: 60px;
  }
  .toolbar {
    flex-direction: column;
  }
  .search-input {
    min-width: auto;
    width: 100%;
  }
  .filter-select {
    width: 100%;
  }
  .data-table {
    font-size: 0.73rem;
  }
  .data-table th,
  .data-table td {
    padding: 6px 8px;
  }
  .page-title {
    font-size: 1rem;
  }
  .page-sub {
    font-size: 0.7rem;
  }

  /* Modals full-width on tiny screens */
  .instr-modal,
  .modal {
    width: 100%;
    border-radius: var(--r);
  }

  /* Login */
  #login-screen .card {
    width: 100%;
    padding: 20px 14px 18px;
  }
  .login-card {
    padding: 14px 12px;
  }

  /* Ticker shrink */
  .ticker-tag {
    padding: 8px 12px;
    font-size: 0.6rem;
  }
  .ticker-item {
    font-size: 0.72rem;
  }
}

/* ── VERY SMALL (≤ 360px) ─────────────────────────── */
@media (max-width: 360px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .action-card {
    padding: 16px 14px;
  }
  .action-icon {
    font-size: 1.8rem;
  }
  .action-card h3 {
    font-size: 0.9rem;
  }
}

/* ── LANDSCAPE MOBILE ─────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .college-logo {
    height: 56px;
    width: auto;
  }
  .card {
    margin: 10px auto;
  }
  .card-header {
    gap: 4px;
    margin-bottom: 4px;
  }
  .divider {
    margin: 12px 0;
  }
}

/* ── PRINT ────────────────────────────────────────── */
@media print {
  body::before,
  .ticker-bar,
  .back-btn,
  #page-loader,
  .mobile-menu-btn {
    display: none !important;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .sidebar {
    display: none;
  }
  .admin-main {
    padding: 0;
  }
}
