:root { --p: #F96501; --pd: #C94F00; --ink: #222326; --text: #4A4B4E; --muted: #7C7D82; --line: #EDEAE7; --bg: #F6F5F3; --side: #2E2F31; }
* { box-sizing: border-box; }
body { margin: 0; font: 14.5px/1.6 "Poppins", system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--p); text-decoration: none; }
h1, h2, h3 { color: var(--ink); margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.right { text-align: right; }
img { max-width: 100%; }

.side { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--side); color: #D6D6D8; display: flex; flex-direction: column; padding: 18px 12px; z-index: 20; transition: transform .25s; }
.side-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 1.05rem; padding: 4px 8px 20px; }
.side-brand .logo { width: 36px; height: 36px; object-fit: contain; }
.side-brand b { color: #FFB27A; }
.side nav { display: grid; gap: 2px; flex: 1; overflow-y: auto; align-content: start; }
.side a, .side button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #D6D6D8; font: inherit; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.side a:hover, .side button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side a.on { background: var(--p); color: #fff; }
.side-group { margin: 14px 12px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8d8e93; }
.side-foot small { display: block; font-size: .7rem; color: #a5a6aa; }
.side em { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 700; background: #47484A; color: #fff; padding: 1px 8px; border-radius: 99px; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 10px; display: grid; gap: 2px; }
.side-foot form { margin: 0; }

.main { margin-left: 240px; min-height: 100vh; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top h1 { font-size: 1.25rem; margin: 0; }
.burger { display: none; background: var(--bg); border: 0; border-radius: 10px; width: 40px; height: 40px; color: var(--p); cursor: pointer; place-items: center; }
.content { padding: 26px 28px 60px; max-width: 1240px; }

.box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 20px; }
.box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.cols.wide { grid-template-columns: 1.6fr 1fr; }
/* Grid children may shrink below their content (wide tables scroll inside .table-wrap instead of widening the page). */
.cols > *, .row2 > *, .row3 > *, .minis > *, .stats > * { min-width: 0; }
.box { overflow-wrap: break-word; }
.toolbar select { max-width: 100%; }
.actions > * { max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; color: var(--text); container-type: inline-size; }
.stat .ic { grid-row: span 2; width: 46px; height: 46px; padding: 11px; border-radius: 14px; color: #fff; }
.stat b { font-size: clamp(.95rem, 9cqi, 1.6rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--ink); line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }
.s1 .ic { background: var(--p); } .s2 .ic { background: #47484A; } .s3 .ic { background: #E89400; } .s4 .ic { background: #E2502A; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr[onclick] { cursor: pointer; }
.table tbody tr:hover { background: #FFF8F2; }
.table td small { display: block; color: var(--muted); font-size: .75rem; }
.table .thumb { width: 64px; }
.table .thumb img { width: 56px; height: 40px; object-fit: cover; border-radius: 8px; display: block; }
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: #eee; color: #444; }
.st-new { background: #FFE7D4; color: #C94F00; } .st-contacted { background: #e3efff; color: #1f5fc7; } .st-test { background: #fff2dc; color: #a35b00; }
.st-admitted { background: #dcf7ea; color: #0d7a50; } .st-waitlist { background: #f1eff5; color: #5d5670; } .st-declined { background: #ffe4ea; color: #a3123a; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.mini li span { grid-column: 1; color: var(--muted); }
.mini li small { grid-column: 2; grid-row: 1; color: var(--muted); }
.mini li.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; background: #47484A; border-radius: 50%; margin-right: 6px; }
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; color: var(--ink); }
.msg.unread { border-left: 4px solid #47484A; }
.msg-body { margin: 10px 0 0; color: var(--ink); }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 .88rem/1.2 inherit; font-family: inherit; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--p); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--pd); color: #fff; }
.btn-light { background: #FFEBDC; color: var(--pd); }
.btn-light:hover { background: #FFDCC2; color: var(--pd); }
.btn-danger { background: #fff0f3; color: #b0153f; }
.btn-danger:hover { background: #ffd9e2; color: #8d0f31; }
.btn-sm { padding: 7px 12px; font-size: .8rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input[type=search] { flex: 1; min-width: 220px; }

input, select, textarea { font: inherit; color: var(--ink); background: #FCFAF8; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #FF9A4D; box-shadow: 0 0 0 3px rgba(255, 154, 77, .2); background: #fff; }
input[type=file] { padding: 8px; background: #fff; }
input[type=checkbox] { width: auto; accent-color: var(--p); }
.toolbar select, .toolbar input:not([type=search]) { width: auto; }
.toolbar { align-items: center; }
.lbl { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.lbl small { font-weight: 400; color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; margin: 4px 12px 14px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.current-img { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.current-img img { width: 160px; border-radius: 10px; }

.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 16px; }
.gitem { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.gitem img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.gitem input { padding: 7px 10px; font-size: .84rem; }
.gi-row { display: grid; grid-template-columns: 1fr 70px; gap: 8px; }
.gi-row:last-child { grid-template-columns: 1fr 1fr; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 18px; }
.slot { margin: 0; display: flex; flex-direction: column; }
.slot-img { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 14px; aspect-ratio: 16 / 10; background: #FFEBDC; }
.slot-img img { width: 100%; height: 100%; object-fit: cover; }
.slot-img.contain img { object-fit: contain; padding: 10px; }
.slot-tag { position: absolute; left: 10px; bottom: 10px; font-size: .72rem; font-weight: 600; color: #fff; background: rgba(30, 31, 33, .72); padding: 3px 9px; border-radius: 99px; }
.slot p { font-size: .84rem; flex: 1; }
.slot input[type=file] { margin-bottom: 10px; }

/* placeholder panel (shared with the public site) */
.ph { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.ph svg { width: 50%; }
.ph span { position: absolute; right: 10px; bottom: 6px; font-weight: 800; font-size: .7rem; letter-spacing: .12em; color: rgba(255, 255, 255, .85); }
.ph .ph-a { fill: rgba(255, 255, 255, .85); } .ph .ph-b { fill: rgba(255, 255, 255, .45); } .ph .ph-c { fill: rgba(255, 255, 255, .6); }
.ph-grape { background: linear-gradient(135deg, #FFA05A, #E85A00); } .ph-berry { background: linear-gradient(135deg, #7a7b80, #47484A); }
.ph-sky { background: linear-gradient(135deg, #FFD066, #F29A00); } .ph-sun { background: linear-gradient(135deg, #FFB36B, #F2541B); }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-size: .9rem; }
.alert-error { background: #fff0f3; border-color: #ffc9d6; color: #a3123a; }
.alert-success { background: #ecfbf4; border-color: #b5ecd2; color: #0d7a50; }
.alert-info { background: #F3F8FF; border-color: #D6E6FB; color: #2c4f7c; }
.alert-info .ic { width: 18px; height: 18px; vertical-align: -4px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #FFF1E5 0%, #FFE3CC 45%, #EEEEEF 100%); }
.login { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 32px; box-shadow: 0 30px 60px -30px rgba(45, 30, 20, .5); display: grid; gap: 14px; }
.login label { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--ink); }
.login .btn { justify-content: center; padding: 12px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand .logo { width: 48px; height: 48px; object-fit: contain; }
.login-brand b { display: block; color: var(--ink); }
.login-brand span { font-size: .82rem; color: var(--muted); }
.back { text-align: center; font-size: .85rem; }

/* ---------- school management ---------- */
.c { text-align: center; } .r { text-align: right; } .nowrap { white-space: nowrap; } .small { font-size: .8rem; } .center { text-align: center; }
.table th.c, .table td.c { text-align: center; } .table th.r, .table td.r { text-align: right; }
.table th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; }
.table tr.row-on td { background: #FFF4EA; }
.table input, .table select { padding: 7px 9px; font-size: .86rem; }
.cols.even { grid-template-columns: 1fr 1fr; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .85rem; color: var(--text); }
.tabs a:hover { border-color: var(--p); color: var(--p); }
.hello { background: linear-gradient(120deg, #FFF1E5, #fff 70%); border-color: #FFE0C7; }
.avatar-cell { width: 46px; }
.avatar-cell img, .avatar-cell span { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #FFE7D4; color: var(--pd); font-weight: 700; }
.profile { display: flex; gap: 18px; align-items: center; }
.profile-photo { width: 84px; height: 84px; flex: none; border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, #FF8A2A, #E85A00); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.6rem; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo.sm { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.minis div { background: #FFF4EA; border-radius: 12px; padding: 12px; text-align: center; }
.minis b { display: block; font-size: 1.4rem; color: var(--ink); }
.minis span { font-size: .78rem; color: var(--muted); }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.linklist a { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.guardian { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #FCFAF8; }
.add-more summary { cursor: pointer; font-weight: 600; color: var(--p); display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.add-more form { margin-top: 12px; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 4px; }
.class-card h2 { margin-bottom: 2px; }
.child-card { display: flex; gap: 16px; align-items: center; color: var(--text); transition: box-shadow .2s, transform .2s; }
.child-card:hover { box-shadow: 0 16px 30px -18px rgba(80, 45, 15, .45); transform: translateY(-2px); color: var(--text); }
.child-card h2 { margin-bottom: 0; }
.child-card p { margin: 0 0 8px; }
.reg .mark { display: inline-block; cursor: pointer; }
.reg .mark input { position: absolute; opacity: 0; pointer-events: none; }
.reg .mark span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; color: var(--muted); transition: .15s; }
.reg .mark input:focus-visible + span { outline: 3px solid #FF9A4D; }
.reg .mark-ok input:checked + span { background: #18a46b; border-color: #18a46b; color: #fff; }
.reg .mark-warn input:checked + span { background: #E89400; border-color: #E89400; color: #fff; }
.reg .mark-bad input:checked + span { background: #c8264b; border-color: #c8264b; color: #fff; }
.scores input.score { width: 76px; text-align: center; }
.scores input.bad { border-color: #c8264b; background: #fff0f3; }
.sheet th.vert { height: 130px; vertical-align: bottom; padding: 6px 4px; }
.sheet th.vert span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .72rem; }
.sheet td { padding: 7px 6px; }
.remark-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.remark-row b { display: block; margin-bottom: 6px; color: var(--ink); }
.remark-row .row2 { gap: 10px; }
.note { margin-top: 16px; background: #FFF4EA; border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
code { background: #FFF1E5; padding: 2px 6px; border-radius: 6px; font-size: .92em; }

/* online payment */
.sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sumrow.total { border-top: 1px dashed #FFC9A0; margin-top: 6px; padding-top: 10px; font-size: 1.05rem; color: var(--ink); }
input.bad { border-color: #c8264b; background: #fff0f3; }
b.bad { color: #b0153f; }
.pay-result { max-width: 560px; margin: 20px auto; text-align: center; padding: 36px 26px; }
.pr-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pr-icon .ic { width: 40px; height: 40px; }
.pr-success { background: linear-gradient(135deg, #2fbf86, #10966a); }
.pr-pending { background: linear-gradient(135deg, #FFC233, #E89400); }
.pr-failed, .pr-unknown { background: linear-gradient(135deg, #9a9ca1, #5f6064); }
.pr-amt { font-size: 1.8rem; font-weight: 700; color: var(--ink); margin: 6px 0; }

/* roles, library, exams */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.role-card { margin: 0; }
.perm-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.perm-list li { font-size: .78rem; background: #FFF1E5; color: var(--pd); padding: 3px 10px; border-radius: 99px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 6px 26px; }
.perm-groups h3 { margin: 14px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chk.perm { display: flex; align-items: flex-start; margin: 0 0 8px; }
.chk.perm input { margin-top: 4px; }
.tabs a.on { background: var(--p); color: #fff; border-color: var(--p); }
.table tr.row-late td { background: #fff6f7; }
.return-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.return-form .chk { margin: 0; }
.class-picks { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: -6px 0 12px; }
.class-picks .chk { margin: 0; }
.day-head { margin: 18px 0 6px; font-size: .9rem; color: var(--p); }
.day-head:first-of-type { margin-top: 4px; }

/* CBT */
.qlist { margin: 0; padding-left: 22px; }
.qlist li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.qlist li small { display: block; color: var(--muted); font-size: .78rem; }
.qlist li.retired { opacity: .55; }
.optrow { display: grid; grid-template-columns: 28px 18px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.optrow .chk { margin: 0; }
.optrow b { color: var(--muted); }
.qt { margin-bottom: 14px; }
.chk-row { display: flex; flex-wrap: wrap; gap: 0 18px; margin-bottom: 8px; }
.qpick-list { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.qpick { display: flex; align-items: flex-start; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.qpick input { margin-top: 5px; }
.qtopic { margin: 10px 0 2px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--p); }
.bar { height: 8px; background: #F1EEEA; border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.bar i { display: block; height: 100%; background: #18a46b; border-radius: 99px; }
.bar i.mid { background: #E89400; } .bar i.low { background: #c8264b; }

/* timetable */
.tt-card { color: var(--text); }
.tt-card:hover { color: var(--text); box-shadow: 0 16px 30px -18px rgba(80, 45, 15, .45); }
.table.tt th, .table.tt td { vertical-align: top; }
.tt-time { width: 110px; white-space: nowrap; }
.tt-break td { background: #FFF6EE !important; font-weight: 600; color: var(--muted); }
.tt-cell { min-width: 150px; }
.tt-cell select, .tt-cell input { padding: 5px 7px; font-size: .8rem; margin-bottom: 4px; border-radius: 8px; }
.tt-cell.filled { background: #FFF8F2; }
.tt-cell .tt-room { width: 100%; }

/* notifications */
.top .bell { margin-left: auto; position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); background: var(--bg); }
.top .bell:hover, .top .bell.on { color: var(--p); background: #FFEBDC; }
.top .bell .ic { width: 22px; height: 22px; }
.bell em, .pbell em { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: #F96501; color: #fff; font: 700 .68rem/19px Poppins, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
.pbell { position: relative; }
.pbell em { box-shadow: 0 0 0 2px #2E2F31; top: -6px; right: -8px; }
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li { border-bottom: 1px solid var(--line); }
.nlist li:last-child { border-bottom: 0; }
.nlist a { display: grid; gap: 2px; padding: 12px 10px 12px 18px; color: var(--text); border-radius: 10px; position: relative; }
.nlist a:hover { background: #FFF8F2; }
.nlist b { color: var(--ink); font-weight: 500; }
.nlist span { font-size: .88rem; }
.nlist small { font-size: .76rem; color: var(--muted); }
.nlist li.unread b { font-weight: 700; }
.nlist li.unread a::before { content: ""; position: absolute; left: 4px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: #F96501; }
.nlist li.ev-absent.unread a::before { background: #c8264b; }

/* parent portal shell */
.portal { background: #F6F5F3; }
.pbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; background: #2E2F31; color: #fff; position: sticky; top: 0; z-index: 10; }
.pbrand { display: flex; align-items: center; gap: 10px; color: #fff; }
.pbrand .logo { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.pbrand b { display: block; font-size: .98rem; }
.pbrand small { color: #FFB27A; font-size: .75rem; }
.pbar nav { display: flex; gap: 4px; align-items: center; }
.pbar nav a, .pbar nav button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: #e3e3e5; background: none; border: 0; font: inherit; cursor: pointer; }
.pbar nav a:hover, .pbar nav button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pbar nav .psite { border-left: 1px solid rgba(255, 255, 255, .14); border-radius: 0 10px 10px 0; margin-left: 4px; }
.pbar form { margin: 0; }
.pmain { max-width: 1000px; margin: 0 auto; padding: 26px 20px 50px; }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.wide { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { transform: translateX(-100%); box-shadow: 20px 0 50px rgba(0, 0, 0, .3); }
  .side.open { transform: none; }
  .main { margin-left: 0; }
  .burger { display: grid; }
  .top { padding: 12px 16px; }
  .content { padding: 18px 16px 50px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; grid-template-columns: minmax(0, 1fr); }
  .stat .ic { width: 38px; height: 38px; padding: 9px; grid-row: auto; margin-bottom: 8px; }
  .stat b { font-size: clamp(.9rem, 12.5cqi, 1.25rem); }
  .cols.even { grid-template-columns: 1fr; }
  .pbar { padding: 10px 14px; }
  .pbar nav span, .pbrand small { display: none; }
  .pbrand b { font-size: .85rem; }
  .pmain { padding: 18px 14px 40px; }
  .profile { align-items: flex-start; }
  .child-card { align-items: flex-start; }
  .reg .mark span { width: 34px; height: 34px; }
  .btn { white-space: normal; max-width: 100%; }
}

/* family applications (several children on one admission form) */
.fam { list-style: none; margin: 0; padding: 0; }
.fam li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.fam li + li { margin-top: 4px; }
.fam li.on { background: #FFF4EA; }
.fam li small { grid-column: 1; color: var(--muted); }
.fam li .pill { grid-column: 2; grid-row: 1 / span 2; }
.fam-tag { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 600; color: var(--p); background: #FFF0E3; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* ---------- Pages editor ---------- */
.enter-saves { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pages-table td code { background: #F6F3F0; padding: 2px 7px; border-radius: 6px; }
.pages-table .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--p); }
.nowrap { white-space: nowrap; }
.slug-row { display: flex; align-items: center; gap: 4px; }
.slug-row .muted { white-space: nowrap; font-weight: 400; font-size: .85rem; }
.slug-row input[readonly] { background: #F2F0EE; color: var(--muted); }
details.more { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--p); margin-bottom: 10px; }
.merge-help { margin: -6px 2px 16px; line-height: 2; }
.merge-help code { background: #FFF1E5; color: #A84300; padding: 1px 6px; border-radius: 6px; font-size: .78rem; cursor: help; }
.sec-card { padding: 0; overflow: hidden; scroll-margin-top: 90px; }
.sec-card.is-hidden { opacity: .7; border-style: dashed; }
.sec-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #FBF8F5; border-bottom: 1px solid var(--line); }
.sec-card.closed .sec-card-head { border-bottom: 0; }
.sec-card.closed .sec-body { display: none; }
.sec-card.closed .sec-toggle .ic { transform: rotate(-90deg); }
.sec-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #FFEBDC; color: var(--p); }
.sec-title { flex: 1; min-width: 0; }
.sec-title small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sec-tools button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; display: grid; place-items: center; font: inherit; font-weight: 700; padding: 0; }
.sec-tools button:hover:not(:disabled) { border-color: #FF9A4D; color: var(--p); }
.sec-tools button:disabled { opacity: .35; cursor: default; }
.sec-tools button.danger:hover { color: #c8264b; border-color: #f0a5b7; }
.sec-tools .ic { width: 16px; height: 16px; }
.sec-body { padding: 18px; }
.widget-note { background: #F3F8FF; border: 1px solid #D6E6FB; color: #2c4f7c; border-radius: 10px; padding: 8px 12px; font-size: .85rem; margin: 0 0 14px; }
.widget-note .ic { width: 16px; height: 16px; vertical-align: -3px; }
.lbl > span { display: block; }
.lbl > .slug-row, .lbl > .icon-pick { display: flex; }
.rte { border: 1.5px solid var(--line); border-radius: 10px; background: #FCFAF8; overflow: hidden; }
.rte:focus-within { border-color: #FF9A4D; box-shadow: 0 0 0 3px rgba(255, 154, 77, .2); background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line); background: #F7F3EF; }
.rte-bar button { border: 0; background: none; padding: 5px 9px; border-radius: 7px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink); }
.rte-bar button:hover { background: #fff; color: var(--p); }
.rte-area { min-height: 110px; padding: 10px 14px; outline: 0; font-weight: 400; font-size: .92rem; line-height: 1.6; color: var(--ink); max-height: 520px; overflow: auto; }
.rte-area p { margin: 0 0 .7em; }
.rte-area h3 { font-size: 1.05rem; margin: .8em 0 .4em; }
.rte-area ul, .rte-area ol { margin: 0 0 .7em; padding-left: 22px; }
.rte-area a { color: var(--p); text-decoration: underline; }
.icon-pick { display: flex; align-items: center; gap: 8px; }
.icon-prev { flex: none; width: 38px; height: 38px; border-radius: 10px; background: #FFEBDC; color: var(--p); display: grid; place-items: center; }
.icon-prev .ic { width: 20px; height: 20px; }
.up-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-weight: 400; }
.up-cur { position: relative; }
.up-field.image .up-cur { width: 150px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #FFEBDC; display: grid; place-items: center; }
.up-field.image .up-cur img { width: 100%; height: 100%; object-fit: cover; }
.up-field > div:last-child { display: grid; gap: 6px; min-width: 0; flex: 1; }
.list-field > span small { font-weight: 400; color: var(--muted); }
.list-rows { display: grid; gap: 10px; margin: 6px 0 10px; }
.list-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 0; background: #fff; font-weight: 400; }
.list-row-tools { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.list-row-tools button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; font-weight: 700; padding: 0; color: var(--ink); }
.list-row-tools button:hover { color: var(--p); border-color: #FF9A4D; }
.list-row-tools button.danger:hover { color: #c8264b; border-color: #f0a5b7; }
.list-handle { color: #c9c1b9; }
.list-handle .ic { width: 16px; height: 16px; }
.list-row-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 0 14px; min-width: 0; }
.list-row-fields > .lbl:has(textarea), .list-row-fields > .lbl:has(.rte), .list-row-fields > .lbl:has(.up-field) { grid-column: 1 / -1; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.add-type { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: var(--ink); }
.add-type:hover { border-color: #FF9A4D; box-shadow: 0 6px 16px -10px rgba(249, 101, 1, .5); }
.add-type .ic { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: #FFEBDC; color: var(--p); }
.add-type small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; margin-top: 2px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-top: 10px; box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .4); }
.save-bar .btn-danger { margin-right: auto; }
.save-state { color: #B4570F; font-weight: 600; }

/* ---------- School System Guide ---------- */
.guide-intro { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.guide-intro > div { flex: 1; min-width: min(280px, 100%); }
.guide-toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 6px 28px; scroll-margin-top: 90px; }
.guide-toc h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--p); margin: 0 0 6px; }
.guide-toc ol { margin: 0 0 10px; padding-left: 22px; font-size: .9rem; line-height: 1.9; }
.guide-toc a { color: var(--ink); }
.guide-toc a:hover { color: var(--p); }
.guide-part { margin: 30px 2px 14px; }
.guide-part h2 { margin: 0 0 2px; font-size: 1.3rem; }
.guide-part p { margin: 0; }
.guide-ch { scroll-margin-top: 90px; }
.guide-ch > header { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.guide-ch > header h3 { margin: 0; font-size: 1.12rem; }
.guide-no { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--p); color: #fff; font-weight: 700; display: grid; place-items: center; }
.guide-where { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); background: #F6F1EC; border-radius: 7px; padding: 2px 9px; margin-top: 4px; }
.guide-where .ic { width: 13px; height: 13px; }
.guide-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 1200px) { .guide-body { grid-template-columns: minmax(0, 1fr); } }
.guide-text p { margin: 0 0 10px; }
.guide-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.guide-steps li { padding-left: 4px; }
.guide-tip { background: #FFF4EA; border-radius: 10px; padding: 8px 12px; font-size: .88rem; color: #8a4207; }
.guide-tip .ic { width: 15px; height: 15px; vertical-align: -2px; }
.guide-fig { margin: 0; }
.guide-fig img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .45); display: block; }
.guide-fig figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.guide-top { margin: 10px 0 0; text-align: right; font-size: .8rem; }
.guide-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #FFF4EA, #FFFFFF); }
.guide-cta > div { flex: 1; min-width: min(240px, 100%); }
.guide-cta .ic-big { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--p); color: #fff; }
.guide-cta .ic-big .ic { width: 24px; height: 24px; }
.login-alt { display: grid; gap: 6px; text-align: center; border-top: 1px solid var(--line); padding-top: 14px; }
.login-alt .btn { justify-content: center; }
