html:not(.security-frame-allowed) {
  visibility: hidden;
}

:root {
  --green-950: #063b68;
  --green-900: #0b559f;
  --green-800: #0b6fa4;
  --green-700: #078f72;
  --green-100: #daf7ef;
  --green-50: #f0fbf8;
  --orange: #ff8416;
  --orange-dark: #df6b00;
  --orange-pale: #fff1e2;
  --ink: #12345b;
  --ink-soft: #465269;
  --muted: #7b8699;
  --line: #e0e5eb;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --blue: #145aa5;
  --blue-pale: #eaf3fc;
  --purple: #8267ce;
  --purple-pale: #f1edff;
  --red: #d0505d;
  --red-pale: #fff0f1;
  --brand-blue: #145aa5;
  --brand-blue-deep: #073f7d;
  --brand-teal: #09b88d;
  --brand-teal-deep: #078f72;
  --shadow: 0 20px 60px rgba(31, 48, 68, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

.school-brand { display: inline-flex; align-items: center; gap: 11px; }
.school-logo { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; color: #fff; background: var(--orange); box-shadow: 0 9px 24px rgba(244,163,64,.24); }
.school-logo svg { width: 25px; }
.school-brand > span:last-child { display: flex; flex-direction: column; }
.school-brand b { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.school-brand strong { margin-top: 1px; color: var(--green-900); font: 800 20px/1 "Manrope", sans-serif; letter-spacing: -.045em; }
.school-brand-light b { color: rgba(255,255,255,.5); }
.school-brand-light strong { color: #fff; }

.login-screen { display: grid; grid-template-columns: minmax(490px, 1.08fr) minmax(450px, .92fr); min-height: 100vh; background: #fff; }
.login-brand-panel { position: relative; display: flex; min-height: 100vh; flex-direction: column; padding: 42px max(42px, calc((100vw - 1200px) / 2)); overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--brand-blue) 0%, var(--brand-blue-deep) 72%, #052f61 100%); }
.login-brand-panel::before { content: ""; position: absolute; width: 47%; height: 54%; right: -7%; bottom: -7%; border-radius: 34px 0 0 0; background: linear-gradient(145deg, var(--brand-teal), var(--brand-teal-deep)); box-shadow: -32px -32px 0 rgba(255,255,255,.11); transform: rotate(-2deg); }
.login-brand-panel::after { content: ""; position: absolute; inset: 0; opacity: .24; background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom right, black, transparent 78%); }
.login-decoration { position: absolute; pointer-events: none; }
.decoration-one { width: 390px; height: 390px; right: -170px; top: 17%; border: 2px solid rgba(255,255,255,.11); border-radius: 36px; transform: rotate(45deg); }
.decoration-two { width: 330px; height: 330px; top: -210px; left: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(74,169,148,.42), transparent 68%); }
.official-brand { position: relative; z-index: 3; display: grid; width: min(195px, 100%); min-height: 140px; padding: 9px 14px; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 17px; background: rgba(255,255,255,.98); box-shadow: 0 16px 36px rgba(3,38,83,.25); }
.official-brand img { display: block; width: 100%; height: 120px; object-fit: contain; }
.login-message { position: relative; z-index: 2; max-width: 600px; margin: auto 0; padding: 65px 0 145px; }
.login-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #65e0bf; font-size: 13px; font-weight: 800; letter-spacing: .15em; }
.login-eyebrow i { width: 20px; height: 2px; border-radius: 3px; background: currentColor; }
.login-message h1 { margin: 20px 0 18px; font: 700 clamp(42px, 5vw, 64px)/1.08 "Manrope", sans-serif; letter-spacing: -.055em; }
.login-message > p { max-width: 560px; margin: 0; color: rgba(255,255,255,.62); font-size: 16px; line-height: 1.7; }
.login-benefits { display: grid; gap: 10px; margin-top: 31px; color: rgba(255,255,255,.7); font-size: 14px; }
.login-benefits span { display: flex; align-items: center; gap: 8px; }
.login-benefits svg { width: 17px; color: #65e0bf; stroke-width: 2.4; }
.family-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(255,255,255,.09); box-shadow: 0 15px 45px rgba(0,0,0,.2); backdrop-filter: blur(16px); }
.family-card-one { right: 65px; bottom: 103px; width: 268px; padding: 13px; transform: rotate(-1.5deg); }
.family-card-two { right: 25px; bottom: 35px; width: 230px; padding: 11px; transform: rotate(2deg); }
.family-avatar, .family-icon { display: grid; flex: 0 0 auto; width: 37px; height: 37px; place-items: center; border-radius: 11px; font-size: 13px; font-weight: 800; }
.avatar-purple { color: #fff; background: var(--purple); }
.family-icon { color: #fac37f; background: rgba(244,163,64,.13); }
.family-icon svg { width: 19px; }
.family-card p { display: flex; min-width: 0; margin: 0; flex-direction: column; }
.family-card b { font-size: 13px; }
.family-card small { margin-top: 2px; color: rgba(255,255,255,.45); font-size: 11px; }
.family-card-one i { margin-left: auto; color: #a6eadb; font: 800 17px/1 "Manrope", sans-serif; font-style: normal; }
.family-card-two em { margin-left: auto; color: #a6eadb; font-style: normal; }

.login-form-panel { display: grid; min-height: 100vh; padding: 50px clamp(36px, 7vw, 95px); place-items: center; background: #fff; }
.mobile-brand { display: none; }
.login-box { width: min(430px, 100%); }
.prototype-pill { display: inline-flex; padding: 6px 9px; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.login-box h2 { margin: 17px 0 7px; font: 700 31px/1.2 "Manrope", sans-serif; letter-spacing: -.04em; }
.login-box > p { margin: 0; color: var(--muted); font-size: 15px; }
.login-role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 27px 0 24px; }
.login-role-tabs button { display: flex; min-height: 74px; align-items: center; flex-direction: column; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #fbfcfd; font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.login-role-tabs button:hover { border-color: #a9bcb4; }
.login-role-tabs button.active { border-color: var(--green-700); color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 2px rgba(28,105,77,.06); }
.login-role-tabs svg { width: 21px; }
.form-field { display: block; margin-bottom: 16px; }
.form-field > span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.form-field > div { position: relative; }
.form-field > div > svg { position: absolute; top: 50%; left: 13px; width: 17px; color: #95a09e; transform: translateY(-50%); }
.form-field input { width: 100%; height: 48px; padding: 0 42px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fbfcfd; font-size: 14px; transition: .2s ease; }
.form-field input:focus { border-color: #82b19e; background: #fff; box-shadow: 0 0 0 3px rgba(28,105,77,.08); }
.form-field div > button { position: absolute; top: 50%; right: 10px; display: grid; width: 30px; height: 30px; place-items: center; border: 0; color: #95a09e; background: transparent; transform: translateY(-50%); cursor: pointer; }
.form-field div > button svg { width: 17px; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; color: var(--muted); font-size: 12px; }
.login-options label { display: flex; align-items: center; gap: 5px; }
.login-options input { accent-color: var(--green-700); }
.login-options button { padding: 0; border: 0; color: var(--green-700); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.login-options > span { display: flex; gap: 10px; }
.login-button[disabled] { cursor: wait; opacity: .7; transform: none; }
.loading-state, .empty-state { padding: 34px 20px; border: 1px dashed #cdd8d3; border-radius: 14px; color: var(--muted); background: #fbfcfc; font-size: 13px; line-height: 1.6; text-align: center; }
.empty-state b { display: block; margin-bottom: 4px; color: var(--ink); 700 16px/1.3 "Manrope", sans-serif; }
.inline-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.muted-code { color: var(--muted); 500 10px/1.4 monospace; }
.portal-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 99px; color: var(--green-700); background: var(--green-100); font-size: 10px; font-weight: 700; }
.danger-text { color: var(--red); }
.form-error { margin: -8px 0 12px; color: var(--red); font-size: 12px; }
.email-confirmation-note { display: block; margin: -4px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.login-button { display: flex; width: 100%; height: 49px; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; color: #fff; background: var(--green-700); box-shadow: 0 10px 25px rgba(28,105,77,.2); font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.login-button:hover { background: var(--green-800); transform: translateY(-1px); box-shadow: 0 13px 30px rgba(28,105,77,.25); }
.login-button svg { width: 17px; }
.demo-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; color: #9ba4b1; font-size: 11px; line-height: 1.4; text-align: center; }
.demo-note svg { flex: 0 0 auto; width: 14px; }
.mfa-panel { display: grid; gap: 16px; margin-top: 18px; }
.mfa-panel[hidden] { display: none; }
.mfa-panel h3 { margin: 0; color: var(--ink); font-size: 25px; }
.mfa-panel > p { margin: 0; color: var(--muted); line-height: 1.55; }
.mfa-enrollment { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #f7faf8; text-align: center; }
.mfa-enrollment[hidden] { display: none; }
.mfa-enrollment img { width: 210px; max-width: 100%; margin: auto; border-radius: 14px; background: #fff; }
.mfa-enrollment p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mfa-enrollment label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; text-align: left; }
.mfa-enrollment input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-family: monospace; }
#mfaCancel { justify-self: center; }

.portal-app { display: grid; grid-template-columns: 255px minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar { position: fixed; z-index: 25; top: 0; bottom: 0; left: 0; display: flex; width: 255px; flex-direction: column; padding: 27px 20px 22px; overflow-y: auto; color: #fff; background: linear-gradient(165deg, var(--brand-blue), var(--brand-blue-deep)); }
.sidebar-brand { display: grid; width: 100%; min-height: 70px; padding: 8px 10px; place-items: center; border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: 0 12px 28px rgba(3,38,83,.2); }
.sidebar-brand-image { display: block; width: 100%; height: 100px; object-fit: contain; }
.profile-card { display: flex; align-items: center; gap: 10px; margin: 29px 0 23px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.07); }
.profile-avatar { display: grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 800; }
.profile-card p { display: flex; min-width: 0; margin: 0; flex-direction: column; }
.profile-card b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-card small { margin-top: 2px; color: rgba(255,255,255,.43); font-size: 11px; }
.portal-sidebar nav { display: grid; gap: 4px; }
.nav-label { margin: 0 9px 7px; color: rgba(255,255,255,.3); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.nav-button { position: relative; display: flex; width: 100%; min-height: 41px; align-items: center; gap: 10px; padding: 0 11px; border: 0; border-radius: 10px; color: rgba(255,255,255,.53); background: transparent; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-button svg { width: 17px; }
.nav-button:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.05); }
.nav-button.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-button.active::before { content: ""; position: absolute; left: -20px; width: 3px; height: 21px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-button.active svg { color: #f7b966; }
.nav-badge { margin-left: auto; padding: 3px 6px; border-radius: 99px; color: var(--green-950); background: var(--orange); font-size: 10px; font-weight: 800; }
.sidebar-help { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.055); }
.sidebar-help > span { display: grid; width: 29px; height: 29px; margin-bottom: 8px; place-items: center; border-radius: 9px; color: #fac075; background: rgba(244,163,64,.11); }
.sidebar-help svg { width: 17px; }
.sidebar-help p { display: flex; margin: 0; flex-direction: column; }
.sidebar-help b { font-size: 12px; }
.sidebar-help small { margin-top: 2px; color: rgba(255,255,255,.4); font-size: 10px; }
.sidebar-help button { margin-top: 10px; padding: 0; border: 0; color: #f7bc70; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.logout-button { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 11px; border: 0; color: rgba(255,255,255,.4); background: transparent; font-size: 11px; cursor: pointer; }
.logout-button svg { width: 15px; }
.sidebar-overlay { display: none; }
.portal-main { grid-column: 2; min-width: 0; }
.portal-topbar { position: sticky; z-index: 15; top: 0; display: flex; height: 78px; align-items: center; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.menu-button { display: none; }
.page-title span { color: var(--green-700); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.page-title h1 { margin: 3px 0 0; font: 700 20px/1.1 "Manrope", sans-serif; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.sync-status { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #f8faf9; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sync-status > i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-700); box-shadow: 0 0 0 3px rgba(28,105,77,.09); }
.sync-status.syncing > i { animation: sync-pulse 1s ease-in-out infinite; }
.sync-status.warning > i { background: var(--orange); box-shadow: 0 0 0 3px rgba(244,163,64,.12); }
@keyframes sync-pulse { 50% { opacity: .35; transform: scale(.75); } }
.role-switcher { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.role-switcher select { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink-soft); background: #f8fafb; font-size: 12px; font-weight: 600; }
.icon-button { position: relative; display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: #fff; cursor: pointer; }
.icon-button svg { width: 17px; }
.icon-button i { position: absolute; top: -6px; right: -6px; display: grid; min-width: 18px; height: 18px; padding: 0 4px; place-items: center; border: 2px solid #fff; border-radius: 10px; color: #fff; background: var(--orange); normal 700 12px/1 "DM Sans", sans-serif; }
.icon-button i[hidden] { display: none; }
.icon-button.has-notifications { color: var(--green-700); border-color: rgba(28,105,77,.35); }
.top-avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 800; }
.portal-content { min-height: calc(100vh - 78px); padding: 30px 36px 52px; outline: 0; }

.welcome-banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 145px; margin-bottom: 22px; padding: 28px 31px; overflow: hidden; border-radius: 18px; color: #fff; background: linear-gradient(110deg, var(--brand-blue), var(--brand-blue-deep)); }
.welcome-banner::after { content: ""; position: absolute; right: -45px; bottom: -95px; width: 250px; height: 250px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 76px rgba(255,255,255,.018); }
.welcome-copy { position: relative; z-index: 1; }
.welcome-copy > span { color: #f4bc75; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.welcome-copy h2 { margin: 7px 0 5px; font: 700 25px/1.2 "Manrope", sans-serif; letter-spacing: -.04em; }
.welcome-copy p { margin: 0; color: rgba(255,255,255,.58); font-size: 13px; }
.student-switch { position: relative; z-index: 1; display: flex; min-width: 235px; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.08); }
.student-switch .avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 800; }
.student-switch p { display: flex; margin: 0; flex-direction: column; }
.student-switch b { font-size: 13px; }
.student-switch small { margin-top: 2px; color: rgba(255,255,255,.43); font-size: 11px; }
.student-switch svg { width: 15px; margin-left: auto; color: rgba(255,255,255,.45); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.stat-card { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.stat-icon { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 11px; }
.stat-icon svg { width: 20px; }
.stat-icon.green { color: var(--green-700); background: var(--green-100); }
.stat-icon.orange { color: var(--orange-dark); background: var(--orange-pale); }
.stat-icon.blue { color: var(--blue); background: var(--blue-pale); }
.stat-icon.purple { color: var(--purple); background: var(--purple-pale); }
.stat-card p { display: flex; min-width: 0; margin: 0; flex-direction: column; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-card b { margin-top: 3px; font: 800 19px/1 "Manrope", sans-serif; letter-spacing: -.04em; }
.stat-card em { margin-top: 5px; color: var(--green-700); font-size: 10px; font-style: normal; }
.stat-card em.warning { color: var(--orange-dark); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 17px; }
.stack { display: grid; align-content: start; gap: 17px; }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-head div { min-width: 0; }
.panel-head h3 { margin: 0; 700 16px/1.2 "Manrope", sans-serif; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.text-link { padding: 0; border: 0; color: var(--green-700); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.activity-list { display: grid; gap: 9px; }
.activity-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid #edf0f3; border-radius: 11px; background: #fcfdfd; }
.subject-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; font-size: 16px; }
.subject-icon.math { background: var(--blue-pale); }
.subject-icon.science { background: var(--green-100); }
.subject-icon.portuguese { background: var(--orange-pale); }
.subject-icon.history { background: var(--purple-pale); }
.activity-row > div:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.activity-row b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.activity-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-row-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.meeting-row > div { width: 100%; }
.meeting-row .status { display: inline-flex; margin-top: 8px; }
.meeting-schedule-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid #dfe8e4; }
.meeting-schedule-form .form-submit { justify-content: flex-start; }
.activity-row-tools .activity-file { display: inline-flex; max-width: 270px; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-row-tools .activity-file svg { flex: 0 0 13px; width: 13px; }
.activity-actions { display: inline-flex; gap: 6px; }
.activity-form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.date-tag { display: flex; min-width: 54px; flex-direction: column; align-items: center; padding: 7px 8px; border-radius: 9px; color: var(--orange-dark); background: var(--orange-pale); }
.date-tag b { font-size: 13px; }
.date-tag small { margin: 1px 0 0; color: inherit; font-size: 10px; text-transform: uppercase; }
.notice-list { display: grid; gap: 11px; }
.notice { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
.notice > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--green-700); background: var(--green-100); }
.notice > span svg { width: 16px; }
.notice p { margin: 0; }
.notice b { display: block; font-size: 12px; }
.notice small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.performance-bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 66px 1fr 25px; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; }
.bar-row > div { height: 6px; overflow: hidden; border-radius: 7px; background: #edf1f3; }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--green-700); }
.bar-row b { font-size: 11px; text-align: right; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.page-intro span { display: block; color: var(--green-700); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.page-intro h2 { margin: 5px 0 4px; font: 700 24px/1.2 "Manrope", sans-serif; letter-spacing: -.035em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.page-intro-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.print-button svg { width: 16px; }
.primary-button, .outline-button, .soft-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border-radius: 9px; font-size: 11px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.primary-button { border: 0; color: #fff; background: var(--green-700); box-shadow: 0 7px 18px rgba(28,105,77,.16); }
.primary-button:hover { background: var(--green-800); transform: translateY(-1px); }
.outline-button { border: 1px solid var(--line); color: var(--ink-soft); background: #fff; }
.soft-button { border: 0; color: var(--green-700); background: var(--green-100); }
.primary-button svg, .outline-button svg, .soft-button svg { width: 15px; }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbfc; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #eef1f3; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { color: var(--ink); font-size: 12px; }
.data-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-action { padding: 6px 9px; border: 0; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-size: 10px; font-weight: 700; cursor: pointer; }
.invoice-status-select { min-width: 104px; height: 31px; padding: 0 25px 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink-soft); background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.invoice-status-select:focus { border-color: #81ad9b; box-shadow: 0 0 0 3px rgba(28,105,77,.07); }
.invoice-status-select:disabled { opacity: .65; cursor: wait; }
.file-removed { color: var(--muted); font-size: 10px; font-weight: 700; }
.student-actions { display: flex; align-items: center; gap: 6px; }
.danger-action { color: var(--red); background: var(--red-pale); }
.danger-action:hover { background: #f7d9dc; }
.positive-action { color: var(--green-700); background: var(--green-100); }
.positive-record { color: var(--green-700) !important; font-weight: 700; }
.teacher-message-card > div { width: 100%; }
.message-thread { display: grid; gap: 8px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.message-thread > b { font-size: 12px; }
.message-reply { max-width: 82%; padding: 9px 11px; border-radius: 10px 10px 10px 3px; background: #fff; box-shadow: 0 2px 8px rgba(23,35,58,.06); }
.message-reply.mine { justify-self: end; border-radius: 10px 10px 3px 10px; background: var(--green-100); }
.message-reply span { display: block; color: var(--green-700); font-size: 10px; font-weight: 800; }
.message-reply p { margin: 3px 0; color: var(--ink); font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.message-reply small, .thread-empty, .thread-closed { color: var(--muted); font-size: 10px; }
.teacher-reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.teacher-reply-form label { margin: 0; }
.teacher-reply-form label > span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.teacher-reply-form textarea { min-height: 58px; }
.student-form-actions { gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.paid, .status.present, .status.active { color: var(--green-700); background: var(--green-100); }
.status.pending, .status.late { color: var(--orange-dark); background: var(--orange-pale); }
.status.cancelled { color: #66736f; background: #edf1f0; }
.status.absent { color: var(--red); background: var(--red-pale); }
.grade { font-weight: 800; }
.grade.good { color: var(--green-700); }
.grade.attention { color: var(--orange-dark); }

.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box svg { position: absolute; top: 50%; left: 11px; width: 15px; color: #97a1af; transform: translateY(-50%); }
.search-box input, .filter-bar select { height: 38px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink-soft); background: #fff; font-size: 11px; }
.search-box input { width: 100%; padding: 0 12px 0 34px; }
.filter-bar select { padding: 0 25px 0 10px; }

.clock-layout { display: grid; grid-template-columns: minmax(310px, .85fr) minmax(0, 1.15fr); gap: 17px; }
.clock-card { position: relative; padding: 29px; overflow: hidden; border-radius: 17px; color: #fff; background: linear-gradient(145deg, var(--green-800), var(--green-950)); }
.clock-card::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 36px rgba(255,255,255,.02); }
.clock-card > * { position: relative; z-index: 1; }
.clock-card > span { color: #fac079; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.live-clock { margin: 11px 0 2px; font: 800 44px/1 "Manrope", sans-serif; letter-spacing: -.06em; }
.clock-date { color: rgba(255,255,255,.5); font-size: 12px; }
.clock-status { display: flex; align-items: center; gap: 6px; margin-top: 23px; color: rgba(255,255,255,.67); font-size: 11px; }
.clock-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(244,163,64,.1); }
.clock-button { display: flex; width: 100%; height: 43px; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; border: 0; border-radius: 10px; color: var(--green-950); background: var(--orange); font-size: 12px; font-weight: 800; cursor: pointer; }
.clock-button svg { width: 17px; }
.clock-button:disabled { cursor: default; opacity: .72; }
.point-photo-button { white-space: nowrap; }
.camera-modal { position: relative; width: min(100%, 520px); padding: 24px; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(5,31,21,.3); }
.camera-heading { display: flex; align-items: center; gap: 12px; padding-right: 35px; }
.camera-heading .camera-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #fff; background: var(--green-700); font-size: 20px; }
.camera-heading small { color: var(--green-700); font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.camera-heading h2 { margin: 3px 0 0; color: var(--ink); font: 800 20px/1.2 "Manrope", sans-serif; }
.camera-help { margin: 13px 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.camera-frame { position: relative; display: grid; min-height: 280px; overflow: hidden; place-items: center; border-radius: 14px; background: #10251d; }
.camera-frame video, .camera-frame img { display: block; width: 100%; max-height: 55vh; object-fit: cover; aspect-ratio: 4 / 3; }
.camera-frame video { transform: scaleX(-1); }
.camera-frame > span { position: absolute; color: rgba(255,255,255,.8); font-size: 16px; }
.camera-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.camera-actions button { flex: 1; }
.photo-viewer > img { display: block; width: 100%; max-height: 62vh; margin-top: 17px; border-radius: 14px; background: #10251d; object-fit: contain; }
.timeline { display: grid; gap: 13px; }
.timeline-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.timeline-row > i { position: relative; width: 9px; height: 9px; margin-left: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--green-700); box-shadow: 0 0 0 1px #bad4c8; }
.timeline-row > i::after { content: ""; position: absolute; top: 10px; left: 2px; width: 1px; height: 22px; background: #dfe8e3; }
.timeline-row:last-child > i::after { display: none; }
.timeline-row p { display: flex; margin: 0; flex-direction: column; }
.timeline-row b { font-size: 12px; }
.timeline-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.timeline-row > span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.class-list { display: grid; gap: 8px; }
.class-row { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; border: 1px solid #edf0f3; border-radius: 10px; }
.class-time { padding: 7px; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-size: 11px; font-weight: 800; text-align: center; }
.class-row p { display: flex; margin: 0; flex-direction: column; }
.class-row b { font-size: 12px; }
.class-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.class-room { color: var(--muted); font-size: 10px; }

.form-panel { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.input-group { min-width: 0; }
.input-group.full { grid-column: 1 / -1; }
.input-group label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.input-group label em { color: var(--orange-dark); font-style: normal; }
.input-group input, .input-group select, .input-group textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fbfcfd; font-size: 12px; transition: .18s ease; }
.input-group input, .input-group select { height: 40px; padding: 0 11px; }
.input-group textarea { min-height: 82px; padding: 10px 11px; resize: vertical; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: #81ad9b; background: #fff; box-shadow: 0 0 0 3px rgba(28,105,77,.07); }
.file-drop { position: relative; display: flex; min-height: 93px; align-items: center; justify-content: center; flex-direction: column; border: 1px dashed #afc6bc; border-radius: 11px; color: var(--green-700); background: var(--green-50); text-align: center; cursor: pointer; }
.file-drop svg { width: 21px; margin-bottom: 5px; }
.file-drop b { font-size: 12px; }
.file-drop small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.form-submit { display: flex; justify-content: flex-end; margin-top: 17px; }
.form-message { margin: 10px 0 0; color: var(--red); font-size: 11px; }

.record-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.record-tabs { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #f4f6f7; }
.record-tabs button { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.record-tabs button svg { width: 14px; }
.record-tabs button.active { color: var(--green-700); background: #fff; box-shadow: 0 3px 10px rgba(30,50,44,.08); }
.record-saved { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.record-saved i { width: 6px; height: 6px; border-radius: 50%; background: var(--green-700); }
.record-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfb; }
.record-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.record-list-head, .record-student { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(120px, .8fr) minmax(130px, .7fr); align-items: center; gap: 12px; padding: 11px 15px; }
.record-list-head { color: var(--muted); background: #f7f9fa; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.record-student { border-top: 1px solid #edf0f2; background: #fff; }
.student-cell { display: flex; min-width: 0; align-items: center; gap: 10px; }
.student-mini-avatar { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #fff; background: var(--purple); font-size: 11px; font-weight: 800; }
.student-cell p { display: flex; min-width: 0; margin: 0; flex-direction: column; }
.student-cell b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.student-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.grade-input-wrap { display: flex; align-items: center; gap: 6px; }
.grade-input { width: 68px; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fbfcfd; font-size: 12px; font-weight: 700; }
.grade-input:focus { border-color: #80ad99; box-shadow: 0 0 0 3px rgba(28,105,77,.07); }
.grade-input-wrap small { color: var(--muted); font-size: 10px; }
.attendance-toggle { display: inline-flex; gap: 5px; }
.attendance-toggle label { position: relative; cursor: pointer; }
.attendance-toggle input { position: absolute; opacity: 0; }
.attendance-toggle span { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 10px; font-weight: 700; transition: .15s ease; }
.attendance-toggle input[value="present"]:checked + span { border-color: #a9d9c4; color: var(--green-700); background: var(--green-100); }
.attendance-toggle input[value="absent"]:checked + span { border-color: #efbdc2; color: var(--red); background: var(--red-pale); }
.record-summary { display: flex; align-items: center; gap: 15px; margin-top: 15px; color: var(--muted); font-size: 11px; }
.record-summary span { display: inline-flex; align-items: center; gap: 5px; }
.record-summary b { color: var(--ink); }
.record-summary .primary-button { margin-left: auto; }
.record-summary .print-button { margin-left: auto; }
.record-summary .print-button + .primary-button { margin-left: 0; }
.frequency-panel { margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfa; }
.frequency-panel .panel-head { margin-bottom: 12px; }

.stat-icon.red { color: var(--red); background: var(--red-pale); }
.dre-filter-panel { margin-bottom: 17px; }
.dre-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dre-stats { margin-top: 17px; }
.dre-layout { display: grid; gap: 17px; margin-top: 17px; }
.dre-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dre-form-grid .full { grid-column: span 2; }
.dre-kind { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.dre-kind.revenue { color: var(--green-700); background: var(--green-100); }
.dre-kind.expense { color: var(--red); background: var(--red-pale); }
.dre-positive { color: var(--green-700) !important; }
.dre-negative { color: var(--red) !important; }
.table-note { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.table-actions { display: flex; gap: 6px; }
.table-action.danger { color: var(--red); background: var(--red-pale); }

.report-grid { display: grid; gap: 17px; }
.report-panel { padding: 22px; }
.report-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.report-panel-head > span { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--green-700); background: var(--green-100); }
.report-panel-head svg { width: 21px; }
.report-panel-head h3 { margin: 0 0 3px; 700 16px/1.25 "Manrope", sans-serif; }
.report-panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.report-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-actions { display: flex; justify-content: flex-end; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }

.modal-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; padding: 20px; place-items: center; background: rgba(7,25,19,.7); opacity: 0; pointer-events: none; backdrop-filter: blur(6px); transition: opacity .22s ease; }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.invoice-modal { position: relative; width: min(480px, 100%); padding: 28px; border-radius: 19px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25); transform: translateY(12px); transition: transform .22s ease; }
.modal-backdrop.show .invoice-modal { transform: translateY(0); }
.modal-close { position: absolute; top: 14px; right: 14px; display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: #f1f4f5; cursor: pointer; }
.modal-close svg { width: 15px; }
.invoice-heading { display: flex; align-items: center; gap: 11px; }
.invoice-heading > span { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 12px; color: var(--green-700); background: var(--green-100); }
.invoice-heading svg { width: 21px; }
.invoice-heading div { display: flex; flex-direction: column; }
.invoice-heading small { color: var(--green-700); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.invoice-heading h2 { margin: 3px 0 0; font: 700 18px/1.2 "Manrope", sans-serif; }
.invoice-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfb; }
.invoice-details div { display: flex; flex-direction: column; }
.invoice-details small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.invoice-details b { margin-top: 3px; font-size: 13px; }
.barcode { display: flex; height: 47px; align-items: stretch; justify-content: center; gap: 3px; padding: 4px 10px; overflow: hidden; }
.barcode i, .barcode b, .barcode span { display: block; background: var(--ink); }
.barcode i { width: 2px; }
.barcode b { width: 5px; }
.barcode span { width: 3px; }
.barcode-number { margin: 7px 0 20px; color: var(--muted); 500 11px/1.4 monospace; text-align: center; word-break: break-all; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.modal-demo-note { display: block; margin-top: 13px; color: #9da5b0; font-size: 10px; text-align: center; }
.toast { position: fixed; z-index: 80; right: 23px; bottom: 23px; display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-radius: 10px; color: #fff; background: var(--green-950); box-shadow: 0 14px 35px rgba(11,44,33,.24); font-size: 12px; font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; color: #7ed2ae; stroke-width: 2.3; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(28,105,77,.2); outline-offset: 2px; }
[hidden] { display: none !important; }

.kids-hero { position: relative; display: flex; min-height: 170px; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 28px 32px; overflow: hidden; border-radius: 22px; color: #fff; background: linear-gradient(125deg, var(--brand-blue), #087baa 58%, var(--brand-teal)); box-shadow: 0 18px 45px rgba(11,85,159,.18); }
.kids-hero::before { content: ""; position: absolute; right: -55px; bottom: -100px; width: 270px; height: 270px; border: 2px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.05), 0 0 0 68px rgba(255,255,255,.035); }
.kids-hero > div:first-child { position: relative; z-index: 1; }
.kids-hero span { color: #ffe0ad; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.kids-hero h3 { margin: 8px 0 6px; font: 800 28px/1.15 "Manrope", sans-serif; letter-spacing: -.04em; }
.kids-hero p { max-width: 590px; margin: 0; color: rgba(255,255,255,.76); font-size: 14px; line-height: 1.55; }
.kids-hero-art { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 48px); gap: 8px; transform: rotate(-4deg); }
.kids-hero-art b, .kids-hero-art i { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid rgba(255,255,255,.28); border-radius: 15px; color: #fff; background: rgba(255,255,255,.15); font: 800 20px/1 "Manrope", sans-serif; font-style: normal; backdrop-filter: blur(8px); }
.kids-hero-art i { grid-column: 2; color: #ffd17b; background: rgba(255,132,22,.3); }
.kids-game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 17px; }
.game-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 32px rgba(18,52,91,.06); }
.game-card-head { display: flex; align-items: center; gap: 12px; }
.game-emoji { display: grid; flex: 0 0 auto; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--blue-pale); font-size: 25px; }
.math-game .game-emoji { background: var(--green-100); }
.word-game .game-emoji { background: var(--orange-pale); }
.game-card-head > div { min-width: 0; }
.game-card-head small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.game-card-head h3 { margin: 2px 0 2px; font: 800 17px/1.2 "Manrope", sans-serif; letter-spacing: -.025em; }
.game-card-head p { margin: 0; color: var(--muted); font-size: 11px; }
.game-score { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 13px; padding: 9px 11px; border-radius: 10px; color: var(--ink-soft); background: #f5f8fb; font-size: 11px; }
.game-score b { color: var(--brand-blue); }
.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.memory-card { display: grid; aspect-ratio: 1; min-width: 0; place-items: center; border: 0; border-radius: 12px; color: rgba(255,255,255,.9); background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-deep)); box-shadow: 0 5px 12px rgba(11,85,159,.18); font-size: 18px; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.memory-card:hover { transform: translateY(-2px); }
.memory-card.flipped { color: var(--ink); background: var(--blue-pale); transform: rotateY(180deg); }
.memory-card.flipped span { transform: rotateY(180deg); }
.memory-card.matched { color: #fff; background: linear-gradient(145deg, var(--brand-teal), var(--brand-teal-deep)); box-shadow: none; }
.math-question, .scrambled-word { display: grid; min-height: 76px; margin: 12px 0; place-items: center; border: 2px dashed #badfd4; border-radius: 16px; color: var(--brand-blue-deep); background: var(--green-50); font: 800 27px/1 "Manrope", sans-serif; }
.scrambled-word { min-height: 66px; border-color: #ffd2a8; color: var(--orange-dark); background: #fff9f2; font-size: 19px; letter-spacing: .05em; }
.word-hint { display: block; min-height: 31px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.answer-grid button { min-height: 44px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.answer-grid button:hover { border-color: var(--brand-teal); background: var(--green-50); transform: translateY(-1px); }
.answer-grid button.correct { border-color: var(--brand-teal); color: #fff; background: var(--brand-teal); }
.answer-grid button.wrong { border-color: #e07b86; color: #fff; background: #d0505d; }
.word-answers { grid-template-columns: 1fr; }
.game-feedback { min-height: 34px; margin: 12px 0 4px; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
.kids-button { width: 100%; min-height: 42px; margin-top: 9px; border: 0; border-radius: 11px; color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.kids-button:hover { filter: brightness(.95); transform: translateY(-1px); }
.kids-button.blue { background: var(--brand-blue); }
.kids-button.green { background: var(--brand-teal-deep); }
.kids-button.orange { background: var(--orange); }

@media (max-width: 1020px) {
  .login-screen { grid-template-columns: 1fr 1fr; }
  .login-brand-panel { padding: 36px; }
  .family-card-one { right: 38px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .clock-layout { grid-template-columns: 1fr; }
  .kids-game-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  html, body { width: 100%; overflow-x: hidden; }
  .login-screen { display: block; min-height: 100vh; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; padding: 27px 22px; place-items: start center; }
  .mobile-brand { display: inline-flex; margin: 7px 0 55px; align-self: start; justify-self: start; }
  .login-box { align-self: center; }
  .login-role-tabs { gap: 6px; }
  .login-role-tabs button { min-height: 67px; }
  .form-field > span { font-size: 16px; }
  .form-field input { height: 50px; font-size: 16px; }
  .login-box > p, .demo-note { font-size: 15px; line-height: 1.5; }
  .login-options, .login-options button { font-size: 15px; }
  .login-button { height: 50px; font-size: 16px; }
  .portal-app { display: block; }
  .portal-sidebar { transform: translateX(-105%); transition: transform .25s ease; }
  .portal-sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 24; inset: 0; display: block; background: rgba(9,25,19,.55); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .portal-main { width: 100%; }
  .portal-topbar { height: 69px; padding: 0 16px; }
  .menu-button { display: grid; width: 35px; height: 35px; margin-right: 11px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; }
  .menu-button svg { width: 17px; }
  .page-title span { display: none; }
  .page-title h1 { font-size: 17px; }
  .role-switcher { display: none; }
  .sync-status { width: 35px; padding: 0; justify-content: center; }
  .sync-status > span { display: none; }
  .portal-content { width: 100%; max-width: 100%; padding: 18px 12px 40px; overflow-x: hidden; }
  .welcome-banner { align-items: flex-start; flex-direction: column; padding: 24px; }
  .student-switch { width: 100%; min-width: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { gap: 9px; padding: 13px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-card b { font-size: 16px; }
  .activity-row { grid-template-columns: 39px minmax(0, 1fr); }
  .activity-row .date-tag { grid-column: 2; justify-self: start; align-items: flex-start; min-width: 0; flex-direction: row; gap: 3px; padding: 4px 7px; }
  .activity-row-tools { align-items: flex-start; flex-direction: column; }
  .activity-row-tools .activity-file { max-width: 100%; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .page-intro-actions, .page-intro-actions .print-button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .input-group.full { grid-column: auto; }
  .form-panel, .panel { width: 100%; max-width: 100%; }
  .input-group label { font-size: 16px; }
  .input-group input, .input-group select, .input-group textarea { font-size: 16px; }
  .input-group input, .input-group select { min-height: 46px; }
  .input-group textarea { min-height: 110px; }
  .primary-button, .outline-button, .soft-button { min-height: 44px; padding: 0 15px; font-size: 16px; }
  .camera-modal { padding: 20px 16px; }
  .camera-frame { min-height: 220px; }
  .camera-actions { flex-direction: column; }
  .form-submit { align-items: stretch; flex-direction: column; gap: 8px; }
  .form-submit > button { width: 100%; }
  .panel-head h3, .report-panel-head h3 { font-size: 16px; }
  .panel-head p, .report-panel-head p, .page-intro p { font-size: 16px; line-height: 1.45; }
  .page-intro h2 { font-size: 22px; }
  .activity-row b { font-size: 16px; white-space: normal; }
  .activity-row small { font-size: 15px; line-height: 1.4; }
  .message-reply { max-width: 94%; }
  .message-reply span, .message-reply small, .thread-empty, .thread-closed { font-size: 15px; }
  .message-reply p { font-size: 16px; }
  .teacher-reply-form { grid-template-columns: 1fr; }
  .teacher-reply-form label > span { font-size: 16px; }
  .table-action, .status { min-height: 34px; padding: 7px 10px; font-size: 15px; }
  .empty-state, .loading-state { font-size: 16px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-box { max-width: none; }
  .filter-bar select { width: 100%; }
  .data-table { min-width: 650px; }
  .invoice-modal { padding: 24px 18px; }
  .record-toolbar { align-items: flex-start; flex-direction: column; }
  .record-controls { grid-template-columns: 1fr; }
  .report-filter-grid { grid-template-columns: 1fr 1fr; }
  .dre-filter-grid { grid-template-columns: 1fr; }
  .dre-form-grid { grid-template-columns: 1fr; }
  .dre-form-grid .full { grid-column: auto; }
  .dre-filter-panel .panel-head { align-items: stretch; flex-direction: column; }
  .dre-filter-panel .print-button { width: 100%; }
  .access-grid { grid-template-columns: 1fr; }
  .record-list { overflow-x: auto; }
  .record-list-head, .record-student { width: 650px; }
  .record-summary { align-items: flex-start; flex-wrap: wrap; }
  .record-summary .primary-button { width: 100%; margin-left: 0; }
  .record-summary .print-button { width: 100%; margin-left: 0; }
  .toast { right: 14px; bottom: 14px; left: 14px; justify-content: center; }
  .kids-hero { min-height: 0; padding: 24px; }
  .kids-hero h3 { font-size: 24px; }
  .kids-hero p { font-size: 15px; }
  .kids-hero-art { display: none; }
  .kids-game-grid { grid-template-columns: 1fr; }
  .game-card { padding: 18px; }
  .game-card-head p, .game-score, .word-hint, .game-feedback { font-size: 14px; }
  .kids-button, .answer-grid button { min-height: 48px; font-size: 16px; }
}

@media (max-width: 430px) {
  .mobile-brand { margin-bottom: 42px; }
  .stats-grid { grid-template-columns: 1fr; }
  .login-box h2 { font-size: 27px; }
  .login-role-tabs button span { font-size: 11px; }
  .topbar-actions { gap: 7px; }
  .top-avatar { display: none; }
  .panel { padding: 17px; }
  .portal-topbar { padding: 0 10px; }
  .page-title { min-width: 0; }
  .page-title h1 { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .icon-button, .sync-status { flex: 0 0 35px; }
  .welcome-banner { padding: 20px 17px; }
  .welcome-copy h2 { font-size: 24px; }
  .welcome-copy p { font-size: 16px; line-height: 1.5; }
  .invoice-details { grid-template-columns: 1fr; }
  .report-filter-grid { grid-template-columns: 1fr; }
  .report-actions .print-button { width: 100%; }
  .modal-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.admission-callout { margin: 24px 0 16px; padding: 20px; border: 1px solid #d9e6ef; border-radius: 16px; background: #f2f8fc; color: var(--ink); }
.admission-callout strong { display: block; font-size: 17px; }
.admission-callout p { margin: 8px 0 15px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.admission-callout a { display: flex; align-items: center; justify-content: center; height: auto; min-height: 46px; padding: 12px; text-decoration: none; text-align: center; }
.public-admission-screen { min-height: 100vh; padding: 32px 20px 60px; background: #f3f7fb; }
.public-admission-wrap { width: 100%; max-width: 860px; margin: auto; }
.public-admission-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 34px; }
.public-admission-header img { width: 140px; max-width: 50%; height: auto; }
.admission-intro { color: var(--ink-soft); line-height: 1.6; margin: 0 0 20px; }
.admission-consent { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; line-height: 1.6; }
.admission-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 3px; }
.admission-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.admission-success p, .admission-request p { line-height: 1.65; overflow-wrap: anywhere; }
.admission-success a, .admission-request a { display: inline-flex; align-items: center; padding: 12px 16px; height: auto; text-decoration: none; }
.admission-request { margin-top: 18px; }
@media (max-width: 760px) {
  .public-admission-screen { padding: 22px 12px 40px; }
  .public-admission-header { gap: 10px; margin-bottom: 24px; }
  .public-admission-header img { width: 115px; }
  .public-admission-header button { font-size: 14px; padding: 0 10px; }
  .public-admission-screen .form-panel { padding: 20px 16px; }
}
