/* ============================================================
   Alpine Academy Portal — EHR-style light theme
   Clean white + green accent, professional clinical feel
   Font: Figtree (display) + DM Sans (body)
   ============================================================ */
/* Font loaded via <link> in HTML head — do not @import here */

:root {
  /* Core palette */
  --white:      #ffffff;
  --bg:         #f4f6f9;
  --bg-2:       #eef1f6;
  --panel:      #ffffff;
  --border:     #e2e8f0;
  --border-2:   #cbd5e1;

  /* Brand */
  --green:      #16a34a;
  --green-lt:   #22c55e;
  --green-bg:   #f0fdf4;
  --green-mid:  #dcfce7;

  /* Text */
  --text:       #0f172a;
  --text-2:     #334155;
  --text-3:     #64748b;
  --text-4:     #94a3b8;

  /* Status */
  --amber:      #d97706;
  --amber-bg:   #fffbeb;
  --red:        #dc2626;
  --red-bg:     #fef2f2;
  --blue:       #2563eb;
  --blue-bg:    #eff6ff;

  /* UI */
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow:     0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  --shadow-lg:  0 16px 48px rgba(15,23,42,.12);

  --font-head:  'Figtree', sans-serif;
  --font-body:  'DM Sans', sans-serif;

  --sidebar-w:  232px;
  --topbar-h:   56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ======== TOPBAR ======== */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.topbar-brand {
  font-family: var(--font-head);
  font-size: .95rem; font-weight: 700;
  color: var(--text); display: flex; align-items: center; gap: .6rem;
}
.topbar-mark {
  width: 30px; height: 30px;
  background: var(--green); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .82rem;
  flex-shrink: 0;
}
.topbar-name { font-weight: 700; color: var(--text); }
.topbar-divider {
  width: 1px; height: 16px;
  background: var(--border-2); flex-shrink: 0;
}
.topbar-portal-label {
  font-size: .78rem; font-weight: 500; color: var(--text-3);
}
.topbar-brand .accent { color: var(--green); }
.topbar-brand .divider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: inline-block;
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.user-pill {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .85rem .3rem .35rem;
  font-size: .78rem; color: var(--text-2); font-weight: 500;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-mid); border: 1.5px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--green);
}
.role-tag {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: .18rem .55rem; border-radius: 999px;
}
.role-tag.admin   { background: var(--green-bg);  color: var(--green); border: 1px solid var(--green-mid); }
.role-tag.teacher { background: var(--blue-bg);   color: var(--blue);  border: 1px solid #bfdbfe; }
.role-tag.parent  { background: var(--amber-bg);  color: var(--amber); border: 1px solid #fde68a; }

/* ======== LAYOUT ======== */
.portal-wrap { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--white); border-right: 1px solid var(--border);
  padding: 1rem .65rem 2rem;
  display: flex; flex-direction: column; gap: .1rem;
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.sidebar-label {
  font-size: .65rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-4);
  padding: .9rem .75rem .3rem;
}
.nav-btn {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .85rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .84rem; font-weight: 500;
  color: var(--text-3); background: none; border: none;
  cursor: pointer; width: 100%; text-align: left;
  transition: background .12s, color .12s;
  text-decoration: none;
  border-left: 3px solid transparent;
  margin-left: -3px;
  padding-left: calc(.85rem - 1px);
}
.nav-btn:hover { background: var(--bg); color: var(--text-2); text-decoration: none; }
.nav-btn.active {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 600;
  border-left-color: var(--green);
}
.nav-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.75;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.nav-btn .ico { font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-btn .badge-count {
  margin-left: auto; font-size: .68rem; font-weight: 700;
  background: var(--green); color: #fff;
  padding: .1rem .45rem; border-radius: 999px;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: .25rem;
}

.main { flex: 1; padding: 2rem 2.25rem; overflow-y: auto; max-width: 1300px; }

/* ======== PAGE HEADER ======== */
.page-hdr { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.page-hdr-left h1 { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.page-hdr-left p  { color: var(--text-3); font-size: .85rem; margin-top: .2rem; }

/* ======== STATS ======== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-box {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--border);
}
.stat-box .stat-val { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; margin: .25rem 0 .3rem; }
.stat-box .stat-lbl { font-size: .76rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-box .stat-ico { font-size: 1.4rem; margin-bottom: .5rem; }

/* Stat icon wrapper — for Lucide SVGs */
.stat-icon-wrap {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .6rem;
}
.stat-icon-wrap svg {
  width: 17px; height: 17px;
  stroke: currentColor; stroke-width: 1.75;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.stat-box.green { border-left-color: var(--green); }
.stat-box.green .stat-icon-wrap { background: var(--green-bg); color: var(--green); }
.stat-box.amber { border-left-color: var(--amber); }
.stat-box.amber .stat-icon-wrap { background: var(--amber-bg); color: var(--amber); }
.stat-box.blue  { border-left-color: var(--blue); }
.stat-box.blue  .stat-icon-wrap { background: var(--blue-bg); color: var(--blue); }
.stat-box.red   { border-left-color: var(--red); }
.stat-box.red   .stat-icon-wrap { background: var(--red-bg); color: var(--red); }

/* ======== CARDS ======== */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.card-hdr {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.1rem; padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-head); font-size: .88rem; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
}
.card-hdr-inner {
  display: flex; align-items: center; gap: .45rem;
}
.card-hdr-icon {
  width: 15px; height: 15px;
  stroke: var(--text-3); stroke-width: 1.75;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ======== TABLES ======== */
.tbl-wrap {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg); }
th {
  padding: .75rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-size: .87rem; color: var(--text-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ======== PILLS / BADGES ======== */
.pill {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.pill-green  { background: var(--green-bg);  color: var(--green); border: 1px solid var(--green-mid); }
.pill-amber  { background: var(--amber-bg);  color: var(--amber); border: 1px solid #fde68a; }
.pill-red    { background: var(--red-bg);    color: var(--red);   border: 1px solid #fecaca; }
.pill-blue   { background: var(--blue-bg);   color: var(--blue);  border: 1px solid #bfdbfe; }
.pill-neutral{ background: var(--bg-2);      color: var(--text-2);border: 1px solid var(--border-2); font-weight: 600; }

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .84rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.3); }
.btn-outline { background: var(--white); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-ghost   { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger  { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-amber   { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-xs { padding: .22rem .55rem; font-size: .72rem; border-radius: 6px; }
.btn-icon { padding: .4rem; border-radius: 7px; }

/* ======== FORMS ======== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-full { grid-column: 1 / -1; }
.fld { margin-bottom: .1rem; }
.fld label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .3px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: .65rem .9rem;
  background: var(--white); border: 1.5px solid var(--border-2);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: .88rem;
  transition: border-color .15s, box-shadow .15s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--text-4); }

/* ======== FILTER BAR ======== */
.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; align-items: center; }
.filter-bar input, .filter-bar select {
  padding: .5rem .85rem;
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: .84rem;
}
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--green); }

/* ======== MODALS ======== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.45); z-index: 500;
  align-items: center; justify-content: center; padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal.open { display: flex; }
.modal-box {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 580px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: mIn .2s ease;
}
.modal-box.wide { max-width: 740px; }
@keyframes mIn { from { transform: translateY(20px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border);
  font-family: var(--font-head); font-size: .95rem; font-weight: 700; color: var(--text);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 1.35rem; line-height: 1;
  padding: .1rem .3rem; border-radius: 5px;
  transition: background .15s;
}
.modal-close-btn:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-ftr {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--white);
}

/* ======== TABS ======== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: .75rem 1.35rem; background: none; border: none;
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s; letter-spacing: .01em;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* ======== NOTES ======== */
.note-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .65rem;
  border-left: 3px solid var(--green);
}
.note-item.note-item-ai {
  background: #f0fdf4; border-color: #bbf7d0;
  border-left-color: var(--green);
}
.note-item .note-meta { font-size: .74rem; color: var(--text-3); margin-bottom: .35rem; }
.note-item .note-text { font-size: .87rem; line-height: 1.6; color: var(--text-2); }

.ai-badge {
  display: inline-flex; align-items: center;
  background: var(--green); color: #fff;
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .1rem .5rem; border-radius: 999px;
  margin-right: .5rem; vertical-align: middle;
}

/* ======== DOCUMENT LIST ======== */
.doc-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: .5rem; gap: .75rem;
}
.doc-item .doc-info { flex: 1; min-width: 0; }
.doc-item .doc-name { font-size: .87rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .doc-meta { font-size: .74rem; color: var(--text-3); margin-top: .1rem; }
.doc-icon { font-size: 1.4rem; flex-shrink: 0; }

/* ======== COMPLIANCE CHECKLIST ======== */
.compliance-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
}
.compliance-row:last-child { border-bottom: none; }
.compliance-row .chk-label { font-size: .9rem; font-weight: 600; color: var(--text); }
.compliance-row .chk-detail { font-size: .78rem; color: var(--text-3); margin-top: .2rem; }
.chk-status { display: flex; align-items: center; gap: .5rem; }

/* ======== STUDENT PHOTO ======== */
.s-photo {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--border-2);
  background: var(--bg-2); flex-shrink: 0;
}
.s-photo.lg { width: 96px; height: 96px; border: 2px solid var(--green); }
.s-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); color: var(--text-3); font-size: 1rem;
  border-radius: 50%; flex-shrink: 0;
}

/* ======== PARENT PORTAL ======== */

/* Student banner */
.student-banner {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem 1.75rem;
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.hero-photo {
  width: 72px !important; height: 72px !important;
  border-radius: 12px !important;
  border: 2px solid var(--border-2) !important;
  object-fit: cover;
  flex-shrink: 0;
}
.s-initials-avatar {
  width: 72px; height: 72px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 800;
  color: #fff; flex-shrink: 0;
  letter-spacing: -.02em;
}
.student-banner-info { flex: 1; min-width: 0; }
.student-banner-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; color: var(--text); }
.student-banner-meta {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin-top: .3rem; font-size: .82rem; color: var(--text-3);
}
.meta-sep { color: var(--border-2); }

/* Overview two-column grid */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* Course rows */
.course-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0; border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.course-row:last-child { border-bottom: none; }
.cr-name { font-weight: 600; font-size: .88rem; color: var(--text); }
.cr-teacher { font-size: .76rem; color: var(--text-3); margin-top: .1rem; }
.cr-schedule { font-size: .76rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

/* Course detail cards */
.course-card { padding: 0 !important; overflow: hidden; }
.course-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; gap: .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.course-card-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text); }
.info-grid {
  display: grid; grid-template-columns: 130px 1fr; gap: .4rem .75rem;
  padding: 1rem 1.5rem; font-size: .85rem; align-items: baseline;
}
.info-label { color: var(--text-3); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: .05rem; }
.course-notes-section {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  background: var(--bg);
}
.course-notes-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); margin-bottom: .65rem; }

/* Note items */
.note-course-pill {
  display: inline-flex; align-items: center;
  background: var(--blue-bg); color: var(--blue);
  border: 1px solid #bfdbfe; border-radius: 999px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .1rem .5rem;
}

/* Modal hint text */
.modal-hint {
  font-size: .82rem; color: var(--text-3); line-height: 1.55;
  background: var(--bg); padding: .75rem 1rem;
  border-radius: var(--radius); margin-bottom: 1.1rem;
}

/* Success message */
.success-msg {
  background: var(--green-bg); border: 1px solid var(--green-mid);
  color: var(--green); padding: .65rem .9rem;
  border-radius: var(--radius); font-size: .84rem; margin-top: .5rem;
}

/* Legacy */
.student-hero-name { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; }
.student-hero-meta { color: var(--text-3); font-size: .85rem; margin-top: .2rem; }

/* ======== LOGIN PAGE ======== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 1.5rem;
  background-image: linear-gradient(135deg, rgba(22,163,74,.04) 0%, transparent 50%),
                    linear-gradient(225deg, rgba(37,99,235,.03) 0%, transparent 50%);
}
.login-box {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-wordmark {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .35rem;
}
.login-wordmark .mark {
  width: 32px; height: 32px; background: var(--green);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 800; font-size: .95rem;
}
.login-wordmark .name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; }
.login-sub { color: var(--text-3); font-size: .83rem; margin-bottom: 1.75rem; }
.divider { display: flex; align-items: center; gap: .65rem; color: var(--text-4); font-size: .78rem; margin: .9rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google {
  width: 100%; padding: .65rem; background: var(--white);
  border: 1.5px solid var(--border-2); border-radius: var(--radius);
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  cursor: pointer; color: var(--text-2); transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.btn-google:hover { border-color: var(--green); color: var(--green); }
.login-btn-full {
  width: 100%; padding: .72rem; background: var(--green);
  border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  cursor: pointer; color: #fff; transition: all .15s; margin-top: .35rem;
}
.login-btn-full:hover { background: #15803d; }
.err-msg {
  background: var(--red-bg); border: 1px solid #fecaca; color: var(--red);
  padding: .65rem .9rem; border-radius: var(--radius);
  font-size: .82rem; display: none; margin-bottom: .85rem;
}

/* ======== EMPTY / LOADING ======== */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); }
.empty-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .85rem;
}
.empty-icon svg {
  width: 20px; height: 20px;
  stroke: var(--text-4); stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.empty .ico { font-size: 2.2rem; margin-bottom: .6rem; }
.empty p { font-size: .85rem; line-height: 1.5; }

/* Full-page empty state */
.empty-state-page {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 5rem 2rem; gap: 1rem;
}
.empty-state-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .25rem;
}
.empty-state-icon svg {
  width: 28px; height: 28px;
  stroke: var(--text-4); stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.empty-state-page h2 { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--text-2); }
.empty-state-page p  { font-size: .88rem; color: var(--text-3); line-height: 1.6; max-width: 360px; }

/* Loading state */
.loading-state { text-align: center; padding: 4rem 2rem; }
.loading-state p { color: var(--text-3); font-size: .85rem; margin-top: .75rem; }
.spinner { width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin .65s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======== PHOTO UPLOAD ======== */
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  padding: 1.25rem; text-align: center; cursor: pointer; transition: all .15s; color: var(--text-3);
}
.upload-zone:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.upload-zone.drag { border-color: var(--green); background: var(--green-bg); }
.upload-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto .5rem; border: 2px solid var(--green); }

/* ======== SECTION VISIBILITY ======== */
.section { display: none; }
.section.on { display: block; }

/* ======== RESPONSIVE ======== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 1.25rem; }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .student-banner { flex-direction: column; text-align: center; }
  .student-banner-meta { justify-content: center; }
  .page-hdr { flex-direction: column; }
  .overview-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-label { margin-top: .5rem; }
  .topbar-divider, .topbar-portal-label { display: none; }
  .topbar-right .role-tag { display: none; }
}
