/* ═══════════════════════════════════════════════════════════
   Go Beyond  ·  Design System v3  ·  Navy on Cream Edition
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:          #F4EFE3;
  --bg-2:        #EDE6D4;
  --surface:     #FFFFFF;
  --surface-2:   #FBF8F1;
  --ink:         #1A1814;
  --ink-2:       #3A352D;
  --muted:       #7A7264;
  --muted-2:     #A39988;
  --line:        #E3DBC8;
  --line-2:      #EFE9D8;

  --primary:          #14264E;   /* Navy */
  --primary-ink:      #FFFFFF;
  --primary-soft:     #DDE2EF;   /* Navy tinted cream */
  --primary-soft-ink: #14264E;

  --warn:        #B86A1F;
  --warn-soft:   #F4E3CC;
  --danger:      #A8392B;
  --danger-soft: #F3D9D3;
  --info:        #2F8AA8;        /* Teal-blue — kept distinct from navy primary */
  --info-soft:   #D6EAF1;
  --violet:      #5A4A8E;
  --violet-soft: #E2DCF1;

  /* Backward-compat aliases — existing pages reference these */
  --green:       #14264E;
  --green-dark:  #0B1730;
  --green-light: #DDE2EF;
  --amber:       #B86A1F;
  --amber-light: #F4E3CC;
  --red:         #A8392B;
  --red-light:   #F3D9D3;
  --blue:        #2F8AA8;
  --purple:      #5A4A8E;
  --border:      #E3DBC8;
  --text:        #1A1814;
  --text-2:      #3A352D;

  --font-display: "Varela Round", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui:      "Varela Round", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --sidebar-w:  240px;
  --topbar-h:   56px;
  --nav-h:      56px;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 4px rgba(26,24,20,.08);
  --shadow-md:  0 4px 16px rgba(26,24,20,.10);
  --shadow-lg:  0 8px 32px rgba(26,24,20,.14);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; color: var(--ink); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ═══════════════════════════════════════════════════════════
   APP SHELL — sidebar + body
   ═══════════════════════════════════════════════════════════ */

.gb-app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.gb-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.gb-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  text-decoration: none;
}
.gb-sidebar__brand:hover { text-decoration: none; }

.gb-sidebar__mark {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--primary-ink);
  flex-shrink: 0;
  letter-spacing: -.5px;
  user-select: none;
}

.gb-sidebar__name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -.2px;
  line-height: 1.2;
}

/* ── Side nav ── */
.gb-sidenav { flex: 1; padding: 8px 0; }
.gb-sidenav__section { margin-bottom: 4px; }

.gb-sidenav__label {
  display: block;
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 18px 4px;
}

.gb-sidenav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  transition: background .12s, color .12s;
}
.gb-sidenav__link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.gb-sidenav__link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.gb-sidenav__link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.gb-sidenav__icon {
  width: 16px; height: 16px;
  flex-shrink: 0; opacity: .6;
  display: flex; align-items: center; justify-content: center;
}
.gb-sidenav__link:hover .gb-sidenav__icon,
.gb-sidenav__link.active .gb-sidenav__icon { opacity: 1; }

.gb-sidenav__badge {
  margin-left: auto;
  background: var(--warn);
  color: #fff;
  font-size: 10px; font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 16px;
}

/* ── Sidebar footer ── */
.gb-sidebar__footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.gb-sidebar__av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  font-family: var(--font-ui);
  flex-shrink: 0;
}

.gb-sidebar__user-info { flex: 1; min-width: 0; }
.gb-sidebar__user-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gb-sidebar__user-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }

.gb-sidebar__signout {
  color: var(--muted); text-decoration: none;
  padding: 4px; flex-shrink: 0;
  display: flex; align-items: center;
  border-radius: 4px;
}
.gb-sidebar__signout:hover { color: var(--danger); text-decoration: none; }

/* ── Mobile overlay ── */
.gb-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(26,24,20,.4);
  z-index: 190;
}
.gb-sidebar-overlay--open { display: block; }

/* ── Body (right of sidebar) ── */
.gb-body {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}

/* ── Topbar ── */
.gb-topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  z-index: 100; flex-shrink: 0;
}

.gb-topbar__burger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--ink-2); flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.gb-topbar__burger:hover { background: var(--bg-2); }

.gb-crumbs { font-family: var(--font-ui); font-size: 14px; color: var(--muted); }
.gb-crumbs strong { color: var(--ink); font-weight: 600; }

/* ── Main content ── */
.gb-main { flex: 1; }

/* ── Public pages (signup / token-apply / etc — no sidebar) ── */
.gb-public {
  display: block;
  min-height: 100vh;
  background: var(--bg);
  padding: 32px 16px 48px;
}
.gb-public .gb-page { margin: 0 auto; padding: 0; }
.gb-public .gb-page__header { text-align: center; margin-bottom: 24px; }
.gb-public .gb-page__header h1 { font-size: 28px; }
.gb-public .gb-card {
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}
.gb-public .gb-card__body { padding: 28px 28px 24px; max-width: none !important; }
.gb-public .gb-modal__actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.gb-public .gb-modal__actions .gb-btn { min-width: 130px; }
.gb-public .gb-section-card { max-width: 600px; margin-left: auto; margin-right: auto; }
.gb-public .gb-alert { max-width: 600px; margin-left: auto; margin-right: auto; }
@media (max-width: 600px) {
  .gb-public { padding: 16px 12px 32px; }
  .gb-public .gb-card__body { padding: 20px 18px; }
  .gb-public .gb-modal__actions { flex-direction: column-reverse; }
  .gb-public .gb-modal__actions .gb-btn { width: 100%; min-width: 0; }
}

/* ── Mobile ── */
@media (max-width: 800px) {
  .gb-app { grid-template-columns: 1fr; }
  .gb-body { grid-column: 1; }
  .gb-sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .gb-sidebar--open { transform: translateX(0); }
  .gb-topbar__burger { display: flex; }
  .gb-topbar { padding: 0 16px; }
}

/* ═══════════════════════════════════════════════════════════
   PAGE STRUCTURE
   ═══════════════════════════════════════════════════════════ */

.gb-page { padding: 28px 32px; max-width: 1100px; }
.gb-page--narrow { max-width: 720px; }
.gb-page__header { margin-bottom: 28px; }
.gb-page__header h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 400;
  color: var(--ink);
  letter-spacing: -.4px; margin-bottom: 4px;
}
.gb-page__header p { color: var(--muted); font-size: 15px; }

@media (max-width: 800px) { .gb-page { padding: 20px 16px; } }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE (unauthenticated)
   ═══════════════════════════════════════════════════════════ */

.gb-login-body {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.gb-login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.gb-login-brand { text-align: center; margin-bottom: 32px; }
.gb-login-brand__icon {
  width: 56px; height: 56px;
  background: var(--primary); border-radius: 14px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic;
  font-size: 30px; color: var(--primary-ink);
}
.gb-login-brand__name {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 400;
  color: var(--ink); margin-bottom: 4px;
}
.gb-login-brand__sub { color: var(--muted); font-size: 14px; }
.gb-login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px;
  box-shadow: var(--shadow-lg); margin-bottom: 20px;
}
.gb-login-card__title { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.gb-login-footer { text-align: center; font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   KPI GRID
   ═══════════════════════════════════════════════════════════ */

.gb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.gb-kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.gb-kpi__label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 8px; font-family: var(--font-ui);
}
.gb-kpi__val {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 400;
  color: var(--ink); letter-spacing: -.5px;
}
.gb-kpi__trend { font-size: 12px; color: var(--muted); margin-top: 4px; }
.gb-kpi__trend--up   { color: var(--primary); }
.gb-kpi__trend--down { color: var(--danger); }
.kpi-green { color: var(--primary); }
.kpi-amber { color: var(--warn); }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════ */

.gb-dash-grid {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 20px; align-items: start;
}
@media (max-width: 960px) { .gb-dash-grid { grid-template-columns: 1fr; } }

/* ── Activity feed ── */
.gb-feed__item {
  display: flex; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
  transition: background .1s;
}
.gb-feed__item:last-child { border-bottom: none; }
.gb-feed__item:hover { background: var(--surface-2); }

.gb-feed__dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.gb-feed__dot--green  { background: var(--primary); }
.gb-feed__dot--warn   { background: var(--warn); }
.gb-feed__dot--danger { background: var(--danger); }
.gb-feed__dot--info   { background: var(--info); }
.gb-feed__dot--muted  { background: var(--muted-2); }

.gb-feed__content { flex: 1; min-width: 0; }
.gb-feed__actor { font-weight: 600; font-size: 14px; color: var(--ink); }
.gb-feed__text  { font-size: 14px; color: var(--ink-2); }
.gb-feed__time  { font-size: 11px; color: var(--muted-2); margin-top: 3px; font-family: var(--font-mono); }

/* ── Quick actions card body ── */
.gb-quick-actions { display: flex; flex-direction: column; gap: 8px; padding: 16px; }

/* ═══════════════════════════════════════════════════════════
   ACTIONS BAR + BUTTONS
   ═══════════════════════════════════════════════════════════ */

.gb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.gb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  font-family: var(--font-ui);
  transition: opacity .12s;
  text-decoration: none; white-space: nowrap;
}
.gb-btn:hover { opacity: .85; text-decoration: none; }
.gb-btn--primary   { background: var(--primary);      color: var(--primary-ink); }
.gb-btn--secondary { background: var(--surface);      color: var(--ink-2);  border: 1px solid var(--line); }
.gb-btn--ghost     { background: transparent;         color: var(--ink-2);  border: 1px solid var(--line); }
.gb-btn--green     { background: var(--primary-soft); color: var(--primary); border: 1px solid #BDD8C8; }
.gb-btn--danger    { background: var(--danger-soft);  color: var(--danger);  border: 1px solid #D8A59C; }
.gb-btn--amber     { background: var(--warn-soft);    color: var(--warn);    border: 1px solid #DEB68A; }
.gb-btn--full      { width: 100%; }
.gb-btn--sm        { min-height: 32px; padding: 0 12px; font-size: 13px; }
.gb-btn--xs        { min-height: 26px; padding: 0 9px;  font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════ */

.gb-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.gb-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.gb-card__head h2 { font-size: 15px; font-weight: 600; font-family: var(--font-ui); }
.gb-card__body { padding: 0; }

/* ═══════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════ */

.gb-table-wrap { overflow-x: auto; }
.gb-table { width: 100%; border-collapse: collapse; }
.gb-table thead tr { border-bottom: 1.5px solid var(--line); background: var(--surface-2); }
.gb-table th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  white-space: nowrap; font-family: var(--font-ui);
}
.gb-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px; color: var(--ink-2);
}
.gb-table tbody tr:last-child td { border-bottom: none; }
.gb-table tbody tr:hover { background: var(--surface-2); }
.gb-table--sm td, .gb-table--sm th { padding: 8px 12px; }
.gb-table tfoot td { padding: 14px 16px; background: var(--surface-2); }

/* ═══════════════════════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════════════════════ */

.gb-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.gb-field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.gb-field input,
.gb-field select,
.gb-field textarea {
  min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-size: 15px; font-family: var(--font-ui);
  transition: border-color .15s;
}
.gb-field input:focus,
.gb-field select:focus,
.gb-field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,82,64,.1);
}
.gb-field textarea { resize: vertical; min-height: 72px; }
.gb-hint { font-size: 12px; color: var(--muted); }
.gb-hint--secure { font-size: 12px; color: var(--primary); font-weight: 500; }
.req { color: var(--danger); }

.gb-select {
  min-height: 36px; padding: 6px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; font-family: var(--font-ui);
}
.gb-select--sm { min-height: 32px; font-size: 13px; }
.gb-select--xs { min-height: 28px; padding: 4px 8px; font-size: 12px; }

.gb-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gb-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .gb-grid-2, .gb-grid-3 { grid-template-columns: 1fr; } }

.gb-checks { display: flex; gap: 16px; flex-wrap: wrap; }
.gb-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.gb-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ── Section card ── */
.gb-section-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.gb-section-card__label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--primary); margin-bottom: 16px;
  font-family: var(--font-ui);
}

/* ── Score preview ── */
.gb-score-preview {
  background: var(--primary-soft); border: 1px solid #BDD8C8;
  border-radius: var(--radius); padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.gb-score-preview__label { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
.gb-score-preview__hint  { font-size: 12px; color: var(--primary); opacity: .8; }
.gb-score-num { font-family: var(--font-mono); font-size: 36px; color: var(--muted); }
.gb-score-num.green { color: var(--primary); }
.gb-score-num.amber { color: var(--warn); }
.gb-score-status { font-size: 13px; font-weight: 600; color: var(--muted); }
.gb-score-status.green { color: var(--primary); }
.gb-score-status.amber { color: var(--warn); }

/* ── Form footer ── */
.gb-form-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.gb-form-footer a { font-size: 14px; color: var(--muted); }
.gb-form-footer button {
  min-height: 46px; padding: 0 28px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--primary-ink); border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui); transition: opacity .12s;
}
.gb-form-footer button:hover { opacity: .88; }
.gb-form-footer button:disabled { opacity: .5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════ */

.gb-alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.gb-alert--error   { background: var(--danger-soft); border: 1px solid #D8A59C; color: #6B2218; }
.gb-alert--success { background: var(--primary-soft); border: 1px solid #BDD8C8; color: var(--green-dark); }

/* ═══════════════════════════════════════════════════════════
   BADGES, PILLS, TAGS
   ═══════════════════════════════════════════════════════════ */

.gb-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-ui);
}
.gb-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

.gb-role-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; font-family: var(--font-ui); }
.role-superuser, .role-administrator { background: var(--primary-soft); color: var(--primary); }
.role-benefactor  { background: var(--warn-soft);   color: var(--warn); }
.role-institution { background: var(--info-soft);   color: var(--info); }
.role-school      { background: var(--info-soft);   color: var(--info); }
.role-volunteer   { background: var(--violet-soft); color: var(--violet); }
.role-guest       { background: var(--bg-2);        color: var(--muted); }

.gb-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .4px; font-family: var(--font-ui); }
.gb-tag--amber { background: var(--warn-soft);    color: var(--warn); }
.gb-tag--red   { background: var(--danger-soft);  color: var(--danger); }
.gb-tag--green { background: var(--primary-soft); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   AVATAR
   ═══════════════════════════════════════════════════════════ */

.gb-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.gb-avatar--initial {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 14px; font-family: var(--font-ui);
}
.gb-child-cell  { display: flex; align-items: center; gap: 12px; }
.gb-row-actions { display: flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════════════════════════
   CHILD CARDS (benefactor view)
   ═══════════════════════════════════════════════════════════ */

.gb-child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; margin-bottom: 28px; }
.gb-child-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s; }
.gb-child-card:hover { box-shadow: var(--shadow-md); }
.gb-child-card__img { height: 140px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gb-child-photo { width: 100%; height: 100%; object-fit: cover; }
.gb-child-photo--initial {
  width: 72px; height: 72px; border-radius: 50%; background: #BDD8C8;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 26px; color: var(--primary);
  font-family: var(--font-display);
}
.gb-child-card__body { padding: 16px; }
.gb-child-card__name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.gb-child-card__meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.gb-child-card__total { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 8px; font-family: var(--font-mono); }
.gb-child-card__total span { font-size: 12px; font-weight: 400; color: var(--muted); font-family: var(--font-ui); }
.gb-renewal-warn { background: var(--warn-soft); border: 1px solid #DEB68A; border-radius: 6px; padding: 7px 11px; font-size: 12px; color: var(--warn); margin-top: 10px; font-weight: 500; }
.gb-school-note { font-size: 13px; color: var(--ink-2); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */

.gb-modal { display: none; position: fixed; inset: 0; background: rgba(26,24,20,.45); z-index: 9998; align-items: center; justify-content: center; padding: 24px; }
.gb-modal__box { background: var(--surface); border-radius: 14px; padding: 28px 32px; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); position: relative; max-height: 90vh; overflow-y: auto; }
.gb-modal__box--wide { max-width: 640px; }
.gb-modal__box h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; font-family: var(--font-ui); }
.gb-modal__close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.gb-modal__close:hover { background: var(--bg); }
.gb-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.gb-modal-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.gb-modal-photo--initial { display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 24px; font-family: var(--font-display); }
.gb-modal-child-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.gb-modal-child-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.gb-total-strip { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.gb-total-strip__label { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; font-family: var(--font-ui); }
.gb-total-strip__val { font-family: var(--font-mono); font-size: 24px; color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   URGENT BOX / MISC COMPONENTS
   ═══════════════════════════════════════════════════════════ */

.gb-urgent { background: var(--warn-soft); border: 1.5px solid #DEB68A; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.gb-urgent__title { font-size: 14px; font-weight: 700; color: var(--warn); margin-bottom: 10px; }
.gb-urgent__item { font-size: 14px; color: var(--ink-2); padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.gb-urgent__item:last-child { border-bottom: none; }
.gb-urgent__item a { color: var(--warn); font-weight: 600; }

.gb-update-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.gb-update-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; }
.gb-update-card p { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.gb-year-group { margin-bottom: 20px; }
.gb-year-group__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px 10px 0 0; border-bottom: none; font-size: 15px; }

.gb-platform-note { font-size: 12px; color: var(--muted); margin: -12px 0 20px; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--line); border-radius: 0 4px 4px 0; }
.gb-log-actor { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 10px; }

.gb-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media(max-width:640px){ .gb-review-grid{ grid-template-columns:1fr; } }

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */

.gb-loading { padding: 48px; text-align: center; color: var(--muted); font-size: 15px; }
.gb-empty { padding: 48px 32px; text-align: center; }
.gb-empty p { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.gb-empty--error p { color: var(--danger); }
.gb-empty-cell { padding: 16px !important; color: var(--muted); font-size: 14px; }
.gb-text-muted  { color: var(--muted); }
.gb-text-green  { color: var(--primary); }
.gb-text-2      { color: var(--ink-2); }
.gb-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 12px; font-family: var(--font-ui); }

/* ── User management ── */
.gb-user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
tr.gb-row--suspended td { opacity: .45; }
tr.gb-row--suspended td:last-child { opacity: 1; }

/* ── Toast ── */
.gb-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; font-family: var(--font-ui);
  color: #fff; box-shadow: var(--shadow-lg); transition: opacity .3s;
}

/* ═══════════════════════════════════════════════════════════
   DEMO PAGE
   ═══════════════════════════════════════════════════════════ */

.gb-demo-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #2C4078 100%);
  color: #fff; border-radius: var(--radius); padding: 32px;
  margin-bottom: 28px; text-align: center;
}
.gb-demo-banner h2 { font-family: var(--font-display); font-size: 24px; font-weight: 400; color: #fff; margin-bottom: 8px; }
.gb-demo-banner p  { font-size: 15px; opacity: .88; margin-bottom: 0; }
.gb-demo-notice { display: inline-block; background: rgba(255,255,255,.2); border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 700; letter-spacing: .5px; margin-bottom: 14px; }
.gb-demo-child-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--primary); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════ */

@media print {
  .gb-sidebar, .gb-topbar, .gb-actions { display: none !important; }
  .gb-app { grid-template-columns: 1fr; }
  .gb-body { grid-column: 1; }
  .gb-card { box-shadow: none; border: 1px solid #ccc; }
  .gb-btn { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE & TABLET RESPONSIVE PASS (v3.1)
   ═══════════════════════════════════════════════════════════ */

/* Make tables scroll horizontally on narrow viewports */
.gb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tablets and below */
@media (max-width: 1024px) {
  .gb-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gb-dash-grid { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 640px) {
  .gb-kpi-grid { grid-template-columns: 1fr; gap: 10px; }
  .gb-kpi { padding: 14px 16px; }
  .gb-kpi__val { font-size: 24px; }
  .gb-page { padding: 16px; }
  .gb-page__header h1 { font-size: 26px; }
  .gb-card__head { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .gb-card__head h2 { font-size: 16px; }
  .gb-card__body { padding: 14px 16px; }

  /* Modal full-screen on phones */
  .gb-modal__box {
    margin: 0; width: 100%; max-width: 100%;
    max-height: 100vh; height: 100vh;
    border-radius: 0; overflow-y: auto;
  }

  /* Actions wrap nicely */
  .gb-actions { flex-direction: column; align-items: stretch; }
  .gb-actions .gb-btn { width: 100%; }
  .gb-actions .gb-select { width: 100%; }

  /* Topbar tighter */
  .gb-topbar { padding: 10px 14px; }
  .gb-crumbs { font-size: 13px; }

  /* Tables: keep horizontal scroll, smaller text */
  .gb-table { font-size: 13px; }
  .gb-table--sm { font-size: 12px; }

  /* User action button row → vertical */
  .gb-user-actions { flex-direction: column; align-items: stretch; }
  .gb-user-actions .gb-btn { width: 100%; }
}
