/* ============================================================
   PORTAL.CSS — Art Saves Lives Dashboard & Portal Styles
   Admin | Teacher | Student | Sponsor portals
   ============================================================ */

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  font-family: var(--font-body);
}

.login-brand {
  width: 420px;
  background: var(--purple-900);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12);
  overflow: hidden;
  flex-shrink: 0;
}
.login-brand::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(212,175,55,0.09) 0%, transparent 65%);
  pointer-events: none;
}
.login-brand::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -60px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0,191,165,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.login-brand__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
  position: relative;
  z-index: 1;
  text-decoration: none;
}
.login-brand__logo-mark {
  width: 44px;
  height: 44px;
  background: var(--gold-500);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  color: var(--purple-900);
  font-family: var(--font-heading);
  flex-shrink: 0;
}
.login-brand__org-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: white;
  font-family: var(--font-heading);
  line-height: 1.25;
}
.login-brand__content {
  position: relative;
  z-index: 1;
}
.login-brand__tagline {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  color: white;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}
.login-brand__tagline span { color: var(--gold-400); }
.login-brand__quote {
  font-style: italic;
  color: rgba(255,255,255,0.5);
  font-size: var(--text-sm);
  margin-bottom: var(--space-10);
  border-left: 3px solid rgba(212,175,55,0.25);
  padding-left: var(--space-4);
  line-height: 1.65;
}
.login-brand__stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.login-brand__stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13.5px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.login-brand__stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.login-brand__sankofa {
  position: absolute;
  bottom: var(--space-8);
  right: var(--space-6);
  opacity: 0.05;
  z-index: 0;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  background: white;
  overflow-y: auto;
}
.login-form-wrap {
  width: 100%;
  max-width: 420px;
}
.login-form-wrap__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-800);
  font-family: var(--font-heading);
  margin-bottom: var(--space-1);
}
.login-form-wrap__subtitle {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-bottom: var(--space-8);
}
.login-role-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  padding: 4px;
  margin-bottom: var(--space-8);
  gap: 2px;
}
.login-role-tab {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border-radius: var(--radius-lg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: var(--font-body);
}
.login-role-tab:hover { color: var(--gray-800); }
.login-role-tab.is-active {
  background: white;
  color: var(--purple-700);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
}
.login-demo-creds {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: rgba(61,43,130,0.04);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(61,43,130,0.15);
}
.login-demo-creds__title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-600);
  margin-bottom: var(--space-3);
}
.login-demo-creds__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.login-demo-creds__row:last-child { margin-bottom: 0; }
.login-demo-creds__val {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--purple-700);
  font-weight: 600;
}

/* ---- Portal Base Layout ---- */
body.portal-body {
  margin: 0;
  padding: 0;
  background: #F0F1F5;
  font-family: var(--font-body);
  min-height: 100vh;
}

.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.portal-sidebar {
  width: 256px;
  background: var(--purple-900);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-sidebar__header {
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-decoration: none;
  flex-shrink: 0;
}
.portal-sidebar__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gold-500);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--purple-900);
  font-family: var(--font-heading);
  flex-shrink: 0;
}
.portal-sidebar__org {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.portal-sidebar__org-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-sidebar__org-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.portal-sidebar__nav { flex: 1; padding: var(--space-3) 0; }

.portal-sidebar__group { margin-bottom: var(--space-1); }
.portal-sidebar__group-label {
  padding: var(--space-3) var(--space-5) var(--space-1);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}
.portal-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  margin: 1px var(--space-2);
  border-radius: var(--radius-lg);
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.portal-sidebar__link:hover {
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.07);
}
.portal-sidebar__link.is-active {
  color: var(--gold-400);
  background: rgba(212,175,55,0.1);
}
.portal-sidebar__link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--gold-400);
  border-radius: 0 2px 2px 0;
}
.portal-sidebar__link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.75;
}
.portal-sidebar__link.is-active svg { opacity: 1; }
.portal-sidebar__badge {
  margin-left: auto;
  background: var(--gold-500);
  color: var(--purple-900);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.6;
  min-width: 20px;
  text-align: center;
}
.portal-sidebar__badge--alert { background: #ef4444; color: white; }
.portal-sidebar__badge--teal { background: var(--teal-500); color: var(--purple-900); }

.portal-sidebar__footer {
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.portal-sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.portal-sidebar__user-info { flex: 1; min-width: 0; }
.portal-sidebar__user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-sidebar__user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,0.38);
  margin-top: 1px;
}
.portal-sidebar__logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
  display: flex;
}
.portal-sidebar__logout-btn:hover { color: rgba(255,255,255,0.7); }

/* ---- Portal Main Area ---- */
.portal-main {
  flex: 1;
  margin-left: 256px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.portal-topbar {
  background: white;
  border-bottom: 1px solid #E8E8EE;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-4);
}
.portal-topbar__breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--gray-600);
  min-width: 0;
}
.portal-topbar__breadcrumb a {
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.15s;
}
.portal-topbar__breadcrumb a:hover { color: var(--purple-700); }
.portal-topbar__breadcrumb .sep { color: var(--gray-400); }
.portal-topbar__breadcrumb .current {
  color: var(--gray-800);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.portal-topbar__notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  color: var(--gray-600);
  transition: background 0.15s;
}
.portal-topbar__notif-btn:hover { background: #E8E8EE; }
.portal-topbar__notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--gold-500);
  border-radius: 50%;
  border: 2px solid white;
}
.portal-topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: 5px var(--space-3) 5px var(--space-2);
  border-radius: var(--radius-lg);
  transition: background 0.15s;
}
.portal-topbar__user:hover { background: var(--gray-100); }
.portal-topbar__user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.portal-topbar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}
.role-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.role-chip--admin { background: rgba(61,43,130,0.1); color: var(--purple-700); }
.role-chip--teacher { background: rgba(0,191,165,0.1); color: #00897B; }
.role-chip--student { background: rgba(212,175,55,0.15); color: #8B6500; }
.role-chip--sponsor { background: rgba(212,175,55,0.2); color: #7A5C00; }

/* ---- Portal Content ---- */
.portal-content {
  flex: 1;
  padding: var(--space-8);
}
.portal-content--narrow { max-width: 980px; }

/* ---- Welcome Banner ---- */
.portal-welcome {
  background: linear-gradient(135deg, var(--purple-800) 0%, #180840 100%);
  border-radius: 20px;
  padding: var(--space-8) var(--space-10);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.portal-welcome::before {
  content: '';
  position: absolute;
  top: -60px;
  right: 80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.portal-welcome::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -20px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0,191,165,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.portal-welcome__eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-400);
  margin-bottom: var(--space-2);
  position: relative;
}
.portal-welcome__name {
  font-size: var(--text-3xl);
  font-family: var(--font-heading);
  color: white;
  margin-bottom: var(--space-3);
  position: relative;
  line-height: 1.15;
}
.portal-welcome__meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  position: relative;
  flex-wrap: wrap;
}
.portal-welcome__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.portal-welcome__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  position: relative;
  flex-wrap: wrap;
}
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.portal-btn--primary {
  background: var(--gold-500);
  color: var(--purple-900);
}
.portal-btn--primary:hover { background: var(--gold-400); transform: translateY(-1px); }
.portal-btn--ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}
.portal-btn--ghost:hover { background: rgba(255,255,255,0.14); }
.portal-btn--light {
  background: white;
  color: var(--purple-700);
}
.portal-btn--light:hover { background: var(--gray-100); }
.portal-btn--sm {
  padding: 6px var(--space-4);
  font-size: 12px;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  background: white;
  border-radius: 16px;
  padding: var(--space-5) var(--space-6);
  border: 1px solid #E8E8EE;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon--purple { background: rgba(61,43,130,0.1); color: var(--purple-600); }
.stat-card__icon--teal { background: rgba(0,191,165,0.1); color: #00897B; }
.stat-card__icon--gold { background: rgba(212,175,55,0.12); color: #8B6500; }
.stat-card__icon--orange { background: rgba(251,146,60,0.1); color: #C2410C; }
.stat-card__icon--blue { background: rgba(59,130,246,0.1); color: #2563EB; }
.stat-card__icon--red { background: rgba(239,68,68,0.08); color: #DC2626; }

.stat-card__body { flex: 1; min-width: 0; }
.stat-card__value {
  font-size: 30px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1;
  font-family: var(--font-heading);
  margin-bottom: 4px;
}
.stat-card__label {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}
.stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  margin-top: var(--space-2);
}
.stat-card__trend--up { background: rgba(0,191,165,0.1); color: #00897B; }
.stat-card__trend--pending { background: rgba(245,158,11,0.1); color: #B45309; }
.stat-card__trend--neutral { background: var(--gray-100); color: var(--gray-600); }

/* ---- Two-column Layout ---- */
.portal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  align-items: start;
}
.portal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.portal-section-gap { margin-top: var(--space-6); }

/* ---- Panel (white card) ---- */
.portal-panel {
  background: white;
  border-radius: 16px;
  border: 1px solid #E8E8EE;
  overflow: hidden;
}
.portal-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid #EEEEEF;
}
.portal-panel__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-800);
}
.portal-panel__body { padding: var(--space-5) var(--space-6); }
.portal-panel__foot {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid #EEEEEF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-panel__foot-info {
  font-size: 12.5px;
  color: var(--gray-600);
}
.portal-panel__foot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-600);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.portal-panel__foot-link:hover { color: var(--purple-700); }

/* ---- Filter Tabs ---- */
.portal-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--space-6);
  border-bottom: 1px solid #EEEEEF;
}
.portal-tab {
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  user-select: none;
}
.portal-tab:hover { color: var(--gray-800); }
.portal-tab.is-active {
  color: var(--purple-700);
  border-bottom-color: var(--purple-700);
}
.portal-tab__count {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  background: var(--gray-200);
  color: var(--gray-600);
}
.portal-tab.is-active .portal-tab__count {
  background: rgba(61,43,130,0.1);
  color: var(--purple-700);
}

/* ---- Table ---- */
.portal-table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
}
.portal-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 7px var(--space-3);
  flex: 1;
  max-width: 260px;
}
.portal-search svg { flex-shrink: 0; color: var(--gray-400); }
.portal-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--gray-800);
  width: 100%;
  font-family: var(--font-body);
}
.portal-search input::placeholder { color: var(--gray-400); }

table.ptable {
  width: 100%;
  border-collapse: collapse;
}
table.ptable th {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray-600);
  padding: var(--space-3) var(--space-6);
  text-align: left;
  background: #FAFAFA;
  border-bottom: 1px solid #EEEEEF;
  white-space: nowrap;
}
table.ptable td {
  padding: 13px var(--space-6);
  font-size: 13.5px;
  color: var(--gray-700);
  border-bottom: 1px solid #F4F4F6;
  vertical-align: middle;
}
table.ptable tr:last-child td { border-bottom: none; }
table.ptable tr:hover td { background: #FAFAFA; }
table.ptable tr[data-status] { cursor: default; }

.ptable__name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ptable__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.ptable__name { font-weight: 600; color: var(--gray-900); font-size: 13.5px; }
.ptable__sub { font-size: 11.5px; color: var(--gray-500); margin-top: 1px; }

/* Avatar colors by initial */
.av--a { background: linear-gradient(135deg,#7C3AED,#5B21B6); }
.av--b { background: linear-gradient(135deg,#0891B2,#0E7490); }
.av--c { background: linear-gradient(135deg,#059669,#047857); }
.av--d { background: linear-gradient(135deg,#D97706,#B45309); }
.av--e { background: linear-gradient(135deg,#DC2626,#B91C1C); }
.av--f { background: linear-gradient(135deg,#7C5CBF,#5B21B6); }
.av--g { background: linear-gradient(135deg,#0D9488,#0F766E); }
.av--h { background: linear-gradient(135deg,#EA580C,#C2410C); }
.av--i { background: linear-gradient(135deg,#7C3AED,#6D28D9); }
.av--j { background: linear-gradient(135deg,#2563EB,#1D4ED8); }
.av--k { background: linear-gradient(135deg,#9333EA,#7E22CE); }
.av--l { background: linear-gradient(135deg,#16A34A,#15803D); }
.av--m { background: linear-gradient(135deg,#D4AF37,#9c7800); }
.av--n { background: linear-gradient(135deg,#00BFA5,#00897B); }
.av--t { background: linear-gradient(135deg,#6D28D9,#4C1D95); }
.av--w { background: linear-gradient(135deg,#1D4ED8,#1E40AF); }

/* ---- Status Badges ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-badge--approved { background: rgba(0,191,165,0.1); color: #00897B; }
.status-badge--approved::before { background: #00BFA5; }
.status-badge--pending { background: rgba(245,158,11,0.1); color: #B45309; }
.status-badge--pending::before { background: #F59E0B; }
.status-badge--waitlisted { background: rgba(124,92,191,0.1); color: var(--purple-600); }
.status-badge--waitlisted::before { background: var(--purple-400); }
.status-badge--rejected { background: rgba(239,68,68,0.08); color: #DC2626; }
.status-badge--rejected::before { background: #EF4444; }
.status-badge--assigned { background: rgba(59,130,246,0.1); color: #2563EB; }
.status-badge--assigned::before { background: #3B82F6; }

/* ---- Table Action Buttons ---- */
.tbl-actions { display: flex; align-items: center; gap: 5px; }
.tbl-btn {
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-body);
  white-space: nowrap;
}
.tbl-btn--view { background: var(--gray-100); color: var(--gray-700); border-color: #E0E0E0; }
.tbl-btn--view:hover { background: #E8E8EE; }
.tbl-btn--approve { background: rgba(0,191,165,0.08); color: #00897B; border-color: rgba(0,191,165,0.2); }
.tbl-btn--approve:hover { background: rgba(0,191,165,0.15); }
.tbl-btn--assign { background: rgba(59,130,246,0.08); color: #2563EB; border-color: rgba(59,130,246,0.2); }
.tbl-btn--assign:hover { background: rgba(59,130,246,0.15); }
.tbl-btn--reject { background: rgba(239,68,68,0.06); color: #DC2626; border-color: rgba(239,68,68,0.15); }
.tbl-btn--reject:hover { background: rgba(239,68,68,0.12); }

/* ---- Demographics Panel ---- */
.demo-section { margin-bottom: var(--space-6); }
.demo-section:last-child { margin-bottom: 0; }
.demo-section__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: var(--space-3);
}
.gender-bar {
  display: flex;
  border-radius: 100px;
  overflow: hidden;
  height: 10px;
  margin-bottom: var(--space-3);
}
.gender-bar__f { background: linear-gradient(90deg, var(--purple-600), var(--purple-400)); }
.gender-bar__m { background: linear-gradient(90deg, var(--teal-500), var(--teal-400)); }
.gender-legend { display: flex; gap: var(--space-5); }
.gender-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12.5px;
  color: var(--gray-600);
  font-weight: 500;
}
.gender-legend__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.age-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.age-row { display: flex; align-items: center; gap: var(--space-3); font-size: 12px; }
.age-row__label { width: 44px; color: var(--gray-500); font-weight: 500; text-align: right; flex-shrink: 0; }
.age-row__bar-wrap { flex: 1; background: var(--gray-100); border-radius: 100px; height: 8px; overflow: hidden; }
.age-row__bar { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); transition: width 0.8s ease; }
.age-row__count { width: 24px; font-weight: 700; color: var(--gray-700); font-size: 12px; text-align: right; }

.discipline-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.discipline-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-700);
}
.discipline-pill__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ---- Activity Feed ---- */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid #F4F4F6;
}
.activity-item:last-child { border-bottom: none; }
.activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.activity-item__body { flex: 1; }
.activity-item__text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.activity-item__text strong { color: var(--gray-900); font-weight: 600; }
.activity-item__time { font-size: 11.5px; color: var(--gray-400); margin-top: 3px; }

/* ---- Student Roster Cards ---- */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
.student-card {
  background: white;
  border: 1px solid #E8E8EE;
  border-radius: 14px;
  padding: var(--space-5);
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.student-card:hover {
  border-color: var(--purple-400);
  box-shadow: 0 4px 20px rgba(61,43,130,0.12);
  transform: translateY(-2px);
}
.student-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0 auto var(--space-3);
}
.student-card__name { font-weight: 700; color: var(--gray-900); font-size: 13.5px; margin-bottom: 4px; }
.student-card__meta { font-size: 12px; color: var(--gray-500); margin-bottom: var(--space-3); }
.student-card__tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.student-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.student-tag--level { background: rgba(61,43,130,0.08); color: var(--purple-700); }
.student-tag--island { background: rgba(0,191,165,0.08); color: #00897B; }

/* ---- Schedule Timeline ---- */
.schedule-timeline { display: flex; flex-direction: column; gap: 0; }
.schedule-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid #F4F4F6;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item__time {
  width: 80px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  flex-shrink: 0;
  padding-top: 2px;
}
.schedule-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.schedule-item__body { flex: 1; }
.schedule-item__title { font-size: 13.5px; font-weight: 600; color: var(--gray-800); }
.schedule-item__sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ---- Photo Grid ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.photo-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.photo-item__bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: var(--space-2);
}
.photo-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background 0.2s;
}
.photo-item:hover .photo-item__overlay { background: rgba(0,0,0,0.52); }
.photo-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-800);
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.photo-item:hover .photo-action-btn { opacity: 1; transform: scale(1); }

/* ---- Application Status Tracker (Student) ---- */
.status-tracker {
  display: flex;
  align-items: flex-start;
  background: white;
  border: 1px solid #E8E8EE;
  border-radius: 16px;
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}
.tracker-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 90px;
}
.tracker-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 15px);
  right: calc(-50% + 15px);
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.tracker-step.is-done:not(:last-child)::after { background: var(--teal-500); }
.tracker-step.is-current:not(:last-child)::after { background: var(--gray-200); }

.tracker-step__circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-3);
}
.tracker-step.is-done .tracker-step__circle {
  border-color: var(--teal-500);
  background: var(--teal-500);
  color: white;
}
.tracker-step.is-current .tracker-step__circle {
  border-color: var(--gold-500);
  background: var(--gold-500);
  color: white;
  box-shadow: 0 0 0 4px rgba(212,175,55,0.2);
}
.tracker-step__label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-align: center; }
.tracker-step.is-done .tracker-step__label { color: #00897B; }
.tracker-step.is-current .tracker-step__label { color: #8B6500; }
.tracker-step__sub { font-size: 10.5px; color: var(--gray-400); text-align: center; margin-top: 2px; }

/* ---- Announcement Cards ---- */
.announcement-list { display: flex; flex-direction: column; gap: var(--space-3); }
.announcement-card {
  background: white;
  border: 1px solid #E8E8EE;
  border-radius: 14px;
  padding: var(--space-4) var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  transition: box-shadow 0.2s;
  cursor: pointer;
}
.announcement-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.announcement-card.is-unread { border-left: 3px solid var(--gold-500); }
.announcement-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.announcement-card__body { flex: 1; }
.announcement-card__category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}
.announcement-card__title { font-size: 14px; font-weight: 700; color: var(--gray-900); margin-bottom: 3px; }
.announcement-card__preview { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.announcement-card__date { font-size: 11.5px; color: var(--gray-400); margin-top: var(--space-2); font-weight: 500; }
.announcement-card__unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  flex-shrink: 0;
  margin-top: 5px;
}

/* ---- Document Cards ---- */
.doc-list { display: flex; flex-direction: column; gap: var(--space-3); }
.doc-card {
  background: white;
  border: 1px solid #E8E8EE;
  border-radius: 14px;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.doc-card:hover {
  border-color: var(--purple-400);
  box-shadow: 0 3px 14px rgba(61,43,130,0.1);
}
.doc-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.doc-card__icon--pdf { background: rgba(239,68,68,0.08); }
.doc-card__icon--form { background: rgba(59,130,246,0.08); }
.doc-card__icon--info { background: rgba(212,175,55,0.1); }
.doc-card__body { flex: 1; }
.doc-card__name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.doc-card__meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.doc-card__status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.doc-card__status--required { background: rgba(239,68,68,0.08); color: #DC2626; }
.doc-card__status--optional { background: var(--gray-100); color: var(--gray-500); }
.doc-card__download {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.15s;
  flex-shrink: 0;
}
.doc-card:hover .doc-card__download { background: var(--purple-700); color: white; }

/* ---- Class Card (student) ---- */
.class-card {
  background: linear-gradient(135deg, var(--purple-700) 0%, var(--purple-900) 100%);
  border-radius: 16px;
  padding: var(--space-6);
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.class-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -20px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 65%);
}
.class-card__eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-400); margin-bottom: var(--space-2); }
.class-card__title { font-size: var(--text-xl); font-family: var(--font-heading); margin-bottom: var(--space-4); }
.class-card__details { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.class-card__detail { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: rgba(255,255,255,0.7); }

/* ---- Sponsor Leaderboard Hero ---- */
.leaderboard-hero {
  background: linear-gradient(135deg, var(--purple-900) 0%, #1a0840 100%);
  border-radius: 20px;
  padding: var(--space-8) var(--space-10);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.leaderboard-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 60%);
}
.leaderboard-hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0,191,165,0.07) 0%, transparent 65%);
}
.leaderboard-hero__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-6); position: relative; }
.leaderboard-hero__tier { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-400); margin-bottom: var(--space-2); }
.leaderboard-hero__org { font-size: var(--text-3xl); font-family: var(--font-heading); color: white; margin-bottom: var(--space-1); }
.leaderboard-hero__amount { font-size: var(--text-xl); color: var(--gold-300); font-weight: 700; }
.leaderboard-hero__rank-badge {
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 12px;
  padding: var(--space-3) var(--space-5);
  text-align: center;
  flex-shrink: 0;
}
.leaderboard-hero__rank-num { font-size: var(--text-3xl); font-family: var(--font-heading); color: var(--gold-400); line-height: 1; }
.leaderboard-hero__rank-label { font-size: 10px; color: rgba(255,255,255,0.45); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }

.tier-progress { position: relative; }
.tier-progress__labels { display: flex; justify-content: space-between; margin-bottom: var(--space-2); }
.tier-progress__current { font-size: 13px; color: rgba(255,255,255,0.55); }
.tier-progress__next { font-size: 13px; color: var(--gold-400); font-weight: 600; }
.tier-progress__bar { background: rgba(255,255,255,0.1); border-radius: 100px; height: 10px; overflow: hidden; }
.tier-progress__fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }
.tier-progress__hint { font-size: 12.5px; color: rgba(255,255,255,0.4); margin-top: var(--space-3); }
.tier-progress__hint strong { color: var(--gold-300); font-weight: 700; }

/* ---- Leaderboard List ---- */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid #F4F4F6;
  transition: background 0.15s;
  position: relative;
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item:hover { background: #FAFAFA; }
.leaderboard-item.is-you {
  background: rgba(212,175,55,0.04);
}
.leaderboard-item.is-you::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold-500);
  border-radius: 0 2px 2px 0;
}
.leaderboard-item__rank {
  width: 32px;
  text-align: center;
  font-size: 20px;
  flex-shrink: 0;
}
.leaderboard-item__rank--num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaderboard-item__logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
  border: 1px solid #EEEEEF;
  padding: 4px;
}
.leaderboard-item.is-you .leaderboard-item__logo { border-color: rgba(212,175,55,0.35); background: rgba(212,175,55,0.06); }
.leaderboard-item__info { flex: 1; min-width: 0; }
.leaderboard-item__name { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.leaderboard-item__tier-info { font-size: 12px; color: var(--gray-500); margin-top: 2px; display: flex; align-items: center; gap: var(--space-2); }
.leaderboard-item__right { text-align: right; flex-shrink: 0; }
.leaderboard-item__amount { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.leaderboard-item__impact { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.you-tag {
  display: inline-flex;
  background: var(--gold-500);
  color: var(--purple-900);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  margin-left: 5px;
}
.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}
.tier-chip--diamond { background: rgba(212,175,55,0.15); color: #8B6500; }
.tier-chip--platinum { background: rgba(200,200,220,0.15); color: #6B7280; }
.tier-chip--gold { background: rgba(212,175,55,0.1); color: #9C7800; }
.tier-chip--silver { background: rgba(156,163,175,0.15); color: #6B7280; }
.tier-chip--bronze { background: rgba(180,120,80,0.1); color: #92400E; }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed #D0D0DA;
  border-radius: 16px;
  padding: var(--space-10) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #FAFAFA;
}
.upload-zone:hover { border-color: var(--purple-400); background: rgba(61,43,130,0.03); }
.upload-zone__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(61,43,130,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--purple-600);
}
.upload-zone__title { font-size: var(--text-base); font-weight: 700; color: var(--gray-800); margin-bottom: var(--space-2); }
.upload-zone__hint { font-size: var(--text-sm); color: var(--gray-500); }
.upload-zone__hint strong { color: var(--purple-600); }

/* ---- Impact Stats ---- */
.impact-card {
  background: white;
  border: 1px solid #E8E8EE;
  border-radius: 14px;
  padding: var(--space-6);
  text-align: center;
}
.impact-card__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--purple-800);
  font-family: var(--font-heading);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.impact-card__label { font-size: 13px; color: var(--gray-500); }

/* ---- Social Share ---- */
.social-share { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.share-btn--instagram { background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCB045); color: white; }
.share-btn--facebook { background: #1877F2; color: white; }
.share-btn--twitter { background: #1DA1F2; color: white; }
.share-btn:hover { transform: translateY(-2px); opacity: 0.9; }

/* ---- Mobile FAB Sidebar Toggle ---- */
.sidebar-fab {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--purple-700);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 300;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(13,5,32,0.35);
  transition: background 0.2s;
}
.sidebar-fab:hover { background: var(--purple-600); }

/* ---- Section Title within Portal ---- */
.psection-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: var(--space-4);
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-grid-2 { grid-template-columns: 1fr; }
  .stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .stats-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .portal-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .portal-sidebar { transform: translateX(-100%); }
  .portal-sidebar.is-open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
  .sidebar-fab { display: flex; }
  .portal-content { padding: var(--space-5); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid--3 { grid-template-columns: 1fr 1fr; }
  .portal-grid-3 { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .portal-welcome { padding: var(--space-6); }
  .portal-welcome__name { font-size: var(--text-2xl); }
  .leaderboard-hero { padding: var(--space-6); }
  .leaderboard-hero__top { flex-direction: column; gap: var(--space-4); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .status-tracker { padding: var(--space-5); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid--3 { grid-template-columns: 1fr; }
  .student-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-topbar { padding: 0 var(--space-4); }
  .portal-topbar__user-name { display: none; }
}

/* ============================================================
   PORTAL BOTTOM NAV — Native-app tab bar (mobile only)
   ============================================================ */
.portal-bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {

  /* Show bottom nav */
  .portal-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    /* iOS safe area support (notch / home indicator) */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--purple-900);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 300;
    align-items: stretch;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  }

  /* Each tab */
  .portal-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.38);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: color 0.15s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .portal-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s;
  }

  .portal-bottom-nav__item:active svg {
    transform: scale(0.88);
  }

  /* Active tab */
  .portal-bottom-nav__item.is-active {
    color: var(--gold-400);
  }

  /* Active indicator line at top of tab */
  .portal-bottom-nav__item.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    background: var(--gold-400);
    border-radius: 0 0 3px 3px;
  }

  /* Notification badge on a tab item */
  .portal-bottom-nav__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    background: var(--teal-500);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
  }

  /* Push portal content up so it's not hidden behind the bottom nav */
  .portal-content {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--space-6)) !important;
  }

  /* Hide the floating sidebar FAB when bottom nav is present —
     the hamburger FAB on portal pages is only needed for the sidebar
     which is accessible via scroll or swipe on mobile anyway */
  .sidebar-fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   PWA INSTALL BAR — Slides up on login.html
   Hidden if already running in standalone (installed) mode
   ============================================================ */
.pwa-install-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1E0A4C;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  animation: pwaSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-bar.is-visible {
  display: flex;
}

@keyframes pwaSlideUp {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* App icon in the install bar */
.pwa-install-bar__icon {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Text block */
.pwa-install-bar__text {
  flex: 1;
  min-width: 0;
}

.pwa-install-bar__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-bar__sub {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Install button */
.pwa-install-bar__btn {
  background: var(--gold-500);
  color: #0D0520;
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-bar__btn:hover   { background: var(--gold-400); }
.pwa-install-bar__btn:active  { transform: scale(0.96); }

/* Dismiss button */
.pwa-install-bar__dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-bar__dismiss:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   PWA STANDALONE MODE ADJUSTMENTS
   Applied when the app is installed and running in standalone mode
   ============================================================ */
@media (display-mode: standalone) {
  /* Pad the top of the sidebar and topbar for iOS status bar notch */
  .portal-sidebar {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .portal-topbar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(64px + env(safe-area-inset-top, 0px));
  }
  /* Slightly increase topbar logo weight for app context */
  .portal-sidebar__header {
    padding-top: calc(var(--space-5) + env(safe-area-inset-top, 0px));
  }
}
