/* ==========================================================================
   SERWAA NYARKO GIRLS' SENIOR HIGH SCHOOL - ADMIN PORTAL
   Design: Exact match to school branding (Midnight Purple, Royal Purple, Gold)
   Responsive: Full desktop & mobile off-canvas drawer navigation
   ========================================================================== */

:root {
  --portal-bg: #f8f9fd;
  --portal-card-bg: #ffffff;
  --portal-sidebar-bg: #120726;
  --portal-sidebar-dark: #0c041c;
  --portal-primary: #1e1b4b;
  --portal-purple: #5b21b6;
  --portal-purple-dark: #43217c;
  --portal-purple-light: #7c3aed;
  --portal-gold: #e5a824;
  --portal-gold-light: #fef3c7;
  --portal-text-muted: #64748b;
  --portal-border: #eef0f6;
  --portal-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --portal-font-heading: 'Outfit', sans-serif;
}

.portal-root {
  display: none;
  min-height: 100vh;
  background-color: var(--portal-bg);
  color: var(--portal-primary);
  font-family: var(--portal-font-sans);
  position: relative;
}

.portal-root.active {
  display: flex;
}

/* --------------------------------------------------------------------------
   BACKDROP FOR MOBILE DRAWER
   -------------------------------------------------------------------------- */
.portal-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 32, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.portal-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */
.portal-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--portal-sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1050;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-crest {
  height: 48px;
  width: auto;
  max-width: 54px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.sidebar-brand-text h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.15;
  font-family: var(--portal-font-heading);
  letter-spacing: -0.01em;
}

.sidebar-brand-text h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c4b5fd;
  margin: 1px 0 0 0;
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 3px 0 0 0;
}

.sidebar-section-tag {
  padding: 16px 18px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--portal-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  padding: 8px 12px;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-menu-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  color: #b7b4cb;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.sidebar-menu-btn .menu-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu-btn .menu-btn-left i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.sidebar-menu-btn i.chevron-icon {
  font-size: 0.62rem;
  color: #64748b;
  opacity: 0.7;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-menu-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.sidebar-menu-btn:hover i.chevron-icon {
  transform: translateX(2px);
  color: #ffffff;
  opacity: 1;
}

.sidebar-menu-btn.active {
  background: var(--portal-purple);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.45);
}

.sidebar-menu-btn.active i.chevron-icon {
  color: #ffffff;
  opacity: 1;
}

/* Sidebar Bottom Profile */
.sidebar-user-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--portal-sidebar-dark);
  margin-top: auto;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--portal-sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-meta-info h5 {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.role-title-text {
  font-size: 0.72rem;
  color: #94a3b8;
  display: block;
}

.user-online-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: #22c55e;
  font-weight: 600;
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
}

.sidebar-action-links {
  display: flex;
  gap: 8px;
}

.btn-sidebar-quick {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sidebar-quick:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-sidebar-quick.logout:hover {
  background: #dc2626;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   PORTAL MAIN CONTENT & TOPBAR
   -------------------------------------------------------------------------- */
.portal-main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--portal-bg);
}

.portal-topbar {
  background: #ffffff;
  padding: 14px 28px;
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-hamburger-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--portal-primary);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s;
}

.topbar-hamburger-btn:hover {
  background: #e2e8f0;
}

.portal-page-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--portal-primary);
  margin: 0;
  line-height: 1.15;
  font-family: var(--portal-font-heading);
}

.portal-page-title p {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
  margin: 2px 0 0 0;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-search-box {
  display: flex;
  align-items: center;
  background: #f8f9fd;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 7px 14px;
  gap: 8px;
  width: 280px;
  transition: all 0.2s ease;
}

.topbar-search-box:focus-within {
  border-color: var(--portal-purple-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  width: 320px;
}

.topbar-search-box i {
  color: #94a3b8;
  font-size: 0.85rem;
}

.topbar-search-box input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  color: var(--portal-primary);
}

.topbar-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8f9fd;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.topbar-icon-btn:hover {
  background: #f1f5f9;
  color: var(--portal-primary);
}

.badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.academic-year-badge {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 12px;
  position: relative;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--portal-primary);
}

.academic-year-badge select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--portal-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 16px;
}

.select-chevron {
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-size: 0.65rem;
  color: #64748b;
}

.btn-topbar-website {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-topbar-website:hover {
  background: var(--portal-purple-dark);
  color: #ffffff;
}

.portal-content-body {
  padding: 24px 28px;
  flex-grow: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   ROW 1: 5 METRIC CARDS
   -------------------------------------------------------------------------- */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--portal-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.kpi-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.kpi-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.kpi-card.purple .kpi-icon-circle { background: #7c3aed; color: #ffffff; }
.kpi-card.yellow .kpi-icon-circle { background: #eab308; color: #ffffff; }
.kpi-card.blue .kpi-icon-circle { background: #0284c7; color: #ffffff; }
.kpi-card.pink .kpi-icon-circle { background: #e11d48; color: #ffffff; }
.kpi-card.green .kpi-icon-circle { background: #16a34a; color: #ffffff; }

.kpi-info h4 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--portal-primary);
  line-height: 1.1;
  margin: 0;
  font-family: var(--portal-font-heading);
}

.kpi-info p {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  margin: 2px 0 0 0;
}

.kpi-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.kpi-trend-badge {
  font-size: 0.72rem;
  font-weight: 700;
}

.kpi-trend-badge.up { color: #16a34a; }
.kpi-trend-badge.neutral { color: #64748b; }

.kpi-sparkline {
  width: 85px;
  height: 24px;
}

/* --------------------------------------------------------------------------
   ROW 2: CHARTS & NOTIFICATIONS GRID
   -------------------------------------------------------------------------- */
.admin-mid-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--portal-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

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

.admin-card-header h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--portal-primary);
  font-family: var(--portal-font-heading);
  margin: 0;
}

.card-action-select {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  outline: none;
  background: #ffffff;
  cursor: pointer;
}

.card-action-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-purple-light);
  text-decoration: none;
  cursor: pointer;
}

.card-action-link:hover {
  text-decoration: underline;
}

/* Donut Chart */
.donut-chart-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.donut-svg-box {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-text .big-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--portal-primary);
  line-height: 1;
}

.donut-center-text .sub-lbl {
  font-size: 0.65rem;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-pct {
  font-weight: 700;
  color: var(--portal-primary);
}

/* Notifications List */
.notifications-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
}

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

.notif-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notif-content {
  flex-grow: 1;
  min-width: 0;
}

.notif-content h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--portal-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-content p {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
  margin: 1px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   ROW 3: QUICK ACTIONS & TODAY'S SUMMARY
   -------------------------------------------------------------------------- */
.admin-actions-summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 20px;
  margin-bottom: 24px;
}

.quick-actions-btns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.quick-action-btn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
  text-align: center;
}

.quick-action-btn-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  border-color: #e2e8f0;
}

.btn-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-action-icon.purple { background: #f3e8ff; color: #7c3aed; }
.btn-action-icon.amber { background: #fef3c7; color: #d97706; }
.btn-action-icon.blue { background: #e0f2fe; color: #0284c7; }
.btn-action-icon.pink { background: #ffe4e6; color: #e11d48; }
.btn-action-icon.green { background: #dcfce7; color: #16a34a; }
.btn-action-icon.violet { background: #f5f3ff; color: #6d28d9; }

.btn-action-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--portal-primary);
  white-space: nowrap;
}

/* Today's Summary Card (Royal Purple Gradient) */
.todays-summary-card {
  background: linear-gradient(135deg, #43217c 0%, #220845 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(67, 33, 124, 0.25);
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-card-header h3 {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--portal-font-heading);
  margin: 0;
}

.summary-card-header a {
  color: #facc15;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.summary-card-header a:hover {
  text-decoration: underline;
}

.summary-stats-cols {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 14px;
  text-align: center;
}

.summary-stat-col .stat-icon {
  font-size: 1.25rem;
  opacity: 0.85;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.summary-stat-col .stat-val {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.summary-stat-col .stat-lbl {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 4px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   ROW 4: RECENT STUDENTS, UPCOMING EVENTS, RECENT VISITORS
   -------------------------------------------------------------------------- */
.admin-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Student Row */
.student-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f8fafc;
}

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

.student-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ede9fe;
  color: #6d28d9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.student-meta {
  flex-grow: 1;
  min-width: 0;
}

.student-meta h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-primary);
  margin: 0;
}

.student-meta p {
  font-size: 0.7rem;
  color: var(--portal-text-muted);
  margin: 1px 0 0 0;
}

.form-tag-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.form-tag-badge.f1 { background: #ede9fe; color: #6d28d9; }
.form-tag-badge.f2 { background: #fef3c7; color: #b45309; }
.form-tag-badge.f3 { background: #dcfce7; color: #15803d; }

.student-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 8px;
  white-space: nowrap;
}

/* Event Row */
.event-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f8fafc;
}

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

.event-date-badge {
  width: 44px;
  height: 46px;
  border-radius: 8px;
  background: #ede9fe;
  color: #5b21b6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-date-badge .month {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-date-badge .day {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.event-details {
  flex-grow: 1;
  min-width: 0;
}

.event-details h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--portal-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-details p {
  font-size: 0.7rem;
  color: var(--portal-text-muted);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}

/* Visitor Row */
.visitor-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f8fafc;
}

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

.visitor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.visitor-meta {
  flex-grow: 1;
  min-width: 0;
}

.visitor-meta h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-primary);
  margin: 0;
}

.visitor-meta p {
  font-size: 0.7rem;
  color: var(--portal-text-muted);
  margin: 1px 0 0 0;
}

.visitor-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.portal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  border-top: 1px solid var(--portal-border);
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   DATA TABLES & MANAGEMENT VIEWS (Students, Teachers, Admissions, etc.)
   -------------------------------------------------------------------------- */
.portal-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--portal-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  margin-bottom: 24px;
}

.portal-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--portal-primary);
  font-family: var(--portal-font-heading);
}

.table-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-search-input {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
  outline: none;
  font-family: inherit;
}

.table-filter-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.8rem;
  outline: none;
  font-family: inherit;
  background: #ffffff;
  cursor: pointer;
}

.btn-table-action {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-table-action.primary {
  background: var(--portal-purple);
  color: #ffffff;
}

.btn-table-action.primary:hover {
  background: #4c1d95;
}

.btn-table-action.secondary {
  background: #f1f5f9;
  color: #334155;
}

.btn-table-action.secondary:hover {
  background: #e2e8f0;
}

.btn-table-action.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-table-action.danger:hover {
  background: #fecaca;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.portal-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.portal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.portal-table tr:hover {
  background: #fbfcfe;
}

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: capitalize;
}

.status-pill.active,
.status-pill.approved {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.pending {
  background: #fef3c7;
  color: #b45309;
}

.status-pill.rejected,
.status-pill.inactive {
  background: #fee2e2;
  color: #b91c1c;
}

/* Student ID Card Badge */
.id-card-preview {
  max-width: 440px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.id-card-header {
  background: linear-gradient(135deg, #120726 0%, #43217c 100%);
  color: #ffffff;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.id-card-header img {
  height: 44px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
}

.id-card-body {
  padding: 20px;
  display: flex;
  gap: 16px;
}

.id-photo-box {
  width: 100px;
  height: 120px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.id-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.id-details-list .row {
  display: flex;
  gap: 6px;
}

.id-details-list .lbl {
  font-weight: 700;
  color: #64748b;
  min-width: 80px;
}

.id-details-list .val {
  font-weight: 800;
  color: var(--portal-primary);
}

.id-card-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   TEACHER PANEL SPECIFIC STYLES
   -------------------------------------------------------------------------- */

/* Sidebar Menu Badge Pill (e.g. 8, 3, 5) */
.sidebar-menu-btn .menu-badge-pill {
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 12px;
  margin-left: auto;
  margin-right: 6px;
  transition: all 0.2s ease;
}

.sidebar-menu-btn.active .menu-badge-pill {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* Topbar Teacher Profile */
.topbar-teacher-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  border-radius: 24px;
  background: #f8f9fd;
  border: 1px solid #e2e8f0;
}

.topbar-teacher-info h6 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--portal-primary);
  line-height: 1.15;
}

.topbar-teacher-info span {
  font-size: 0.68rem;
  color: var(--portal-text-muted);
  display: block;
}

/* Teacher 6-KPI Grid */
.teacher-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.teacher-kpi-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--portal-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teacher-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.teacher-kpi-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  flex-shrink: 0;
}

.teacher-kpi-icon.purple { background: #7c3aed; }
.teacher-kpi-icon.amber { background: #f59e0b; }
.teacher-kpi-icon.blue { background: #0284c7; }
.teacher-kpi-icon.pink { background: #e11d48; }
.teacher-kpi-icon.green { background: #16a34a; }
.teacher-kpi-icon.teal { background: #0d9488; }

.teacher-kpi-info p {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--portal-text-muted);
  margin: 0;
}

.teacher-kpi-info h4 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--portal-primary);
  margin: 2px 0 0;
  line-height: 1.1;
  font-family: var(--portal-font-heading);
}

.teacher-kpi-bottom {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.teacher-kpi-sub {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}

.teacher-kpi-action {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--portal-purple);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-kpi-action:hover {
  text-decoration: underline;
  transform: translateX(2px);
}

/* Class Overview Progress Bars */
.class-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f8fafc;
  gap: 12px;
}

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

.class-name-box {
  min-width: 140px;
}

.class-name-box h5 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-primary);
}

.class-name-box p {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--portal-text-muted);
}

.mini-progress-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  max-width: 90px;
}

.mini-progress-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--portal-primary);
  text-align: right;
}

.mini-progress-track {
  width: 100%;
  height: 5px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 4px;
}

.mini-progress-fill.green { background: #16a34a; }
.mini-progress-fill.purple { background: #7c3aed; }

/* To Do List */
.teacher-todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teacher-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f8fafc;
}

.teacher-todo-item:last-child {
  border-bottom: none;
}

.teacher-todo-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  margin-top: 2px;
  accent-color: #7c3aed;
  cursor: pointer;
}

.teacher-todo-content {
  flex-grow: 1;
  min-width: 0;
}

.teacher-todo-content h6 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--portal-primary);
}

.teacher-todo-content p {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--portal-text-muted);
}

.teacher-todo-due {
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 8px;
}

.teacher-todo-due.red { color: #e11d48; }
.teacher-todo-due.amber { color: #d97706; }
.teacher-todo-due.muted { color: #64748b; }

/* Quick Links 4x2 Grid */
.teacher-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.teacher-quick-link-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
  text-align: center;
}

.teacher-quick-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  border-color: #e2e8f0;
}

.teacher-quick-link-btn i {
  font-size: 1.25rem;
  color: var(--portal-purple);
}

.teacher-quick-link-btn span {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--portal-primary);
  white-space: nowrap;
}

/* Row 5 Quad Grid */
.teacher-bottom-quad {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Teacher Status Pills */
.teacher-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.teacher-status-pill.completed {
  background: #dcfce7;
  color: #166534;
}

.teacher-status-pill.ongoing {
  background: #ede9fe;
  color: #6d28d9;
}

.teacher-status-pill.upcoming {
  background: #e0f2fe;
  color: #0369a1;
}

.teacher-status-pill.pending {
  background: #fef3c7;
  color: #b45309;
}

/* Teacher List Items */
.teacher-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f8fafc;
  gap: 12px;
}

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

.teacher-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.teacher-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.teacher-item-icon.purple {
  background: #ede9fe;
  color: #7c3aed;
}

.teacher-item-icon.blue {
  background: #e0f2fe;
  color: #0284c7;
}

.teacher-item-icon.pink {
  background: #ffe4e6;
  color: #e11d48;
}

.teacher-item-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.teacher-item-text {
  min-width: 0;
}

.teacher-item-text h6 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-item-text p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--portal-text-muted);
}

.teacher-date-badge {
  width: 48px;
  height: 50px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ede9fe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
}

.teacher-date-badge .badge-month {
  font-size: 0.62rem;
  font-weight: 800;
  color: #7c3aed;
  text-transform: uppercase;
  line-height: 1;
}

.teacher-date-badge .badge-day {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e1b4b;
  line-height: 1;
  margin-top: 3px;
}

.teacher-date-badge .badge-year {
  font-size: 0.58rem;
  color: #94a3b8;
  line-height: 1;
  margin-top: 1px;
}

/* Student Attendance Chart Container with Pinned Tooltip */
.attendance-chart-container {
  position: relative;
  width: 100%;
  padding-top: 10px;
}

.attendance-pinned-tooltip {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 6px 12px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

.attendance-pinned-tooltip .tooltip-day {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}

.attendance-pinned-tooltip .tooltip-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e1b4b;
}

/* --------------------------------------------------------------------------
   STUDENT PANEL STYLING (EXACT DESIGN MATCH)
   -------------------------------------------------------------------------- */
.student-quad-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr 0.9fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Subject Performance Rows */
.subject-perf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
  gap: 12px;
}

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

.subject-perf-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.subject-perf-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.subject-perf-icon.purple { background: #ede9fe; color: #7c3aed; }
.subject-perf-icon.blue { background: #e0f2fe; color: #0284c7; }
.subject-perf-icon.orange { background: #ffedd5; color: #ea580c; }
.subject-perf-icon.green { background: #dcfce7; color: #16a34a; }
.subject-perf-icon.teal { background: #ccfbf1; color: #0f766e; }
.subject-perf-icon.pink { background: #ffe4e6; color: #e11d48; }

.subject-perf-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-primary);
}

.subject-perf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 120px;
}

.subject-perf-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.subject-perf-fill {
  height: 100%;
  border-radius: 4px;
}

.subject-perf-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--portal-primary);
  min-width: 32px;
  text-align: right;
}

/* Behaviour Points Medal Card */
.behaviour-medal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 6px;
  text-align: center;
}

.behaviour-medal-icon {
  font-size: 3.8rem;
  color: #7c3aed;
  filter: drop-shadow(0 6px 14px rgba(124, 58, 237, 0.28));
  margin-bottom: 8px;
}

.behaviour-score-big {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--portal-primary);
  font-family: var(--portal-font-heading);
  line-height: 1.1;
}

.behaviour-standing-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #16a34a;
  margin-top: 4px;
}

.behaviour-motto-sub {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
  margin-top: 6px;
}

/* School Management Grid */
.management-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.management-person-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px;
  background: #fcfcfd;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.management-person-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border-color: #e2e8f0;
}

.management-person-img {
  width: 62px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
}

.management-person-role {
  font-size: 0.65rem;
  color: var(--portal-text-muted);
  font-weight: 600;
  line-height: 1.25;
  min-height: 28px;
}

.management-person-name {
  font-size: 0.72rem;
  color: var(--portal-primary);
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.2;
}

/* Alumni Stats Wrap */
.alumni-stats-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.alumni-stat-box {
  background: #f8f9fd;
  border: 1px solid #eef0f6;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}

.alumni-stat-box span {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 600;
  display: block;
}

.alumni-stat-box strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e1b4b;
  font-family: var(--portal-font-heading);
  margin-top: 2px;
  display: block;
}

.alumni-actions-row {
  display: flex;
  gap: 10px;
}

.btn-alumni-primary {
  background: var(--portal-purple);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-alumni-primary:hover {
  background: var(--portal-purple-dark);
}

.btn-alumni-outline {
  background: #ffffff;
  color: var(--portal-primary);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-alumni-outline:hover {
  background: #f8f9fd;
  border-color: #cbd5e1;
}

/* Download Item Row */
.download-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
}

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

.download-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.download-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ffe4e6;
  color: #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.download-item-text h6 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-item-text p {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--portal-text-muted);
}

.download-btn-icon {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: color 0.2s ease;
}

.download-btn-icon:hover {
  color: var(--portal-purple);
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN (MOBILE & TABLET)
   -------------------------------------------------------------------------- */
@media (max-width: 1480px) {
  .admin-kpi-grid,
  .teacher-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-mid-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-mid-grid .chart-overview-card {
    grid-column: span 2;
  }
  .quick-actions-btns {
    grid-template-columns: repeat(3, 1fr);
  }
  .teacher-bottom-quad {
    grid-template-columns: 1fr 1fr;
  }
  .student-quad-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .topbar-hamburger-btn {
    display: flex;
  }

  .portal-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1200;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.25);
  }

  .portal-sidebar.mobile-open {
    left: 0;
  }

  .admin-mid-grid {
    grid-template-columns: 1fr;
  }

  .admin-mid-grid .chart-overview-card {
    grid-column: span 1;
  }

  .admin-actions-summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-bottom-grid {
    grid-template-columns: 1fr;
  }

  .teacher-bottom-quad {
    grid-template-columns: 1fr 1fr;
  }

  .student-quad-grid {
    grid-template-columns: 1fr 1fr;
  }

  .management-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .quick-actions-btns {
    grid-template-columns: repeat(3, 1fr);
  }

  .teacher-quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .teacher-bottom-quad {
    grid-template-columns: 1fr;
  }

  .student-quad-grid {
    grid-template-columns: 1fr;
  }

  .management-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-search-box {
    display: none;
  }

  .portal-content-body {
    padding: 16px;
  }

  .portal-topbar {
    padding: 12px 16px;
  }

  .portal-page-title p {
    display: none;
  }
}

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

  .quick-actions-btns {
    grid-template-columns: repeat(2, 1fr);
  }

  .management-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hide-mobile {
    display: none;
  }

  .portal-footer {
    flex-direction: column;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   PARENT / GUARDIAN, ACCOUNTANT & HEADMISTRESS SPECIALIZED PANELS
   -------------------------------------------------------------------------- */

/* Parent Panel */
.parent-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.parent-child-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.parent-child-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.parent-child-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.parent-child-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1b4b;
}

.parent-child-info p {
  margin: 3px 0 6px;
  font-size: 0.78rem;
  color: #64748b;
}

.parent-status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.parent-status-pill.active {
  background: #ede9fe;
  color: #6d28d9;
}

.parent-add-child-card {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6366f1;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 84px;
  transition: all 0.2s ease;
}

.parent-add-child-card:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #4f46e5;
}

.parent-academic-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.parent-stat-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.parent-stat-box .stat-lbl {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 4px;
}

.parent-stat-box .stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e1b4b;
}

.parent-stat-box .stat-sub {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 4px;
}

.parent-fee-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0;
}

.parent-fee-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.parent-fee-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 8px;
}

.parent-fee-item .fee-lbl {
  font-size: 0.72rem;
  color: #64748b;
}

.parent-fee-item .fee-amt {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 4px;
}

.btn-make-payment {
  background: linear-gradient(135deg, #43217c 0%, #6d28d9 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s ease;
}

.btn-make-payment:hover {
  opacity: 0.94;
}

/* Accountant & Headmistress 5/6 KPI Grids */
.accountant-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.headmistress-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stars-gold {
  color: #eab308;
  display: inline-flex;
  gap: 2px;
  font-size: 0.82rem;
}

.kpi-link-arrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6366f1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.kpi-link-arrow:hover {
  text-decoration: underline;
}

/* Arrears and Aging */
.arrears-ageing-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.arrears-ageing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.arrears-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Finance summary breakdown */
.finance-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finance-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}

.finance-breakdown-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Headmistress Class Table */
.perf-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.perf-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.perf-table-wrap th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.72rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.perf-table-wrap td {
  padding: 10px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e1b4b;
}

/* Discipline sub-kpis */
.discipline-kpi-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.discipline-kpi-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 6px;
}

.discipline-kpi-box .disc-icon {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.discipline-kpi-box .disc-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e1b4b;
}

.discipline-kpi-box .disc-lbl {
  font-size: 0.68rem;
  color: #64748b;
}

/* Approvals list */
.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  gap: 12px;
}

.approval-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.approval-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Responsive updates for new grids */
@media (max-width: 1480px) {
  .accountant-kpi-grid,
  .headmistress-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 768px) {
  .accountant-kpi-grid,
  .headmistress-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .discipline-kpi-quad {
    grid-template-columns: repeat(2, 1fr);
  }
  .parent-fee-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .accountant-kpi-grid,
  .headmistress-kpi-grid {
    grid-template-columns: 1fr;
  }
  .parent-academic-stats {
    grid-template-columns: 1fr;
  }
}

