/* ============================================================
   EmpowerLink Component Styles
   ============================================================ */

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--fg1);
  background: var(--bg-page);
}

a { color: var(--fg-link); text-decoration: none; }
a:hover { color: var(--fg-link-hover); text-decoration: underline; }

/* ── App Shell ─────────────────────────────────────────────── */
.el-app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
}
.el-app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.el-main-area {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.el-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--color-navy-800);
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.el-sidebar-brand {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.el-sidebar-logo {
  max-width: 140px;
  height: auto;
  display: block;
}
.el-sidebar-brand-text {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--text-h4);
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.el-sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.el-sidebar-section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: var(--space-3) var(--space-3) var(--space-1);
  margin-top: var(--space-2);
}
.el-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.el-sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}
.el-sidebar-item.active {
  background: rgba(92,184,232,0.2);
  color: #fff;
  font-weight: var(--fw-semibold);
}
.el-sidebar-footer {
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.el-sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
}
.el-sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-sky-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.el-sidebar-org-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3) 0;
}
.el-sidebar-org-logo img {
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  padding: var(--space-1);
}
.el-sidebar-user-name {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.el-sidebar-user-name-link {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
  transition: color .15s;
}
.el-sidebar-user-name-link:hover {
  color: #fff;
  text-decoration: underline;
}
.el-sidebar-user-actions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: var(--space-2);
}
.el-sidebar-user-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.el-sidebar-user-logout:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

/* ── Topbar ────────────────────────────────────────────────── */
.el-topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  flex-shrink: 0;
}
.el-topbar-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg2);
  padding: var(--space-1);
  display: none;
}
.el-topbar-title {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--fw-semibold);
  color: var(--color-navy-800);
  flex: 1;
}
.el-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.el-topbar-user-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  text-decoration: none;
  transition: color .15s;
}
.el-topbar-user-link:hover { color: var(--color-navy-800); text-decoration: none; }
.el-topbar-role-badge { font-size: 11px; padding: 2px 8px; }

/* ── Topbar logout button ──────────────────────────────────── */
.el-topbar-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--fg2);
  text-decoration: none;
  border: 1.5px solid var(--border-default);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.el-topbar-logout-btn:hover {
  background: var(--color-error-100, #fdecea);
  color: var(--color-error-500);
  border-color: var(--color-error-500);
  text-decoration: none;
}

/* ── Topbar school name ────────────────────────────────────── */
.el-topbar-school-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg1);
  white-space: nowrap;
}

/* ── School switcher dropdown ──────────────────────────────── */
.el-school-switcher {
  position: relative;
}
.el-school-switcher-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  transition: background .15s;
}
.el-school-switcher-btn:hover { background: var(--color-neutral-100); }
.el-school-switcher-btn svg { color: var(--fg2); flex-shrink: 0; }

.el-school-switcher-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.el-school-switcher.open .el-school-switcher-menu { display: block; }

.el-school-switcher-header {
  padding: 8px 14px 6px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border-default);
}
.el-school-switcher-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border-default);
}
.el-school-switcher-item:last-child { border-bottom: none; }
.el-school-switcher-item:hover { background: var(--color-neutral-50); }
.el-school-switcher-item.active { background: rgba(92,184,232,0.08); }
.el-school-switcher-item-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg1);
}
.el-school-switcher-item-role {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg3);
  margin-top: 1px;
}

/* ── Org switcher dropdown (SuperAdmin only) ───────────────── */
.el-org-switcher {
  position: relative;
}
.el-org-switcher-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  transition: background .15s;
}
.el-org-switcher-btn:hover { background: var(--color-neutral-100); }
.el-org-switcher-btn svg { color: var(--fg2); flex-shrink: 0; }

.el-org-switcher-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  overflow: hidden;
}
.el-org-switcher.open .el-org-switcher-menu { display: block; }

.el-org-switcher-header {
  padding: 8px 14px 6px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border-default);
}
.el-org-switcher-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border-default);
}
.el-org-switcher-item:last-child { border-bottom: none; }
.el-org-switcher-item:hover { background: var(--color-neutral-50); }
.el-org-switcher-item.active { background: rgba(245,200,64,0.10); }
.el-org-switcher-item-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg1);
}
.el-org-switcher-item-sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg3);
  margin-top: 1px;
}
/* Gold badge for the active org label in the topbar */
.el-topbar-org-badge {
  background: rgba(245,200,64,0.18);
  color: var(--color-gold-500);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 2px 9px;
  white-space: nowrap;
}
/* Divider between org-switcher and school-switcher */
.el-topbar-switcher-divider {
  width: 1px;
  height: 22px;
  background: var(--border-default);
  flex-shrink: 0;
}

/* ── Page Content ──────────────────────────────────────────── */
.el-page-content {
  padding: var(--space-6);
  max-width: 100%;
  flex: 1;
  width: 100%;
}
.el-footer {
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg3);
  border-top: 1px solid var(--border-default);
  background: var(--bg-surface);
}

/* ── Page Header ───────────────────────────────────────────── */
.el-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.el-page-heading {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--fw-bold);
  color: var(--color-navy-800);
  margin: 0;
  line-height: var(--lh-tight);
}
.el-page-subheading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  margin-top: var(--space-1);
}
.el-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg3);
  margin-bottom: var(--space-2);
}
.el-breadcrumb a { color: var(--fg2); }
.el-breadcrumb a:hover { color: var(--color-navy-800); }

/* ── Alerts ────────────────────────────────────────────────── */
.el-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  gap: var(--space-3);
}
.el-alert-success {
  background: var(--color-success-100);
  color: var(--color-success-500);
  border: 1px solid rgba(34,160,107,0.2);
}
.el-alert-error {
  background: var(--color-error-100);
  color: var(--color-error-500);
  border: 1px solid rgba(229,65,42,0.2);
}
.el-alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  flex-shrink: 0;
}
.el-alert-close:hover { opacity: 1; }

/* Autosave bar */
.el-autosave-bar {
  display: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  background: var(--color-sky-100);
  color: var(--color-sky-700);
}
.el-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--radius-full);
  animation: el-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes el-spin { to { transform: rotate(360deg); } }

/* ── Cards ─────────────────────────────────────────────────── */
.el-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.el-card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  color: var(--color-navy-800);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.el-card-body { padding: var(--space-6); }

/* Info card (centered, icon-based) */
.el-info-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  max-width: 480px;
  width: 100%;
}

/* ── Badges ────────────────────────────────────────────────── */
.el-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  white-space: nowrap;
}
.el-badge-success { background: var(--color-success-100); color: var(--color-success-500); }
.el-badge-warning { background: var(--color-warning-100); color: var(--color-warning-500); }
.el-badge-error   { background: var(--color-error-100);   color: var(--color-error-500); }
.el-badge-navy    { background: var(--color-navy-100);    color: var(--color-navy-800); }
.el-badge-sky     { background: var(--color-sky-100);     color: var(--color-sky-700); }
.el-badge-gold    { background: var(--color-gold-100);    color: var(--color-gold-800); }

/* ── Buttons ───────────────────────────────────────────────── */
.el-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  border: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.el-btn:focus-visible { outline: 2px solid var(--color-sky-500); outline-offset: 2px; }
.el-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.el-btn-primary { background: var(--color-navy-800); color: #fff; }
.el-btn-primary:hover { background: var(--color-navy-700); color: #fff; text-decoration: none; }
.el-btn-outline {
  background: transparent;
  color: var(--color-navy-800);
  border: 1.5px solid var(--color-navy-800);
}
.el-btn-outline:hover {
  background: var(--color-navy-50);
  text-decoration: none;
}
.el-btn-danger { background: var(--color-error-500); color: #fff; }
.el-btn-danger:hover { background: #c73520; color: #fff; text-decoration: none; }
.el-btn-success { background: var(--color-success-500); color: #fff; }
.el-btn-success:hover:not(:disabled) { background: #1a8a5a; color: #fff; text-decoration: none; }
.el-btn-ghost {
  background: transparent;
  color: var(--fg2);
  border: 1.5px solid var(--border-default);
}
.el-btn-ghost:hover { background: var(--bg-subtle); color: var(--fg1); text-decoration: none; }

/* ── Forms ─────────────────────────────────────────────────── */
.el-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.el-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--fg1);
}
.el-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.el-label-link {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg-link);
  text-decoration: none;
}
.el-label-link:hover { text-decoration: underline; }
.el-required { color: var(--color-error-500); margin-left: 2px; }
.el-field-hint { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); }
.el-field-error { font-family: var(--font-body); font-size: var(--text-xs); color: var(--color-error-500); }

.el-input {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg1);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.el-input::placeholder { color: var(--fg3); }
.el-input:focus { border-color: var(--color-sky-500); box-shadow: 0 0 0 3px rgba(92,184,232,0.15); }
.el-input:disabled { background: var(--bg-subtle); color: var(--fg3); cursor: not-allowed; }
textarea.el-input { resize: vertical; min-height: 90px; }

/* Input with inline action button */
.el-input-with-action { position: relative; display: flex; }
.el-input-with-action .el-input { padding-right: 40px; flex: 1; }
.el-input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg3);
  padding: 0;
  display: flex;
  align-items: center;
}
.el-input-action:hover { color: var(--fg1); }

/* Toggle (checkbox-based) */
.el-toggle-field { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.el-toggle-input { margin-top: 3px; flex-shrink: 0; accent-color: var(--color-navy-800); width: 16px; height: 16px; cursor: pointer; }
.el-toggle-content { flex: 1; }
.el-toggle-title { font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--fg1); }
.el-toggle-description { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg2); margin-top: 2px; }

/* Form layout grids */
.el-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.el-form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.el-form-page { max-width: 680px; }
.el-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .el-form-grid-2, .el-form-grid-3 { grid-template-columns: 1fr; }
}

/* ── Tables ────────────────────────────────────────────────── */
.el-table-wrap { overflow-x: auto; }
.el-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
}
.el-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--fg3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-default);
  background: var(--color-neutral-50);
  white-space: nowrap;
}
.el-table tbody td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: var(--fg1);
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}
.el-table tbody tr:hover td { background: var(--color-neutral-50); }
.el-table-link { color: var(--fg-link); text-decoration: none; font-weight: var(--fw-medium); }
.el-table-link:hover { color: var(--fg-link-hover); text-decoration: underline; }

/* ── Progress Bar ──────────────────────────────────────────── */
.el-progress {
  width: 100%;
  height: 6px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.el-progress-bar {
  height: 100%;
  background: var(--color-sky-500);
  border-radius: var(--radius-full);
  transition: width .3s ease;
}

/* ── Stats Grid ────────────────────────────────────────────── */
.el-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}
.el-stat-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--fg3);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.el-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--fw-bold);
  color: var(--color-navy-800);
  line-height: 1.1;
}
.el-stat-sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg2);
  margin-top: var(--space-1);
}

/* ── Layout grids ──────────────────────────────────────────── */
.el-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.el-detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-6);
  align-items: start;
}
.el-detail-left, .el-detail-right { min-width: 0; }

@media (max-width: 768px) {
  .el-two-col-grid, .el-detail-grid { grid-template-columns: 1fr; }
}

/* Quick links (sidebar-style list inside a card) */
.el-quick-links { display: flex; flex-direction: column; gap: 2px; }
.el-quick-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  text-decoration: none;
  transition: background .1s, color .1s;
}
.el-quick-link:hover { background: var(--bg-subtle); color: var(--fg1); text-decoration: none; }

/* ── Empty State ───────────────────────────────────────────── */
.el-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-8);
  gap: var(--space-3);
}
.el-empty-title {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--fw-semibold);
  color: var(--fg1);
  margin: 0;
}
.el-empty-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  margin: 0;
  max-width: 360px;
}

/* ── Auth Layout ───────────────────────────────────────────── */
.el-auth-body {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.el-auth-page { width: 100%; max-width: 440px; }
.el-auth-container { display: flex; flex-direction: column; gap: var(--space-6); }
.el-auth-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}
.el-auth-logo {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: var(--space-4);
}
.el-auth-logo img {
  width: 400px;
  max-width: 100%;
  height: auto;
}
.el-auth-heading {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--fw-bold);
  color: var(--color-navy-800);
  text-align: center;
  margin: 0 0 var(--space-1);
}
.el-auth-subheading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  text-align: center;
  margin: 0 0 var(--space-6);
}
.el-auth-footer {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--fg3);
  text-align: center;
}
.el-auth-footer a { color: var(--fg2); }
.el-auth-footer a:hover { color: var(--color-navy-800); }

/* ── Student / Result Components ───────────────────────────── */
.el-student-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.el-student-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--fw-bold);
  color: #fff;
  flex-shrink: 0;
  background-color: var(--color-navy-800)
}
.el-student-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.el-result-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.el-result-hero-content {
  flex: 1;
  min-width: 0;
}
.el-result-hero-image {
  flex-shrink: 0;
  width: 72px;
  align-self: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0.88;
  box-shadow: var(--shadow-md);
}
.el-result-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.el-result-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--fw-bold);
  color: #fff;
  flex-shrink: 0;
}
.el-result-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: #fff;
  flex-shrink: 0;
}

/* ── Assessment: Image Choice ──────────────────────────────── */
.el-image-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}
.el-image-option {
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
  background: var(--bg-surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.image-choice-card:hover .el-image-option {
  border-color: var(--color-sky-500);
  box-shadow: var(--shadow-sm);
}
.el-image-option.selected-card {
  border-color: var(--color-sky-500) !important;
  background: var(--color-sky-50) !important;
  box-shadow: 0 0 0 3px rgba(92,184,232,0.15);
}

/* Assessment intro video */
.el-intro-title {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--fw-semibold);
  color: var(--color-navy-800);
  margin: 0 0 var(--space-2);
}
.el-intro-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg2);
  margin: 0 0 var(--space-6);
}
.el-intro-video-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-navy-900);
  aspect-ratio: 16 / 9;
  position: relative;
}
.el-intro-video { display: block; width: 100%; height: 100%; }
.el-intro-unmute {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-gold-500);
  color: var(--color-navy-800);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.el-intro-unmute[hidden] { display: none; }
.el-intro-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

@media (max-width: 640px) {
  .el-intro-actions { flex-direction: column-reverse; }
  .el-intro-actions .el-btn { width: 100%; text-align: center; }
}

@media (max-width: 640px) {
  .el-image-choice-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Assessment: Scenarios ─────────────────────────────────── */
.el-scenario-list { display: flex; flex-direction: column; }
.el-scenario-item {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.el-scenario-item:last-child { border-bottom: none; }
.el-scenario-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.scenario-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background .1s;
  font-family: var(--font-body);
}

/* Student type pills */
.el-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  white-space: nowrap;
}
.el-type-driver     { background: var(--color-error-100);   color: var(--color-error-500); }
.el-type-dreamer    { background: var(--color-cyan-100);    color: var(--color-cyan-500); }
.el-type-inspirer   { background: var(--color-purple-100);  color: var(--color-purple-500); }
.el-type-processor  { background: var(--color-success-100); color: var(--color-success-500); }
.el-type-adventurer { background: var(--color-gold-100);    color: var(--color-gold-900); }
/* Educator type pills */
.el-type-direct     { background: var(--color-error-100);   color: var(--color-error-500); }
.el-type-empowering { background: var(--color-gold-100);    color: var(--color-gold-900); }
.el-type-systemized { background: var(--color-sky-100);     color: var(--color-sky-500); }
.el-type-counselor  { background: var(--color-success-100); color: var(--color-success-500); }

/* Student enrollment / educator employment status pills */
.el-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  white-space: nowrap;
}
.el-status-enrolled  { background: var(--color-sky-100);     color: var(--color-sky-700); }
.el-status-active    { background: var(--color-success-100); color: var(--color-success-500); }
.el-status-inactive  { background: var(--color-neutral-100); color: var(--fg2); }
.el-status-graduated { background: var(--color-gold-100);    color: var(--color-gold-900); }
.el-status-candidate { background: var(--color-sky-100);     color: var(--color-sky-700); }
.el-status-employee  { background: var(--color-success-100); color: var(--color-success-500); }
.el-status-notset    { background: transparent; color: var(--fg3); padding-left: 0; padding-right: 0; font-weight: var(--fw-regular); }

/* Inline "label: value  Edit" editor used on student / educator profiles */
.el-inline-edit-btn { background: none; border: none; padding: 0; margin-left: var(--space-1); font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--color-sky-500); cursor: pointer; }
.el-inline-edit-btn:hover { text-decoration: underline; }
.el-inline-edit-form { display: none; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.el-inline-edit-form.open { display: flex; }
.el-inline-edit-actions { display: flex; gap: var(--space-2); }
.scenario-option:hover { background: var(--color-sky-50); }
.scenario-option-checked { background: var(--color-sky-100) !important; }

@media (max-width: 640px) {
  .el-scenario-options { grid-template-columns: 1fr; }
}

/* ── Radio label ───────────────────────────────────────────── */
.el-radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--fg1);
}

/* ── Centered page (full-height centered content) ─────────── */
.el-centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--bg-page);
}

/* ── Shadows ───────────────────────────────────────────────── */
:root {
  --shadow-sm: 0 1px 3px rgba(26,48,96,0.07), 0 1px 2px rgba(26,48,96,0.04);
  --shadow-md: 0 4px 12px rgba(26,48,96,0.08), 0 2px 4px rgba(26,48,96,0.04);
  --shadow-lg: 0 10px 28px rgba(26,48,96,0.1), 0 4px 10px rgba(26,48,96,0.06);
  --shadow-xl: 0 20px 48px rgba(26,48,96,0.12), 0 8px 16px rgba(26,48,96,0.07);
}

/* ── Sidebar drawer backdrop (mobile) ─────────────────────── */
.el-sidebar-backdrop { display: none; }

/* Wide tables/diagrams scroll inside their own wrap; a stray wide
   child must never scroll the whole app sideways. */
.el-main-area { overflow-x: hidden; }

/* ── Responsive: app shell (mobile) ───────────────────────── */
@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas drawer */
  .el-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 260px;
    min-width: 260px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-xl);
  }
  .el-sidebar.el-sidebar-open { transform: translateX(0); }

  .el-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(13,30,96,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .el-sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }
  body.el-drawer-open { overflow: hidden; }

  /* Topbar: keep it to hamburger + title (+ compact switchers) */
  .el-topbar-menu-btn { display: flex; }
  .el-topbar {
    padding: 0 var(--space-4);
    gap: var(--space-2);
  }
  .el-topbar-title {
    font-size: var(--text-h4);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .el-topbar-user { gap: var(--space-1); min-width: 0; }
  .el-topbar-logout-btn,
  .el-topbar-switcher-divider,
  .el-topbar-role-badge { display: none; }
  .el-topbar-school-name {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .el-topbar-org-badge {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .el-school-switcher-btn,
  .el-org-switcher-btn { padding: 4px; }

  /* Switcher dropdowns must fit the viewport, not a 500px min-width */
  .el-school-switcher-menu,
  .el-org-switcher-menu {
    position: fixed;
    top: 52px;
    left: var(--space-3);
    right: var(--space-3);
    min-width: 0;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }

  .el-page-content { padding: var(--space-4); }
  .el-footer { padding: var(--space-4); text-align: center; }

  /* Page headers stack their action buttons */
  .el-page-header { gap: var(--space-3); }
  .el-page-heading { font-size: var(--text-h3); }
  .el-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .el-form-actions .el-btn { width: 100%; }

  /* Tables: scroll horizontally within their container instead of being
     clipped by the .el-main-area overflow guard. Covers bare .el-table,
     the design-system wrap, and DataTables output. */
  .el-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .el-table,
  .dataTables_wrapper > table.dataTable,
  .dataTables_scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dataTables_wrapper .dt-top-controls,
  .dataTables_wrapper .dt-bottom-controls { flex-wrap: wrap; gap: var(--space-2); }

  /* Two-up form grids collapse; also neutralise any `grid-column: span N`
     on children, which would otherwise re-create a second column. */
  .el-form-grid-2, .el-form-grid-3 { grid-template-columns: 1fr; }
  .el-form-grid-2 > *, .el-form-grid-3 > * { grid-column: auto !important; }

  /* Modals get near-full-width on phones */
  .el-modal-overlay { padding: var(--space-3); }
  .el-modal { max-width: 100% !important; }
  .el-modal-header, .el-modal-body, .el-modal-footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .el-modal-footer { flex-direction: column-reverse; }
  .el-modal-footer .el-btn { width: 100%; }

  /* Result hero stacks; side image becomes a short top banner */
  .el-result-hero { flex-direction: column; gap: var(--space-4); }
  .el-result-hero-image { width: 100%; height: 120px; align-self: auto; order: -1; }
  .el-result-avatar { width: 64px; height: 64px; font-size: var(--text-h3); }

  /* Student/educator identity + detail rows */
  .el-student-detail-row { gap: var(--space-3); }

  /* Card headers/bodies: tighter padding on phones */
  .el-card-header { padding: var(--space-3) var(--space-4); }
  .el-card-body { padding: var(--space-4); }
  .el-scenario-item { padding: var(--space-3) var(--space-4); }
}
/* ── Type info ("?" bubble + info sheet link on type summary cards) ── */
.el-type-card { position: relative; }
.el-type-card:hover,
.el-type-card:has(.el-type-info.open) { z-index: 5; }

.el-type-info { position: relative; display: inline-flex; }
.el-type-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1.5px solid var(--fg3);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--fg2);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: help;
  transition: all 0.15s;
}
.el-type-info-btn:hover,
.el-type-info.open .el-type-info-btn {
  border-color: var(--color-sky-500);
  background: var(--color-navy-100);
  color: var(--color-navy-800);
}

.el-type-info-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: var(--space-3) var(--space-4);
  background: var(--color-navy-800);
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(-50% + var(--el-type-info-shift, 0px))) translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
/* Invisible bridge so the bubble stays open while the cursor moves onto it */
.el-type-info-bubble::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.el-type-info-bubble::after {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(50% - var(--el-type-info-shift, 0px));
  width: 10px;
  height: 10px;
  background: var(--color-navy-800);
  transform: translateX(-50%) rotate(45deg);
}
.el-type-info:hover .el-type-info-bubble,
.el-type-info.open .el-type-info-bubble,
.el-type-info-btn:focus-visible + .el-type-info-bubble,
.el-type-info-bubble:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateX(calc(-50% + var(--el-type-info-shift, 0px))) translateY(0);
}
.el-type-info-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}
.el-type-info-text { color: var(--color-sky-200); }
.el-type-info-link {
  align-self: flex-start;
  color: var(--color-sky-500);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.el-type-info-link:hover { color: var(--color-sky-300); text-decoration: underline; }

.el-type-sheet-link {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  display: inline-flex;
  padding: 5px;
  border-radius: var(--radius-md);
  color: var(--fg3);
  transition: all 0.15s;
}
.el-type-sheet-link:hover {
  background: var(--color-navy-100);
  color: var(--color-navy-800);
}

/* ── Billing ─────────────────────────────────────────────────────────────── */
.billing-org-card { margin-bottom: var(--space-6); overflow: hidden; }
.billing-org-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.billing-org-name { font-family: var(--font-heading); font-size: var(--text-h4); font-weight: var(--fw-semibold); color: var(--color-navy-800); }
.billing-org-meta { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg2); margin-top: var(--space-1); }
.billing-org-body { display: grid; grid-template-columns: 1fr 1fr; }
.billing-org-section { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.billing-org-section + .billing-org-section { border-left: 1px solid var(--border-default); }
.billing-section-title { font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--fg3); letter-spacing: 0.06em; text-transform: uppercase; }
.billing-section-actions { margin: 0; }
.billing-price-form { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.billing-price-input { display: flex; align-items: center; gap: var(--space-2); }
.billing-price-input .el-input { width: 120px; }
.billing-price-prefix, .billing-price-suffix { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); }
.billing-send-form { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.billing-email-input { flex: 1; min-width: 200px; }
.billing-link-row { display: flex; align-items: center; gap: var(--space-2); }
.billing-link-input { flex: 1; min-width: 0; font-size: var(--text-xs); color: var(--fg2); background: var(--bg-page); }
.billing-btn-sm svg { vertical-align: -2px; margin-right: 4px; }
.billing-btn-sm { padding: 6px 12px; font-size: var(--text-xs); white-space: nowrap; }
.billing-btn-block { width: 100%; justify-content: center; }

.billing-summary-card { max-width: 640px; }
.billing-text { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg2); margin: 0; }
.billing-info-grid { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-3) var(--space-4); align-items: center; }
.billing-label { font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--fg2); }
.billing-value { font-family: var(--font-body); font-size: var(--text-sm); color: var(--fg1); }
.billing-card-actions { margin-top: var(--space-6); }

.billing-setup-summary {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  background: var(--bg-page);
}
.billing-setup-row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0; }
.billing-setup-row .billing-value { text-align: right; font-weight: var(--fw-medium); }
.billing-setup-total {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-default);
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--fw-bold);
  color: var(--color-navy-800);
}
.billing-setup-interval { font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--fw-regular); color: var(--fg2); }
.billing-setup-footnote { font-family: var(--font-body); font-size: var(--text-xs); color: var(--fg3); text-align: center; margin: var(--space-4) 0 0; }
.billing-setup-success-icon { display: flex; justify-content: center; color: var(--color-success-500); margin-bottom: var(--space-3); }

@media (max-width: 640px) {
  .billing-org-header { padding: var(--space-4); }
  .billing-org-body { grid-template-columns: 1fr; }
  .billing-org-section { padding: var(--space-4); }
  .billing-org-section + .billing-org-section { border-left: none; border-top: 1px solid var(--border-default); }
  .billing-info-grid { grid-template-columns: 1fr; gap: var(--space-1); }
  .billing-info-grid .billing-label { margin-top: var(--space-2); }
}
