/* ════════════════════════════════════════════════════════════
   admin.css  |  Organiser Dashboard Styles
   ════════════════════════════════════════════════════════════ */

/* ── Admin body layout ── */
.admin-body { overflow: hidden; }

/* ════════════════════════════════
   LOGIN GATE
════════════════════════════════ */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2.8rem 2.5rem;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeUp 0.55s ease;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 1rem 0 0.35rem;
}
.login-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}
.login-card .field-group { text-align: left; }

/* ════════════════════════════════
   DASHBOARD LAYOUT
════════════════════════════════ */
.admin-dash {
  display: none;
  height: 100vh;
  overflow: hidden;
  animation: fadeIn 0.4s ease;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: rgba(8,12,24,0.9);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.2rem;
  gap: 0;
  backdrop-filter: blur(16px);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 2rem;
  flex: 1;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.side-link:hover { background: rgba(201,168,76,0.08); color: var(--text); }
.side-link.active { background: rgba(201,168,76,0.13); color: var(--gold-light); }

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin-top: auto;
}
.btn-logout:hover { border-color: var(--gold-dim); color: var(--text); }

/* ── Main content pane ── */
.dash-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
}

/* ── Tab panels ── */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* ── Dash header ── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}
.dash-header h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--success);
  border: 1px solid rgba(90,200,154,0.3);
  border-radius: 50px;
  padding: 0.25rem 0.7rem;
  background: rgba(90,200,154,0.07);
}

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-glow); }
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
}

/* ── Section blocks ── */
.dash-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}
.dash-section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gold-light);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid rgba(201,168,76,0.07); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(201,168,76,0.04); }
tbody td { padding: 0.65rem 0.8rem; color: var(--text); }

.table-count { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.75rem; }

/* ── Draw Box ── */
.draw-box {
  background: linear-gradient(135deg, rgba(201,168,76,0.07), rgba(13,20,40,0.8));
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
}
.draw-box h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}
.draw-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.55;
}
.spin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  cursor: pointer;
}
.spin-toggle input { accent-color: var(--gold); }

.btn-draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-light));
  border: none;
  border-radius: var(--radius-btn);
  padding: 0.85rem 2.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--night);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 24px rgba(201,168,76,0.35);
}
.btn-draw:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(201,168,76,0.5); }
.btn-draw:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Winner Announce ── */
.winner-announce {
  margin-top: 1.6rem;
  padding: 1.4rem 1.8rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  animation: fadeUp 0.5s ease;
}
.winner-announce .w-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.winner-announce .w-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}
.winner-announce .w-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.winner-announce .w-time {
  font-size: 0.78rem;
  color: var(--gold-dim);
  margin-top: 0.5rem;
}

/* ── Export buttons ── */
.btn-export {
  background: rgba(201,168,76,0.1);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gold-light);
  cursor: pointer;
  transition: var(--transition);
}
.btn-export:hover { background: rgba(201,168,76,0.18); }

/* ── Search bar ── */
.search-bar {
  position: relative;
  margin-bottom: 1.2rem;
  max-width: 380px;
}
.search-bar svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  fill: var(--text-muted);
}
.search-bar input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--gold); }

/* ════════════════════════════════
   SPINNING WHEEL MODAL
════════════════════════════════ */
.wheel-modal {
  position: fixed;
  inset: 0;
  background: rgba(8,12,24,0.85);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.wheel-modal.active {
  display: flex;
}
.wheel-modal-inner {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-card);
  max-width: 380px;
  width: 90%;
}
.wheel-modal-inner h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.4rem;
  color: var(--gold-light);
}

.wheel-container {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}
#wheelCanvas { border-radius: 50%; display: block; }
.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  color: var(--gold-light);
  filter: drop-shadow(0 2px 6px rgba(201,168,76,0.6));
}
#wheelStatus {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ════════════════════════════════
   RESPONSIVE — ADMIN
════════════════════════════════ */
@media (max-width: 768px) {
  .admin-dash { flex-direction: column; height: auto; overflow: auto; }
  .admin-body { overflow: auto; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; gap: 0.5rem; }
  .btn-logout { margin-top: 0; margin-left: auto; }
  .dash-content { padding: 1.5rem 1rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.9rem; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
