/* ═══════════════════════════════════════════════════════════════════════════
   AIML 1860 Course Gateway — Global Styles
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --brand-blue:    #2563eb;
  --brand-blue-dk: #1d4ed8;
  --brand-blue-lt: #dbeafe;
  --success:       #16a34a;
  --success-lt:    #dcfce7;
  --warning:       #d97706;
  --warning-lt:    #fef3c7;
  --danger:        #dc2626;
  --danger-lt:     #fee2e2;
  --info:          #0891b2;
  --info-lt:       #cffafe;
  --gray-50:       #f9fafb;
  --gray-100:      #f3f4f6;
  --gray-200:      #e5e7eb;
  --gray-400:      #9ca3af;
  --gray-600:      #4b5563;
  --gray-800:      #1f2937;
  --text:          #111827;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.btn-primary:hover  { background: var(--brand-blue-dk); border-color: var(--brand-blue-dk); }
.btn-secondary { background: #fff; color: var(--gray-800); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-ghost     { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-lg  { padding: 12px 28px; font-size: 1rem; }
.btn-sm  { padding: 5px 12px; font-size: 0.85rem; }
.btn-xs  { padding: 3px 10px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.9rem; font-weight: 500; color: var(--gray-800); }
.form-group input,
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: 10px 16px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 16px; }
.alert-error   { background: var(--danger-lt); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-lt); color: #166534; border: 1px solid #86efac; }
.alert-info    { background: var(--info-lt); color: #155e75; border: 1px solid #67e8f9; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; background: var(--gray-100); color: var(--gray-600); }
.badge-success { background: var(--success-lt); color: var(--success); }
.badge-warning { background: var(--warning-lt); color: var(--warning); }
.badge-danger  { background: var(--danger-lt); color: var(--danger); }
.badge-info    { background: var(--info-lt); color: var(--info); }

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  padding: 24px 40px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.logo-lockup {
  display: flex; align-items: center; gap: 14px;
}
.logo-icon { font-size: 2rem; }
.logo-lockup h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.logo-lockup .subtitle { color: var(--gray-600); font-size: 0.9rem; }

.landing-main { max-width: 900px; margin: 0 auto; padding: 60px 24px; width: 100%; }

.hero { text-align: center; margin-bottom: 60px; }
.hero h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.hero-description { font-size: 1.1rem; color: var(--gray-600); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 60px; }
.feature-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 28px 24px; }
.feature-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--gray-600); font-size: 0.9rem; }

.how-it-works { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 32px; }
.how-it-works h3 { font-size: 1.1rem; margin-bottom: 16px; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 10px; color: var(--gray-600); }
.steps li strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES (login, register, redeem, verify)
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}

.auth-header { margin-bottom: 24px; }
.auth-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-header p { color: var(--gray-600); font-size: 0.95rem; }
.back-link { font-size: 0.85rem; color: var(--gray-400); display: inline-block; margin-bottom: 12px; }
.back-link:hover { color: var(--brand-blue); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-footer { margin-top: 24px; font-size: 0.85rem; color: var(--gray-600); text-align: center; }
.auth-footer p { margin-bottom: 4px; }

.text-center { text-align: center; }
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--gray-200); line-height: 1; }

.code-badge {
  background: var(--brand-blue-lt);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px;
}
.code-badge-label { font-size: 0.8rem; font-weight: 600; color: var(--brand-blue); text-transform: uppercase; letter-spacing: 0.5px; }
.code-badge-value { font-family: monospace; font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; color: var(--text); }

/* ═══════════════════════════════════════════════════════════════════════════
   STUDENT DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-page { min-height: 100vh; display: flex; flex-direction: column; }

.dashboard-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}

.dashboard-title { display: flex; align-items: center; gap: 12px; }
.dashboard-title h1 { font-size: 1.2rem; font-weight: 700; }
.dashboard-title .subtitle { font-size: 0.8rem; color: var(--gray-600); }

.dashboard-user { display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 0.85rem; color: var(--gray-600); }

.dashboard-main { max-width: 1200px; margin: 0 auto; padding: 40px 24px; width: 100%; flex: 1; }
.dashboard-main h2 { font-size: 1.4rem; margin-bottom: 8px; }
.dashboard-intro { color: var(--gray-600); margin-bottom: 32px; font-size: 0.95rem; }

/* Course tabs (multi-course dashboard) */
.course-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--gray-200);
}
.course-tab {
  padding: 8px 20px;
  border-radius: 6px 6px 0 0;
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  bottom: -2px;
  transition: color 0.15s, background 0.15s;
}
.course-tab.active {
  color: var(--brand-blue);
  background: #fff;
  border-color: var(--gray-200);
  border-bottom-color: #fff;
}
.course-tab:hover:not(.active) {
  color: var(--brand-blue);
  background: var(--gray-100);
}
.tab-status {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gray-400);
  font-style: italic;
}
.past-courses {
  margin-top: 40px;
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
}
.past-courses > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
  list-style: none;
}
.past-courses > summary::-webkit-details-marker { display: none; }
.past-courses > summary::before { content: '▸ '; color: var(--gray-400); }
.past-courses[open] > summary::before { content: '▾ '; }
.past-course-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.past-course-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius);
  text-decoration: none; color: var(--gray-600); background: var(--gray-50);
}
.past-course-list a:hover, .past-course-list a.active { border-color: var(--brand-blue); color: var(--brand-blue); }
.past-course-name { font-weight: 500; }
.past-course-meta { font-size: 0.8rem; color: var(--gray-400); }

.module-section { margin-bottom: 40px; }
.module-heading {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-600);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--brand-blue-lt);
}

.gadget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }

.gadget-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
  display: flex; align-items: flex-start; gap: 16px;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  position: relative;
}
.gadget-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  text-decoration: none;
}
.gadget-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.gadget-icon img { display: block; width: 2rem; height: 2rem; object-fit: contain; }
.gadget-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.gadget-info p { font-size: 0.85rem; color: var(--gray-600); }
.gadget-type { position: absolute; top: 12px; right: 12px; }
.gadget-type--static { display: none; }
.gadget-type--proxy  { }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-page { min-height: 100vh; display: flex; flex-direction: column; }

.admin-header {
  background: var(--gray-800);
  color: #fff;
  padding: 12px 32px;
  display: flex; align-items: center; gap: 24px;
}
.admin-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; }
.admin-nav { display: flex; gap: 4px; flex: 1; margin-left: 16px; }
.admin-nav-link { color: var(--gray-400); padding: 6px 12px; border-radius: var(--radius); font-size: 0.9rem; }
.admin-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.admin-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.admin-user .user-email { color: var(--gray-400); font-size: 0.85rem; }

/* "Student View" — prominent, high-contrast against the dark admin header.
   The default ghost style rendered dark-gray text on the dark header, which
   was nearly invisible. */
.btn-student-view {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  font-weight: 600;
}
.btn-student-view:hover { background: var(--brand-blue-dk); border-color: var(--brand-blue-dk); color: #fff; }

/* "Log Out" — legible on the dark admin header but kept secondary to the
   blue Student View action: light text with a subtle outline that fills in
   on hover. */
.btn-logout {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}
.btn-logout:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.7); color: #fff; }

/* Admin course tab bar */
.admin-course-bar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  display: flex;
  gap: 0;
}
.admin-course-tab {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.admin-course-tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}
.admin-course-tab:hover:not(.active) {
  color: var(--brand-blue);
}

.admin-main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; width: 100%; flex: 1; }
.admin-main h2 { font-size: 1.4rem; margin-bottom: 8px; }
.admin-intro { color: var(--gray-600); margin-bottom: 24px; font-size: 0.95rem; }

.admin-section { margin-bottom: 40px; }
.admin-section h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-200); }

.admin-form { display: flex; flex-direction: column; gap: 16px; max-width: 700px; }

/* Stats grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-top: 16px; }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--brand-blue); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--gray-600); }
.stat-link { font-size: 0.85rem; color: var(--brand-blue); margin-top: 8px; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.admin-table th { background: var(--gray-50); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); color: var(--gray-600); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }
.row-inactive td { opacity: 0.5; }
.table-meta { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 12px; }

/* ── Page header (title block + help button) ─────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head-text h2 { margin: 0; }
.page-head-sub { color: var(--gray-600); font-size: 0.92rem; margin-top: 2px; }

.btn-help {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 9999px;
  background: #fff; color: var(--gray-800);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-help-icon { color: var(--brand-blue); transition: color 0.15s; }
.btn-help:hover { background: var(--brand-blue-lt); border-color: var(--brand-blue); color: var(--brand-blue-dk); box-shadow: var(--shadow-md); }
.btn-help:hover .btn-help-icon { color: var(--brand-blue-dk); }
.btn-help:active { transform: translateY(1px); }
.btn-help:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* ── Soft action buttons (enterprise roster) ─────────────────────────────── */
.btn-soft {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px;
  background: #fff; color: var(--gray-800);
  border: 1px solid var(--gray-200); font-weight: 600; cursor: pointer;
  font-size: 0.85rem; line-height: 1.1; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-soft:hover { background: var(--gray-50); border-color: var(--gray-400); box-shadow: var(--shadow); }
.btn-soft:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.btn-soft.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-soft.btn-compact { padding: 4px 10px; font-size: 0.78rem; border-radius: 6px; }
.btn-soft-danger { color: var(--danger); border-color: var(--danger-lt); }
.btn-soft-danger:hover { background: var(--danger-lt); border-color: var(--danger); color: var(--danger); box-shadow: none; }
.btn-soft-accent { color: var(--brand-blue); border-color: var(--brand-blue-lt); }
.btn-soft-accent:hover { background: var(--brand-blue-lt); border-color: var(--brand-blue); color: var(--brand-blue-dk); box-shadow: none; }
.btn-delete svg { opacity: 0.85; }
.btn-soft:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-soft:disabled:hover { background: #fff; border-color: var(--gray-200); box-shadow: none; }

/* Section header with a right-aligned action (e.g. the Sessions archived toggle) */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h3 { margin: 0; padding: 0; border: none; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(17, 24, 39, 0.55);
  align-items: flex-start; justify-content: center;
  padding: 5vh 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: modalFade 0.18s ease; }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  max-width: 1320px; width: 100%; padding: 28px 32px; position: relative;
}
.modal-overlay.open .modal { animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 1.4rem; margin-bottom: 8px; padding-right: 28px; }
.modal h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-600); margin: 24px 0 8px;
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.7rem; line-height: 1;
  color: var(--gray-400); cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--gray-800); }
.modal-intro { color: var(--gray-600); font-size: 0.95rem; }
.modal-note {
  margin-top: 18px; padding: 12px 14px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: 0.9rem; color: var(--gray-800);
}

.action-def-list { margin: 0; }
.action-def { padding: 12px 0; border-top: 1px solid var(--gray-200); }
.action-def:first-child { border-top: none; padding-top: 4px; }
.action-def dt { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.action-def dd { margin: 0; color: var(--gray-600); font-size: 0.92rem; }
.action-tag {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.action-tag.reversible { background: var(--success-lt); color: var(--success); }
.action-tag.permanent  { background: var(--danger-lt);  color: var(--danger); }

/* Course tagline — branding element on informational modals */
.tagline {
  font-style: italic; text-align: center;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  color: #888; font-size: 0.9rem; letter-spacing: 0.5px;
}

/* ── Enterprise roster ───────────────────────────────────────────────────── */
.roster-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }

.roster-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--gray-100);
}
.toolbar-filter { margin: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); }
.select-wrap { position: relative; display: inline-block; }
.select-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--gray-400); border-bottom: 2px solid var(--gray-400);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  min-width: 260px; padding: 9px 36px 9px 13px;
  border: 1px solid var(--gray-200); border-radius: 8px; background: #fff;
  font-size: 0.9rem; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select-wrap select:hover { border-color: var(--gray-400); }
.select-wrap select:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--brand-blue-lt); }

.roster-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
  font-size: 0.85rem; color: var(--gray-600);
}
.roster-summary .summary-stat strong { color: var(--text); font-weight: 700; }
.summary-warn strong { color: var(--warning); }
.summary-dot { color: var(--gray-400); }
.roster-summary .summary-scope {
  margin-left: auto; font-weight: 600; color: var(--brand-blue);
  background: var(--brand-blue-lt); padding: 3px 12px; border-radius: 9999px; font-size: 0.78rem;
}

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: #fff; text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table .ta-center { text-align: center; }
.data-table .ta-right { text-align: right; }
.row-inactive td { background: #fcfcfd; }
.row-inactive .avatar { filter: grayscale(1); opacity: 0.7; }
.row-inactive .student-email { color: var(--gray-600); }
.muted { color: var(--gray-400); }

/* Student identity cell */
.cell-student { display: flex; align-items: center; gap: 12px; }
.avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-blue), var(--info));
  color: #fff; font-weight: 700; font-size: 1rem; text-transform: uppercase;
}
.student-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.student-email { font-weight: 600; color: var(--text); }
.student-email:hover { color: var(--brand-blue); }
.student-meta { font-size: 0.78rem; color: var(--gray-400); }

/* Status pills with leading dot */
.status-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 9999px; font-size: 0.74rem; font-weight: 600;
  border: 1px solid transparent;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.status-pill.is-active     { background: var(--success-lt); color: var(--success); }
.status-pill.is-verified   { background: var(--brand-blue-lt); color: var(--brand-blue-dk); }
.status-pill.is-suspended  { background: var(--warning-lt); color: var(--warning); }
.status-pill.is-unverified { background: var(--gray-100); color: var(--gray-600); }
.status-pill.is-inactive   { background: var(--danger-lt); color: var(--danger); }

/* Activity metrics */
.activity-cell { display: inline-flex; gap: 18px; justify-content: center; }
.metric { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.metric-num { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.metric-label { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-flag .metric-num { color: var(--danger); }

/* Account actions cluster */
.account-actions { display: inline-flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Per-session enrollment chips */
.enrollment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.enrollment-chip {
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 9px 11px;
  background: #fff; min-width: 270px; transition: border-color 0.12s, box-shadow 0.12s;
}
.enrollment-chip:hover { border-color: var(--gray-400); box-shadow: var(--shadow); }
.enrollment-chip.is-suspended { background: #fffdf6; border-color: var(--warning-lt); }
.chip-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.enrollment-name { font-weight: 600; font-size: 0.86rem; white-space: nowrap; }
.enrollment-actions { display: inline-flex; gap: 6px; }

.ua-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: var(--gray-600); }

.code-summary { display: flex; gap: 8px; margin-bottom: 12px; }
.code-tabs { display: flex; gap: 4px; margin: 8px 0 16px; border-bottom: 2px solid var(--gray-200); }
.code-tab { padding: 8px 18px; border: 1px solid transparent; border-bottom: none; background: none; cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--gray-600); border-radius: 6px 6px 0 0; position: relative; bottom: -2px; display: flex; align-items: center; gap: 6px; }
.code-tab.active { color: var(--brand-blue); background: #fff; border-color: var(--gray-200); border-bottom-color: #fff; }
.code-tab:hover:not(.active) { color: var(--brand-blue); background: var(--gray-100); }
.panel-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* Codes tab: Select Session + Generate New Codes side by side (stacks when narrow) */
.codes-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; margin-bottom: 40px; }
.codes-setup .admin-section { margin-bottom: 0; }
.empty-state { color: var(--gray-400); font-size: 0.9rem; padding: 24px; text-align: center; background: var(--gray-50); border-radius: var(--radius); border: 1px dashed var(--gray-200); }

.breadcrumb { margin-bottom: 16px; font-size: 0.85rem; }
.breadcrumb a { color: var(--gray-400); }
.breadcrumb a:hover { color: var(--brand-blue); }
