/* ===== PRAXIS App Styles ===== */
@import url('./tokens.css');

:root {
  /* ── PRAXIS Brand Color System (canonical) ── */
  --color-primary: #0A1628;
  --color-secondary: #1E293B;
  --color-accent: #2D9CDB;
  --color-gold: #D4A853;
  --color-text-primary: #E8ECF1;
  --color-text-secondary: #94A3B8;
  --color-surface: #0F1D2E;
  --color-border: #1E3A5F;
  --color-success: #22C55E;
  --color-error: #EF4444;
  --color-warning: #F59E0B;

  /* Legacy aliases — map to canonical brand colors */
  --bg-deep: var(--color-primary);
  --bg-card: var(--color-surface);
  --bg-elevated: #2A3441;
  --bg-hover: #3D4F5F;

  --accent: var(--color-accent);
  --accent-hover: #1E8FC8;
  --accent-dim: rgba(45, 156, 219, 0.12);
  --accent-glow: rgba(45, 156, 219, 0.3);

  --gold: var(--color-gold);
  --gold-hover: #F0C75E;
  --gold-dim: rgba(212, 168, 83, 0.12);

  --text-primary: var(--color-text-primary);
  --text-secondary: #8A9BB5;
  --text-dim: #5A6B7F;

  --border: var(--color-border);
  --border-subtle: rgba(45, 156, 219, 0.1);

  --amber: var(--color-gold);
  --coral: var(--color-error);
  --green: var(--color-success);
  --blue: var(--color-accent);
  --red: var(--color-error);
  --warning: var(--color-warning);
  --success: var(--color-success);
  --error: var(--color-error);

  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

/* ===== GENERIC CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover {
  border-color: rgba(255,255,255,0.1);
}

/* ===== APP NAV ===== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-left { display: flex; align-items: center; gap: 32px; flex: 1; min-width: 0; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-weight: 700; font-size: 1.15rem;
  color: var(--text-primary); text-decoration: none;
}
.nav-logo-mark {
  width: 30px; height: 30px;
  border-radius: 6px; display: block;
  flex-shrink: 0;
}
/* Desktop: show full wordmark — Mobile: icon only */
.nav-logo-wordmark {
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--color-text-primary, #E8ECF1);
}
@media (max-width: 480px) {
  .nav-logo-wordmark { display: none; }
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: all 0.15s;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.nav-link svg { opacity: 0.5; }
/* Hide lower-priority nav items on narrower viewports */
@media (max-width: 1100px) { .nav-hide-xl { display: none !important; } }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px;
  min-width: 200px; z-index: 50;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 8px 14px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.85rem; border-radius: 6px;
  transition: all 0.15s; white-space: nowrap;
}
.nav-dropdown-menu a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.nav-user { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.nav-user-name { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.nav-user-role {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--accent-dim);
  padding: 2px 8px; border-radius: 4px;
}
.nav-admin-badge {
  transition: opacity 0.15s, filter 0.15s;
}
.nav-admin-badge:hover {
  opacity: 0.8;
  filter: brightness(1.15);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  font-weight: 600; cursor: pointer; border: none;
  transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--bg-deep); }
.btn-primary:hover { background: var(--accent-hover, #1E8FC8); transform: translateY(-1px); }
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.24);
}
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-full { width: 100%; }
.btn-success { background: var(--green); color: var(--bg-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
.form-error {
  background: rgba(255,107,107,0.1); color: var(--coral);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: 16px;
}
.select-input { -webkit-appearance: none; appearance: none; cursor: pointer; }

/* ===== GENERIC CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ===== FEEDBACK MODAL ===== */
.feedback-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: modal-fadein 0.2s ease;
}
.feedback-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 480px;
  position: relative;
}
.feedback-modal h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.feedback-modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.6;
}
.feedback-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.06); border: none;
  border-radius: 8px; color: var(--text-secondary);
  width: 32px; height: 32px; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.feedback-modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.feedback-form textarea {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  margin-bottom: 16px;
}
.feedback-form textarea:focus { border-color: var(--accent); }
.feedback-form textarea::placeholder { color: var(--text-dim); }

/* ===== AUTH PAGES ===== */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px); padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
}
.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-sub { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 28px; }
.auth-footer {
  text-align: center; margin-top: 24px;
  font-size: 0.85rem; color: var(--text-dim);
}
.auth-footer a { color: var(--accent); text-decoration: none; }

/* ===== LAYOUT ===== */
.main-content { min-height: calc(100vh - 60px); }
.page-container { max-width: 1100px; margin: 0 auto; padding: 40px 32px; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-sub { color: var(--text-secondary); font-size: 1.05rem; }

.breadcrumb {
  display: inline-block; color: var(--text-dim);
  text-decoration: none; font-size: 0.85rem;
  margin-bottom: 20px; transition: color 0.15s;
}
.breadcrumb:hover { color: var(--accent); }

/* ===== STATS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 40px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  text-align: center;
}
.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; color: var(--accent);
}
.stat-label { font-size: 0.82rem; color: var(--text-dim); margin-top: 4px; }

/* ===== COURSE GRID ===== */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  cursor: pointer; transition: all 0.2s;
}
.course-card:hover {
  border-color: rgba(45,156,219,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.course-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.course-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }
.course-card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.course-card-badge {
  display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
  vertical-align: middle; line-height: 1.4;
}
.course-card-cat {
  display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  vertical-align: middle; line-height: 1.4;
}
.course-card-meta {
  display: flex; gap: 12px; font-size: 0.78rem; color: var(--text-dim);
  padding-top: 12px; border-top: 1px solid var(--border);
}
.course-meta { font-size: 0.8rem; color: var(--text-dim); }

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden; margin-top: 12px;
}
.progress-bar {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width 0.3s;
}
.progress-text { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; display: block; }

/* ===== COURSE DETAIL ===== */
.course-header-section { margin-bottom: 40px; }
.course-header-row { display: flex; gap: 40px; align-items: flex-start; }
.course-header-row > div:first-child { flex: 1; }
.course-action-col { text-align: center; min-width: 160px; }
.course-badges { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 600;
  padding: 4px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
  vertical-align: middle;
}
.badge-cat { background: rgba(240,168,48,0.12); color: var(--amber); }
.badge-diff { background: var(--accent-dim); color: var(--accent); }
.badge-role { background: var(--accent-dim); color: var(--accent); }
.course-desc { color: var(--text-secondary); font-size: 1rem; margin: 12px 0 16px; max-width: 640px; }
.course-meta-row { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-dim); }
.progress-ring-wrap {
  margin-bottom: 16px; padding: 16px;
  background: var(--accent-dim); border-radius: var(--radius);
}
.progress-ring-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; color: var(--accent);
}
.progress-ring-label { font-size: 0.78rem; color: var(--text-dim); }

/* ===== MODULES/LESSONS ===== */
.modules-list { display: flex; flex-direction: column; gap: 20px; }
.module-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.module-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.module-num {
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--accent-dim);
  padding: 3px 10px; border-radius: 4px;
}
.module-header h3 { flex: 1; font-size: 1rem; }
.module-count { font-size: 0.78rem; color: var(--text-dim); }
.module-header-toggle { cursor: pointer; user-select: none; }
.module-header-toggle:hover { background: rgba(255,255,255,0.02); }
.module-chevron { color: var(--text-dim); flex-shrink: 0; transition: transform 0.2s ease; }
.lessons-list.module-collapsed { display: none; }
.lessons-list { padding: 4px 0; }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; cursor: pointer; transition: background 0.15s;
}
.lesson-row:hover { background: rgba(255,255,255,0.02); }
.lesson-row.completed { opacity: 0.65; }
.lesson-check {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.75rem; font-weight: 600;
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  border: 1px solid var(--border);
}
.lesson-row.completed .lesson-check {
  background: var(--accent-dim); color: var(--accent); border-color: transparent;
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: 0.9rem; font-weight: 500; display: block; }
.lesson-type { font-size: 0.75rem; color: var(--text-dim); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-duration { font-size: 0.78rem; color: var(--text-dim); }

/* ===== LESSON VIEWER ===== */
.lesson-page { max-width: 800px; margin: 0 auto; padding: 40px 32px; }
.lesson-header { margin-bottom: 32px; }
.lesson-module-label {
  font-size: 0.78rem; color: var(--accent); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.lesson-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.lesson-duration-badge {
  font-size: 0.78rem; color: var(--text-dim);
  background: rgba(255,255,255,0.04); padding: 4px 10px; border-radius: 4px;
}
.lesson-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; margin-bottom: 32px;
}
.lesson-content-area {
  font-size: 0.95rem; line-height: 1.8; color: var(--text-secondary);
}
.lesson-content-area h1, .lesson-content-area h2, .lesson-content-area h3 {
  color: var(--text-primary); margin: 24px 0 12px;
}
.lesson-content-area h1 { font-size: 1.5rem; }
.lesson-content-area h2 { font-size: 1.25rem; }
.lesson-content-area h3 { font-size: 1.1rem; }
.lesson-content-area strong { color: var(--text-primary); }
.lesson-content-area code {
  background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px;
  font-size: 0.85rem;
}
.lesson-content-area ul { padding-left: 20px; margin: 12px 0; }
.lesson-content-area li { margin-bottom: 6px; }
.lesson-footer { margin-top: 20px; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ===== LIBRARY ===== */
.filter-bar {
  display: flex; gap: 12px; margin-bottom: 24px;
}
.search-input { flex: 1; max-width: 400px; }
.select-input { max-width: 200px; }

.library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.library-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; cursor: pointer;
  transition: all 0.2s;
}
.library-card:hover {
  border-color: rgba(45,156,219,0.2);
  transform: translateY(-2px);
}
.library-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.library-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.lib-card-cat {
  display: inline-block; font-size: 0.7rem; color: var(--amber);
  background: rgba(240,168,48,0.1); padding: 2px 8px; border-radius: 4px;
  margin-bottom: 10px;
}
.lib-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lib-tag {
  font-size: 0.7rem; color: var(--text-dim);
  background: rgba(255,255,255,0.04); padding: 3px 8px;
  border-radius: 4px; border: 1px solid var(--border);
}

.lib-detail-header { margin-bottom: 28px; }
.lib-detail-header h1 { font-size: 1.8rem; margin: 12px 0; }
.lib-detail-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  font-size: 0.95rem; line-height: 1.8; color: var(--text-secondary);
}

/* ===== CERTIFICATIONS ===== */
.certs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.cert-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; text-align: center;
}
.cert-icon { font-size: 3rem; margin-bottom: 12px; }
.cert-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.cert-date { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 8px; }
.cert-status {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 3px 10px; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
}

/* ===== DATA TABLE ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 16px; font-size: 0.78rem;
  color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.06em; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover { background: rgba(255,255,255,0.02); }

/* ===== SECTIONS ===== */
.dash-section { margin-bottom: 40px; }
.dash-section h2 { font-size: 1.3rem; margin-bottom: 16px; }

/* ===== RECENT LIST ===== */
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.recent-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
}
.recent-item:hover { background: rgba(255,255,255,0.03); }
.recent-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.8rem;
}
.recent-title { font-size: 0.9rem; font-weight: 500; }
.recent-course { font-size: 0.78rem; color: var(--text-dim); }

/* ===== STATES ===== */
.dashboard-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-dim);
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; font-size: 1.2rem; }
.empty-state p { margin-bottom: 20px; }
.error-state {
  padding: 20px; background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius-sm); color: var(--coral);
  text-align: center;
}

/* ===== ADMIN LAYOUT v9 — Premium Overhaul ===== */

/* --- Core Layout --- */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--bg-deep);
}

/* --- Sidebar --- */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1), min-width 0.22s cubic-bezier(0.4,0,0.2,1), max-width 0.22s cubic-bezier(0.4,0,0.2,1);
  z-index: 10;
}

/* Collapsed sidebar — icon only */
.admin-layout.sidebar-collapsed .admin-sidebar {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 48px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  overflow: hidden;
}

/* Brand logo + name */
.admin-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.admin-brand svg { flex-shrink: 0; }

.admin-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.18s, max-width 0.22s;
  max-width: 140px;
}

.admin-layout.sidebar-collapsed .admin-brand-text {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* Collapse toggle button */
.admin-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.admin-collapse-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* Nav list */
.admin-nav-list {
  padding: 8px 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Nav group label */
.admin-nav-group-label {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  margin-top: 8px;
  overflow: hidden;
}
.admin-nav-group-label:first-child { margin-top: 0; }
.admin-nav-group-label span {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
  transition: opacity 0.18s;
}
.admin-layout.sidebar-collapsed .admin-nav-group-label span { opacity: 0; }

/* Nav items */
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.835rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s, transform 0.12s;
  margin-bottom: 1px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.admin-nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  transform: translateX(1px);
}
.admin-nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.admin-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}
.admin-nav-icon svg { width: 15px; height: 15px; }

.admin-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s, max-width 0.22s;
  max-width: 140px;
}
.admin-layout.sidebar-collapsed .admin-nav-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* Inline nav badge (count pill) */
.admin-nav-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #000;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
  flex-shrink: 0;
  animation: badge-pulse 2s ease infinite;
  transition: opacity 0.18s;
}
.admin-layout.sidebar-collapsed .admin-nav-badge { opacity: 0; }

/* Sidebar footer */
.admin-sidebar-footer {
  padding: 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* --- Content area (right of sidebar) --- */
.admin-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* --- Top bar --- */
.admin-topbar {
  display: flex;
  align-items: center;
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  z-index: 20;
  flex-shrink: 0;
}

.admin-topbar-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.admin-topbar-mobile-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* Breadcrumbs */
.admin-topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.admin-bc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}
.admin-bc-link:hover { color: var(--text-primary); }
.admin-bc-seg { color: var(--text-dim); }
.admin-bc-sep { color: var(--text-dim); margin: 0 2px; }
.admin-bc-current { color: var(--text-primary); font-weight: 600; }

.admin-topbar-spacer { flex: 1; }

/* Top bar right-side actions */
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Search button */
.admin-topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.admin-topbar-search-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); background: var(--bg-hover); }
.admin-topbar-search-label { font-size: 0.78rem; }
.admin-topbar-kbd {
  font-size: 0.68rem;
  font-family: inherit;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Generic top bar button */
.admin-topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.admin-topbar-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }

/* Primary top bar button (quick actions) */
.admin-topbar-btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent-glow);
  color: var(--accent);
}
.admin-topbar-btn-primary:hover { background: rgba(45,156,219,0.18); border-color: var(--accent); color: var(--accent); }

/* Icon-only button */
.admin-topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.admin-topbar-icon-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); border-color: var(--border); }

/* Notification badge dot */
.admin-notif-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: badge-pulse 2.5s ease infinite;
}

/* Quick actions dropdown */
.admin-qa-wrap { position: relative; }
.admin-qa-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  padding: 4px;
  overflow: hidden;
}
.admin-qa-menu.visible { display: block; }
.admin-qa-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: all 0.12s;
}
.admin-qa-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.admin-qa-item svg { flex-shrink: 0; opacity: 0.7; }

/* Notification panel */
.admin-notif-wrap { position: relative; }
.admin-notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}
.admin-notif-panel.visible { display: block; }
.admin-notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.admin-notif-count {
  font-size: 0.72rem;
  background: #ef444420;
  color: #ef4444;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.admin-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.admin-notif-item:last-child { border-bottom: none; }
.admin-notif-item:hover { background: rgba(255,255,255,0.04); }
.admin-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.admin-notif-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
.admin-notif-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.admin-notif-empty {
  padding: 20px 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* User chip */
.admin-user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.admin-user-chip:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }
.admin-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.admin-user-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Main content --- */
.admin-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Mobile overlay */
.admin-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9;
  backdrop-filter: blur(2px);
}
.admin-mobile-overlay.visible { display: block; }

/* --- Global search modal --- */
.admin-search-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  backdrop-filter: blur(3px);
}
.admin-search-backdrop.visible { display: block; }

.admin-search-modal {
  display: none;
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  z-index: 901;
  overflow: hidden;
}
.admin-search-modal.visible { display: block; }

.admin-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-search-input-wrap svg { color: var(--text-dim); flex-shrink: 0; }

.admin-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}
.admin-search-input::placeholder { color: var(--text-dim); }

.admin-search-esc-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  flex-shrink: 0;
}

.admin-search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}

.admin-search-hint {
  padding: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

.admin-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.admin-search-result:hover,
.admin-search-result.focused { background: rgba(255,255,255,0.07); }

.admin-search-result-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}
.admin-search-result-group {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px;
  border-radius: 4px;
}

/* --- Page content --- */
.admin-page {
  max-width: 1200px;
  padding: 28px 32px;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.admin-page-header h1 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.admin-page-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* KPI Grid */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.admin-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.admin-kpi-card:hover {
  border-color: rgba(255,255,255,0.12);
}

.admin-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-kpi-body { flex: 1; }

.admin-kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.admin-kpi-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.admin-kpi-trend {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
  margin-top: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cards */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.admin-card h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.admin-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Actions Grid */
.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.admin-action-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
  background: var(--bg-hover);
}

.admin-action-btn.admin-action-primary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(45,156,219,0.2);
}

.admin-action-btn.admin-action-primary:hover {
  background: rgba(45,156,219,0.2);
}

/* Health List */
.admin-health-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.admin-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-health-value {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* Filter Bar */
.admin-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-filter-bar .form-input {
  max-width: 320px;
}

.admin-filter-bar .select-input {
  max-width: 180px;
}

/* User Cell */
.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.admin-user-name {
  font-weight: 500;
  font-size: 0.88rem;
}

.admin-user-email {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Status dots */
.admin-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-active { background: #48bb78; }
.status-inactive { background: #EF4444; }

/* Role badges */
.badge-role-admin { background: rgba(237,100,166,0.12); color: #ed64a6; }
.badge-role-org_admin { background: rgba(240,168,48,0.12); color: #D4A853; }
.badge-role-learner { background: var(--accent-dim); color: var(--accent); }

/* Deactivated row */
.row-deactivated { opacity: 0.5; }

/* Table enhancements */
.admin-data-table th { font-size: 0.72rem; }
.admin-data-table td { font-size: 0.85rem; }

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

.admin-result-count {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Actions column */
.admin-actions {
  display: flex;
  gap: 4px;
}

/* Progress cell */
.admin-progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-progress-cell span {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Detail page */
.admin-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.admin-detail-info { flex: 1; }
.admin-detail-info h1 { font-size: 1.5rem; margin-bottom: 2px; }
.admin-detail-email { color: var(--text-dim); font-size: 0.88rem; }

.admin-detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.admin-detail-actions {
  display: flex;
  gap: 8px;
}

.admin-detail-meta {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-meta-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Cert item */
.admin-cert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.admin-cert-item:last-child { border-bottom: none; }

.admin-certs-list { margin-top: 12px; }

/* Activity list */
.admin-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.admin-activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.85rem;
}

.admin-activity-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  flex-shrink: 0;
}

.activity-complete {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Org cards */
.admin-org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.admin-org-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-org-card:hover {
  border-color: rgba(45,156,219,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.admin-org-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.admin-org-card-header h3 { font-size: 1.05rem; }

.admin-org-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.admin-org-stat { text-align: center; }

.admin-org-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-org-stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-org-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Charts */
.admin-chart {
  height: 200px;
  overflow: hidden;
}

.admin-bar-chart {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-bar-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
  padding: 8px 0;
}

.admin-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
}

.admin-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}

.admin-bar-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Role breakdown */
.admin-role-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.admin-role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 60px;
  text-align: center;
}

/* Library stats */
.admin-lib-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-lib-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.admin-lib-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.admin-lib-stat span:last-child {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Rankings */
.admin-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.admin-ranking-num {
  color: var(--text-dim);
  font-weight: 700;
  min-width: 24px;
}

.admin-ranking-title { flex: 1; }

.admin-ranking-value {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* Billing */
.admin-billing-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-billing-placeholder {
  text-align: center;
  padding: 48px 20px;
}

.admin-billing-placeholder-icon {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.admin-billing-placeholder h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.admin-billing-placeholder p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 480px;
  margin: 0 auto 8px;
}

/* Modal */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.admin-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 0;
}

.admin-modal-header h2 { font-size: 1.3rem; }

.admin-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.admin-modal-close:hover { color: var(--text-primary); }

.admin-modal-body {
  padding: 20px 28px 28px;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Text helpers */
.text-dim { color: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .admin-topbar-search-label { display: none; }
  .admin-topbar-btn-primary span:not(.admin-topbar-btn-primary svg ~ span) { display: none; }
  .admin-page { padding: 24px 20px; }
  .admin-grid-2col { grid-template-columns: 1fr; }
  .admin-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-persistent-quicknav { padding: 10px 20px; }
}

@media (max-width: 768px) {
  .app-nav { padding: 0 16px; }
  .nav-links { display: none; }
  .page-container { padding: 24px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .search-input, .select-input { max-width: 100%; }
  .course-header-row { flex-direction: column; gap: 20px; }
  .lesson-page { padding: 24px 16px; }
  .lesson-nav { flex-direction: column; }
  .auth-card { padding: 28px 24px; }

  /* Mobile: sidebar becomes slide-out drawer */
  .admin-topbar-mobile-btn { display: flex; }
  .admin-topbar-search-label { display: none; }
  .admin-topbar-kbd { display: none; }
  .admin-user-name { display: none; }

  .admin-sidebar {
    position: fixed;
    left: -220px;
    top: 0;
    bottom: 0;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    z-index: 10;
    transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .admin-layout.mobile-open .admin-sidebar {
    left: 0;
  }

  /* Ensure labels always visible on mobile drawer */
  .admin-layout.mobile-open .admin-nav-label,
  .admin-layout.mobile-open .admin-brand-text {
    opacity: 1;
    max-width: 140px;
  }
  .admin-layout.mobile-open .admin-nav-group-label span { opacity: 1; }
  .admin-layout.mobile-open .admin-nav-badge { opacity: 1; }

  .admin-page { padding: 20px 16px; }
  .admin-topbar { padding: 0 12px; gap: 8px; }

  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-org-grid { grid-template-columns: 1fr; }
  .admin-filter-bar { flex-direction: column; }
  .admin-filter-bar .form-input,
  .admin-filter-bar .select-input { max-width: 100%; }
  .admin-detail-header { flex-direction: column; align-items: flex-start; }
  .admin-detail-meta { flex-wrap: wrap; }
  .admin-page-header { flex-direction: column; gap: 12px; }
  .admin-lib-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============ ORG ADMIN TABS ============ */
.admin-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--fg); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}
.empty-state p { margin-bottom: 16px; font-size: 0.95rem; }

/* ============ ORG SEAT METER ============ */
.seat-warning { color: #D4A853; }
.seat-danger { color: #EF4444; }

/* ===== BILLING / PRICING ===== */

/* Pricing Page */
.pricing-page { padding-top: 80px; }
.pricing-hero { text-align: center; padding: 100px 24px 60px; max-width: 800px; margin: 0 auto; }
.pricing-hero-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(45,156,219,0.2); padding: 6px 16px; border-radius: 20px; margin-bottom: 24px; }
.pricing-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 20px; letter-spacing: -0.03em; }
.pricing-hero h1 .accent-text { color: var(--accent); }
.pricing-hero-sub { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto 40px; line-height: 1.8; }

.pricing-toggle-wrap { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 60px; }
.pricing-toggle-btn { padding: 10px 24px; border-radius: 9px; border: none; background: transparent; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif; }
.pricing-toggle-btn.active { background: var(--bg-elevated); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.pricing-save-badge { font-size: 0.65rem; background: rgba(72,187,120,0.2); color: #48bb78; padding: 2px 8px; border-radius: 10px; margin-left: 3px; font-weight: 700; }

.pricing-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; align-items: start; }
.pricing-loading { display: flex; justify-content: center; padding: 60px; width: 100%; }

.pricing-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 36px 28px; position: relative; transition: all 0.25s; }
.pricing-card:first-child { border-radius: 16px; }
.pricing-card:last-child { border-radius: 16px; }
.pricing-card:not(:first-child) { border-left: 1px solid var(--border); }
.pricing-card:hover { z-index: 1; border-color: rgba(255,255,255,0.12); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.pricing-card-popular { border-color: var(--accent) !important; background: linear-gradient(180deg, rgba(45,156,219,0.04) 0%, var(--bg-card) 100%); box-shadow: 0 0 40px rgba(45,156,219,0.1); z-index: 2; transform: translateY(-8px); border-radius: 16px !important; border-left: 1px solid var(--accent) !important; margin: 0; padding: 48px 28px 36px; }
.pricing-card-popular:hover { transform: translateY(-10px); box-shadow: 0 20px 60px rgba(45,156,219,0.2); }
.pricing-popular-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--bg-deep); font-size: 0.68rem; font-weight: 800; padding: 5px 16px; border-radius: 20px; white-space: nowrap; letter-spacing: 0.06em; text-transform: uppercase; }

.pricing-card-header { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.pricing-card-header h3 { font-size: 1.4rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.pricing-card-desc { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }

.pricing-card-price { margin-bottom: 28px; }
.pricing-price-amount { font-size: 2.8rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.03em; }
.pricing-billed-annual { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }

.pricing-features { list-style: none; margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.pricing-features li { font-size: 0.9rem; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.pricing-check { color: var(--accent); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.pricing-card-action button, .pricing-card-action a { display: block; }

.pricing-faq { max-width: 900px; margin: 0 auto; padding: 0 24px 100px; }
.pricing-faq h2 { text-align: center; font-size: 2rem; margin-bottom: 12px; letter-spacing: -0.02em; }
.pricing-faq-sub { text-align: center; color: var(--text-secondary); margin-bottom: 48px; font-size: 1rem; }
.pricing-faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.pricing-faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; transition: border-color 0.2s; }
.pricing-faq-item:hover { border-color: rgba(255,255,255,0.1); }
.pricing-faq-item h4 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text-primary); }
.pricing-faq-item p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 1100px) {
  .pricing-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .pricing-cards { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 60px; }
  .pricing-card { border-radius: 14px !important; border-left: 1px solid var(--border) !important; }
  .pricing-card-popular { transform: none; margin: 0; border-left: 1px solid var(--accent) !important; }
  .pricing-card:not(:first-child) { border-left: 1px solid var(--border); }
}

/* Checkout Page */
.checkout-page { padding-top: 80px; min-height: 100vh; }
.checkout-container { max-width: 1000px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1fr 400px; gap: 48px; }
@media (max-width: 768px) { .checkout-container { grid-template-columns: 1fr; } .checkout-right { order: -1; } }
.checkout-back { margin-bottom: 16px; }
.checkout-left h2 { font-size: 1.6rem; margin-bottom: 8px; }
.checkout-plan-summary { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 28px; }
.checkout-plan-badge { display: flex; align-items: center; justify-content: space-between; }
.checkout-plan-name { font-weight: 600; font-size: 1rem; }
.checkout-plan-seats { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.checkout-plan-price { font-size: 1.4rem; font-weight: 700; }
.checkout-plan-price span { font-size: 0.8rem; color: var(--text-secondary); font-weight: 400; }
.checkout-form-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.helcim-notice { display: flex; align-items: center; gap: 12px; background: rgba(45,156,219,0.06); border: 1px solid rgba(45,156,219,0.15); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.helcim-notice-icon { font-size: 1.2rem; }
.helcim-notice-title { font-size: 0.875rem; font-weight: 600; }
.helcim-notice-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkout-right { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; height: fit-content; position: sticky; top: 100px; }
.checkout-order-summary h3 { font-size: 1rem; font-weight: 600; margin-bottom: 20px; }
.order-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.order-line:last-of-type { border-bottom: none; }
.order-total { font-size: 1rem; padding-top: 12px; }
.order-discount span.text-accent { color: var(--accent); }
.order-features { margin-top: 20px; }
.order-features h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 10px; }
.order-features ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.order-features li { font-size: 0.82rem; color: var(--text-secondary); }
.success-message { background: rgba(72,187,120,0.12); border: 1px solid rgba(72,187,120,0.3); color: #48bb78; padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; }
.error-message { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.3); color: #EF4444; padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; }

/* Billing Portal */
.billing-portal-page, .org-billing-page { padding-top: 80px; min-height: 100vh; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; cursor: pointer; padding: 4px 0; font-family: 'DM Sans', sans-serif; transition: color 0.15s; }
.back-btn:hover { color: var(--text-primary); }
.page-container { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.page-header { margin-bottom: 40px; }
.page-header h1 { font-size: 2rem; margin: 10px 0 6px; letter-spacing: -0.02em; }
.billing-trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(163,191,250,0.08); border: 1px solid rgba(163,191,250,0.2); border-radius: 14px; padding: 16px 24px; margin-bottom: 28px; }
.billing-trial-banner.urgent { background: rgba(240,168,48,0.08); border-color: rgba(240,168,48,0.25); }
.billing-trial-banner.urgent .billing-trial-icon { color: var(--amber); }
.billing-trial-text { flex: 1; font-size: 0.9rem; display: flex; gap: 10px; align-items: center; }
.billing-expired-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.2); border-radius: 14px; padding: 16px 24px; margin-bottom: 28px; font-size: 0.9rem; }
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
@media (max-width: 600px) { .billing-grid { grid-template-columns: 1fr; } }
.billing-current-plan, .billing-payment-method { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; transition: border-color 0.2s, box-shadow 0.2s; }
.billing-current-plan:hover, .billing-payment-method:hover { border-color: rgba(255,255,255,0.1); box-shadow: 0 6px 24px rgba(0,0,0,0.2); }
.billing-current-plan h3, .billing-payment-method h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 20px; }
.billing-plan-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.billing-plan-name { font-size: 1.5rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }
.billing-plan-status { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.billing-plan-actions { display: flex; gap: 8px; flex-shrink: 0; }
.billing-period { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.85rem; display: flex; gap: 8px; align-items: center; }
.billing-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-green { background: #48bb78; }
.status-accent { background: var(--accent); }
.status-amber { background: var(--amber); }
.status-dim { background: var(--text-dim); }
.status-coral { background: var(--coral); }
.billing-card-row { display: flex; align-items: center; gap: 12px; }
.billing-card-icon { font-size: 1.5rem; }
.billing-card-info { flex: 1; }
.billing-card-type { font-size: 0.9rem; font-weight: 500; }
.billing-no-card { text-align: center; padding: 16px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.billing-no-card .text-dim { font-size: 0.9rem; }
.billing-invoices { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; transition: border-color 0.2s; }
.billing-invoices:hover { border-color: rgba(255,255,255,0.1); }
.billing-invoices h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 20px; }
.billing-invoice-table { display: flex; flex-direction: column; }
.billing-invoice-header { display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.billing-invoice-row { display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.875rem; }
.billing-invoice-status { padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.billing-invoice-status.paid { background: rgba(72,187,120,0.15); color: #48bb78; }
.billing-invoice-status.failed { background: rgba(255,107,107,0.15); color: #EF4444; }
.billing-seat-display { text-align: center; padding: 12px 0; }
.billing-seat-number { font-size: 2rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.billing-license-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; margin-bottom: 24px; }
.billing-license-card h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 20px; }
.billing-license-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 0.9rem; }
.billing-upgrade-prompt { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(45,156,219,0.04); border: 1px solid rgba(45,156,219,0.14); border-radius: 16px; padding: 24px 32px; }
.billing-upgrade-prompt h4 { font-size: 0.95rem; margin-bottom: 4px; }

/* Trial Banner (in dashboard) */
.trial-banner { display: none; }
.trial-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 900px; margin: 0 auto; background: rgba(163,191,250,0.1); border: 1px solid rgba(163,191,250,0.25); border-radius: 10px; padding: 10px 16px; font-size: 0.875rem; }
.trial-banner-inner.urgent { background: rgba(240,168,48,0.1); border-color: rgba(240,168,48,0.3); }

/* Button sizes */
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-xs { padding: 4px 10px; font-size: 0.78rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text-primary); }

/* Admin billing extras */
.admin-billing-list { display: flex; flex-direction: column; gap: 10px; }

/* Admin table */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; padding: 8px 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.admin-table tr:last-child td { border-bottom: none; }
.badge-active { background: rgba(72,187,120,0.15); color: #48bb78; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-diff { background: rgba(240,168,48,0.15); color: #D4A853; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }


/* ============ FRESHNESS BADGES ============ */
.freshness-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.freshness-new {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.freshness-updated {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.course-updated-meta {
  color: #60a5fa;
  font-size: 0.8rem;
}

/* ============ NOTIFICATION BELL ============ */
.notif-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.notif-bell-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 10000;
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.notif-mark-all {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}
.notif-mark-all:hover { opacity: 0.8; }
.notif-dropdown-items {
  max-height: 320px;
  overflow-y: auto;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: rgba(59,130,246,0.06); }
.notif-item-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text-dim); }
.notif-item-loading, .notif-item-empty { padding: 24px 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--accent);
}
.notif-dropdown-footer a:hover { opacity: 0.8; }

/* Notifications page list */
.notif-page-list { display: flex; flex-direction: column; gap: 6px; }
.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-page-item:hover { background: rgba(255,255,255,0.06); }
.notif-page-item.notif-unread { border-left: 3px solid var(--accent); }
.notif-page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--text-dim);
  margin-top: 5px;
  flex-shrink: 0;
}
.notif-page-dot.dot-active { background: var(--accent); border-color: var(--accent); }
.notif-page-body { flex: 1; }
.notif-page-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.notif-page-msg { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-page-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.notif-page-category {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}

/* Notification page tabs */
.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0 0 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.notif-tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.notif-tab-btn:hover { color: var(--text-primary); }
.notif-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.notif-tab-count {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.notif-tab-count.red { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Notification filter bar */
.notif-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.notif-filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Notification preferences panel */
.notif-pref-section {
  margin-bottom: 28px;
}
.notif-pref-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.notif-pref-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 6px;
}
.notif-pref-row-info {
  flex: 1;
}
.notif-pref-row-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
}
.notif-pref-row-sub {
  font-size: 11px;
  color: var(--text-dim);
}
.notif-pref-critical-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.notif-pref-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toggle switch */
.notif-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}
.notif-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.notif-toggle-track {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.notif-toggle input:checked + .notif-toggle-track { background: var(--accent); }
.notif-toggle-track::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.notif-toggle input:checked + .notif-toggle-track::before { transform: translateX(14px); }

.notif-pref-digest-select {
  font-size: 11px;
  padding: 3px 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.notif-pref-digest-select:focus { outline: none; border-color: var(--accent); }

/* Dropdown category badge */
.notif-item-cat {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Dropdown unread count */
.notif-dropdown-unread {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

/* ============ UPDATES FEED ============ */
.updates-feed-list { display: flex; flex-direction: column; gap: 10px; }
.update-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s;
}
.update-feed-item:hover { background: rgba(255,255,255,0.06); }
.update-feed-icon { font-size: 20px; margin-top: 2px; flex-shrink: 0; }
.update-feed-content { flex: 1; }
.update-feed-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 3px; }
.update-feed-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.update-feed-summary { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 6px; }
.update-feed-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.update-feed-time { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* ============ DASHBOARD WHAT'S NEW BANNER ============ */
.dash-whats-new-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}
.dash-new-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dash-new-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 500;
}
.dash-new-see-all {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.dash-new-see-all:hover { opacity: 0.8; }


/* ============================================================
   MICROINTERACTIONS & MOTION SYSTEM — Praxis
   All CSS-native, no JS animation libraries
   ============================================================ */

/* ===== PAGE TRANSITION ===== */
#app {
  animation: page-fade-in 0.25s ease forwards;
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

/* ===== BUTTON ENHANCEMENTS ===== */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.15s;
}
.btn:active::after { opacity: 1; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  box-shadow: 0 0 0 0 rgba(45,156,219,0);
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(45,156,219,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { box-shadow: none; }

/* ===== CARD HOVER GLOW ===== */
.course-card,
.library-card,
.admin-org-card,
.cert-card,
.admin-kpi-card,
.stat-card,
.path,
.pillar {
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s cubic-bezier(0.22,1,0.36,1);
}
.course-card:hover,
.library-card:hover {
  border-color: rgba(45,156,219,0.3) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(45,156,219,0.08);
}
.admin-org-card:hover {
  border-color: rgba(45,156,219,0.25) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.admin-kpi-card:hover {
  border-color: rgba(45,156,219,0.15) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.stat-card:hover {
  border-color: rgba(45,156,219,0.2) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===== PILLAR CARD HOVER (Landing) ===== */
.pillar {
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.pillar:hover {
  border-color: rgba(45,156,219,0.25) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(45,156,219,0.06);
  transform: translateY(-3px);
}
.pillar:hover .pillar-icon {
  background: rgba(45,156,219,0.2);
  transition: background 0.3s;
}

/* ===== AUDIENCE CARDS (Landing) ===== */
.audience-card {
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s;
}
.audience-card:hover {
  border-color: rgba(45,156,219,0.2) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ===== PROGRESS BAR ANIMATED FILL ===== */
.progress-bar {
  width: 0% !important;
  transition: width 0.9s cubic-bezier(0.22,1,0.36,1) !important;
}
.progress-bar.animated {
  width: var(--progress-target, 0%) !important;
}
/* Shimmer on progress bar */
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: progress-shimmer 1.5s ease 0.9s forwards;
  pointer-events: none;
}
.progress-bar-wrap { position: relative; }
@keyframes progress-shimmer {
  from { left: -60%; }
  to   { left: 110%; }
}

/* ===== STAT NUMBER COUNT-UP ===== */
.stat-number,
.admin-kpi-value,
.stat-value {
  transition: opacity 0.3s;
}
.stat-number.counting { opacity: 0.7; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover, #3D4F5F) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* ===== LESSON ROW INTERACTIONS ===== */
.lesson-row {
  transition: background 0.15s, padding-left 0.2s cubic-bezier(0.22,1,0.36,1);
  position: relative;
}
.lesson-row:hover {
  background: rgba(45,156,219,0.04) !important;
  padding-left: 28px;
}
.lesson-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  border-radius: 0 2px 2px 0;
  transition: opacity 0.2s;
}
.lesson-row:hover::before { opacity: 1; }
.lesson-row.completed .lesson-check {
  transition: background 0.3s, transform 0.3s cubic-bezier(0.22,1,0.36,1);
}

/* ===== LESSON COMPLETION CELEBRATION ===== */
@keyframes completion-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes completion-glow {
  0%   { box-shadow: 0 0 0 0 rgba(45,156,219,0.6); }
  60%  { box-shadow: 0 0 0 14px rgba(45,156,219,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,156,219,0); }
}
.lesson-complete-celebrate {
  animation: completion-pop 0.5s cubic-bezier(0.22,1,0.36,1), completion-glow 0.6s ease;
}

/* Sparkle burst overlay */
@keyframes sparkle-fade {
  0%   { opacity: 1; transform: scale(0.8); }
  80%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.3); }
}
.completion-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(45,156,219,0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: sparkle-fade 0.7s ease forwards;
}

/* ===== TOAST / NOTIFICATION SLIDE-IN ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}
.toast.toast-error { border-left-color: var(--coral); }
.toast.toast-success { border-left-color: #48bb78; }
.toast.removing {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) translateY(8px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}

/* ===== NAV LINK ACTIVE INDICATOR ===== */
.nav-link {
  position: relative;
  transition: color 0.15s, background 0.15s;
  align-self: center;
}

/* admin-nav-item hover/active styles defined above in admin layout section */

/* ===== NOTIFICATION BADGE PULSE ===== */
.notif-badge {
  animation: badge-pulse 2.5s ease infinite;
}
@keyframes badge-pulse {
  0%, 90%, 100% { transform: scale(1); }
  95% { transform: scale(1.2); }
}

/* ===== FRESHNESS BADGE SHIMMER ===== */
.freshness-new {
  animation: freshness-glow 3s ease infinite;
}
@keyframes freshness-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ===== LOADING SPINNER ENHANCED ===== */
.loading-spinner {
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

/* ===== FORM INPUT FOCUS GLOW ===== */
.form-input {
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,156,219,0.12);
}

/* ===== MODAL ENTRANCE ===== */
.admin-modal {
  animation: modal-in 0.25s cubic-bezier(0.22,1,0.36,1);
}
.admin-modal-overlay {
  animation: overlay-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== DROPDOWN FADE-IN ===== */
.nav-dropdown-menu {
  animation: dropdown-in 0.15s ease;
  transform-origin: top left;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-dropdown {
  animation: dropdown-in 0.2s cubic-bezier(0.22,1,0.36,1);
  transform-origin: top right;
}

/* ===== CURSOR GLOW EFFECT (Hero) ===== */
.hero-glow-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,156,219,0.06) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: left 0.12s linear, top 0.12s linear;
  will-change: left, top;
}

/* ===== SECTION DIVIDER GRADIENT ===== */
.section-glow-top {
  position: relative;
}
.section-glow-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

/* ===== CERTIFICATION CARD EARNED ===== */
.cert-card.earned {
  border-color: rgba(45,156,219,0.3);
  box-shadow: 0 0 24px rgba(45,156,219,0.08);
}
.cert-card.earned .cert-icon {
  animation: earned-bounce 0.5s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}
@keyframes earned-bounce {
  from { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ===== ENROLLMENT SUCCESS ===== */
@keyframes enroll-success {
  0%   { transform: scale(1); background: var(--accent-dim); }
  40%  { transform: scale(1.05); background: rgba(45,156,219,0.25); }
  100% { transform: scale(1); background: var(--accent-dim); }
}
.enroll-success-flash {
  animation: enroll-success 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ===== DASHBOARD STAT CARD ENTRY ===== */
.stat-card {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.10s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.20s; }
@keyframes stat-entry {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== KPI CARD ENTRY (Admin) ===== */
.admin-kpi-card {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.admin-kpi-grid .admin-kpi-card:nth-child(1) { animation-delay: 0.04s; }
.admin-kpi-grid .admin-kpi-card:nth-child(2) { animation-delay: 0.08s; }
.admin-kpi-grid .admin-kpi-card:nth-child(3) { animation-delay: 0.12s; }
.admin-kpi-grid .admin-kpi-card:nth-child(4) { animation-delay: 0.16s; }
.admin-kpi-grid .admin-kpi-card:nth-child(5) { animation-delay: 0.20s; }
.admin-kpi-grid .admin-kpi-card:nth-child(6) { animation-delay: 0.24s; }

/* ===== COURSE CARD GRID STAGGER ===== */
.course-grid .course-card {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.course-grid .course-card:nth-child(1) { animation-delay: 0.04s; }
.course-grid .course-card:nth-child(2) { animation-delay: 0.09s; }
.course-grid .course-card:nth-child(3) { animation-delay: 0.14s; }
.course-grid .course-card:nth-child(4) { animation-delay: 0.19s; }
.course-grid .course-card:nth-child(5) { animation-delay: 0.24s; }
.course-grid .course-card:nth-child(6) { animation-delay: 0.29s; }

/* ===== ALERT / CONFIRMATION PATTERNS ===== */
.alert-success {
  background: rgba(72,187,120,0.1);
  border: 1px solid rgba(72,187,120,0.25);
  border-left: 3px solid #48bb78;
  color: #48bb78;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  animation: toast-in 0.3s cubic-bezier(0.22,1,0.36,1);
}
.alert-error {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.25);
  border-left: 3px solid var(--coral);
  color: var(--coral);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  animation: toast-in 0.3s cubic-bezier(0.22,1,0.36,1);
}
.alert-info {
  background: rgba(45,156,219,0.08);
  border: 1px solid rgba(45,156,219,0.2);
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* ===== SAVE STATE INDICATOR ===== */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.save-indicator.saving { color: var(--amber); }
.save-indicator.saved  { color: var(--accent); }
.save-indicator.saved::before {
  content: '✓';
  font-weight: 700;
}

/* ===== SCROLL PROGRESS BAR (Lesson) ===== */
.lesson-scroll-progress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 90;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(45,156,219,0.5);
}

/* ===== BACK BUTTON HOVER ===== */
.breadcrumb,
.btn-ghost {
  transition: all 0.15s;
}
.breadcrumb:hover {
  color: var(--accent);
  transform: translateX(-2px);
}

/* ===== DATA TABLE ROW HOVER ===== */
.data-table tr,
.admin-table tr {
  transition: background 0.1s;
}

/* ===== HERO PULSE DOT (Landing) ===== */
.hero-label .dot {
  animation: hero-dot-pulse 2s ease infinite;
  box-shadow: 0 0 0 0 rgba(45,156,219,0.4);
}
@keyframes hero-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45,156,219,0.5); }
  60%  { box-shadow: 0 0 0 6px rgba(45,156,219,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,156,219,0); }
}

/* ===== HERO STAT COUNTER REVEAL ===== */
.stat-item {
  animation: stat-entry 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.hero-stats .stat-item:nth-child(1) { animation-delay: 0.3s; }
.hero-stats .stat-item:nth-child(2) { animation-delay: 0.45s; }
.hero-stats .stat-item:nth-child(3) { animation-delay: 0.6s; }

/* ===== LANDING SECTION REVEAL ===== */
.hero-label { animation: stat-entry 0.5s cubic-bezier(0.22,1,0.36,1) 0.1s both; }
.hero h1    { animation: stat-entry 0.6s cubic-bezier(0.22,1,0.36,1) 0.18s both; }
.hero-sub   { animation: stat-entry 0.6s cubic-bezier(0.22,1,0.36,1) 0.26s both; }
.hero-ctas  { animation: stat-entry 0.5s cubic-bezier(0.22,1,0.36,1) 0.34s both; }

/* ===== LOGO MARK SUBTLE PULSE ===== */
.logo-mark,
.nav-logo-mark {
  transition: box-shadow 0.3s, transform 0.2s;
}
.logo-mark:hover,
.nav-logo-mark:hover {
  box-shadow: 0 0 16px rgba(45,156,219,0.4);
  transform: scale(1.05);
}

/* ===== ORG SEAT UTILIZATION BAR ===== */
.seat-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.seat-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}
.seat-bar.warn { background: var(--amber); }
.seat-bar.danger { background: var(--coral); }

/* ===== WHAT'S NEW BANNER ANIMATION ===== */
.dash-whats-new-bar {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}

/* ===== LIBRARY CARD STAGGER ===== */
.library-grid .library-card {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.library-grid .library-card:nth-child(1) { animation-delay: 0.04s; }
.library-grid .library-card:nth-child(2) { animation-delay: 0.09s; }
.library-grid .library-card:nth-child(3) { animation-delay: 0.14s; }
.library-grid .library-card:nth-child(4) { animation-delay: 0.19s; }
.library-grid .library-card:nth-child(5) { animation-delay: 0.24s; }
.library-grid .library-card:nth-child(6) { animation-delay: 0.29s; }

/* ===== UPDATE FEED STAGGER ===== */
.updates-feed-list .update-feed-item {
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.updates-feed-list .update-feed-item:nth-child(1) { animation-delay: 0.04s; }
.updates-feed-list .update-feed-item:nth-child(2) { animation-delay: 0.08s; }
.updates-feed-list .update-feed-item:nth-child(3) { animation-delay: 0.12s; }
.updates-feed-list .update-feed-item:nth-child(4) { animation-delay: 0.16s; }
.updates-feed-list .update-feed-item:nth-child(5) { animation-delay: 0.20s; }

/* ===== BILLING STATUS DOT ANIMATION ===== */
.billing-status-dot.status-green,
.admin-status-dot.status-active {
  animation: live-pulse 2s ease infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; box-shadow: 0 0 0 4px rgba(72,187,120,0); }
}

/* ===== PRICING CARD HOVER ===== */
.pricing-card {
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.pricing-card-popular:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 60px rgba(45,156,219,0.2), 0 12px 40px rgba(0,0,0,0.4);
}

/* ===== REDUCE MOTION RESPECT ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* admin-nav-group-label styles defined above in admin layout section */

/* ============ WORKBENCH ============ */
#wb-input {
  font-family: inherit;
}

#wb-input::placeholder {
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============ SPA HAMBURGER NAV ============ */
.app-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s;
  margin-left: 8px;
}
.app-nav-hamburger:hover { background: rgba(255,255,255,0.06); }
.app-nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.app-nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.app-nav-hamburger.open span:nth-child(2) { opacity: 0; }
.app-nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.app-nav-mobile-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(10, 22, 40, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 99;
  padding: 16px 20px 24px;
  flex-direction: column;
  gap: 0;
}
.app-nav-mobile-drawer.open { display: flex; }
.app-nav-mobile-drawer a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: color 0.15s;
  display: block;
}
.app-nav-mobile-drawer a:last-child { border-bottom: none; }
.app-nav-mobile-drawer a:hover { color: var(--text-primary); }
.app-nav-mobile-drawer .app-nav-mobile-cta {
  margin-top: 12px;
  background: var(--accent);
  color: #0A1628 !important;
  padding: 12px 20px !important;
  border-radius: 10px;
  text-align: center;
  font-weight: 700 !important;
  border-bottom: none !important;
}
.app-nav-mobile-drawer .app-nav-mobile-logout {
  color: var(--coral, #EF4444) !important;
}

/* Public nav links — horizontal row on desktop */
.nav-public-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }

/* ============ MEDIUM DESKTOP NAV — prevent wrapping ============ */
/* On 1024px–1280px screens the authenticated nav can overflow.
   Tighten spacing and progressively hide secondary nav items. */
@media (max-width: 1280px) {
  .nav-link { padding: 8px 8px; font-size: 0.84rem; }
  .nav-left { gap: 20px; }
  .nav-right { gap: 8px; }
}
@media (max-width: 1100px) {
  /* Hide secondary nav items — still accessible via mobile drawer or other pages */
  .nav-hide-xl { display: none !important; }
  .nav-link { padding: 7px 7px; font-size: 0.82rem; }
  /* Shorten user display to just logout */
  .nav-user-name, .nav-user-role { display: none !important; }
}
/* Ensure the nav itself never wraps on desktop */
@media (min-width: 769px) {
  .app-nav { flex-wrap: nowrap; }
  .nav-links { flex-wrap: nowrap; }
  .nav-public-links { flex-wrap: nowrap; }
}

/* ============ MOBILE RESPONSIVE IMPROVEMENTS ============ */
@media (max-width: 768px) {
  .app-nav-hamburger { display: flex; }
  .nav-public-links { display: none !important; }
  .nav-user-desktop { display: none !important; }
  .nav-whats-new { display: none !important; }

  /* Pricing responsive */
  .pricing-hero { padding: 80px 16px 40px; }
  .pricing-hero h1 { font-size: 2rem; }
  .pricing-faq { padding: 0 16px 60px; }
  .pricing-faq-grid { grid-template-columns: 1fr; }

  /* For Teams page */
  .for-teams-hero { padding: 80px 16px 48px; }
}

@media (max-width: 600px) {
  /* Nav */
  .app-nav { padding: 0 12px; }

  /* Page containers */
  .page-container { padding: 20px 12px; }

  /* Auth forms */
  .auth-card { padding: 24px 16px; margin: 0 8px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Course cards */
  .course-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Lesson */
  .lesson-page { padding: 20px 12px; }

  /* Pricing */
  .pricing-hero h1 { font-size: 1.8rem; }
  .pricing-hero-sub { font-size: 0.95rem; }
  .pricing-cards { padding: 0 8px 40px; }
  .pricing-card { padding: 24px 20px; }
  .pricing-cta-wrap { flex-direction: column; gap: 12px; }
  .pricing-cta-wrap .btn { width: 100%; text-align: center; }

  /* For Teams + Roadmap pages */
  .main-content h1, .main-content h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .main-content { padding-top: 60px; }
}

/* ============================================================
   ASSET STUDIO
   ============================================================ */

.studio-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.studio-header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.studio-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(155,126,248,0.2) 0%, rgba(45,156,219,0.12) 100%);
  border: 1px solid rgba(155,126,248,0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #9b7ef8;
  flex-shrink: 0;
}

.studio-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(120deg, var(--text-primary) 0%, #9b7ef8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.studio-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.studio-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.studio-step-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.studio-step-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.studio-step-nav .studio-step-label { margin-bottom: 0; }

/* ── Type picker ─────────────── */
.studio-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.studio-type-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.studio-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}

.studio-type-card:hover::before { opacity: 1; }

.studio-type-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.studio-type-emoji {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.studio-type-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.studio-type-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.studio-type-arrow {
  position: absolute;
  bottom: 16px;
  right: 20px;
  font-size: 1rem;
  color: var(--card-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.studio-type-card:hover .studio-type-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ── Inputs form ────────────── */
.studio-inputs-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.studio-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--card-color, var(--accent));
  margin-bottom: 24px;
}

.studio-type-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: var(--card-color, var(--accent));
}

.studio-field {
  margin-bottom: 16px;
}

.studio-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 8px;
}

.studio-field-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.studio-textarea {
  resize: vertical;
  min-height: 72px;
}

.studio-textarea-sm {
  resize: vertical;
  min-height: 64px;
  font-size: 0.88rem;
}

.studio-form-actions {
  margin-top: 24px;
}

/* Toggle switch */
.studio-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.studio-toggle input { opacity: 0; width: 0; height: 0; }

.studio-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.studio-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}

.studio-toggle input:checked + .studio-toggle-slider {
  background: rgba(45,156,219,0.15);
  border-color: var(--accent);
}

.studio-toggle input:checked + .studio-toggle-slider::before {
  left: 21px;
  background: var(--accent);
}

/* Preview card */
.studio-preview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.studio-preview-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.studio-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.studio-preview-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 7px 0 7px 20px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.studio-preview-list li:last-child { border-bottom: none; }

.studio-preview-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Generating state ────────── */
.studio-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.studio-spinner-wrap {
  text-align: center;
}

.studio-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(45,156,219,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: studio-spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes studio-spin {
  to { transform: rotate(360deg); }
}

.studio-generating-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.studio-generating-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.studio-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.studio-spin-sm {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: studio-spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── Result layout ───────────── */
.studio-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-meta-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.studio-result-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

/* Output panel */
.studio-output-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.studio-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.studio-output-content {
  padding: 28px;
  max-height: 72vh;
  overflow-y: auto;
}

/* Refine panel */
.studio-refine-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
}

.studio-refine-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.studio-quick-refines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.studio-quick-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.studio-quick-btn:hover {
  border-color: rgba(45,156,219,0.3);
  color: var(--text-primary);
  background: rgba(45,156,219,0.04);
}

.studio-refine-custom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.studio-refine-custom-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.studio-refine-submit {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.studio-refine-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-stat-label { font-size: 0.75rem; color: var(--text-dim); }
.studio-stat-val { font-size: 0.8rem; color: var(--text-secondary); }

/* ── Library grid ────────────── */
.studio-library-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-lib-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.studio-lib-card:hover {
  border-color: rgba(45,156,219,0.2);
  transform: translateY(-1px);
}

.studio-lib-emoji { font-size: 1.3rem; flex-shrink: 0; }

.studio-lib-body { flex: 1; min-width: 0; }

.studio-lib-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-lib-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-lib-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.studio-lib-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.studio-lib-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── Empty state ─────────────── */
.studio-empty {
  text-align: center;
  padding: 60px 20px;
}

.studio-empty-icon { font-size: 3rem; margin-bottom: 16px; }

.studio-empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.studio-empty-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Nav link highlight ──────── */
.nav-studio-link {
  color: #9b7ef8 !important;
  white-space: nowrap;
}

.nav-studio-link:hover {
  background: rgba(155,126,248,0.1) !important;
}

.nav-studio-link.active {
  color: #9b7ef8 !important;
  background: rgba(155,126,248,0.12) !important;
}

/* ── What's New nav link ──────── */
.nav-whats-new {
  white-space: nowrap;
}

/* ── Toast ───────────────────── */
.studio-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--coral);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

.studio-toast.studio-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Output document styles ───── */
.output-doc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.output-h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.output-h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.output-desc {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.output-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.output-optional-badge {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.output-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.output-meta-item {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.output-section {
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.output-section:first-child { border-top: none; margin-top: 0; }

.output-instructions {
  background: rgba(45,156,219,0.06);
  border: 1px solid rgba(45,156,219,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.output-template-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.output-section-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.output-template-block {
  background: rgba(155,126,248,0.06);
  border: 1px solid rgba(155,126,248,0.15);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.output-placeholder {
  background: rgba(155,126,248,0.15);
  color: #9b7ef8;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Markdown rendered */
.output-md .output-p { color: var(--text-secondary); margin-bottom: 12px; }
.output-md .output-ul { margin: 8px 0 12px 20px; }
.output-md .output-li { color: var(--text-secondary); margin-bottom: 4px; list-style: disc; }
.output-md .output-md-h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text-primary);
}
.output-md .output-md-h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 12px 0 6px;
  color: var(--text-primary);
}
.output-md .output-blockquote {
  border-left: 3px solid var(--accent-glow);
  padding-left: 12px;
  color: var(--text-dim);
  font-style: italic;
  margin: 8px 0;
}
.output-md .output-code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  overflow-x: auto;
  margin: 8px 0;
}
.output-md .output-inline-code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: monospace;
}

/* Prompt pack */
.output-prompt-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

.output-prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.output-prompt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.output-prompt-num {
  width: 22px;
  height: 22px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.output-prompt-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  flex: 1;
}

.output-copy-btn {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.output-copy-btn:hover { color: var(--accent); border-color: var(--accent-glow); }

.output-prompt-usecase {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.output-prompt-text {
  background: var(--bg-deep);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
  font-family: 'DM Mono', 'Fira Code', monospace;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin: 8px 0;
  line-height: 1.6;
  overflow-x: auto;
}

.output-prompt-tips {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Course outline */
.output-module {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 12px 0;
}

.output-module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.output-module-num {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.output-module-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.output-module-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.output-lessons { display: flex; flex-direction: column; gap: 6px; }

.output-lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.output-lesson-num {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.output-lesson-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.output-lesson-title { font-size: 0.85rem; color: var(--text-primary); }

.output-lesson-dur {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.output-lesson-type {
  font-size: 0.68rem;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 8px;
}

.output-list {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-secondary);
}

.output-list li { margin-bottom: 5px; font-size: 0.88rem; }

/* Checklist */
.output-checklist { display: flex; flex-direction: column; gap: 8px; }

.output-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.output-check-item.output-check-critical {
  border-color: rgba(255,107,107,0.2);
  background: rgba(255,107,107,0.04);
}

.output-checkbox {
  font-size: 1rem;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 1px;
}

.output-check-content { flex: 1; }

.output-check-text {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.output-check-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255,107,107,0.12);
  color: var(--coral);
  margin-left: 6px;
}

.output-check-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Quiz */
.output-quiz-q {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.output-quiz-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
  padding-top: 2px;
}

.output-quiz-question { font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }

.output-quiz-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.output-quiz-option { font-size: 0.82rem; color: var(--text-secondary); padding: 4px 0; }

.output-quiz-correct { color: var(--accent); }

.output-quiz-explanation { font-size: 0.78rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 8px; }

/* ── Responsive ──────────────── */
@media (max-width: 900px) {
  .studio-type-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-inputs-layout { grid-template-columns: 1fr; }
  .studio-inputs-right { display: none; }
  .studio-result-layout { grid-template-columns: 1fr; }
  .studio-refine-panel { position: static; }
}

@media (max-width: 600px) {
  .studio-wrap { padding: 16px 16px 60px; }
  .studio-section { padding: 20px 16px; }
  .studio-type-grid { grid-template-columns: 1fr; }
  .studio-header { flex-direction: column; gap: 12px; }
}

/* ── Pricing FAQ Accordion ──────────────── */
.pq-item:first-child { border-top: 1px solid var(--border); }
.pq-item button:hover .pq-chevron { background: rgba(255,255,255,0.08) !important; }

/* ── Demo Modal — hidden by default on ALL pages ──────────────── */
.demo-modal-backdrop {
  display: none !important;
  font-family: 'DM Sans', sans-serif;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.demo-modal-backdrop.open { display: flex !important; }
@keyframes demo-fade-in { from { opacity: 0; } to { opacity: 1; } }
.demo-modal {
  background: #0F1D2E;
  border: 1px solid rgba(45,156,219,0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(45,156,219,0.08);
}
.demo-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.06); border: none;
  color: var(--text-secondary); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background 0.15s, color 0.15s;
}
.demo-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.demo-modal-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(45,156,219,0.1); border: 1px solid rgba(45,156,219,0.2);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 20px;
}
.demo-modal-badge .dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.demo-modal h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 8px; color: var(--text-primary);
}
.demo-modal .demo-modal-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.6; }
.demo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.demo-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.demo-form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.demo-form-label .opt { color: var(--text-dim); font-weight: 400; }
.demo-form-input, .demo-form-select, .demo-form-textarea {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: var(--text-primary); font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; padding: 11px 14px; outline: none; transition: border-color 0.15s;
  width: 100%;
}
.demo-form-input:focus, .demo-form-select:focus, .demo-form-textarea:focus {
  border-color: rgba(45,156,219,0.5);
}
.demo-form-select { cursor: pointer; }
.demo-form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.demo-error-msg { color: #EF4444; font-size: 0.82rem; display: none; margin-bottom: 12px; }
.demo-submit-btn {
  width: 100%; padding: 14px 24px; background: var(--accent); border: none;
  border-radius: 12px; color: #0A1628; font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.demo-submit-btn:hover { opacity: 0.9; }
.demo-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.demo-success-state { text-align: center; padding: 24px 0; }
.demo-success-icon {
  width: 56px; height: 56px; background: rgba(45,156,219,0.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--accent); margin: 0 auto 20px;
}
.demo-success-state h3 { font-size: 1.4rem; margin-bottom: 12px; }
.demo-success-state p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 24px; }
@media (max-width: 480px) {
  .demo-modal { padding: 28px 20px; }
  .demo-form-row { grid-template-columns: 1fr; }
}

/* ============ ADMIN QUICK NAV ============ */
.admin-quick-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.admin-quick-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}
.admin-quick-nav-primary {
  background: rgba(45,156,219,0.1);
  border-color: rgba(45,156,219,0.3);
  color: var(--accent);
}
.admin-quick-nav-primary:hover {
  background: rgba(45,156,219,0.18);
  border-color: var(--accent);
  color: var(--accent);
}
.admin-quick-nav-active {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.25) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}
.admin-persistent-quicknav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.admin-persistent-quicknav a {
  text-decoration: none;
}

/* ============ ADMIN SECTION LABEL ============ */
.admin-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ============ ADMIN MANAGEMENT BUTTONS ============ */
.admin-mgmt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.admin-mgmt-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}
.admin-mgmt-icon {
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  flex-shrink: 0;
}

/* ============ DASHBOARD WHAT'S NEW CARD ============ */
.dash-whats-new-card {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
  animation: stat-entry 0.4s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}
.dash-whats-new-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dash-whats-new-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-new-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 7px;
  transition: background 0.15s;
}
.dash-new-item:hover {
  background: rgba(255,255,255,0.05);
}
.dash-new-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ WHAT'S NEW FILTER BAR ============ */
.updates-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.updates-filter-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.updates-filter-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.updates-filter-btn.active {
  background: rgba(45,156,219,0.12);
  border-color: rgba(45,156,219,0.35);
  color: var(--accent);
}

@media (max-width: 640px) {
  .updates-filter-bar { gap: 8px; }
  .updates-filter-btn { font-size: 11px; padding: 5px 10px; }
  .dash-whats-new-card { padding: 12px 14px; }
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE POLISH
   Billing, banners, public pages, admin — all breakpoints
   ============================================================ */

/* === Billing — Tablet (768px) === */
@media (max-width: 768px) {
  /* Billing banners: stack vertically */
  .billing-trial-banner,
  .billing-expired-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }
  .billing-trial-banner .btn,
  .billing-expired-banner .btn { align-self: flex-start; }

  /* Plan row: wrap actions below plan info */
  .billing-plan-row { flex-wrap: wrap; }
  .billing-plan-actions { margin-top: 4px; }

  /* Invoice table: hide header, reflow rows */
  .billing-invoice-header { display: none; }
  .billing-invoice-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.82rem;
    padding: 10px 0;
  }
  .billing-invoice-row span:nth-child(2) { grid-column: 1 / -1; color: var(--text-secondary); }

  /* Billing page header */
  .page-header h1 { font-size: 1.7rem; }

  /* Billing grid: slightly reduce gap */
  .billing-grid { gap: 16px; }

  /* License grid: single column */
  .billing-license-grid { grid-template-columns: 1fr; }

  /* Upgrade prompt: stack */
  .billing-upgrade-prompt { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* === Billing — Mobile (600px) === */
@media (max-width: 600px) {
  .billing-current-plan,
  .billing-payment-method,
  .billing-invoices,
  .billing-license-card { padding: 20px; }

  .billing-plan-row { flex-direction: column; gap: 14px; }
  .billing-plan-actions { flex-direction: row; width: 100%; }
  .billing-plan-actions .btn { flex: 1; justify-content: center; }

  .billing-plan-name { font-size: 1.3rem; }

  .billing-invoice-row { grid-template-columns: 1fr; gap: 4px; }
  .billing-invoice-row span:nth-child(2) { grid-column: auto; }

  .billing-upgrade-prompt { padding: 18px 20px; }
}

/* === Pricing — reduce excessive top spacing on mobile === */
@media (max-width: 768px) {
  .pricing-page { padding-top: 20px; }
  .pricing-hero { padding-top: 60px; }
}
@media (max-width: 600px) {
  .pricing-page { padding-top: 0; }
  .pricing-hero { padding-top: 48px; padding-bottom: 40px; }
}

/* === Pricing page — 375px edge case === */
@media (max-width: 375px) {
  .pricing-hero h1 { font-size: 1.65rem; }
  .pricing-toggle-wrap { flex-direction: column; }
  .pricing-card { padding: 20px 16px; }
}

/* === For-Teams page top spacing === */
.for-teams-page { padding-top: 80px; }
@media (max-width: 768px) {
  .for-teams-page { padding-top: 20px; }
  .for-teams-hero { padding-top: 60px !important; padding-bottom: 60px !important; }
}
@media (max-width: 600px) {
  .for-teams-page { padding-top: 0; }
  .for-teams-hero { padding-top: 48px !important; padding-bottom: 48px !important; }
}

/* === For-Teams & Roadmap — 600px === */
@media (max-width: 600px) {
  .for-teams-hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .for-teams-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .roadmap-section { padding: 0 16px 60px; }
  .roadmap-page { padding-top: 32px !important; padding-bottom: 48px !important; }
}

/* === Roadmap page top spacing === */
@media (max-width: 768px) {
  .roadmap-page { padding-top: 40px !important; }
}

/* === Login / Signup — ultra-narrow === */
@media (max-width: 360px) {
  .auth-card { padding: 20px 14px; margin: 0 4px; }
  .auth-card h2 { font-size: 1.3rem; }
}

/* === Admin — 600px === */
@media (max-width: 600px) {
  .admin-page { padding: 16px 12px; }
  .admin-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-actions-grid { grid-template-columns: 1fr !important; }
  .admin-page-header { gap: 10px; }
  .admin-page-header .btn { font-size: 0.78rem; padding: 6px 10px; }

  /* Admin table overflow on mobile */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table-wrap table { min-width: 520px; }
}

/* === Dashboard stats — 375px === */
@media (max-width: 375px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px 16px; }
}

/* === Course/lesson — 375px === */
@media (max-width: 375px) {
  .course-card { padding: 16px; }
  .lesson-page { padding: 16px 12px; }
}

/* === App nav — 375px edge case === */
@media (max-width: 375px) {
  .app-nav { padding: 0 10px; }
  .app-nav-logo { font-size: 0.95rem; }
}

/* === Page container — mobile edge === */
@media (max-width: 480px) {
  .page-container { padding: 32px 16px; }
}

/* === What's New / Updates page — mobile === */
@media (max-width: 480px) {
  .updates-filter-bar { flex-wrap: wrap; }
}

/* ========================================================
   NAV HELP BUTTON
   ======================================================== */
.nav-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.nav-help-btn:hover {
  color: var(--accent);
  border-color: rgba(45,156,219,0.4);
  background: var(--accent-dim);
}

/* ========================================================
   ONBOARDING WIZARD OVERLAY
   ======================================================== */
.ohq-ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.ohq-ob-overlay.ohq-ob-visible { opacity: 1; }
.ohq-ob-overlay.ohq-ob-closing { opacity: 0; }

.ohq-ob-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 40px 40px 32px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(45,156,219,0.08),
    0 40px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(45,156,219,0.04);
  transform: translateY(0) scale(1);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
}
.ohq-ob-card.ohq-ob-exit {
  transform: translateY(-16px) scale(0.97);
  opacity: 0;
}
.ohq-ob-card.ohq-ob-enter {
  transform: translateY(16px) scale(0.97);
  opacity: 0;
}

.ohq-ob-skip {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.ohq-ob-skip:hover { color: var(--text-secondary); }

.ohq-ob-body {
  text-align: center;
  padding: 16px 0 32px;
}
.ohq-ob-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(45,156,219,0.25));
}
.ohq-ob-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.ohq-ob-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}
.ohq-ob-desc {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 360px;
  margin: 0 auto;
}
.ohq-ob-desc strong { color: var(--text-primary); }

.ohq-ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ohq-ob-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ohq-ob-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.25s;
}
.ohq-ob-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}
.ohq-ob-dot.done {
  background: rgba(45,156,219,0.35);
}

.ohq-ob-cta {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ohq-ob-cta:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.ohq-ob-cta-final {
  background: var(--accent);
  color: #0A1628;
  border-color: transparent;
  font-weight: 700;
  padding: 11px 28px;
}
.ohq-ob-cta-final:hover {
  background: var(--accent-hover, #1E8FC8);
  border-color: transparent;
}

@media (max-width: 540px) {
  .ohq-ob-card { padding: 32px 24px 24px; }
  .ohq-ob-title { font-size: 1.3rem; }
  .ohq-ob-icon { font-size: 2.4rem; }
}

/* ========================================================
   PLATFORM GUIDE DRAWER
   ======================================================== */
#ohq-guide-panel {
  position: fixed;
  inset: 0;
  z-index: 1800;
  pointer-events: none;
}
#ohq-guide-panel.ohq-guide-open { pointer-events: all; }

.ohq-guide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}
.ohq-guide-open .ohq-guide-overlay {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
}

.ohq-guide-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.33s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.ohq-guide-open .ohq-guide-drawer {
  transform: translateX(0);
}

.ohq-guide-header {
  padding: 24px 24px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ohq-guide-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ohq-guide-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}
.ohq-guide-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ohq-guide-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.ohq-guide-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.ohq-guide-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.ohq-guide-search {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s;
}
.ohq-guide-search:focus {
  outline: none;
  border-color: rgba(45,156,219,0.4);
}
.ohq-guide-search::placeholder { color: var(--text-dim); }

.ohq-guide-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ohq-guide-body::-webkit-scrollbar { width: 5px; }
.ohq-guide-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.ohq-guide-section {
  padding: 16px 24px 8px;
}
.ohq-guide-section + .ohq-guide-section {
  border-top: 1px solid var(--border);
}
.ohq-guide-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ohq-guide-section-icon {
  font-size: 1.05rem;
  line-height: 1;
}
.ohq-guide-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ohq-guide-item {
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.12s;
}
.ohq-guide-item[open] {
  background: var(--bg-elevated);
}
.ohq-guide-q {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
  transition: color 0.12s;
  user-select: none;
}
.ohq-guide-q::-webkit-details-marker { display: none; }
.ohq-guide-q:hover { color: var(--accent); }
.ohq-guide-item[open] .ohq-guide-q { color: var(--accent); }

.ohq-guide-chevron {
  flex-shrink: 0;
  margin-top: 3px;
  transition: transform 0.18s ease;
}
.ohq-guide-item[open] .ohq-guide-chevron {
  transform: rotate(180deg);
}

.ohq-guide-a {
  padding: 0 14px 14px 34px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.ohq-guide-a strong { color: var(--text-primary); }

.ohq-guide-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.ohq-hl {
  background: rgba(45,156,219,0.2);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 2px;
}

.ohq-guide-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ohq-guide-restart-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}
.ohq-guide-restart-btn:hover {
  color: var(--accent);
  border-color: rgba(45,156,219,0.3);
  background: var(--accent-dim);
}

@media (max-width: 540px) {
  .ohq-guide-drawer { width: 100%; }
}

/* ========================================================
   CONTEXTUAL HELP TOOLTIPS
   ======================================================== */
.ohq-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s;
  position: relative;
  top: -1px;
}
.ohq-help-icon:hover {
  background: var(--accent-dim);
  border-color: rgba(45,156,219,0.4);
  color: var(--accent);
}

.ohq-tip-bubble {
  position: absolute;
  z-index: 3000;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(45,156,219,0.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 240px;
}
.ohq-tip-bubble.ohq-tip-visible {
  opacity: 1;
  transform: translateY(0);
}
.ohq-tip-bubble strong { color: var(--text-primary); }

/* ============ LOGGED-IN FOOTER ============ */
.ohq-app-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  background: var(--bg-base, #0A1628);
  padding: 16px 24px;
  margin-top: auto;
  flex-shrink: 0;
}
.ohq-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ohq-footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ohq-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #f0f0f0);
  letter-spacing: 0.01em;
}
.ohq-footer-copy {
  font-size: 12px;
  color: var(--text-dim, #5A6B7F);
}
.ohq-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ohq-footer-link {
  font-size: 12px;
  color: var(--text-secondary, #888);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.ohq-footer-link:hover {
  color: var(--text-primary, #f0f0f0);
  background: rgba(255,255,255,0.06);
}
.ohq-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #888);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ohq-footer-btn:hover {
  color: var(--accent, #2D9CDB);
  background: rgba(45,156,219,0.08);
  border-color: rgba(45,156,219,0.25);
}
.ohq-footer-btn-danger:hover {
  color: #EF4444;
  background: rgba(255,107,107,0.08);
  border-color: rgba(255,107,107,0.25);
}

/* Ensure the app layout stretches so footer is always at the bottom */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content {
  flex: 1;
}

/* ===== WHITE-LABEL AUTH BRANDING ===== */
.auth-org-logo {
  display: block;
  max-height: 48px;
  max-width: 180px;
  margin: 0 0 20px;
  border-radius: 6px;
  object-fit: contain;
}
.auth-page-branded .auth-card {
  border-color: var(--accent, #2D9CDB);
  box-shadow: 0 0 0 1px var(--accent, #2D9CDB)22;
}
.auth-powered-by {
  text-align: center;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.auth-powered-by a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.7;
}

/* ===== WHITE-LABEL FOOTER ===== */
.ohq-footer-powered {
  font-size: 11px;
  color: var(--text-dim, #5A6B7F);
  margin-left: 4px;
}
.ohq-footer-powered a {
  color: inherit;
  text-decoration: none;
}
.ohq-footer-powered a:hover {
  text-decoration: underline;
}

/* ===== AI TUTOR PANEL ===== */

/* Floating trigger button */
.tutor-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(45, 156, 219, 0.35);
  transition: all 0.2s;
}
.tutor-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(45, 156, 219, 0.45);
}
.tutor-fab.tutor-fab--open {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.tutor-fab-icon {
  font-size: 16px;
  line-height: 1;
}
@media (max-width: 768px) {
  .tutor-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}

/* Tutor panel — desktop: right slide-out; mobile: bottom sheet */
.tutor-panel {
  position: fixed;
  top: 60px; /* below nav */
  right: 0;
  width: 380px;
  height: calc(100vh - 60px);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 190;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.tutor-panel.tutor-panel--open {
  transform: translateX(0);
}
@media (max-width: 768px) {
  .tutor-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  }
  .tutor-panel.tutor-panel--open {
    transform: translateY(0);
  }
}

/* Tutor header */
.tutor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tutor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tutor-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.tutor-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.tutor-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
}
.tutor-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  transition: all 0.15s;
}
.tutor-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Quick actions */
.tutor-quick-actions {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.tutor-quick-btn {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.tutor-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Messages area */
.tutor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tutor-messages::-webkit-scrollbar { width: 4px; }
.tutor-messages::-webkit-scrollbar-track { background: transparent; }
.tutor-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Empty / welcome state */
.tutor-welcome {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-secondary);
}
.tutor-welcome-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.tutor-welcome-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.tutor-welcome-text {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Message bubbles */
.tutor-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tutor-msg--user {
  flex-direction: row-reverse;
}
.tutor-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.tutor-msg--user .tutor-msg-avatar {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.tutor-msg--assistant .tutor-msg-avatar {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: var(--bg-deep);
}
.tutor-msg-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.6;
}
.tutor-msg--user .tutor-msg-bubble {
  background: var(--accent-dim);
  border: 1px solid rgba(45, 156, 219, 0.2);
  color: var(--text-primary);
  border-radius: 12px 4px 12px 12px;
}
.tutor-msg--assistant .tutor-msg-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 4px 12px 12px 12px;
}
.tutor-msg-bubble p { margin: 0 0 8px; }
.tutor-msg-bubble p:last-child { margin-bottom: 0; }
.tutor-msg-bubble strong { color: var(--accent); font-weight: 600; }
.tutor-msg-bubble ul, .tutor-msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.tutor-msg-bubble li { margin: 2px 0; }
.tutor-msg-bubble code {
  background: rgba(45, 156, 219, 0.1);
  border: 1px solid rgba(45, 156, 219, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8em;
  font-family: 'JetBrains Mono', monospace;
}
.tutor-msg-bubble h1, .tutor-msg-bubble h2, .tutor-msg-bubble h3 {
  font-size: 0.9rem;
  margin: 10px 0 4px;
}

/* Streaming "typing" indicator */
.tutor-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  width: fit-content;
}
.tutor-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: tutorDotPulse 1.2s infinite ease-in-out;
}
.tutor-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.tutor-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes tutorDotPulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.tutor-input-area {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.tutor-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  resize: none;
  max-height: 100px;
  transition: border-color 0.15s;
}
.tutor-input:focus {
  outline: none;
  border-color: var(--accent);
}
.tutor-input::placeholder { color: var(--text-dim); }
.tutor-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--bg-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.tutor-send-btn:hover { filter: brightness(1.1); }
.tutor-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Proactive coaching nudge bar */
.tutor-nudge {
  position: fixed;
  bottom: 90px;
  right: 28px;
  z-index: 195;
  background: var(--bg-elevated);
  border: 1px solid rgba(45, 156, 219, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: nudgeSlideIn 0.3s ease;
}
@keyframes nudgeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tutor-nudge-text {
  font-size: 0.83rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.45;
}
.tutor-nudge-actions {
  display: flex;
  gap: 6px;
}
.tutor-nudge-cta {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.tutor-nudge-cta:hover { background: rgba(45, 156, 219, 0.2); }
.tutor-nudge-dismiss {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.tutor-nudge-dismiss:hover { background: var(--bg-hover); }
@media (max-width: 768px) {
  .tutor-nudge {
    right: 12px;
    left: 12px;
    max-width: none;
    bottom: 80px;
  }
}

/* Hint button inside interactive elements */
.ie-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.ie-hint-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
}
.ie-hint-area {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}
.ie-hint-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f59e0b;
  margin-bottom: 6px;
}

/* Lesson layout with tutor panel open */
@media (min-width: 769px) {
  .lesson-page--tutor-open .lesson-content {
    margin-right: 380px;
    transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
}


/* ============================================================
   UX POLISH PASS — Global Enhancements
   ============================================================ */

/* ===== SKELETON LOADING STATES ===== */
.skeleton-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skeleton-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .skeleton-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 375px) {
  .skeleton-stat-grid { grid-template-columns: 1fr; }
}

.skeleton-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skeleton-stat-card .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
}

/* ===== IMPROVED EMPTY STATES ===== */
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
  display: block;
}

.empty-state-cta {
  margin-top: 20px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.ohq-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  color: var(--text-primary);
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 400px;
}

.ohq-toast.toast-success {
  border-color: rgba(45, 156, 219, 0.3);
}

.ohq-toast.toast-error {
  border-color: rgba(255, 107, 107, 0.3);
}

.ohq-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ohq-toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}

.ohq-toast-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.96); }
}

/* ===== IMPROVED CARD FOCUS STATES ===== */
.course-card:focus-visible,
.library-card:focus-visible,
.admin-org-card:focus-visible,
.cert-card:focus-visible,
.pricing-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-deep), 0 0 0 4px rgba(45, 156, 219, 0.5),
              0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===== IMPROVED TABLE RESPONSIVE ===== */
@media (max-width: 600px) {
  .data-table,
  .admin-table,
  .admin-data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .admin-table th,
  .admin-data-table th {
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .data-table td,
  .admin-table td,
  .admin-data-table td {
    padding: 8px 10px;
  }
}

/* ===== IMPROVED MODAL ANIMATIONS ===== */
.admin-modal-overlay,
.feedback-modal-overlay {
  animation: modal-fadein 0.2s ease;
}

@keyframes modal-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.admin-modal,
.feedback-modal {
  animation: modal-slide-up 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== BREADCRUMB IMPROVEMENTS ===== */
.admin-topbar-breadcrumbs {
  text-overflow: ellipsis;
}

/* ===== TOOLTIP SYSTEM ===== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== BADGE PULSE ANIMATION ===== */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ===== LINK UNDERLINE ON HOVER ===== */
.text-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.text-link:hover {
  border-bottom-color: var(--accent);
}

/* ===== DIVIDER ===== */
.ohq-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
  border: none;
}

/* ===== PAGE TRANSITION ENHANCEMENT ===== */
.main-content {
  animation: content-enter 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes content-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== SMALL MOBILE OVERFLOW FIX ===== */
@media (max-width: 320px) {
  body { overflow-x: hidden; }
  .page-container { padding: 16px 8px; }
  .admin-page { padding: 12px 8px; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .pricing-cards { padding: 0 4px 40px; }
}

/* ===== IMAGE / AVATAR CONSISTENCY ===== */
img {
  max-width: 100%;
  height: auto;
}

/* ===== FORM FIELD TRANSITIONS ===== */
.form-input,
.select-input,
textarea,
.demo-form-input,
.demo-form-select,
.demo-form-textarea {
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* ===== DISABLED STATE ===== */
.btn:disabled,
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== ADMIN SIDEBAR SCROLL POLISH ===== */
.admin-nav-list::-webkit-scrollbar {
  width: 4px;
}

.admin-nav-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.admin-nav-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== DARK THEME CONSISTENCY ===== */
/* Ensure inputs, selects, date pickers are dark-themed */
input, textarea, select {
  color-scheme: dark;
}

/* Remove autofill white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px var(--bg-elevated) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
}

/* ===== RESPONSIVE ADMIN PAGE 375px ===== */
@media (max-width: 375px) {
  .admin-kpi-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .admin-kpi-value { font-size: 1.3rem; }
  .admin-page-header h1 { font-size: 1.3rem; }
  .admin-card { padding: 16px; }
  .admin-org-grid { grid-template-columns: 1fr; }
  .admin-org-stats { grid-template-columns: repeat(2, 1fr); }
}
