/* ==========================================================================
   School Pro — App UI (dashboards for all roles)
   Visual language: "PLAYFUL NOTEBOOK / CLASSROOM"
   Ruled notebook paper, ink-blue outlines, sticker shadows, folder tabs on top.
   Builds on ../../../shared/css/base.css
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@400;500;600;700;800&display=swap");

:root {
  /* notebook palette */
  --ink: #26315a;
  --ink-2: #3a4675;
  --paper: #fffdf6;
  --paper-2: #fbf6e6;
  --desk: #f6f0dc;
  --indigo: #3b4bc8;
  --sun: #ffcf3f;
  --grass: #2ebd73;
  --coral: #ff6b5b;
  --sky: #47b5ff;
  --grape: #8b6cf0;
  --rule: rgba(71, 181, 255, .17);
  --margin-red: rgba(255, 107, 91, .5);
  --line: #ebe5d0;
  --line-2: #d9d1b8;

  /* theme tokens (names kept for page compatibility) */
  --brand: #3b4bc8;
  --brand-600: #2f3db0;
  --brand-700: #26318f;
  --brand-soft: #eceefc;
  --accent: #ffcf3f;
  --accent-soft: #fff4cc;
  --sidebar: #26315a;
  --sidebar-2: #33407a;
  --sidebar-text: #c9cdf0;
  --bg: #fffdf6;
  --surface: #ffffff;
  --surface-2: #fbf8ee;
  --border: #e6e0ca;
  --text: #26315a;
  --text-2: #5a6385;
  --muted: #979cb6;
  --success: #1e9d5e; --success-soft: #dbf5e7;
  --warning: #b37a00; --warning-soft: #fff1c2;
  --danger:  #e0483a; --danger-soft:  #ffe2de;
  --info:    #1c86d4; --info-soft:    #ddf0ff;

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 2px 2px 0 rgba(38, 49, 90, .10);
  --shadow: 4px 4px 0 rgba(38, 49, 90, .12);
  --shadow-lg: 6px 6px 0 rgba(38, 49, 90, .14), 0 18px 40px rgba(38, 49, 90, .10);
  --sticker: 4px 4px 0 rgba(38, 49, 90, .12);
  --font: "Baloo Bhaijaan 2", "Cairo", "Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  --sidebar-w: 0px;
  --header-h: 68px;
  --gradient-brand: linear-gradient(135deg, #5466e6 0%, #3b4bc8 100%);
  --gradient-warm: linear-gradient(135deg, #ffdd6b 0%, #ffcf3f 50%, #ffb020 100%);
}

body { font-family: var(--font); color: var(--text); }
body.app {
  background-color: var(--desk);
  background-image: radial-gradient(rgba(38, 49, 90, .07) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  overflow-x: hidden;
}
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2.2; flex-shrink: 0; }
::selection { background: rgba(255, 207, 63, .55); color: var(--ink); }

/* ---------- Layout ---------- */
.main { min-height: 100vh; display: flex; flex-direction: column; padding: 0 24px; }
.content {
  position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1640px; margin-inline: auto;
  padding: 30px 64px 44px 32px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(100% - 42px), var(--margin-red) calc(100% - 42px), var(--margin-red) calc(100% - 40px), transparent calc(100% - 40px)),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
  border: 2px solid var(--ink);
  border-radius: 20px 6px 20px 20px;
  box-shadow: 6px 6px 0 rgba(38, 49, 90, .10);
}

/* ---------- Header ---------- */
.topbar-app {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: rgba(255, 253, 246, .94); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; background: var(--sun); color: var(--ink);
  border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-8deg); transition: transform .2s;
}
.brand:hover .brand-mark { transform: rotate(6deg) scale(1.05); }
.brand-mark svg { width: 22px; height: 22px; color: var(--ink); }
/* Product logo (School Pro) */
.brand-logo { width: 46px; height: 46px; flex-shrink: 0; display: block; object-fit: contain; transform: rotate(-4deg); transition: transform .2s; }
.brand:hover .brand-logo { transform: rotate(4deg) scale(1.06); }
.brand-name { font-weight: 800; font-size: 20px; line-height: 1.05; white-space: nowrap; }
.brand-name small { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.term-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--ink); padding: 4px 12px 4px 10px; border-radius: 999px;
  background: var(--accent-soft); border: 2px dashed rgba(38, 49, 90, .35);
}
.term-pill svg { width: 15px; height: 15px; color: #c58f00; }
.term-pill b { color: var(--indigo); font-weight: 800; }
.menu-toggle { display: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--ink); background: #fff;
  display: grid; place-items: center; color: var(--ink); cursor: pointer; position: relative;
  box-shadow: 2px 2px 0 rgba(38, 49, 90, .18); transition: transform .12s, box-shadow .12s, background .12s;
}
.icon-btn:hover { background: var(--accent-soft); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(38, 49, 90, .22); }
.icon-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 rgba(38, 49, 90, .2); }
.icon-btn .dot-count {
  position: absolute; top: -7px; left: -7px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--ink); line-height: 1;
}

.global-search { position: relative; flex: 1; max-width: 480px; min-width: 0; }
.global-search input {
  width: 100%; height: 44px; border: 2px solid var(--ink); background: #fff; border-radius: 999px;
  padding: 0 44px 0 56px; font: inherit; font-size: 14px; color: var(--ink); transition: .15s;
}
.global-search input::placeholder { color: var(--muted); }
.global-search input:focus { outline: none; box-shadow: 3px 3px 0 var(--sun); }
.global-search > svg { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink); }
.global-search kbd {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font: 700 11px var(--font); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 7px; padding: 0 7px; background: var(--accent-soft); box-shadow: 1px 1px 0 var(--ink);
}
.search-results { position: absolute; top: calc(100% + 10px); inset-inline: 0; z-index: 60; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 12px; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff; cursor: pointer; font: inherit; text-align: right; color: var(--ink);
  box-shadow: 2px 2px 0 rgba(38, 49, 90, .18); transition: .12s;
}
.user-btn:hover { background: var(--accent-soft); }
.user-btn .avatar { width: 34px; height: 34px; font-size: 13px; }
.user-btn .meta b { display: block; font-size: 14px; color: var(--ink); line-height: 1.15; }
.user-btn .meta small { font-size: 12px; color: var(--text-2); line-height: 1.2; }
.user-btn > svg { color: var(--ink); width: 16px; }

/* ---------- Folder tabs (main navigation) ---------- */
.folder-tabs {
  position: relative; z-index: 2; width: 100%; max-width: 1640px; margin: 0 auto -2px;
  display: flex; align-items: flex-end; gap: 6px; padding-top: 16px;
}
.tabs-track {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 5px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-behavior: smooth;
  padding: 8px 2px 0;
}
.tabs-track::-webkit-scrollbar { display: none; }
.nav-link {
  --tab: var(--indigo);
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 9px; margin-top: 8px;
  color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  background: color-mix(in srgb, var(--tab) 20%, var(--paper));
  border: 2px solid var(--ink); border-radius: 14px 14px 0 0;
  box-shadow: inset 0 5px 0 var(--tab);
  transition: margin .15s ease, padding .15s ease, background .15s ease;
}
.nav-link svg { width: 17px; height: 17px; color: color-mix(in srgb, var(--tab) 70%, var(--ink)); }
.nav-link:hover { margin-top: 2px; padding-bottom: 15px; background: color-mix(in srgb, var(--tab) 30%, var(--paper)); color: var(--ink); }
.nav-link.active {
  margin-top: 0; padding: 11px 18px 16px; z-index: 3;
  background: var(--paper); border-bottom-color: var(--paper);
  font-weight: 800; box-shadow: inset 0 7px 0 var(--tab);
}
.nav-link.active svg {
  width: 26px; height: 26px; padding: 4px; border-radius: 50%;
  background: var(--tab); color: #fff; border: 1.5px solid var(--ink);
}
.nav-link .count {
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 999px;
  line-height: 18px; border: 1.5px solid var(--ink);
}
.nav-link .count.soft { background: var(--sun); color: var(--ink); }
.nav-section {
  flex-shrink: 0; align-self: center; font-size: 11px; font-weight: 800; color: var(--text-2);
  padding: 0 10px 0 4px; margin-inline-start: 8px; border-inline-start: 2px dashed rgba(38, 49, 90, .25);
  line-height: 1.25; max-width: 74px; white-space: normal; text-align: center;
}
.nav-section:first-child { border: 0; margin: 0; padding-right: 2px; }
.tabs-arrow {
  flex-shrink: 0; align-self: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff; color: var(--ink); display: none; place-items: center; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(38, 49, 90, .18); margin-bottom: 6px;
}
.tabs-arrow svg { width: 16px; height: 16px; }
.tabs-arrow:hover { background: var(--accent-soft); }
.folder-tabs.has-overflow .tabs-arrow { display: grid; }

/* Footer under the sheet */
.app-foot {
  width: 100%; max-width: 1640px; margin: 0 auto; padding: 14px 8px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2);
}
.app-foot a { color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.app-foot a:hover { color: var(--indigo); }
.app-foot svg { width: 15px; height: 15px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px;
  background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(38, 49, 90, .15); transform: rotate(-1deg);
}
.role-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grass); box-shadow: 0 0 0 3px rgba(46, 189, 115, .2); }
.role-chip b { color: var(--ink); font-weight: 800; }
.foot-links { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.by-almgrat { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.by-almgrat img { width: 18px; height: 18px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 0; min-width: 250px; z-index: 50;
  background: #fff; border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px) rotate(-.6deg); transition: .16s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 11px;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: right;
}
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--accent-soft); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--indigo); }
.dropdown-menu .danger, .dropdown-menu .danger svg { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 2px dashed var(--line); margin: 6px 0; }
.dropdown-head { padding: 12px 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-head b { font-size: 16px; font-weight: 800; }
.notif-menu { width: 390px; padding: 0; overflow: hidden; }
.notif-menu .dropdown-head { background: var(--accent-soft); border-bottom: 2px solid var(--ink); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1.5px dashed var(--line); position: relative; }
.notif-item:first-child { border-top: 0; }
.notif-item.unread { background: #f4f5ff; }
.notif-item.unread::after { content: ""; position: absolute; left: 14px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); border: 1.5px solid var(--ink); }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.notif-item b { font-size: 14px; display: block; }
.notif-item small { font-size: 12px; color: var(--muted); }
.notif-foot { display: block; text-align: center; padding: 12px; border-top: 2px solid var(--ink); font-weight: 800; font-size: 14px; color: var(--indigo); background: var(--paper); }

.search-panel { background: #fff; border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 420px; overflow-y: auto; z-index: 60; }
.search-group { font-size: 12px; font-weight: 800; color: var(--indigo); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--ink); }
.search-item:hover, .search-item.focus { background: var(--accent-soft); }
.search-item .sub { font-size: 12px; color: var(--muted); }
.search-item .tail { margin-right: auto; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 {
  font-size: 30px; font-weight: 800; margin: 0; display: inline; line-height: 1.25;
  background: linear-gradient(transparent 60%, rgba(255, 207, 63, .55) 60%, rgba(255, 207, 63, .55) 90%, transparent 90%);
  padding: 0 4px;
}
.page-head p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons (extend base) ---------- */
.btn {
  border-radius: 14px; padding: 8px 16px; font-size: 14px; font-weight: 700; border-width: 2px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none !important; }
.btn-primary { background: var(--indigo); color: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { background: #3343bd; color: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 rgba(38, 49, 90, .2); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 11px; }
.btn-sm.btn-primary, .btn-sm.btn-outline, .btn-sm.btn-accent, .btn-sm.btn-dark, .btn-sm.btn-danger { box-shadow: 2px 2px 0 var(--ink); }
.btn-sm.btn-outline { box-shadow: 2px 2px 0 rgba(38, 49, 90, .2); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: 16px; }
.btn-soft { background: var(--brand-soft); color: var(--brand-700); border-color: transparent; }
.btn-soft:hover { background: #dfe3fb; border-color: rgba(38, 49, 90, .25); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--sun); }
.btn-dark:hover { background: #1c2547; color: #fff; }
.btn-danger { background: var(--coral); color: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-danger:hover { background: #f25848; color: #fff; }
.btn-accent { background: var(--sun); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: #fff; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; box-shadow: 2px 2px 0 rgba(38, 49, 90, .15); transition: .12s;
}
.btn-icon:hover { color: var(--ink); background: var(--accent-soft); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 22px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap instead of stretching the page */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand); }
.fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 2px solid var(--ink); border-radius: 16px; box-shadow: var(--sticker); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 2px dashed var(--line-2); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.card-head p { margin: 0; font-size: 13px; color: var(--muted); }
.card-body { padding: 20px 22px; }
.card-foot { padding: 12px 22px; border-top: 2px dashed var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; background: var(--paper); border-radius: 0 0 14px 14px; }

/* KPI = colourful index cards */
.kpi {
  padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(var(--c, var(--brand)) 0 8px, transparent 8px),
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(71, 181, 255, .14) 25px 26px);
  background-position: 0 0, 0 18px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi::after { content: ""; position: absolute; inset-block: 8px 0; right: 18px; width: 2px; background: var(--margin-red); opacity: .45; pointer-events: none; }
.kpi > * { position: relative; z-index: 1; }
.grid > .kpi:nth-child(odd):hover { transform: rotate(-1deg) translateY(-2px); }
.grid > .kpi:nth-child(even):hover { transform: rotate(1deg) translateY(-2px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand));
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(38, 49, 90, .18); transform: rotate(-8deg);
}
.kpi-icon svg { width: 22px; height: 22px; stroke-width: 2.3; }
.kpi-label { font-size: 14px; color: var(--text-2); font-weight: 700; }
.kpi-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--ink); }
.kpi-value small { font-size: 14px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; padding: 1px 9px; border-radius: 999px; border: 1.5px solid currentColor; }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: var(--success); background: var(--success-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }
.trend.flat { color: var(--text-2); background: var(--surface-2); }
.kpi-foot { font-size: 12px; color: var(--text-2); font-weight: 600; }
.c-green  { --c: #1fa863; --c-soft: #dbf5e7; }
.c-indigo { --c: #3b4bc8; --c-soft: #e6e9fc; }
.c-pink   { --c: #e8478f; --c-soft: #ffe1ee; }
.c-blue   { --c: #1c95ea; --c-soft: #dcf0ff; }
.c-amber  { --c: #d99a00; --c-soft: #fff1bf; }
.c-red    { --c: #ec4b3b; --c-soft: #ffe0db; }
.c-violet { --c: #7b5ce6; --c-soft: #ece6ff; }
.c-slate  { --c: #26315a; --c-soft: #e9ebf3; }
.c-teal   { --c: #17a589; --c-soft: #d6f5ee; }
.c-orange { --c: #f07a2a; --c-soft: #ffe7d4; }

/* Hero / welcome banner — a big indigo sticker */
.welcome {
  border-radius: 22px; padding: 28px 30px; color: #fff; position: relative; overflow: hidden;
  background-color: var(--indigo);
  border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.welcome::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1.4px, transparent 1.4px); background-size: 20px 20px;
  mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.welcome::after {
  content: ""; position: absolute; left: -54px; bottom: -84px; width: 250px; height: 250px; border-radius: 50%;
  border: 3px dashed rgba(255, 207, 63, .45); pointer-events: none;
}
.welcome h2 { font-size: 28px; font-weight: 800; margin-bottom: 4px; color: #fff; }
.welcome p { margin: 0; opacity: .92; }
.welcome .btn-outline { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .8); color: #fff; box-shadow: 2px 2px 0 rgba(0, 0, 0, .18); }
.welcome .btn-outline:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* Page heroes defined inside role pages — give them the same sticker outline */
.p-hello, .kid-hero, .gr-hero, .streak-card, .bal, .lib-hero, .pf-cover { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.pf-cover { box-shadow: none; }

/* ---------- Badges (stickers) ---------- */
.badge {
  font-size: 12px; padding: 2px 10px; gap: 6px; white-space: nowrap; font-weight: 700; border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
  box-shadow: 1px 1px 0 rgba(38, 49, 90, .12);
}
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-brand   { background: var(--brand-soft);   color: var(--brand); }
.badge-slate { background: #eceef4; color: #4c5578; }
.badge-violet { background: #ece6ff; color: #6a48d8; }
.badge-accent { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.badge-lg { font-size: 13px; padding: 4px 13px; }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px;
  color: #fff; flex-shrink: 0; background: var(--av, var(--brand)); border: 2px solid var(--ink); line-height: 1;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; border-width: 1.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--sun); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--muted); }
a.person:hover b { color: var(--brand); }

/* ---------- Tables (grid paper) ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 2px dashed var(--line-2); flex-wrap: wrap; }
.toolbar .search-input { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search-input input { padding-right: 40px; border-radius: 999px; }
.toolbar .search-input svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink); width: 17px; }
.toolbar .spacer { flex: 1; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background-color: #fff;
  background-image: linear-gradient(rgba(71, 181, 255, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(71, 181, 255, .09) 1px, transparent 1px);
  background-size: 18px 18px;
}
.card > .table-wrap:last-child { border-radius: 0 0 14px 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: right; font-weight: 800; font-size: 12.5px; color: var(--ink); background: var(--accent-soft);
  padding: 11px 16px; border-bottom: 2px solid var(--ink); white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1.5px solid rgba(71, 181, 255, .22); vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 207, 63, .16); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 800; font-variant-numeric: tabular-nums; }
.table .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); direction: ltr; display: inline-block; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button { min-width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); }
.pagination button:hover { background: var(--accent-soft); }
.pagination button.active { background: var(--indigo); border-color: var(--ink); color: #fff; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 2px solid var(--line-2); border-radius: 12px; padding: 0 12px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); transition: .15s;
}
.input:hover, .select:hover, .textarea:hover { border-color: #b9b098; }
.textarea {
  height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; line-height: 26px;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, rgba(71, 181, 255, .18) 25px 26px); background-position: 0 7px; background-attachment: local;
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2326315a' stroke-width='2.4' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; }
.toolbar .select { width: auto; min-width: 140px; border-radius: 999px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--sun); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e3dfd0; border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; right: 3px; top: 3px; background: #fff; border: 1.5px solid var(--ink); border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--grass); }
.switch input:checked + span::before { transform: translateX(-20px); }
.check { width: 18px; height: 18px; accent-color: var(--indigo); cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.choice { border: 2px solid var(--line-2); border-radius: 16px; padding: 16px; cursor: pointer; transition: .15s; background: #fff; position: relative; text-align: center; }
.choice:hover { border-color: var(--ink); transform: rotate(-1deg); }
.choice.selected { border-color: var(--ink); background: var(--accent-soft); box-shadow: 3px 3px 0 var(--ink); }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; left: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--grass); border: 1.5px solid var(--ink); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.choice .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; display: block; }

/* ---------- In-page tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px dashed var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: none; border: 0;
  margin-bottom: -2px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink); border-bottom-color: var(--ink);
  background: linear-gradient(transparent 58%, rgba(255, 207, 63, .6) 58%, rgba(255, 207, 63, .6) 86%, transparent 86%);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 3px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-2); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--accent-soft); }
.seg button.active { background: var(--indigo); color: #fff; box-shadow: none; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(38, 49, 90, .45); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal {
  background: #fff; border: 2px solid var(--ink); border-radius: 22px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: 8px 8px 0 rgba(38, 49, 90, .35);
  transform: translateY(14px) rotate(-1deg) scale(.98); transition: transform .22s ease;
}
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 2px dashed var(--line-2); background: var(--paper); border-radius: 20px 20px 0 0; }
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 14px 24px; border-top: 2px dashed var(--line-2); display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.success-mark { width: 80px; height: 80px; border-radius: 50%; background: var(--grass); color: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--sun); display: grid; place-items: center; margin: 4px auto 16px; animation: pop .35s ease; }
.success-mark svg { width: 40px; height: 40px; stroke-width: 3; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px; background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 16px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 4px 4px 0 var(--sun); font-size: 14px; font-weight: 600; animation: toastIn .25s ease;
}
.toast .t-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grass); color: #fff; border: 2px solid #fff; flex-shrink: 0; }
.toast.error .t-icon { background: var(--coral); }
.toast.info .t-icon { background: var(--sky); }
.toast.warning .t-icon { background: var(--sun); color: var(--ink); }
.toast.hide { animation: toastOut .25s ease forwards; }

/* ---------- Lists / Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; border: 2px solid var(--ink); }
.feed p { margin: 0; font-size: 14px; }
.feed small { color: var(--muted); font-size: 12px; }
.t-info { background: var(--info-soft); color: var(--info); }
.t-success { background: var(--success-soft); color: var(--success); }
.t-warning { background: var(--warning-soft); color: var(--warning); }
.t-danger { background: var(--danger-soft); color: var(--danger); }
.t-brand { background: var(--brand-soft); color: var(--brand); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.list-row:last-child { border-bottom: 0; }

/* Progress = pencil bars */
.progress { height: 12px; background: #f3eedd; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 999px 0 0 999px; transition: width .6s ease;
  background-color: var(--c, var(--brand));
  background-image:
    linear-gradient(90deg, var(--ink) 0 3px, #f5d9a8 3px 9px, transparent 9px),
    linear-gradient(180deg, rgba(255, 255, 255, .35) 0 30%, transparent 30% 70%, rgba(0, 0, 0, .1) 70%);
}
.ring { --p: 75; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #f1ecdb 0); position: relative; box-shadow: 0 0 0 2px var(--ink), 3px 3px 0 2px rgba(38, 49, 90, .15); }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 26px; font-weight: 800; display: block; line-height: 1; }
.ring small { font-size: 12px; color: var(--muted); }

/* Chart containers */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink); }

/* Empty state */
.empty-state { padding: 48px 24px; }
.empty-state .empty-icon { background: var(--accent-soft); color: var(--ink); border: 2px dashed var(--ink); transform: rotate(-6deg); }
.empty-state h3 { color: var(--ink); font-weight: 800; }

/* Info list */
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.info-list div small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-list div b { font-size: 14px; font-weight: 700; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink); padding: 4px 0; }
.cal .day { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #fff; border: 1.5px solid var(--line-2); color: var(--text-2); position: relative; }
.cal .day.p { background: var(--success-soft); color: #137a46; border-color: #8fd9b2; }
.cal .day.a { background: var(--danger-soft); color: #c23426; border-color: #ffb0a6; }
.cal .day.today { outline: 2.5px dashed var(--indigo); outline-offset: 2px; }
.cal .day.future { background: transparent; color: #c9c4b2; border-style: dashed; }
.cal .day.empty { background: transparent; border-color: transparent; }

/* Schedule timeline */
.session { display: flex; gap: 14px; padding: 14px; border-radius: 16px; border: 2px solid var(--line-2); background: #fff; align-items: center; border-right: 6px solid var(--c, var(--brand)); }
.session .time { text-align: center; min-width: 64px; }
.session .time b { display: block; font-size: 16px; font-weight: 800; }
.session .time small { font-size: 12px; color: var(--muted); }
.session h4 { margin: 0 0 2px; font-size: 15px; font-weight: 800; }
.session .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.session .meta span { display: inline-flex; align-items: center; gap: 4px; }
.session .meta svg { width: 14px; height: 14px; }

/* Sport emoji tile */
.sport-tile { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c, var(--brand)) 14%, #fff); border: 2px solid var(--ink); flex-shrink: 0; }

/* QR (pseudo) */
.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 14px; border: 2px solid var(--ink); display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.qr i { display: block; aspect-ratio: 1; }
.qr i.on { background: var(--ink); }

/* Animations */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6) rotate(-10deg); opacity: 0; } 70% { transform: scale(1.08) rotate(4deg); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.fade-in { animation: fade .3s ease both; }

/* ==========================================================================
   School Pro — education components
   ========================================================================== */
.btn-accent:hover { background: #ffd95e; color: var(--ink); }
.badge-indigo { background: var(--brand-soft); color: var(--brand); }
.badge-pink { background: #ffe1ee; color: #c92f77; }
.welcome .btn-accent { box-shadow: 3px 3px 0 var(--ink); }
.welcome-art {
  position: absolute; left: 30px; top: 50%; transform: translateY(-50%) rotate(7deg); width: 116px; height: 116px; border-radius: 18px;
  background: var(--sun); border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, .22); display: grid; place-items: center; z-index: 0;
}
.welcome-art::before { content: ""; position: absolute; top: -10px; left: 50%; width: 46px; height: 18px; transform: translateX(-50%) rotate(-4deg); background: rgba(255, 255, 255, .55); border: 1px solid rgba(38, 49, 90, .15); }
.welcome-art svg { width: 60px; height: 60px; color: var(--ink); stroke-width: 1.8; }

/* Child switcher (parent role) */
.child-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 999px; background: var(--accent-soft); border: 2px solid var(--ink); }
.child-switch button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); padding: 3px 10px 3px 4px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.child-switch button .avatar { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
.child-switch button:hover { background: rgba(255, 255, 255, .7); }
.child-switch button.active { background: var(--indigo); color: #fff; }
.child-switch small { font-weight: 600; color: var(--text-2); font-size: 11px; }
.child-switch button.active small { color: #dfe3ff; }

/* Subject chip / tile */
.subject { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; padding: 1px 10px 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--brand)) 13%, #fff); border: 1.5px solid color-mix(in srgb, var(--c, var(--brand)) 45%, transparent); }
.subject i.sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); display: inline-block; flex-shrink: 0; border: 1.5px solid var(--ink); }
.subject-tile { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 15%, #fff); border: 2px solid var(--ink); flex-shrink: 0; }
.subject-tile svg { width: 21px; height: 21px; }

/* Grade sticker */
.grade { display: inline-grid; place-items: center; min-width: 44px; height: 28px; padding: 0 9px; border-radius: 999px; font-weight: 800; font-size: 13px; direction: ltr; border: 1.5px solid currentColor; box-shadow: 1px 1px 0 rgba(38, 49, 90, .15); }
.grade.g-a { background: var(--success-soft); color: #158a50; }
.grade.g-b { background: var(--brand-soft); color: var(--brand); }
.grade.g-c { background: var(--warning-soft); color: #a26e00; }
.grade.g-d { background: var(--danger-soft); color: #cf3628; }

/* Weekly timetable — grid paper with sticky-note lessons */
.tt-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px;
  background-image: linear-gradient(rgba(71, 181, 255, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(71, 181, 255, .1) 1px, transparent 1px);
  background-size: 16px 16px; border-radius: 12px;
}
.tt { display: grid; grid-template-columns: 92px repeat(var(--cols, 7), minmax(110px, 1fr)); gap: 6px; min-width: 860px; }
.tt .h { font-size: 12px; font-weight: 800; color: var(--ink); text-align: center; padding: 7px 4px; background: var(--accent-soft); border: 1.5px solid var(--ink); border-radius: 12px; }
.tt .h small { display: block; font-weight: 600; color: var(--text-2); font-size: 11px; direction: ltr; }
.tt .day { font-weight: 800; font-size: 13px; display: grid; place-items: center; background: var(--indigo); color: #fff; border: 1.5px solid var(--ink); border-radius: 12px; }
.tt .cell {
  border-radius: 10px; padding: 8px 10px; min-height: 58px; font-size: 12px;
  background: color-mix(in srgb, var(--c, var(--brand)) 16%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--c, var(--brand)) 55%, var(--ink));
  border-top: 5px solid var(--c, var(--brand));
  box-shadow: 2px 2px 0 rgba(38, 49, 90, .1); transition: transform .15s;
}
.tt .cell:nth-child(odd):hover { transform: rotate(-1.5deg); }
.tt .cell:nth-child(even):hover { transform: rotate(1.5deg); }
.tt .cell b { display: block; font-size: 13px; color: var(--ink); }
.tt .cell small { color: var(--text-2); }
.tt .cell.now { box-shadow: 0 0 0 3px var(--sun), 3px 3px 0 3px var(--ink); }
.tt .cell.break { background: repeating-linear-gradient(45deg, #fffdf6 0 6px, #f4efde 6px 12px); border: 1.5px dashed var(--line-2); border-top: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-weight: 800; box-shadow: none; }

/* Admissions funnel */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.funnel-row .bar { height: 30px; border-radius: 999px; background: #f3eedd; border: 1.5px solid var(--ink); overflow: hidden; }
.funnel-row .bar span { display: flex; align-items: center; height: 100%; border-radius: 999px 0 0 999px; background: var(--c, var(--brand)); padding: 0 10px; color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; min-width: 36px; }
.funnel-row b { text-align: left; font-variant-numeric: tabular-nums; }

/* Bus tracker mini */
.bus-row { padding: 12px 0; border-bottom: 2px dashed var(--line); }
.bus-row:last-child { border-bottom: 0; }
.bus-track { position: relative; height: 8px; border-radius: 99px; background: repeating-linear-gradient(90deg, #e9e3cf 0 10px, transparent 10px 16px); margin-top: 12px; }
.bus-track > span { position: absolute; inset-block: 0; right: 0; border-radius: 99px; background: var(--c, var(--brand)); }
.bus-track > em { position: absolute; top: 50%; transform: translate(50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 2px 2px 0 rgba(38, 49, 90, .2); }
.bus-track > em svg { width: 14px; height: 14px; }
.bus-num { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(38, 49, 90, .2); flex-shrink: 0; transform: rotate(-4deg); }

/* Event date block — tear-off calendar */
.date-block { width: 56px; flex-shrink: 0; border-radius: 12px; overflow: hidden; text-align: center; border: 2px solid var(--ink); background: #fff; box-shadow: 2px 2px 0 rgba(38, 49, 90, .15); }
.date-block small { display: block; font-size: 11px; font-weight: 800; color: #fff; background: var(--c, var(--brand)); padding: 2px 0; border-bottom: 2px solid var(--ink); }
.date-block b { display: block; font-size: 20px; font-weight: 800; line-height: 1.6; }

/* Mini stat */
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-stats > div { background: var(--paper); border: 2px dashed var(--line-2); border-radius: 14px; padding: 8px 12px; }
.mini-stats small { display: block; font-size: 12px; color: var(--text-2); }
.mini-stats b { font-size: 19px; font-weight: 800; }

/* Stage tile */
.stage-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 2px solid var(--line-2); background: #fff; transition: .15s; }
.stage-tile:hover { border-color: var(--ink); box-shadow: 3px 3px 0 rgba(38, 49, 90, .15); }
.stage-tile .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--brand)) 15%, #fff); color: var(--c, var(--brand)); border: 2px solid var(--ink); }

/* Report card / certificate */
.report-card { border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--sticker); }
.report-card .rc-head { padding: 18px 22px; background: var(--accent-soft); border-bottom: 2px dashed var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Segmented controls never widen the page on phones */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex-shrink: 0; }
.page-actions { max-width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .term-pill { display: none; }
}
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .main { padding: 0 14px; }
  .topbar-app { padding: 0 16px; gap: 10px; }
  .brand-name small { display: none; }
  .content {
    padding: 24px 44px 34px 20px;
    background-image:
      linear-gradient(90deg, transparent calc(100% - 28px), var(--margin-red) calc(100% - 28px), var(--margin-red) calc(100% - 26px), transparent calc(100% - 26px)),
      repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
  }
  .user-btn .meta { display: none; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .main { padding: 0 8px; }
  .topbar-app { gap: 8px; padding: 0 10px; }
  .brand-name { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-logo { width: 38px; height: 38px; }
  .icon-btn { width: 38px; height: 38px; }
  .global-search input { height: 40px; padding: 0 38px 0 12px; }
  .global-search > svg { right: 13px; }
  .global-search kbd { display: none; }
  .user-btn { padding: 2px; }
  .user-btn > svg { display: none; }
  .folder-tabs { padding-top: 10px; }
  .tabs-arrow, .folder-tabs.has-overflow .tabs-arrow { display: none; }
  .nav-section { display: none; }
  .nav-link { padding: 7px 11px 8px; font-size: 13px; gap: 6px; }
  .nav-link.active { padding: 9px 13px 13px; }
  .nav-link.active svg { width: 22px; height: 22px; padding: 3px; }
  .content {
    padding: 18px 28px 26px 12px; border-radius: 16px 4px 16px 16px;
    background-image:
      linear-gradient(90deg, transparent calc(100% - 18px), var(--margin-red) calc(100% - 18px), var(--margin-red) calc(100% - 16px), transparent calc(100% - 16px)),
      repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
  }
  .app-foot { justify-content: center; text-align: center; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 24px; }
  .card-pad, .card-body { padding: 18px 16px; }
  .card-head, .toolbar, .card-foot { padding-inline: 16px; }
  .notif-menu { position: fixed; top: calc(var(--header-h) + 6px); left: 10px; right: 10px; width: auto; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; min-width: 0; }
  .welcome { padding: 22px 20px; box-shadow: 4px 4px 0 var(--ink); }
  .welcome h2 { font-size: 22px; }
  .header-actions { gap: 6px; }
  .header-actions .hide-sm { display: none; }
  .kpi::after { right: 12px; }
  .child-switch small { display: none; }
  .child-switch button { padding: 2px 8px 2px 3px; }
  .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel-row { grid-template-columns: 86px minmax(0, 1fr) 36px; }
  .welcome-art { display: none; }
  .p-hello, .kid-hero, .gr-hero, .streak-card, .bal, .lib-hero { box-shadow: 4px 4px 0 var(--ink); }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 18px 14px 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-icon { width: 38px; height: 38px; }
  .kpi-icon svg { width: 18px; height: 18px; }
  .child-switch .cs-name { display: none; }
  .content { padding-right: 24px; }
}
@media print {
  .topbar-app, .folder-tabs, .app-foot, .page-actions, .toolbar, .toast-wrap { display: none !important; }
  body.app { background: #fff; }
  .main { padding: 0; }
  .content { border: 0; box-shadow: none; background: #fff; padding: 0; }
  .card { box-shadow: none; }
}
