/* ==========================================================================
   ELECTROREC ADMIN DASHBOARD — STYLESHEET
   Matching visual identity: #020202, #111111, #262626, #EAA943, #FFFFFF
   ========================================================================== */

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

:root {
  --black: #020202;
  --black-soft: #0A0A0A;
  --black-card: #111111;
  --black-surface: #171717;

  --white: #FFFFFF;
  --white-soft: #F5F5F5;
  --text-muted: #A7A7A7;
  --text-subtle: #6B7280;

  --gold: #EAA943;
  --gold-light: #F2C266;
  --gold-dark: #C9892F;
  --gold-glow: rgba(234, 169, 67, 0.15);

  --border: #262626;
  --border-subtle: #1C1C1C;
  --border-hover: #3E3E3E;
  --border-gold: rgba(234, 169, 67, 0.5);

  --success: #10B981;
  --danger: #EF4444;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  color-scheme: light;
  --black: #F8FAFC;
  --black-soft: #EEF2F6;
  --black-card: #FFFFFF;
  --black-surface: #F1F5F9;

  --white: #0F172A;
  --white-soft: #1E293B;
  --text-muted: #475569;
  --text-subtle: #64748B;

  --gold: #C97D16;
  --gold-light: #DF8D1C;
  --gold-dark: #A2610A;
  --gold-glow: rgba(201, 125, 22, 0.18);

  --border: #E2E8F0;
  --border-subtle: #EDF2F7;
  --border-hover: #CBD5E1;
  --border-gold: rgba(201, 125, 22, 0.45);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--black);
  color: var(--white);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

.admin-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* =====================
   LOGIN VIEW
===================== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: 
    radial-gradient(circle at 50% 30%, rgba(234, 169, 67, 0.12), transparent 60%),
    var(--black);
}

.login-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 34px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  position: relative;
}

.security-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(234, 169, 67, 0.12);
  border: 1px solid var(--border-gold);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 14px;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

.login-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.restricted-warning-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(234, 169, 67, 0.06);
  border: 1px solid rgba(234, 169, 67, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--gold-light);
  margin-bottom: 20px;
  line-height: 1.4;
}

.restricted-warning-box svg {
  flex-shrink: 0;
  stroke: var(--gold);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white-soft);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--black-surface);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(234, 169, 67, 0.2);
}

.btn-primary {
  width: 100%;
  background-color: var(--gold);
  color: var(--black);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--gold-light);
}

.btn-secondary {
  background-color: transparent;
  color: var(--white);
  border: 1px solid var(--border);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--black-surface);
  border-color: var(--border-hover);
}

.btn-danger {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.12);
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.alert-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #F87171;
}

.alert-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #34D399;
}

/* Role presets selector */
.role-switcher-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.role-switcher-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.role-chips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.role-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--black-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white-soft);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.role-chip:hover, .role-chip.active {
  border-color: var(--gold);
  background: rgba(234, 169, 67, 0.08);
}

.role-chip-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
}

.role-chip-email {
  font-size: 0.74rem;
  color: var(--gold-light);
  font-family: monospace;
}

/* =====================
   ADMIN DASHBOARD VIEW
===================== */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--black-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-nav-logo {
  width: 36px;
  height: 36px;
}

.admin-nav-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-nav-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.security-status-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 8px #22C55E;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  background: rgba(234, 169, 67, 0.08);
  border: 1px solid rgba(234, 169, 67, 0.3);
  border-radius: 9999px;
}

.admin-avatar-icon {
  font-size: 1rem;
}

.admin-badge-info {
  display: flex;
  flex-direction: column;
}

.admin-badge-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

.admin-badge-role {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 500;
}

.admin-nav-logo {
  width: 36px;
  height: 36px;
}

.admin-nav-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.stat-card-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--white);
}

.stat-card-value.highlight {
  color: var(--gold);
}

/* Section Controls */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-bar-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Event Cards in Admin */
.admin-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.admin-event-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.admin-event-card.active-event {
  border-color: var(--border-gold);
}

.admin-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.category-badge {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(234, 169, 67, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

.admin-event-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.admin-event-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-event-capacity {
  margin-bottom: 18px;
}

.admin-event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

/* Table styling */
.table-wrapper {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 40px;
}

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

.registrations-table th {
  background-color: var(--black-surface);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.registrations-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--white-soft);
}

.registrations-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.reg-badge-id {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--gold);
  font-size: 0.84rem;
}

/* Modal Overlay */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(2, 2, 2, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.admin-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .stats-grid, .admin-events-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
    height: auto;
  }

  .admin-nav-left {
    justify-content: space-between;
  }

  .admin-nav-actions {
    justify-content: flex-end;
    gap: 10px;
  }

  .admin-container {
    padding: 20px 14px;
  }

  .admin-modal-card {
    padding: 20px 16px;
    max-width: 94%;
  }

  .login-card {
    padding: 26px 18px;
  }
}

/* Theme Toggle Button for Admin */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--black-surface);
  border: 1px solid var(--border);
  color: var(--white-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

:root:not([data-theme="light"]) .theme-toggle-btn .theme-icon-moon {
  display: none;
}
:root:not([data-theme="light"]) .theme-toggle-btn .theme-icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-toggle-btn .theme-icon-moon {
  display: block;
}

[data-theme="light"] .login-card {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .registrations-table tr:hover td {
  background-color: rgba(15, 23, 42, 0.02);
}

