/* Vidyarise school platform. Colours come from --brand (set per school from its logo). */
@font-face{font-family:"Lexend";font-weight:500;font-display:swap;src:url("../fonts/lexend-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Lexend";font-weight:600;font-display:swap;src:url("../fonts/lexend-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"Lexend";font-weight:700;font-display:swap;src:url("../fonts/lexend-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Noto Sans";font-weight:400;font-display:swap;src:url("../fonts/noto-sans-latin-400-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212}
@font-face{font-family:"Noto Sans";font-weight:400;font-display:swap;src:url("../fonts/noto-sans-latin-ext-400-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+20A0-20C0}
@font-face{font-family:"Noto Sans";font-weight:500;font-display:swap;src:url("../fonts/noto-sans-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Noto Sans";font-weight:600;font-display:swap;src:url("../fonts/noto-sans-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"Noto Sans";font-weight:400;font-display:swap;src:url("../fonts/noto-sans-devanagari-400-normal.woff2") format("woff2");unicode-range:U+0900-097F,U+200C-200D,U+20B9}

:root {
  --brand: #083F7E; --brand-deep: #022B52; --brand-2: #03A6B4; --brand-tint: #EEF5FA; --brand-tint-2: #DCE9F3;
  --ink: #102236; --muted: #55677A; --line: #DCE5EC; --bg: #F4F7FA; --card: #fff;
  --ok: #138A4B; --ok-bg: #E4F6EC; --warn: #8A5A00; --warn-bg: #FFF3D6; --err: #B42318; --err-bg: #FDECE7;
  --flame: #EE6A10;
  --f-head: "Lexend", system-ui, sans-serif; --f-body: "Noto Sans", system-ui, sans-serif;
  --r: 12px; --top: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--f-body); color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid #FDB813; outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
svg { width: 20px; height: 20px; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem var(--f-head); padding: 11px 18px; min-height: 44px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; line-height: 1.15; }
.btn:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand); border-color: var(--brand); }
.btn-danger { background: #fff; color: var(--err); border-color: #F2B8A8; }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: .86rem; }
.btn-sm svg { width: 17px; height: 17px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* App frame */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--brand); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.topbar a { color: #fff; }
.tb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.tb-brand .logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px 6px; }
.tb-brand b { display: block; font: 600 1.02rem var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.tb-brand small { display: block; font-size: .75rem; opacity: .8; white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 99px; padding: 7px 12px; font: 500 .85rem var(--f-head); cursor: pointer; }
.role-pill svg { width: 16px; height: 16px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font: 600 .9rem var(--f-head); overflow: hidden; color: #fff; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
.menu-toggle svg { width: 26px; height: 26px; }
.frame { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--top)); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font: 500 .94rem var(--f-head); }
.side a:hover { background: var(--brand-tint); }
.side a[aria-current="page"] { background: var(--brand-tint-2); color: var(--brand-deep); }
.side a[aria-current="page"] svg { color: var(--brand); }
.side .grp { font-size: .75rem; color: var(--muted); padding: 14px 12px 4px; font-weight: 600; }
.main { padding: 22px 26px 90px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: .86rem; margin-bottom: 6px; display: block; color: var(--muted); }
.banner { padding: 10px 16px; font-size: .92rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner svg { width: 18px; height: 18px; }
.banner.sa { background: #FFF3D6; color: #6B4A00; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner a, .banner button { color: inherit; font-weight: 600; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .frame { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; top: var(--top); left: 0; bottom: 0; width: 270px; height: auto; transform: translateX(-102%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0,0,0,.12); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(10,25,45,.4); z-index: 45; }
  .main { padding: 16px 14px 96px; }
  .tb-brand small, .tb-hide { display: none; }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 500 .72rem var(--f-head); color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px; cursor: pointer; }
  .bottom-nav [aria-current="page"] { color: var(--brand); }
  .bottom-nav svg { width: 22px; height: 22px; }
}
.scrim { display: none; }
.side-role { display: none; padding: 4px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side-role label { font-size: .8rem; color: var(--muted); }
@media (max-width: 600px) { .tb-role { display: none; } .side-role { display: block; } }
.tb-brand > span { min-width: 0; }

/* Cards, stats, layout helpers */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid-2, .split, .grid-3 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-2); }
.stat b { display: block; font: 700 1.7rem var(--f-head); color: var(--brand-deep); }
.stat span { color: var(--muted); font-size: .9rem; }
a.stat:hover { border-color: var(--brand); }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat b { font-size: 1.4rem; } }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .95rem; }
.alert-ok { background: var(--ok-bg); color: #0C5E33; }
.alert-err { background: var(--err-bg); color: #8A1C12; }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--brand-tint); color: var(--brand-deep); }

/* Forms */
label, .lbl { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid #C9D6E1; border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=color] { width: 56px; height: 44px; border: 1.5px solid #C9D6E1; border-radius: 10px; padding: 3px; background: #fff; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
.fields.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .fields, .fields.three { grid-template-columns: 1fr; } }
.help { color: var(--muted); font-size: .84rem; margin: 5px 0 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 0; margin: 18px 0 -20px; z-index: 5; }
@media (max-width: 900px) { .sticky-actions { bottom: 64px; } }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 44px; cursor: pointer; display: block; font-weight: 400; }
.choice input { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; accent-color: var(--brand); }
.choice b { display: block; font-family: var(--f-head); font-weight: 600; margin-bottom: 2px; }
.choice small { color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }

/* Tables */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: #F7FAFC; font: 600 .82rem var(--f-head); color: var(--muted); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: .82rem; }
.tbl a.strong { font-weight: 600; text-decoration: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 10px; }
.person .pic { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-tint-2); color: var(--brand-deep); display: grid; place-items: center; font: 600 .85rem var(--f-head); overflow: hidden; flex: none; }
.person .pic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: grid; grid-template-columns: 104px 1fr; gap: 8px; border: 0; padding: 5px 12px; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; padding-top: 2px; }
  .tbl.stack td.first { grid-template-columns: 1fr; }
  .tbl.stack td > .badge, .tbl.stack td > form, .tbl.stack td > a.btn { justify-self: start; }
  .tbl.stack td.num { text-align: left; }
  .tbl.stack td.first::before { display: none; }
}
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--brand-2); }

/* Badges, chips */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: #EEF1F4; color: #4D5866; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.brand { background: var(--brand-tint-2); color: var(--brand-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar > div { flex: 1 1 180px; max-width: 280px; }
.toolbar .grow { max-width: none; flex: 2 1 240px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font: 500 .9rem var(--f-head); }
.tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.pager span { background: var(--brand); color: #fff; border-color: var(--brand); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; gap: 1px; } .dl dd { margin-bottom: 9px; } }

/* Permission matrix */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 22px; height: 22px; accent-color: var(--brand); }
.matrix td small { display: block; color: var(--muted); font-weight: 400; }

/* Feature switches */
.switch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.switch-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; cursor: pointer; font-weight: 400; }
.switch-item b { font-family: var(--f-head); font-weight: 600; display: block; font-size: .95rem; }
.switch-item small { color: var(--muted); display: block; }
.toggle { position: relative; width: 44px; height: 26px; flex: none; margin-top: 2px; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; background: #C9D3DC; border-radius: 99px; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 3px solid #FDB813; outline-offset: 2px; }

/* Photo field + camera */
.photo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-preview { width: 92px; height: 92px; border-radius: 14px; background: var(--brand-tint); border: 1.5px dashed #B7C8D6; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.photo-preview.round { border-radius: 50%; }
.photo-preview.wide { width: 180px; height: 92px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview.wide img { object-fit: contain; background: #fff; }
.photo-preview svg { width: 32px; height: 32px; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-actions .tiny { font-weight: 400; font-size: .84rem; display: flex; gap: 6px; align-items: center; }
.cam { position: fixed; inset: 0; z-index: 100; background: rgba(5,15,30,.9); display: grid; place-items: center; padding: 16px; }
.cam-box { background: #000; border-radius: 16px; overflow: hidden; width: min(520px, 100%); }
.cam-box video, .cam-box canvas { width: 100%; display: block; max-height: 70vh; object-fit: cover; background: #000; }
.cam-bar { display: flex; justify-content: space-between; gap: 10px; padding: 12px; background: #111; }
.cam-bar .btn-ghost { background: #222; color: #fff; border-color: #444; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--brand-tint) 0%, #fff 60%); }
.auth-box { width: min(420px, 100%); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; text-align: center; }
.auth-logo img { max-height: 72px; width: auto; }
.auth-logo b { font: 600 1.15rem var(--f-head); }
.auth .card { padding: 26px; box-shadow: 0 10px 30px rgba(10,40,70,.08); }
.auth-foot { text-align: center; margin-top: 16px; font-size: .86rem; color: var(--muted); }
.code-input { letter-spacing: .4em; font: 600 1.4rem var(--f-head) !important; text-align: center; }

/* Theme preview */
.theme-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.theme-preview .tp-top { background: var(--p); color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font: 600 .95rem var(--f-head); }
.theme-preview .tp-top img { height: 30px; background: #fff; border-radius: 6px; padding: 2px 5px; }
.theme-preview .tp-body { padding: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.theme-preview .tp-btn { background: var(--p); color: #fff; border-radius: 8px; padding: 8px 14px; font: 600 .85rem var(--f-head); }
.theme-preview .tp-chip { background: var(--s); color: #fff; border-radius: 99px; padding: 4px 10px; font-size: .8rem; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: -4px; border: 1px solid rgba(0,0,0,.1); }

.error-page { text-align: center; padding: 50px 10px; }
.error-page .code { font: 700 4rem var(--f-head); color: var(--brand-tint-2); line-height: 1; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.list-plain li:last-child { border-bottom: 0; }
.kbd { font-family: ui-monospace, Consolas, monospace; background: #F1F4F7; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .88em; }
.credentials { background: #FFFBEA; border: 1px solid #F0D98A; border-radius: 12px; padding: 14px 16px; }
.credentials .dl { grid-template-columns: 120px 1fr; }

/* Dashboard: students by class */
.stat.warn::before { background: #E8772E; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 74px; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 3px 0; }
.bar-row:hover .bar-fill { filter: brightness(1.1); }
.bar-label { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--soft, #EEF2F6); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 6px; min-width: 2px; }
.bar-n { font-weight: 600; text-align: right; font-size: .9rem; }
.bar-n small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
@media (max-width: 600px) { .bar-row { grid-template-columns: 84px 1fr 64px; } }
/* Photo beside fields: stack on phones */
@media (max-width: 600px) { .split[style*="auto 1fr"] { grid-template-columns: 1fr !important; } .split[style*="auto 1fr"] .photo-row { flex-direction: row; } }
.tb-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: .88rem; padding: 6px 10px; border-radius: 8px; opacity: .9; }
.tb-link:hover { background: rgba(255,255,255,.12); opacity: 1; }
.tb-link svg { width: 18px; height: 18px; }
@media (max-width: 600px) { .tb-link span { display: none; } }
tr.unread td { background: #FFFBF2; }
tr.unread .strong { font-weight: 700; }
/* Website admin */
.field-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.field-block .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.field-block textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.changed { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: .74rem; font-weight: 600; }
.serp { font-family: Arial, sans-serif; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.serp .u { color: #202124; font-size: 13px; }
.serp .t { color: #1a0dab; font-size: 19px; margin: 3px 0; line-height: 1.3; }
.serp .d { color: #4d5156; font-size: 14px; line-height: 1.5; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.checks li { padding-left: 26px; position: relative; font-size: .92rem; }
.checks li::before { content: "✕"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--err-bg); color: var(--err); font-size: 11px; display: grid; place-items: center; }
.checks li.ok::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.count-hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.count-hint.over { color: var(--err); font-weight: 600; }
.thumb { display: block; max-width: 240px; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }
.sticky-save { position: sticky; bottom: 0; background: #fff; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; z-index: 5; }

/* Phase 4 */
.profile-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .actions { display: flex; gap: 8px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.mini-stats > div { background: var(--brand-tint); border-radius: 10px; padding: 10px; text-align: center; }
.mini-stats b { display: block; font: 700 1.3rem var(--f-head); color: var(--brand-deep); }
.mini-stats span { font-size: .78rem; color: var(--muted); }
/* Attendance marking — big targets for phones */
.att-bar { position: sticky; top: 64px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.att-count b { font-family: var(--f-head); font-size: 1.15rem; }
.att-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-row.is-A { background: #FFF4F2; }
.att-row.is-L, .att-row.is-H { background: #FFFAEF; }
.att-roll { width: 30px; color: var(--muted); font-size: .85rem; text-align: right; flex: none; }
.att-name { flex: 1; min-width: 0; }
.att-name b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name small { color: var(--muted); }
.att-opts { display: flex; gap: 5px; flex: none; }
.att-opt { position: relative; }
.att-opt input { position: absolute; opacity: 0; inset: 0; }
.att-opt span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); font: 600 .95rem var(--f-head); color: var(--muted); cursor: pointer; user-select: none; }
.att-opt input:focus-visible + span { outline: 3px solid var(--brand-2); outline-offset: 1px; }
.att-P input:checked + span { background: #1F8A4C; border-color: #1F8A4C; color: #fff; }
.att-A input:checked + span { background: #C8372D; border-color: #C8372D; color: #fff; }
.att-L input:checked + span { background: #D98A1A; border-color: #D98A1A; color: #fff; }
.att-H input:checked + span { background: #6A5ACD; border-color: #6A5ACD; color: #fff; }
.att-opt input:disabled + span { cursor: default; opacity: .75; }
@media (max-width: 420px) { .att-opt span { width: 38px; height: 40px; } .att-opts { gap: 4px; } .att-roll { width: 22px; } }
@media (max-width: 900px) { .att-bar { top: 56px; } }
/* Attendance register */
.reg-wrap { overflow-x: auto; }
.reg { font-size: .8rem; min-width: 900px; }
.reg th, .reg td { padding: 5px 4px; text-align: center; border-left: 1px solid var(--line); white-space: nowrap; }
.reg th small { display: block; font-weight: 400; color: var(--muted); font-size: .66rem; }
.reg .reg-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 170px; border-left: 0; }
.reg .off { background: #F2F4F7; }
.reg .m-A { color: #C8372D; font-weight: 700; background: #FFF1EF; }
.reg .m-L { color: #B26A00; } .reg .m-H { color: #5B4BC4; }
.print-head { display: none; }
@media print { .print-head { display: block; margin-bottom: 8px; } .no-print, .toolbar { display: none !important; } .reg { min-width: 0; font-size: 9px; } .reg .reg-name { min-width: 120px; } }
/* Homework */
.day-head { font-size: .95rem; color: var(--muted); margin: 18px 0 8px; }
.hw-card { display: block; text-decoration: none; color: inherit; margin-bottom: 10px; padding: 14px 16px; }
.hw-card:hover { border-color: var(--brand); }
.hw-top { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.hw-top svg { width: 16px; height: 16px; color: var(--muted); }
.hw-title { display: block; font-size: 1.02rem; }
.hw-card p { margin: 4px 0; }
/* Timetable */
.tt { font-size: .85rem; min-width: 760px; }
.tt th, .tt td { text-align: center; border-left: 1px solid var(--line); padding: 8px 6px; vertical-align: middle; }
.tt th small, .tt td small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.tt .brk { background: #F5F6F8; width: 60px; }
.tt tr.today th { color: var(--brand); }
.tt tr.today td { background: var(--brand-tint); }
.tt select { min-height: 34px; font-size: .78rem; padding: 4px 6px; margin: 2px 0; }
.tt-edit td { min-width: 130px; }
@media print { .tt { min-width: 0; font-size: 10px; } }
.my-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.my-class { display: block; border: 1.5px solid var(--brand); border-radius: 12px; padding: 12px; text-decoration: none; color: inherit; background: #fff; }
.my-class b { display: block; font-family: var(--f-head); }
.my-class small { color: var(--err); }
.my-class.done { border-color: var(--line); background: var(--brand-tint); }
.my-class.done small { color: var(--ok); }
@media (max-width: 600px) { .tb-brand b { max-width: 34vw; } .tb-brand .logo { max-width: 96px; height: 34px; } }
/* Fees */
.class-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.class-pills a { flex: none; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font: 500 .88rem var(--f-head); }
.class-pills a small { display: block; font: 400 .72rem var(--f-body, inherit); color: var(--muted); }
.class-pills a[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.class-pills a[aria-current="page"] small { color: #fff; opacity: .85; }
.fee-grid { font-size: .85rem; min-width: 900px; }
.fee-grid th, .fee-grid td { padding: 6px 5px; text-align: center; white-space: nowrap; }
.fee-grid tbody th { text-align: left; }
.fee-grid th small { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.fee-grid input { width: 78px; min-height: 36px; padding: 4px 6px; text-align: right; }
.fee-grid .fill { background: var(--brand-tint); }
.fee-grid .fill input { width: 70px; }
.ledger { display: grid; gap: 8px; }
.led-row { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.led-row summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; gap: 10px; }
.led-row summary::-webkit-details-marker { display: none; }
.led-row summary small { display: block; color: var(--muted); font-size: .78rem; }
.led-amt { text-align: right; }
.led-due { border-color: #F2B8B2; } .led-due summary { background: #FFF6F5; } .led-due .led-amt b { color: var(--err); }
.led-paid summary { background: #F6FBF7; }
.led-tbl { font-size: .85rem; margin: 0; border-top: 1px solid var(--line); }
.led-tbl td, .led-tbl th { padding: 6px 10px; }
.led-tbl tr.late td { color: #9A5B00; } .led-tbl small { display: block; color: var(--muted); font-size: .72rem; }
.waive { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; border-top: 1px dashed var(--line); }
.waive input[name=reason] { flex: 1; min-width: 140px; }
.big-input { font: 700 1.5rem var(--f-head); min-height: 54px; }
.quick-amts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: .8rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.collect { border: 2px solid var(--brand-tint-2); }
/* Fee receipt — two copies on one A4 */
.rcpt-sheet { max-width: 780px; }
.rcpt { background: #fff; border: 1px solid #333; padding: 14px 18px; position: relative; color: #111; }
.rcpt.cancelled::after { content: "CANCELLED"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 3.4rem var(--f-head); color: rgba(200,55,45,.18); transform: rotate(-14deg); pointer-events: none; }
.rcpt-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #333; padding-bottom: 8px; }
.rcpt-head img { height: 46px; width: auto; }
.rcpt-head b { font: 700 1.1rem var(--f-head); display: block; }
.rcpt-head small { font-size: .74rem; color: #444; }
.rcpt-copy { margin-left: auto; font-size: .7rem; border: 1px solid #333; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.rcpt-title { text-align: center; font: 700 .9rem var(--f-head); letter-spacing: .12em; margin: 8px 0; }
.rcpt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; font-size: .82rem; margin-bottom: 8px; }
.rcpt-meta span { color: #555; display: inline-block; min-width: 82px; }
.rcpt-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.rcpt-tbl th, .rcpt-tbl td { border: 1px solid #999; padding: 4px 8px; text-align: left; }
.rcpt-tbl td:last-child, .rcpt-tbl th:last-child { text-align: right; width: 110px; }
.rcpt-words { font-size: .8rem; font-style: italic; margin: 6px 0; }
.rcpt-foot { display: flex; justify-content: space-between; gap: 16px; font-size: .8rem; margin-top: 8px; }
.rcpt-foot .sign { text-align: center; min-width: 140px; border-top: 1px solid #333; padding-top: 4px; margin-top: 18px; }
.rcpt-note { font-size: .7rem; color: #555; margin: 8px 0 0; }
.rcpt-cut { text-align: center; color: #999; font-size: .7rem; margin: 10px 0; overflow: hidden; white-space: nowrap; }
@media print { .rcpt-sheet { max-width: none; } .rcpt { break-inside: avoid; } }
@media (max-width: 600px) { .rcpt-meta { grid-template-columns: 1fr; } .rcpt { padding: 10px; } }

/* Printing: only the page content */
@media print {
  .topbar, .side, .bottom-nav, .scrim, .banner, .no-print, .alert, .sticky-actions { display: none !important; }
  .frame { display: block !important; } .main { padding: 0 !important; max-width: none !important; } body { background: #fff !important; }
  @page { margin: 10mm; }
}
.pay-due { display: flex; justify-content: space-between; align-items: baseline; background: var(--brand-tint); border-radius: 12px; padding: 14px 16px; }
.pay-due b { font: 700 1.6rem var(--f-head); color: var(--brand-deep); }
.fields > div { min-width: 0; }
.help code, p code { overflow-wrap: anywhere; word-break: break-all; }
/* Exams */
.exam-class { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.exam-class summary { padding: 10px 14px; cursor: pointer; }
.exam-class .tbl-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
.fill-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--brand-tint); padding: 8px 12px; border-radius: 10px; margin: 12px 0 4px; font-size: .9rem; }
.fill-bar input { width: 80px; min-height: 34px; }
.mark-in { width: 76px; min-height: 42px; text-align: center; font: 600 1.05rem var(--f-head); flex: none; }
.mark-in.bad { border-color: var(--err); background: #FFF1EF; }
.mark-in.low { color: var(--err); }
.ab { display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); flex: none; }
.ab input { width: 18px; height: 18px; }
.result-tbl td, .result-tbl th { padding: 6px; }
.result-tbl small { display: block; font-size: .7rem; }
.design-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.design-pick .choice { padding: 12px 12px 12px 40px; }
.mini { display: block; height: 70px; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 8px; position: relative; overflow: hidden; background: #fff; }
.mini i { position: absolute; left: 10%; right: 10%; height: 6px; background: #D8DEE6; border-radius: 3px; }
.mini i:nth-child(1) { top: 26px; } .mini i:nth-child(2) { top: 38px; } .mini i:nth-child(3) { top: 50px; }
.rc-classic { border: 2px solid #333; } .rc-modern::before { content: ""; position: absolute; inset: 0 0 auto; height: 18px; background: var(--brand); }
.rc-cbse::before { content: ""; position: absolute; inset: 0 0 auto; height: 18px; border-bottom: 2px solid #333; }
.rc-primary { background: #FFF8E8; border-radius: 14px; } .rc-elegant { outline: 3px double var(--brand-deep); outline-offset: -6px; }
.id-mini { width: 46px; height: 70px; margin-left: auto; margin-right: auto; } .id-h-band, .id-h-minimal { width: 100%; height: 50px; }
.id-v-modern::before, .id-v-photo::before { content: ""; position: absolute; inset: 0 0 auto; height: 22px; background: var(--brand); }
.id-h-band::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: var(--brand); }
/* Report cards — one A4 page each */
.rc-page { background: #fff; color: #111; width: 100%; max-width: 794px; min-height: 1080px; margin: 0 auto 24px; padding: 34px 38px; box-shadow: 0 2px 12px rgba(0,0,0,.08); position: relative; display: flex; flex-direction: column; font-size: 13px; }
.rc-head { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 2px solid #222; }
.rc-logo { height: 70px; width: auto; max-width: 110px; object-fit: contain; }
.rc-school { flex: 1; text-align: center; }
.rc-school b { display: block; font: 700 22px var(--f-head); letter-spacing: .02em; }
.rc-school small { display: block; color: #444; font-size: 11.5px; }
.rc-photo { width: 78px; height: 92px; border: 1px solid #999; overflow: hidden; flex: none; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-title { text-align: center; font: 700 16px var(--f-head); letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 10px; }
.rc-title span { display: block; font-size: 11px; letter-spacing: .06em; font-weight: 500; color: #555; text-transform: none; }
.rc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin-bottom: 14px; }
.rc-info div { display: flex; gap: 8px; border-bottom: 1px dotted #bbb; padding: 3px 0; }
.rc-info span { color: #555; min-width: 96px; }
.rc-marks { width: 100%; border-collapse: collapse; }
.rc-marks th, .rc-marks td { border: 1px solid #555; padding: 6px 8px; text-align: center; }
.rc-marks th { background: #F1F3F6; font-weight: 600; }
.rc-marks th.sub { font-size: 11px; font-weight: 500; }
.rc-marks td.subj, .rc-marks tfoot td:first-child { text-align: left; font-weight: 500; }
.rc-marks small { color: #666; font-size: 10.5px; }
.rc-marks td.low { color: #B3261E; font-weight: 700; }
.rc-marks td.g { font-weight: 700; }
.rc-marks tfoot td { background: #FAFAFA; }
.rc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 14px 0; }
.rc-summary div { border: 1px solid #ccc; border-radius: 6px; padding: 7px 10px; }
.rc-summary span { display: block; font-size: 11px; color: #555; }
.rc-remark { border: 1px solid #ccc; border-radius: 6px; padding: 8px 10px; min-height: 64px; }
.rc-remark span { font-size: 11px; color: #555; } .rc-remark p { margin: 4px 0 0; }
.rc-key { font-size: 10.5px; color: #555; margin: 10px 0 0; }
.rc-signs { margin-top: auto; padding-top: 40px; display: flex; justify-content: space-between; gap: 20px; text-align: center; }
.rc-signs div { flex: 1; font-size: 12px; } .rc-signs i { display: block; border-top: 1px solid #333; margin: 30px 10px 4px; }
.rc-signs img { display: block; height: 42px; margin: 0 auto 2px; } .rc-signs img + * { border-top: 1px solid #333; }
.rc-signs small { display: block; color: #555; }
/* designs */
.rc-classic { border: 3px solid #222; }
.rc-modern .rc-head { background: var(--brand); color: #fff; margin: -34px -38px 0; padding: 18px 38px; border: 0; }
.rc-modern .rc-school small { color: rgba(255,255,255,.85); } .rc-modern .rc-marks th { background: var(--brand-tint); } .rc-modern .rc-title { color: var(--brand-deep); }
.rc-modern .rc-logo { background: #fff; border-radius: 8px; padding: 4px; }
.rc-cbse .rc-marks th, .rc-cbse .rc-marks td { border-color: #222; } .rc-cbse .rc-title { border: 1px solid #222; padding: 6px; }
.rc-primary { background: #FFFBF1; border-radius: 18px; border: 2px solid #F0C36A; }
.rc-primary .rc-marks th { background: #FFE9B8; } .rc-primary .rc-marks td.g { font-size: 15px; } .rc-primary .rc-head { border-bottom-color: #F0C36A; }
.rc-elegant { outline: 4px double var(--brand-deep); outline-offset: -14px; padding: 46px 50px; }
.rc-elegant .rc-school b { font-family: Georgia, 'Times New Roman', serif; } .rc-elegant .rc-head { border-bottom: 1px solid var(--brand-deep); }
@media print { .rc-page { box-shadow: none; margin: 0; max-width: none; min-height: 273mm; page-break-after: always; break-after: page; padding: 10mm 12mm; } .rc-modern .rc-head { margin: -10mm -12mm 0; padding: 6mm 12mm; } .rc-elegant { padding: 14mm; }
  .rc-page:last-of-type { page-break-after: auto; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 700px) { .rc-page { padding: 16px; min-height: 0; font-size: 12px; } .rc-modern .rc-head { margin: -16px -16px 0; padding: 14px 16px; } .rc-info { grid-template-columns: 1fr; } .rc-marks { font-size: 11px; } .rc-marks th, .rc-marks td { padding: 4px; } }
/* ID cards — CR80 size, 9 or 10 per A4 */
.id-sheet { display: grid; gap: 4mm; justify-content: center; background: #fff; padding: 6mm; border-radius: 10px; }
.id-v { grid-template-columns: repeat(3, 54mm); } .id-h { grid-template-columns: repeat(2, 85.6mm); }
.idc { position: relative; overflow: hidden; background: #fff; color: #111; border: .3mm solid #999; border-radius: 3mm; font-size: 2.4mm; display: flex; flex-direction: column; cursor: pointer; }
.id-v .idc { width: 54mm; height: 85.6mm; } .id-h .idc { width: 85.6mm; height: 54mm; }
.idc.skip { opacity: .25; } @media print { .idc.skip { display: none; } }
.idc-top { display: flex; align-items: center; gap: 1.5mm; padding: 2mm 2.5mm; background: var(--brand); color: #fff; }
.idc-top img { height: 7mm; width: auto; max-width: 12mm; background: #fff; border-radius: 1mm; padding: .5mm; object-fit: contain; }
.idc-top b { display: block; font: 700 2.9mm/1.15 var(--f-head); } .idc-top small { display: block; font-size: 1.9mm; opacity: .9; }
.idc-body { flex: 1; display: flex; gap: 2mm; padding: 2mm 2.5mm; min-height: 0; }
.id-v .idc-body { flex-direction: column; align-items: center; text-align: center; }
.idc-photo { width: 18mm; height: 22mm; border: .3mm solid #bbb; border-radius: 1.2mm; overflow: hidden; flex: none; background: #F2F4F7; }
.idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.idc-info { min-width: 0; flex: 1; }
.idc-name { display: block; font: 700 3.4mm/1.15 var(--f-head); color: var(--brand-deep); }
.idc-line { display: block; font-weight: 600; margin: .5mm 0 1mm; }
.idc dl { display: grid; grid-template-columns: auto 1fr; gap: .2mm 1.5mm; margin: 0; text-align: left; }
.idc dt { color: #666; } .idc dd { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .idc dd.addr { white-space: normal; max-height: 5.5mm; }
.idc-qr { width: 13mm; height: 13mm; flex: none; } .idc-qr svg { width: 100%; height: 100%; }
.id-v .idc-qr { position: absolute; right: 2.5mm; bottom: 11mm; width: 11mm; height: 11mm; }
.idc-h-band .idc-body { padding-left: 4mm; }
.idc-foot { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2.5mm 1.5mm; font-size: 1.9mm; color: #555; }
.idc-sign { text-align: center; } .idc-sign img { display: block; height: 4mm; margin: 0 auto; }
.idc-ret { font-size: 1.7mm; text-align: center; background: #F2F4F7; padding: .6mm; color: #555; }
/* designs */
.idc-v-classic .idc-top { background: #fff; color: #111; border-bottom: .5mm solid var(--brand); }
.idc-v-modern .idc-body { background: linear-gradient(180deg, var(--brand-tint) 0, #fff 40%); }
.idc-v-modern .idc-photo { border-radius: 50%; width: 21mm; height: 21mm; border: .6mm solid var(--brand); }
.idc-v-photo .idc-photo { width: 26mm; height: 31mm; }
.idc-v-photo .idc-info dl { display: none; } .idc-v-photo .idc-name { font-size: 3.8mm; }
.idc-h-band::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2mm; background: var(--brand-2); }
.idc-h-minimal .idc-top { background: #fff; color: var(--brand-deep); border-bottom: .3mm solid #ddd; }
@media print { .id-sheet { padding: 0; gap: 3mm; border-radius: 0; } @page { size: A4 portrait; margin: 8mm; } }
.verify-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; color: #fff; }
.verify-mark svg { width: 34px; height: 34px; } .verify-mark.ok { background: #1F8A4C; } .verify-mark.bad { background: #C8372D; }
/* Certificates — A4 */
.cert-page { background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 40px 46px; border: 6px double #333; position: relative; font-size: 13.5px; }
.cert-page.cancelled::after { content: "CANCELLED"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 5rem var(--f-head); color: rgba(200,55,45,.15); transform: rotate(-20deg); pointer-events: none; }
.cert-dup { position: absolute; top: 12px; right: 18px; border: 1.5px solid #B3261E; color: #B3261E; font-weight: 700; font-size: 11px; padding: 2px 8px; letter-spacing: .1em; }
.cert-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #222; padding-bottom: 12px; text-align: center; }
.cert-head img { height: 78px; width: auto; max-width: 110px; object-fit: contain; }
.cert-head > div:nth-child(2), .cert-head > div:first-child:not(.cert-qr) { flex: 1; }
.cert-head b { display: block; font: 700 24px var(--f-head); } .cert-head small { display: block; color: #444; font-size: 11.5px; }
.cert-qr { width: 70px; height: 70px; flex: none; } .cert-qr svg { width: 100%; height: 100%; }
.cert-title { text-align: center; font: 700 18px var(--f-head); letter-spacing: .16em; margin: 18px 0 10px; text-decoration: underline; text-underline-offset: 5px; }
.cert-nos { display: flex; justify-content: space-between; margin-bottom: 12px; }
.cert-tbl { width: 100%; border-collapse: collapse; }
.cert-tbl td { border-bottom: 1px dotted #aaa; padding: 5px 6px; vertical-align: top; }
.cert-tbl td.n { width: 28px; color: #444; } .cert-tbl td.v { font-weight: 600; width: 46%; }
.cert-body { font-size: 15px; line-height: 1.9; margin: 24px 0; text-align: justify; } .cert-body p { margin: 0 0 14px; }
.cert-signs { display: flex; justify-content: space-between; gap: 20px; margin-top: 50px; text-align: center; font-size: 12.5px; }
.cert-signs div { flex: 1; } .cert-signs i { display: block; border-top: 1px solid #333; margin: 30px 10px 4px; } .cert-signs img { display: block; height: 44px; margin: 0 auto; }
.cert-signs small { display: block; color: #555; }
.cert-foot { font-size: 10.5px; color: #555; text-align: center; margin: 18px 0 0; }
@media print { .cert-page { max-width: none; margin: 0; padding: 12mm 14mm; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 700px) { .cert-page { padding: 16px; font-size: 12px; } .cert-head { flex-wrap: wrap; } .cert-tbl td.v { width: auto; } }

/* ---------- Phase 7: notices, messages, notifications ---------- */
.tb-bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: #fff; border-radius: 50%; }
.tb-bell:hover { background: rgba(255,255,255,.14); }
.tb-bell svg { width: 22px; height: 22px; }
.tb-bell .dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--flame); color: #fff; font: 700 11px/18px var(--f-head); text-align: center; border: 2px solid var(--brand); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 16px; font: 600 .92rem var(--f-head); color: var(--muted); border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #FDB813; outline-offset: -3px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.cs-class { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.check.sm { font-size: .88rem; padding-left: 28px; } .check.sm input { width: 17px; height: 17px; }
.check input:disabled + * , .check:has(input:disabled) { opacity: .55; }
.ch-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ch-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; }
.ch-opt input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.ch-opt span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.ch-opt b { font-family: var(--f-head); font-weight: 600; } .ch-opt small { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.ch-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.ch-opt.off { opacity: .65; cursor: default; }
.tpl-pick { display: grid; gap: 8px; }
.tpl-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: #fff; }
.tpl-opt input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.tpl-opt b { font-family: var(--f-head); font-weight: 600; display: block; } .tpl-opt small { color: var(--muted); display: block; font-size: .84rem; } .tpl-opt em { font-style: normal; margin-top: 4px; }
.tpl-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.msg-preview { border: 2px solid var(--brand); }
.msg-sample { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .92rem; }
.msg-sample small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 4px; } .msg-sample p { margin: 0; white-space: pre-line; }
.progress { height: 10px; background: var(--brand-tint-2); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width .4s; }
.tbl td small { display: block; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); } .notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: flex; flex-direction: column; padding: 12px 16px; text-decoration: none; color: inherit; }
.notif-list a:hover { background: var(--brand-tint); }
.notif-list span { color: var(--muted); font-size: .9rem; } .notif-list small { color: var(--muted); font-size: .78rem; }
.notif-list li.new a { background: #FFFBEF; } .notif-list li.new b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--flame); margin-right: 8px; vertical-align: middle; }
.notice-list { display: grid; gap: 10px; }
.notice-card { display: block; text-decoration: none; color: inherit; padding: 14px 16px; margin: 0; }
.notice-card:hover { border-color: var(--brand); }
.notice-card.unread { border-left: 4px solid var(--flame); }
.nc-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .nc-top svg { width: 16px; height: 16px; color: var(--muted); }
.nc-title { display: block; font: 600 1.05rem var(--f-head); margin: 6px 0 2px; } .notice-card p { margin: 4px 0; }
.circular { background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 36px 46px; border: 1px solid var(--line); border-radius: 4px; font-size: 14.5px; box-shadow: 0 2px 10px rgba(16,34,54,.06); }
.circ-to { margin: 8px 0 4px; } .circ-sub { font: 700 15px var(--f-body); margin: 10px 0 12px; text-decoration: underline; text-underline-offset: 3px; }
.circ-body { line-height: 1.75; white-space: normal; overflow-wrap: anywhere; } .circ-img { max-width: 100%; margin: 14px auto 0; border: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; align-items: stretch; } .copy-row input, .copy-row textarea { flex: 1; min-width: 0; font-size: .85rem; background: var(--bg); }
.tokens-card { background: var(--brand-tint); border-color: var(--brand-tint-2); }
.token-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.token { font: 600 .8rem ui-monospace, Consolas, monospace; background: #fff; border: 1px solid var(--brand-tint-2); color: var(--brand-deep); padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.token:hover { border-color: var(--brand); }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--flame); margin-right: 8px; vertical-align: middle; }
.dash-notices .card-head h2 { display: flex; align-items: center; gap: 8px; } .dash-notices li a { text-decoration: none; color: inherit; } .dash-notices li a.strong { font-weight: 600; }
.pub-notice .circ-body { font-size: 1rem; }
.steps-list { padding-left: 20px; margin: 0 0 10px; } .steps-list li { margin-bottom: 8px; }
@media print { .circular { box-shadow: none; border: 0; max-width: none; margin: 0; padding: 10mm 14mm; } }
@media (max-width: 700px) { .circular { padding: 18px; font-size: 13.5px; } .seg { display: flex; } .seg label { flex: 1; } .seg span { text-align: center; padding: 10px 8px; } }
.sa-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sa-set { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.sa-set:hover { border-color: var(--brand); background: var(--brand-tint); }
.sa-set svg { color: var(--brand); } .sa-set b { display: block; font: 600 .92rem var(--f-head); } .sa-set small { display: block; color: var(--muted); font-size: .8rem; }
.design-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.design-gallery.id { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.dg-item { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.dg-item.current { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dg-item:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
.dg-img { display: block; background: #EEF2F6; aspect-ratio: 210 / 297; overflow: hidden; }
.design-gallery.id .dg-img { aspect-ratio: 4 / 3; display: grid; place-items: center; }
.dg-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .2s; }
.design-gallery.id .dg-img img { object-fit: contain; }
.dg-img:hover img { transform: scale(1.03); }
.dg-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; } .dg-meta small { color: var(--muted); } .dg-meta a { display: inline-flex; align-items: center; gap: 4px; } .dg-meta a svg { width: 15px; height: 15px; }
.rc-sample, .idc-sample { position: relative; }
.rc-sample::after { content: "SAMPLE"; position: absolute; inset: auto; height: auto; width: auto; background: none; border: 0; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font: 800 6rem var(--f-head); color: rgba(16,34,54,.06); pointer-events: none; letter-spacing: .1em; z-index: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { --tc: var(--brand); --tb: var(--brand-tint); display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; min-height: 132px; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,34,54,.08); border-color: var(--tc); color: var(--ink); }
.tile-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tb); color: var(--tc); margin-bottom: 6px; }
.tile-ic svg { width: 26px; height: 26px; }
.tile b { font: 600 1rem var(--f-head); line-height: 1.25; } .tile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.t-green { --tc: #138A4B; --tb: #E2F5EA; } .t-blue { --tc: #1F5FBF; --tb: #E5EEFC; } .t-orange { --tc: #D2600F; --tb: #FFEEDF; } .t-purple { --tc: #6B45B8; --tb: #EFE9FB; }
.t-teal { --tc: #0A8A96; --tb: #DFF5F6; } .t-pink { --tc: #C1306B; --tb: #FCE7F0; } .t-red { --tc: #B42318; --tb: #FDECE7; } .t-grey { --tc: #4A5E73; --tb: #EEF1F4; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.opt-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.opt-card:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.opt-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.opt-card b { display: block; font: 600 .95rem var(--f-head); } .opt-card small { display: block; color: var(--muted); font-size: .8rem; }
@media (max-width: 600px) { .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } .tile { min-height: 118px; padding: 12px; } .tile-ic { width: 42px; height: 42px; } }
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.route-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); margin: 0; }
.route-card:hover { border-color: var(--brand); color: var(--ink); } .route-card.off { opacity: .6; }
.rc-top { display: flex; gap: 12px; align-items: center; } .rc-top .tile-ic { margin: 0; border-radius: 12px; display: grid; place-items: center; flex: none; }
.rc-top b { display: block; font: 600 1.05rem var(--f-head); } .rc-top small { color: var(--muted); }
.rc-nums { display: flex; gap: 16px; font-size: .92rem; color: var(--muted); } .rc-nums b { color: var(--ink); font-size: 1.1rem; }
.paper-list { display: flex; flex-wrap: wrap; gap: 4px; } .stop-row td { background: var(--brand-tint); } .stop-row svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--brand); } .stops-tbl input { min-width: 0; }
.pick-list { display: grid; gap: 6px; }
.choice-row { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; background: #fff; }
.choice-row input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; } .choice-row b { display: block; } .choice-row small { color: var(--muted); }
.choice-row:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.room { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.room-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; } .room-head b { font-family: var(--f-head); } .room-head small { color: var(--muted); }
.beds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.bed { display: flex; flex-direction: column; border-radius: 8px; padding: 7px 8px; text-decoration: none; font-size: .82rem; min-height: 58px; color: var(--ink); }
.bed span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; } .bed b { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; } .bed small { color: var(--muted); font-size: .72rem; }
.bed.full { background: #EFE9FB; border: 1px solid #DCD0F4; } .bed.full:hover { border-color: #6B45B8; color: var(--ink); }
.bed.empty { background: #F7FAF8; border: 1.5px dashed #B9D7C5; color: var(--ok); } a.bed.empty:hover { background: var(--ok-bg); }
@media print { .room-grid { grid-template-columns: repeat(3, 1fr); } .room { break-inside: avoid; } }
.list-plain li > span > svg { width: 17px; height: 17px; vertical-align: -3px; color: var(--brand); }
/* Help button and chat */
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border-radius: 30px; border: 0; background: var(--flame); color: #fff; font: 600 .95rem var(--f-head); box-shadow: 0 6px 20px rgba(238,106,16,.35); cursor: pointer; }
.help-fab:hover { background: #D85B05; } .help-fab svg { width: 22px; height: 22px; }
body.help-on .help-fab { display: none; }
.help-panel { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 90px)); background: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(16,34,54,.25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.help-panel header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand); color: #fff; }
.help-panel header b { display: block; font: 600 1rem var(--f-head); } .help-panel header small { display: block; font-size: .78rem; opacity: .85; }
.help-panel header > span:nth-child(2) { flex: 1; }
.help-panel header button { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; } .help-panel header button:hover { background: rgba(255,255,255,.15); }
.hp-ic { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.hp-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.hp-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.45; background: #fff; border: 1px solid var(--line); }
.hp-msg p { margin: 0; } .hp-msg ol { margin: 6px 0; padding-left: 18px; } .hp-msg li { margin-bottom: 3px; } .hp-msg small { display: block; color: var(--muted); font-size: .74rem; margin-bottom: 2px; }
.hp-msg time { display: block; font-size: .7rem; color: var(--muted); margin-top: 3px; text-align: right; }
.hp-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); } .hp-msg.me time { color: rgba(255,255,255,.75); }
.hp-msg.them { background: #FFF6EC; border-color: #F8D8B8; }
.hp-link { display: inline-block; margin-top: 4px; padding: 5px 10px; border-radius: 8px; background: var(--brand-tint); font-weight: 600; text-decoration: none; font-size: .85rem; }
.hp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: #fff; } .hp-chips:empty { display: none; }
.hp-chips button { border: 1px solid var(--brand-tint-2); background: var(--brand-tint); color: var(--brand-deep); border-radius: 16px; padding: 6px 11px; font: 600 .8rem var(--f-body); cursor: pointer; }
.hp-chips button:hover { border-color: var(--brand); }
.hp-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.hp-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 110px; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: .95rem; }
.hp-input button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.hp-dots { display: flex; gap: 4px; } .hp-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: hpd 1s infinite; } .hp-dots i:nth-child(2) { animation-delay: .15s; } .hp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hpd { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.help-card summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; } .help-card summary svg { color: var(--brand); } .help-card ol { margin: 10px 0; padding-left: 20px; } .help-card li { margin-bottom: 4px; }
.help-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; align-items: start; } .help-list .card { margin: 0; }
@media (max-width: 900px) { .help-fab { bottom: 76px; right: 12px; padding: 11px 14px; } .help-panel { right: 0; bottom: 0; width: 100vw; height: calc(100vh - 56px); border-radius: 18px 18px 0 0; } }
@media print { .help-fab, .help-panel { display: none !important; } }
.sa-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sa-msgs { height: 460px; overflow-y: auto; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.sa-reply { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; } .sa-reply textarea { flex: 1; resize: vertical; }
.banner.demo { background: #E5F4E4; color: #1D5B2C; }
.dash-tiles { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .dash-tiles { grid-template-columns: repeat(2, 1fr); } }
.design-gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stops-tbl td:first-child { min-width: 160px; } .stops-tbl input[type=time] { min-width: 105px; }
/* ---------- Parent app ---------- */
.parent-app { background: var(--bg); padding-bottom: 76px; }
.p-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--brand); color: #fff; min-height: 58px; }
.p-top a { color: #fff; text-decoration: none; }
.p-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.p-brand img { height: 40px; width: auto; max-width: 110px; background: #fff; border-radius: 8px; padding: 3px 5px; object-fit: contain; }
.p-brand b { display: block; font: 600 1rem var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .p-brand small { display: block; font-size: .74rem; opacity: .85; }
.p-brand span { min-width: 0; }
.kid-switch { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.kid-switch button { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff; border-radius: 30px; padding: 4px 12px 4px 4px; cursor: pointer; flex: none; font: inherit; color: var(--ink); text-align: left; }
.kid-switch button[aria-current] { border-color: var(--brand); background: var(--brand-tint); }
.kid-switch img, .kid-ini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--brand-tint-2); display: grid; place-items: center; font-weight: 700; color: var(--brand); }
.kid-switch span { display: block; font-weight: 600; font-size: .9rem; line-height: 1.15; } .kid-switch small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.kid-switch .kid-ini { display: grid; flex: none; font-size: 1rem; }
.p-main { max-width: 760px; margin: 0 auto; padding: 14px; }
.p-foot { text-align: center; color: var(--muted); font-size: .8rem; margin: 24px 0 8px; }
.p-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.p-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 500 .72rem var(--f-head); color: var(--muted); text-decoration: none; padding: 4px; }
.p-nav a[aria-current] { color: var(--brand); } .p-nav svg { width: 23px; height: 23px; }
@media (min-width: 900px) { .p-nav { max-width: 760px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 24px rgba(16,34,54,.1); } }
.kid-card { display: flex; gap: 14px; align-items: center; }
.kid-card .kid-photo { width: 72px; height: 88px; border-radius: 12px; object-fit: cover; background: var(--brand-tint); flex: none; display: grid; place-items: center; font: 700 1.6rem var(--f-head); color: var(--brand); }
.kid-card h1 { font-size: 1.3rem; margin: 0 0 2px; } .kid-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.today-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; font-weight: 600; font-size: .88rem; margin-top: 6px; }
.today-pill.P { background: var(--ok-bg); color: var(--ok); } .today-pill.A { background: var(--err-bg); color: var(--err); } .today-pill.L, .today-pill.H { background: var(--warn-bg); color: var(--warn); } .today-pill.none { background: #EEF1F4; color: var(--muted); }
.p-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.p-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.p-stat b { font: 700 1.35rem var(--f-head); } .p-stat span { color: var(--muted); font-size: .82rem; } .p-stat.bad b { color: var(--err); } .p-stat.good b { color: var(--ok); }
.p-stat .btn { margin-top: 6px; align-self: flex-start; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); } .feed li:last-child { border-bottom: 0; }
.feed .f-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.feed .f-ic.absent { background: var(--err-bg); color: var(--err); } .feed .f-ic.fee { background: var(--ok-bg); color: var(--ok); } .feed .f-ic.result { background: #EFE9FB; color: #6B45B8; } .feed .f-ic.homework { background: #FFEEDF; color: #D2600F; }
.feed a { text-decoration: none; color: inherit; flex: 1; min-width: 0; } .feed b { display: block; } .feed small { color: var(--muted); display: block; font-size: .82rem; } .feed .f-new b::after { content: " •"; color: var(--flame); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .wd { font-size: .72rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal .d { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: .9rem; background: #fff; border: 1px solid var(--line); position: relative; }
.cal .d.P { background: var(--ok-bg); color: var(--ok); border-color: #BFE5CF; } .cal .d.A { background: var(--err-bg); color: var(--err); border-color: #F5C7BD; } .cal .d.L, .cal .d.H { background: var(--warn-bg); color: var(--warn); border-color: #F2DCA6; }
.cal .d.off { background: transparent; color: #A9B4BF; border-style: dashed; } .cal .d.today { outline: 2px solid var(--brand); }
.cal-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 8px; } .cal-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.inst-list { list-style: none; margin: 0; padding: 0; } .inst-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; } .inst-list li:last-child { border-bottom: 0; }
.inst-list small { display: block; color: var(--muted); font-size: .8rem; }
.parent-app .rc-page { margin: 0 auto; }
.pin-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin-top: 12px; }
.pin-slip { border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: .88rem; break-inside: avoid; }
.pin-slip a { display: inline-flex; align-items: center; gap: 4px; } .pin-slip svg { width: 15px; height: 15px; }
@media print { .pin-slips { grid-template-columns: 1fr 1fr; } .msg-preview { border: 0; } .msg-preview > h2, .msg-preview > .help, .msg-preview > .form-actions, .msg-preview form { display: none; } }
/* Charts */
.chart-wrap { overflow-x: auto; } .chart { width: 100%; min-width: 300px; height: auto; display: block; font-family: var(--f-body); }
.chart .grid { stroke: #E7EDF2; stroke-width: 1; } .chart .ax { font-size: 10.5px; fill: #6B7C8D; } .chart .val { font-size: 10px; fill: #33475B; font-weight: 600; }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; } .legend b { color: var(--ink); }
.legend.v { flex-direction: column; gap: 6px; margin: 0; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .donut { width: 150px; height: 150px; flex: none; } .donut-c { font: 700 17px var(--f-head); fill: var(--ink); }
.hbars { display: grid; gap: 7px; }
.hb { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hb-t { height: 12px; background: #EEF1F4; border-radius: 6px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--brand); border-radius: 6px; } .hb-t i.low { background: var(--err); }
.hb b { min-width: 52px; text-align: right; } .hb small { grid-column: 2 / -1; color: var(--muted); font-size: .76rem; margin-top: -4px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; } .rep-grid .card { margin: 0; }
.rep-grid .wide { grid-column: 1 / -1; }
@media print { .rep-grid { grid-template-columns: 1fr 1fr; } .rep-grid .card { break-inside: avoid; } .tabs { display: none; } }
.bday-card { background: linear-gradient(135deg, #FFF8EE, #fff); border-color: #F6DDBA; }
.ticklist { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.ticklist li { position: relative; padding-left: 26px; }
.ticklist li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 12px; height: 6px; border-left: 2px solid var(--ok, #138A4B); border-bottom: 2px solid var(--ok, #138A4B); transform: rotate(-45deg); }
.sec-checks { list-style: none; margin: 0; padding: 0 0 6px; }
.sec-checks li { display: flex; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); }
.sec-checks li:first-child { border-top: 0; }
.sec-checks b { display: block; }
.sec-checks p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.sec-checks .sc-fix { color: var(--ink); background: #FFF8E6; border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
.sc-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; color: #fff; margin-top: 1px; }
.sc-dot svg { width: 15px; height: 15px; }
.sc-ok .sc-dot { background: var(--ok, #138A4B); }
.sc-warn .sc-dot { background: #B07A00; }
.sc-fail .sc-dot { background: var(--err, #B42318); }
.sc-fail .sc-fix { background: #FDECE7; }
.install-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 12px 12px 12px 14px; margin-bottom: 16px; }
.install-card[hidden] { display: none; }
.install-card img { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.install-card div { flex: 1; min-width: 0; line-height: 1.35; }
.install-card b { display: block; font-size: .95rem; }
.install-card span { display: block; font-size: .85rem; color: var(--muted); }
.install-card span b { display: inline; font-size: inherit; color: var(--ink); }
.install-x { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.install-x:hover { background: var(--bg, #F4F7FA); }
.install-x svg { width: 18px; height: 18px; }
.masked { color: var(--muted); letter-spacing: .03em; font-variant-numeric: tabular-nums; cursor: help; }

/* ---------- v2.8.0: result workflow (TR), marks entry, remark rules, teacher schedule ---------- */
.req { color: var(--err); }
.marks-list .att-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px auto; gap: 10px; align-items: center; }
.marks-list .mark-in { width: 84px; max-width: 84px; }
.mk-roll { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 42px; border-radius: 8px; background: var(--brand-tint); color: var(--brand-deep); font: 700 1rem/1 var(--f-head); }
.mk-roll small { font: 600 .58rem/1 var(--f-body, inherit); text-transform: uppercase; letter-spacing: .04em; opacity: .75; margin-bottom: 2px; }
.marks-list .att-name small { display: block; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .marks-list .att-row { grid-template-columns: 38px minmax(0, 1fr) 70px auto; gap: 7px; padding: 8px 10px; } .marks-list .mark-in { width: 70px; } .mk-roll { width: 38px; } }
.flow-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flow-steps li { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .8rem; position: relative; }
.flow-steps li b { display: block; font-size: .84rem; color: var(--ink, #10233A); }
.flow-steps li span { color: var(--muted); }
.flow-steps li.done { border-color: #BFE3CD; background: var(--ok-bg); }
.flow-steps li.done b::after { content: " ✓"; color: var(--ok); }
.flow-steps li.now { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
@media (max-width: 700px) { .flow-steps { grid-template-columns: 1fr 1fr; } }
.submit-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.tr-subjects td small { display: block; color: var(--muted); }
.tr-tbl th, .tr-tbl td { text-align: center; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.tr-tbl thead th { white-space: normal; max-width: 86px; line-height: 1.2; vertical-align: bottom; }
.tr-tbl thead th.rmk { max-width: none; }
.tr-actions input[type=datetime-local] { max-width: 260px; margin: 4px 0 0 28px; }
.tr-tbl .reg-name { text-align: left; }
.tr-tbl td.rmk { text-align: left; white-space: normal; min-width: 260px; font-size: .82rem; line-height: 1.35; }
.tr-tbl td.rmk input { width: 100%; min-width: 230px; font-size: .85rem; }
.tr-tbl td.rmk small { display: block; color: var(--muted); }
.tr-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.tr-stamp { display: none; }
.rule-tbl td { vertical-align: top; }
.rule-tbl input[type=number] { width: 58px; padding-left: 6px; padding-right: 4px; }
.rule-tbl td:first-child input[type=number] { width: 50px; }
.rule-tbl select { min-width: 72px; }
.rule-tbl textarea { min-width: 220px; width: 100%; }
.rule-tbl td:last-child { white-space: nowrap; }
.rule-tbl td:last-child .check { display: flex; margin: 2px 0; }
input.weak-pct { width: 74px; display: inline-block; padding: 4px 6px; min-height: 0; }
.rule-tbl .rng { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rule-try { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.rule-out { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-deep); font-weight: 500; }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sched-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.sched-card b { display: block; }
.sched-card .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sched-card .tags span { font-size: .74rem; padding: 2px 7px; border-radius: 6px; background: #EEF1F4; color: #4D5866; }
.tt td.clash { background: var(--err-bg); }
.tt-warn { display: block; margin-top: 3px; font-size: .72rem; line-height: 1.25; color: var(--err); font-weight: 600; }
.tt-edit td.clash select { border-color: var(--err); }
.rc-provisional { margin: 0 0 6px; padding: 4px 8px; border: 1px dashed #C9701D; color: #9A4E0C; font-size: 9pt; text-align: center; border-radius: 4px; }
@media print {
  .tr-print-head { display: block !important; }
  .tr-stamp { display: flex; justify-content: space-between; margin-top: 28px; font-size: 9pt; }
  .tr-stamp div { text-align: center; min-width: 180px; border-top: 1px solid #333; padding-top: 4px; }
  .tr-tbl td.rmk input { border: 0; padding: 0; font-size: 8pt; }
}

.tr-tbl tr.rmk-row td { text-align: left; white-space: normal; padding-top: 0; font-size: .84rem; color: var(--muted); border-top: 0; }
.tr-tbl tr.rmk-row td { display: table-cell; }
.tr-tbl tr.rmk-row .rmk-label { display: inline-block; min-width: 64px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--muted); }
.tr-tbl tr.rmk-row td > input[data-rmk-in] { width: calc(100% - 80px - 210px); min-width: 260px; max-width: 640px; font-size: .86rem; padding: 5px 8px; min-height: 0; }
.tr-tbl tr.rmk-row .rmk-pick { display: inline-block; width: 200px; margin-left: 8px; font-size: .8rem; padding: 4px 6px; min-height: 0; vertical-align: middle; }
@media (max-width: 700px) { .tr-tbl tr.rmk-row td > input[data-rmk-in] { width: 100%; min-width: 0; } .tr-tbl tr.rmk-row .rmk-pick { width: 100%; margin: 4px 0 0; } }
.tr-tbl tr.rmk-row small { margin-left: 8px; color: var(--muted); }
.tr-tbl tbody tr:not(.rmk-row) td { border-bottom: 0; }
@media print { .tr-tbl tr.rmk-row td { font-size: 7.5pt; color: #333; } .tr-tbl tr.rmk-row input { border: 0; padding: 0; width: 100%; } }

/* TR print: one compact landscape sheet */
@media print {
  .tr-tbl { font-size: 7.6pt; width: 100%; }
  .tr-tbl th, .tr-tbl td { padding: 2px 4px !important; }
  .tr-tbl tbody.st-rows { break-inside: avoid; page-break-inside: avoid; }
  .tr-tbl tr.rmk-row td { padding-top: 0 !important; padding-bottom: 3px !important; border-bottom: 1px solid #ccc !important; }
  .tr-tbl thead { display: table-header-group; }
  .tr-sum { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px !important; }
  .tr-sum .stat { padding: 4px 8px; border: 1px solid #ccc; box-shadow: none; } .tr-sum .stat b { font-size: 10pt; }
  .reg-wrap { overflow: visible !important; }
}

/* ---------- v2.9.0: school-themed sign in, "Login as", Android app ---------- */
.auth-themed { position: relative; background: #F4F7FA; align-items: start; padding-top: 0; }
.auth-themed::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 250px; background: radial-gradient(120% 140% at 85% 0%, var(--brand-2) 0%, transparent 55%), linear-gradient(160deg, var(--brand-deep) 0%, var(--brand) 100%); }
.auth-band { position: absolute; left: 0; right: 0; top: 249px; height: 40px; color: var(--brand); line-height: 0; }
.auth-band svg { width: 100%; height: 100%; display: block; }
.auth-themed .auth-box { position: relative; z-index: 1; padding-top: max(36px, env(safe-area-inset-top)); }
.auth-themed .auth-logo { margin-bottom: 18px; color: #fff; }
.auth-themed .auth-logo img { max-height: 92px; max-width: 220px; padding: 12px 16px; background: #fff; border-radius: 20px; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.auth-themed .auth-logo b { color: #fff; font-size: 1.25rem; text-shadow: 0 2px 10px rgba(0,0,0,.2); }
.auth-themed .card { border-radius: 20px; box-shadow: 0 18px 44px rgba(10,40,70,.14); border: 0; }
.as-pick { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.as-pick legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.as-opt { position: relative; display: block; cursor: pointer; margin: 0; }
.as-opt input { position: absolute; opacity: 0; pointer-events: none; }
.as-opt span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; height: 100%; box-sizing: border-box; padding: 12px 12px 11px; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.as-opt svg { width: 26px; height: 26px; color: var(--muted); margin-bottom: 2px; }
.as-opt b { font-size: .98rem; color: var(--ink, #10233A); }
.as-opt small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.as-opt input:checked + span { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.as-opt input:checked + span svg { color: var(--brand); }
.as-opt input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye.on { color: var(--brand); }
/* inside the Android app: no website chrome, room for the status bar */
body.in-app .auth-foot a[href^="tel:"] { white-space: nowrap; }
body.in-app .install-card, body.in-app [data-install] { display: none !important; }
.role-switch { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 14px; border-radius: 14px; background: var(--brand-tint); color: var(--brand-deep); font-size: .9rem; }
.role-switch a { margin-left: auto; font-weight: 600; white-space: nowrap; }
