/* ============================================================
   PORTE OUVERTE — Admin Dashboard
   admin.css — Master Control Panel Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Nunito:wght@300;400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Variables ── */
:root {
  --navy:        #0A0A0A;
  --navy-light:  #1C1C1C;
  --navy-mid:    #2E2E2E;
  --gold:        #00ADBB;
  --gold-light:  #22C5D2;
  --gold-pale:   #E8F8FA;
  --teal:        #00ADBB;
  --crimson:     #A42137;
  --crimson-light:#C42D48;
  --ivory:       #F9F9F9;
  --ivory-dark:  #EFEFEF;
  --white:       #FFFFFF;
  --text-dark:   #0A0A0A;
  --text-mid:    #424242;
  --text-light:  #767676;
  --danger:      #C0392B;
  --danger-light:#FADBD8;
  --success:     #1E8449;
  --success-light:#D5F5E3;
  --warn:        #B7770D;
  --warn-light:  #FEF9E7;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-bg: #050505;
  --sidebar-border: rgba(255,255,255,0.06);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 12px rgba(10,10,10,0.07);
  --shadow-md: 0 6px 28px rgba(10,10,10,0.12);
  --shadow-lg: 0 16px 50px rgba(10,10,10,0.18);
  --trans: 0.25s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: #F5F5F5;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════ */
#loginScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  z-index: 9999;
  overflow: hidden;
}

.login-bg-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0,173,187,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(0,173,187,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(255,255,255,0.03) 0%, transparent 40%);
  pointer-events: none;
}

.login-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: loginPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes loginPop {
  from { opacity:0; transform: translateY(30px) scale(0.95); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--white);
}

.login-logo-text strong {
  display: block;
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
}

.login-logo-text span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.login-title {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-field {
  margin-bottom: 1.1rem;
}

.login-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.4rem;
}

.login-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--trans);
  outline: none;
}

.login-field input:focus {
  border-color: rgba(0,173,187,0.5);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(0,173,187,0.12);
}

.login-field input::placeholder { color: rgba(255,255,255,0.25); }

.login-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(192,57,43,0.15);
  border: 1px solid rgba(192,57,43,0.3);
  color: #ff9090;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.login-error.show { display: flex; }

.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all var(--trans);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,173,187,0.4);
}

.login-hint {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
}

/* ══════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════ */
#dashboard {
  display: none;
  min-height: 100vh;
}

#dashboard.active { display: flex; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform var(--trans);
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--white);
  flex-shrink: 0;
}

.sidebar-title strong {
  display: block;
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-title span {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.sidebar-user-badge {
  margin: 0.75rem 1.25rem;
  background: rgba(0,173,187,0.1);
  border: 1px solid rgba(0,173,187,0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-info strong {
  display: block;
  color: var(--white);
  font-size: 0.8rem;
  line-height: 1.2;
}

.sidebar-user-info span {
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.22);
  padding: 0.75rem 1.25rem 0.3rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--trans);
  border-left: 3px solid transparent;
  user-select: none;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
}

.sidebar-nav-item.active {
  background: rgba(0,173,187,0.1);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.sidebar-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: rgba(0,173,187,0.25);
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(192,57,43,0.12);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--radius-sm);
  color: #ff9090;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}

.btn-logout:hover {
  background: rgba(192,57,43,0.22);
  color: #ffb0b0;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--ivory-dark);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  font-weight: 700;
  flex: 1;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-content {
  padding: 2rem;
  flex: 1;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn-primary-admin {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}

.btn-primary-admin:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gold-admin {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}

.btn-gold-admin:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,173,187,0.35);
}

.btn-danger-admin {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}

.btn-danger-admin:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-edit-admin {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(10,10,10,0.08);
  color: var(--navy);
  border: 1px solid rgba(10,10,10,0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}

.btn-edit-admin:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-sm-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans);
  font-size: 0.85rem;
}

/* ══════════════════════════════════════
   STATS CARDS (Overview)
══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ivory-dark);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--trans);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.navy { background: rgba(10,10,10,0.1); color: var(--navy); }
.stat-icon.gold  { background: rgba(0,173,187,0.12); color: var(--gold); }
.stat-icon.teal  { background: rgba(0,173,187,0.1); color: var(--teal); }
.stat-icon.green { background: rgba(30,132,73,0.1); color: var(--success); }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

/* ══════════════════════════════════════
   PANELS / PAGES
══════════════════════════════════════ */
.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: panelFade 0.25s ease;
}

@keyframes panelFade {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  flex: 1;
}

/* ══════════════════════════════════════
   CARDS / CONTAINERS
══════════════════════════════════════ */
.admin-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ivory-dark);
  overflow: hidden;
}

.admin-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ivory-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
  flex: 1;
}

.admin-card-body { padding: 1.5rem; }

/* ══════════════════════════════════════
   CLASSES LIST
══════════════════════════════════════ */
.class-admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ivory-dark);
  transition: background var(--trans);
  flex-wrap: wrap;
}

.class-admin-item:last-child { border-bottom: none; }
.class-admin-item:hover { background: var(--ivory); }

.class-admin-color {
  width: 10px; height: 44px;
  border-radius: 4px;
  flex-shrink: 0;
}

.class-admin-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.class-admin-info { flex: 1; min-width: 160px; }
.class-admin-info strong {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
  line-height: 1.3;
}

.class-admin-info span {
  font-size: 0.78rem;
  color: var(--text-light);
}

.class-admin-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.3rem;
}

.badge-navy { background: rgba(10,10,10,0.08); color: var(--navy); }
.badge-gold { background: rgba(0,173,187,0.12); color: #7A1929; }
.badge-teal { background: rgba(0,173,187,0.1); color: var(--teal); }

.class-admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   LESSONS TABLE
══════════════════════════════════════ */
.lessons-table-wrap {
  overflow-x: auto;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  border-bottom: 2px solid var(--ivory-dark);
  white-space: nowrap;
  background: var(--ivory);
}

.admin-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--ivory-dark);
  font-size: 0.88rem;
  color: var(--text-mid);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--ivory); }

.lesson-num-badge {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.pdf-path-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  background: rgba(0,173,187,0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ══════════════════════════════════════
   MODAL / DRAWER
══════════════════════════════════════ */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.admin-modal-overlay.open {
  display: flex;
}

.admin-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  margin: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity:0; transform: scale(0.94) translateY(16px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ivory-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  flex: 1;
}

.modal-close-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--ivory-dark);
  background: var(--white);
  color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--trans);
}

.modal-close-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--white);
}

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ivory-dark);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row.single { grid-template-columns: 1fr; }

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.form-control-admin {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-dark);
  background: var(--white);
  transition: all var(--trans);
  outline: none;
}

.form-control-admin:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(0,173,187,0.12);
}

textarea.form-control-admin {
  resize: vertical;
  min-height: 80px;
}

select.form-control-admin { cursor: pointer; }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-picker-row input[type="color"] {
  width: 44px; height: 36px;
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--white);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 0.4rem;
  max-height: 160px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  background: var(--ivory);
}

.icon-option {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-mid);
  transition: all var(--trans);
  border: 2px solid transparent;
}

.icon-option:hover { background: var(--ivory-dark); }
.icon-option.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ══════════════════════════════════════
   QUIZ EDITOR
══════════════════════════════════════ */
.quiz-question-editor {
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.quiz-q-num {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.quiz-option-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  transition: border-color var(--trans);
}

.quiz-option-input:focus-within {
  border-color: var(--gold);
}

.option-letter {
  width: 22px; height: 22px;
  background: var(--ivory-dark);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; color: var(--text-light);
  flex-shrink: 0;
}

.quiz-option-input input {
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  flex: 1;
  color: var(--text-dark);
  background: transparent;
}

.correct-answer-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.correct-answer-select select {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  background: var(--white);
  cursor: pointer;
}

.btn-remove-q {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: var(--danger-light);
  border: none;
  color: var(--danger);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  transition: all var(--trans);
}

.btn-remove-q:hover {
  background: var(--danger);
  color: var(--white);
}

/* ══════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════ */
#adminToastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.admin-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  pointer-events: auto;
  animation: toastSlide 0.3s ease forwards;
  max-width: 340px;
}

@keyframes toastSlide {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}

.admin-toast.success {
  background: var(--white);
  border-left: 4px solid var(--success);
  color: var(--text-dark);
}

.admin-toast.error {
  background: var(--white);
  border-left: 4px solid var(--danger);
  color: var(--text-dark);
}

.admin-toast.info {
  background: var(--white);
  border-left: 4px solid var(--navy);
  color: var(--text-dark);
}

.admin-toast .toast-icon { font-size: 1.15rem; flex-shrink: 0; }
.admin-toast.success .toast-icon { color: var(--success); }
.admin-toast.error   .toast-icon { color: var(--danger); }
.admin-toast.info    .toast-icon { color: var(--navy); }

/* ══════════════════════════════════════
   CONFIRM DIALOG
══════════════════════════════════════ */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.confirm-overlay.open { display: flex; }

.confirm-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.25s ease;
}

.confirm-icon {
  width: 60px; height: 60px;
  background: var(--danger-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.6rem;
  color: var(--danger);
}

.confirm-box h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.confirm-box p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ══════════════════════════════════════
   SETTINGS PANEL
══════════════════════════════════════ */
.settings-section {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--ivory-dark);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-section-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ivory-dark);
  background: var(--ivory);
}

.settings-section-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ivory-dark);
  flex-wrap: wrap;
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  flex: 1;
  min-width: 200px;
}

.settings-row-label strong {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
}

.settings-row-label span {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  #mobileMenuToggle { display: flex !important; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }

  .sidebar-overlay.open { display: block; }
}

#mobileMenuToggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--navy);
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .quiz-options-grid { grid-template-columns: 1fr; }
  .page-content { padding: 1.25rem; }
}

/* ══════════════════════════════════════
   CERTIFICATE UPLOAD ZONES
══════════════════════════════════════ */
.cert-upload-zone {
  border: 2px dashed var(--ivory-dark);
  border-radius: var(--radius-md);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans);
  background: var(--ivory);
  overflow: hidden;
}

.cert-upload-zone:hover {
  border-color: var(--gold);
  background: var(--gold-pale, #FFF0F2);
}

.cert-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem;
  color: var(--text-light);
  text-align: center;
}

.cert-upload-preview i {
  font-size: 1.8rem;
  color: var(--gold);
}

.cert-upload-preview span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-mid);
}

.cert-upload-preview small {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ══════════════════════════════════════
   USERS TABLE DETAIL
══════════════════════════════════════ */
.dash-score-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.dash-score-pass { background: rgba(30,132,73,0.1);  color: #1E8449; }
.dash-score-fail { background: rgba(192,57,43,0.1);  color: #C0392B; }
.dash-score-none { background: var(--ivory-dark);    color: var(--text-light); }

/* ══════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════ */
.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.bc-item {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--trans);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.bc-item:hover { color: var(--gold); }

.bc-home { color: var(--text-light); }

.bc-sep {
  font-size: 0.65rem;
  color: var(--ivory-dark);
}

.bc-current {
  color: var(--navy);
  cursor: default;
  font-weight: 700;
}

.bc-current:hover { color: var(--navy); }

/* ══════════════════════════════════════
   ADMIN ROLE BADGE
══════════════════════════════════════ */
.role-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, rgba(0,173,187,0.15), rgba(0,173,187,0.08));
  border: 1px solid rgba(0,173,187,0.3);
  color: #7A1929;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge-user {
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  color: var(--text-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
