/* ============================================================================
 * SGR Children Academy — Results Portal Design System
 * Brand Palette: Deep Navy (#050d24 / #0b1940), Magenta (#e6007e), Cyan (#00a8e8)
 * ============================================================================ */

@import url("https://cdn-uicons.flaticon.com/2.6.0/uicons-regular-rounded/css/uicons-regular-rounded.css");
@import url("https://cdn-uicons.flaticon.com/2.6.0/uicons-solid-rounded/css/uicons-solid-rounded.css");

:root {
  --sgr-navy: #0b1940;
  --sgr-navy-deep: #050d24;
  --sgr-navy-mid: #132a68;
  --sgr-navy-soft: #eef3fb;
  --sgr-magenta: #e6007e;
  --sgr-magenta-hover: #c4006b;
  --sgr-magenta-soft: #fdf2f8;
  --sgr-cyan: #00a8e8;
  --sgr-cyan-hover: #008ec5;
  --sgr-cyan-soft: #f0f9ff;
  --sgr-gradient: linear-gradient(135deg, #e6007e 0%, #00a8e8 100%);
  --sgr-navy-gradient: linear-gradient(145deg, #050d24 0%, #0b1940 55%, #132a68 100%);

  --ink: #0f172a;
  --muted: #53627a;
  --bg-surface: #f4f7fc;
  --white: #ffffff;
  --border: #dfe7f2;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;

  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --shadow-lg: 0 22px 55px rgba(5, 13, 36, 0.22);
  --shadow-sm: 0 6px 20px rgba(11, 25, 64, 0.06);
  --sidebar-w: 258px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--sans); color: var(--ink); background: var(--bg-surface); }
a { color: var(--sgr-cyan-hover); text-decoration: none; }
a:hover { color: var(--sgr-magenta); }

/* ============================================================================
 * 1. AUTH / THREE-ROLE LOGIN EXPERIENCE (Matches SGRChildrenAcademy.com)
 * ============================================================================ */

.sgr-auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #f6f8fc;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(0, 168, 232, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(230, 0, 126, 0.08) 0%, transparent 40%);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  overflow-x: hidden;
}

/* Official SGR Website Top Header Bar */
.sgr-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(11, 25, 64, 0.04);
}

.sgr-site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sgr-site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sgr-brand-crest {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.sgr-brand-crest img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.sgr-brand-motto {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 0.44rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-top: 1px;
  background: var(--sgr-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.sgr-brand-title b {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--sgr-navy);
  display: block;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.sgr-brand-title small {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}

.sgr-header-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sgr-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #f0f9ff;
  border: 1.5px solid var(--sgr-cyan);
  color: var(--sgr-navy);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sgr-header-pill:hover {
  background: var(--sgr-navy);
  border-color: var(--sgr-navy);
  color: #ffffff;
}

.sgr-header-domain {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Main Centered Login Container (Fits cleanly inside 1 viewport) */
.sgr-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.sgr-login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #d2ddec;
  border-radius: 18px;
  box-shadow:
    0 24px 58px -8px rgba(11, 25, 64, 0.18),
    0 10px 26px -4px rgba(11, 25, 64, 0.10),
    0 0 0 1px rgba(11, 25, 64, 0.05);
  overflow: hidden;
  position: relative;
}

.sgr-login-card::before {
  content: "";
  display: block;
  height: 4px;
  width: 100%;
  background: var(--sgr-gradient);
}

.sgr-auth-panel {
  background: #ffffff;
  padding: 24px 30px 26px;
}

.sgr-card-brand-head {
  text-align: center;
  margin-bottom: 12px;
}

.sgr-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--sgr-magenta-soft);
  color: var(--sgr-magenta);
  border: 1px solid rgba(230, 0, 126, 0.22);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 7px;
}

.sgr-auth-head {
  text-align: center;
  margin-bottom: 12px;
}

.sgr-auth-head h1 {
  font-family: var(--serif);
  font-size: 1.42rem;
  color: var(--sgr-navy);
  margin: 0 0 3px;
  line-height: 1.18;
}

.sgr-auth-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.sgr-auth-footer {
  text-align: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  font-size: 0.76rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.sgr-auth-footer a {
  color: var(--sgr-navy);
  font-weight: 600;
}

.sgr-auth-footer a:hover {
  color: var(--sgr-magenta);
}

/* Three-Role Switcher */
.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  background: var(--sgr-navy-soft);
  border: 1px solid #d5e0ee;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 3px rgba(11, 25, 64, 0.07);
}

.role-tab-btn {
  border: none;
  background: transparent;
  padding: 8px 6px;
  min-height: 38px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.role-tab-btn i {
  font-size: 0.92rem;
}

.role-tab-btn:hover {
  color: var(--sgr-navy);
  background: rgba(255, 255, 255, 0.6);
}

.role-tab-btn.active[data-role="student"] {
  background: #ffffff;
  color: var(--sgr-navy);
  box-shadow: 0 4px 12px rgba(0, 168, 232, 0.16);
  border-bottom: 2.5px solid var(--sgr-cyan);
}

.role-tab-btn.active[data-role="staff"] {
  background: #ffffff;
  color: var(--sgr-navy);
  box-shadow: 0 4px 12px rgba(230, 0, 126, 0.16);
  border-bottom: 2.5px solid var(--sgr-magenta);
}

.role-tab-btn.active[data-role="admin"] {
  background: var(--sgr-navy);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 25, 64, 0.25);
  border-bottom: 2.5px solid var(--sgr-cyan);
}

.role-context-banner {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.77rem;
  line-height: 1.38;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.role-context-banner.student { background: var(--sgr-cyan-soft); border: 1px solid #bae6fd; color: #075985; }
.role-context-banner.staff   { background: var(--sgr-magenta-soft); border: 1px solid #fbcfe8; color: #831843; }
.role-context-banner.admin   { background: var(--sgr-navy-soft); border: 1px solid #c7d6ef; color: var(--sgr-navy); }

.auth-alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.auth-alert.error { background: var(--danger-bg); border: 1px solid #fecaca; color: var(--danger); }
.auth-alert.success { background: var(--success-bg); border: 1px solid #bbf7d0; color: var(--success); }
.auth-alert.info { background: var(--sgr-cyan-soft); border: 1px solid #bae6fd; color: #0369a1; }

.form-group { margin-bottom: 11px; }
.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--sgr-navy);
  margin-bottom: 4px;
}
.form-group label .hint {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap i.lead-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  font-size: 0.90rem;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 11px 38px 11px 36px;
  border: 1.5px solid #d5e0ee;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.91rem;
  color: var(--ink);
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(11, 25, 64, 0.04);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.input-wrap input::placeholder {
  font-size: 0.77rem;
  color: #94a3b8;
  font-weight: 400;
}

.input-wrap input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--sgr-cyan);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.14);
}

.toggle-secret-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  font-size: 0.92rem;
}
.toggle-secret-btn:hover { color: var(--sgr-navy); background: #eef3fb; }

.auth-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
  font-size: 0.79rem;
}

.sgr-submit-btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0b1940 0%, #e6007e 55%, #00a8e8 100%);
  background-size: 180% 180%;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(230, 0, 126, 0.24);
  transition: transform 0.16s ease, box-shadow 0.2s ease, background-position 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sgr-submit-btn:hover {
  transform: translateY(-1px);
  background-position: right center;
  box-shadow: 0 12px 28px rgba(0, 168, 232, 0.30);
}

.auth-intake-note {
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.42;
}

.auth-intake-note strong { color: var(--sgr-navy); }

/* ============================================================================
 * 2. SHARED PORTAL SHELL (ADMIN & STAFF SIDEBAR + TOPBAR)
 * ============================================================================ */

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

.portal-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sgr-navy-deep) 0%, var(--sgr-navy) 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 300;
  transition: transform 0.25s ease;
}

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

.sidebar-brand .crest {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #ffffff;
  padding: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand b {
  display: block;
  font-family: var(--serif);
  font-size: 0.98rem;
  color: #ffffff;
  line-height: 1.15;
}

.sidebar-brand span {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.role-chip-admin { background: rgba(0, 168, 232, 0.22); color: #38bdf8; }
.role-chip-staff { background: rgba(230, 0, 126, 0.28); color: #ff85c8; }

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

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #7c8da6;
  padding: 10px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(230, 0, 126, 0.25), rgba(0, 168, 232, 0.25));
  color: #ffffff;
  border-left: 3px solid var(--sgr-cyan);
  font-weight: 600;
}

.nav-link .soon-tag {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.10);
  color: #94a3b8;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.80rem;
}

.portal-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}

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

.mobile-menu-btn {
  display: none;
  background: var(--sgr-navy-soft);
  border: 1px solid var(--border);
  color: var(--sgr-navy);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
}

.topbar-title h1 {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--sgr-navy);
  margin: 0;
}

.topbar-title small {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sgr-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
}

.user-pill span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sgr-navy);
}

.btn-logout {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--sgr-magenta-soft);
  color: var(--sgr-magenta);
  border: 1px solid #fbcfe8;
  font-size: 0.80rem;
  font-weight: 600;
}

.btn-logout:hover {
  background: var(--sgr-magenta);
  color: #ffffff;
}

.portal-content {
  padding: 26px 28px 52px;
}

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

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--sgr-gradient);
}

.kpi-card .kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-card .kpi-value {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sgr-navy);
  margin: 6px 0 4px;
}

.kpi-card .kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Cards & Tables */
.panel-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 22px;
}

.panel-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-head h2 {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--sgr-navy);
  margin: 0;
}

.panel-body {
  padding: 20px 22px;
}

.table-scroll {
  overflow-x: auto;
}

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

table.sgr-table th {
  background: #f8fafc;
  color: var(--sgr-navy);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.sgr-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.badge-navy    { background: var(--sgr-navy-soft); color: var(--sgr-navy); }
.badge-cyan    { background: var(--sgr-cyan-soft); color: #0369a1; }
.badge-pink    { background: var(--sgr-magenta-soft); color: #9d174d; }
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-amber   { background: var(--warning-bg); color: var(--warning); }
.badge-red     { background: var(--danger-bg); color: var(--danger); }
.badge-gray    { background: #e2e8f0; color: #475569; }

.btn-magenta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  background: var(--sgr-magenta);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-magenta:hover { background: var(--sgr-magenta-hover); color: #ffffff; }

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger-outline:hover { background: var(--danger); border-color: var(--danger); color: #ffffff; }

.filter-bar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.filter-bar input[type="search"],
.filter-bar input[type="text"] {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
}

.filter-bar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #ffffff;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cred-banner {
  background: linear-gradient(135deg, #f0f9ff 0%, #fdf2f8 100%);
  border: 1.5px solid var(--sgr-cyan);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cred-banner-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  align-items: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 36, 0.55);
  z-index: 250;
}
.sidebar-overlay.open { display: block; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  background: var(--sgr-navy);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--sgr-magenta); color: #ffffff; }

.btn-cyan {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  background: var(--sgr-cyan);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-cyan:hover { background: var(--sgr-cyan-hover); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--sgr-navy);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}

.pin-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--sgr-navy);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 36, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  padding: 18px 22px;
  background: var(--sgr-navy);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.modal-close {
  background: rgba(255,255,255,.12);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-body { padding: 22px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-ctl {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
}

/* ============================================================================
 * 3. STUDENT PORTAL & PRINTABLE REPORT CARD
 * ============================================================================ */

.student-shell {
  min-height: 100vh;
  background: var(--bg-surface);
}

.student-hero-bar {
  background: var(--sgr-navy-gradient);
  color: #ffffff;
  padding: 22px 28px 64px;
  position: relative;
}

.student-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.student-wrap {
  max-width: 1120px;
  margin: -42px auto 60px;
  padding: 0 20px;
}

.report-sheet {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-banner {
  background: linear-gradient(135deg, #050d24 0%, #0b1940 65%, #132a68 100%);
  color: #ffffff;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  border-bottom: 4px solid var(--sgr-magenta);
}

.report-school-id {
  display: flex;
  align-items: center;
  gap: 16px;
}

.report-school-id img {
  width: 66px;
  height: 66px;
  background: #ffffff;
  padding: 4px;
  border-radius: 14px;
  object-fit: contain;
}

.report-bio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 26px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.report-bio-item small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-bio-item strong {
  color: var(--sgr-navy);
  font-size: 0.90rem;
}

.traits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 26px;
}

.remarks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 0 26px 26px;
}

.remark-box {
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .report-bio-grid { grid-template-columns: repeat(2, 1fr); }
  .traits-grid, .remarks-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sgr-site-header-inner { padding: 8px 14px; gap: 8px; }
  .sgr-header-domain { display: none; }
  .sgr-brand-crest img { width: 36px; height: 36px; }
  .sgr-brand-motto { font-size: 0.42rem; }
  .sgr-brand-title b { font-size: 1.00rem; }
  .sgr-brand-title small { font-size: 0.58rem; }
  .sgr-header-pill { padding: 6px 11px; font-size: 0.73rem; }

  .sgr-auth-main { padding: 12px 12px 14px; }
  .sgr-login-card { border-radius: 16px; }
  .sgr-auth-panel { padding: 18px 16px 20px; }
  .sgr-auth-head h1 { font-size: 1.26rem; }
  .sgr-auth-head p { font-size: 0.80rem; }

  .role-tab-btn { font-size: 0.74rem; padding: 9px 4px; min-height: 40px; gap: 4px; }
  .input-wrap input { font-size: 16px; min-height: 44px; padding: 10px 40px 10px 36px; }
  .input-wrap input::placeholder { font-size: 0.78rem; }
  .sgr-auth-footer { font-size: 0.72rem; padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 390px) {
  .role-tab-btn i { display: none; }
  .role-tab-btn { font-size: 0.72rem; }
}

@media (max-width: 780px) {
  .portal-sidebar { transform: translateX(-100%); }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
  .portal-topbar { padding: 0 14px; }
  .portal-content { padding: 18px 14px 40px; }
  .topbar-title h1 { font-size: 1.05rem; }
  .topbar-title small { display: none; }
  .user-pill span { display: none; }
  .mobile-menu-btn { display: grid; place-items: center; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

@media print {
  .no-print { display: none !important; }
  .student-shell { background: #ffffff; }
  .student-wrap { margin: 0; padding: 0; max-width: 100%; }
  .report-sheet { border: none; box-shadow: none; }
}
