/* Arrow Classes — Student & Teacher panels (LMS layout, teal theme) */
:root {
  --ink: #13201f; --muted: #5f6f6c; --line: #e3ebe9; --bg: #f4f7f6; --card: #fff;
  --side: #0b2422; --side-2: #0f2f2c;
  --p: #0f8f7f; --p-2: #0b6e62; --p-soft: #e6f4f1; --p-glow: rgba(15,143,127,.18);
  --gold: #c4a14f; --gold-soft: #e3c97f;
  --ok: #16a34a; --ok-soft: #e8f7ee; --bad: #dc2626; --bad-soft: #fdeeee; --warn: #c27803; --warn-soft: #fff5e1; --info: #0e7490; --info-soft: #e5f4f8; --vio: #7c3aed; --vio-soft: #f2ecfe;
  --r: 14px; --shadow: 0 1px 2px rgba(16,40,36,.04), 0 6px 20px -12px rgba(16,40,36,.18);
  --font: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --sw: 236px;
  /* v9 theme tokens (Light = the original design; other themes are applied by panel-plus.js) */
  --card-2: #f7faf9; --line-2: #eef3f2; --tabs-bg: #e9f0ee; --input-line: #d6e2df; --chip-bg: #edf2f1; --chip-ink: #44524f; --hover: #f8fcfb;
  --side-ink: #e1efec; --side-active: #5eead4; --hero-2: #0f4a44; --on-p: #fff; --p-l: #12a08e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--p); }
button { font: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
svg { flex: none; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--sw); background: linear-gradient(180deg, var(--side), var(--side-2)); color: #e1efec; display: flex; flex-direction: column; z-index: 40; transition: width .2s, transform .25s; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; text-decoration: none; color: #fff; }
.side-brand svg, .side-brand img { width: 34px; height: 34px; flex: none; }
.side-brand b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.15; }
.side-brand small { display: block; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); font-weight: 600; }
.side nav { flex: 1; overflow-y: auto; padding: 6px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.side nav::-webkit-scrollbar { width: 6px; } .side nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }
.nav-h { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.38); font-weight: 700; padding: 12px 10px 5px; }
.nav-a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: rgba(225,240,237,.74); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 1px; transition: background .15s, color .15s; white-space: nowrap; }
.nav-a svg { width: 17px; height: 17px; }
.nav-a span:not(.cnt) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-a.on { background: var(--side-active-soft, rgba(45,212,191,.15)); color: #fff; box-shadow: inset 0 0 0 1px var(--side-active-line, rgba(45,212,191,.22)); }
.nav-a.on svg { color: #5eead4; }
.nav-a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #5eead4; }
.nav-a .cnt { margin-left: auto; min-width: 19px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--gold-soft); color: var(--side); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.side-foot .who { min-width: 0; flex: 1; } .side-foot b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .side-foot small { font-size: 11px; color: rgba(255,255,255,.5); }
.side-foot button { background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; } .side-foot button:hover { color: #fff; background: rgba(255,255,255,.08); }
.side-foot svg { width: 17px; height: 17px; }

/* collapsed sidebar (desktop) */
body.mini { --sw: 68px; }
body.mini .side-brand span, body.mini .nav-h, body.mini .nav-a span, body.mini .nav-a .cnt, body.mini .side-foot .who, body.mini .side-foot .av { display: none; }
body.mini .nav-a { justify-content: center; padding: 10px; } body.mini .side-brand { justify-content: center; } body.mini .side-foot { justify-content: center; padding: 6px; }

.main { flex: 1; min-width: 0; margin-left: var(--sw); transition: margin-left .2s; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 58px; background: var(--top-bg, rgba(255,255,255,.9)); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.ib { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink); position: relative; flex: none; }
.ib:hover { border-color: #bfd3cf; } .ib svg { width: 18px; height: 18px; }
.ib .dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--card); }
.crumb { min-width: 0; } .crumb small { display: block; font-size: 11px; color: var(--muted); } .crumb b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sp { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); cursor: pointer; position: relative; }
.me b { display: block; font-size: 12px; font-weight: 600; line-height: 1.15; } .me small { font-size: 10.5px; color: var(--muted); }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--p-l), var(--p-2)); overflow: hidden; flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.gold { background: linear-gradient(135deg, var(--gold-soft), #b38a35); color: var(--side); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 48px rgba(16,40,36,.16); min-width: 220px; padding: 6px; z-index: 50; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; text-decoration: none; color: var(--ink); font-size: 13px; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--bg); } .menu .danger { color: var(--bad); } .menu svg { width: 16px; height: 16px; }
.menu .mh { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; } .menu .mh b { display: block; font-size: 13px; } .menu .mh small { color: var(--muted); font-size: 11.5px; }
.pop { width: 360px; max-width: 92vw; padding: 0; } .pop .ph { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pop .pl { max-height: 380px; overflow-y: auto; } .pop .pi { padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; } .pop .pi:hover { background: var(--hover); }
.pop .pi.un { background: var(--p-soft); } .pop .pi b { font-size: 13px; display: block; } .pop .pi small { color: var(--muted); font-size: 11.5px; }
.content { padding: 22px; max-width: 1360px; width: 100%; }
.page-in { animation: fin .3s ease both; } @keyframes fin { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.scrim { display: none; }
@media (max-width: 899px) {
  .side { transform: translateX(-100%); width: 248px; } body.drawer .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(11,36,34,.45); z-index: 35; }
  .main { margin-left: 0; } .content { padding: 14px; } .top { padding: 0 12px; } .me .nm { display: none; } .me { padding-right: 3px; }
  body.mini { --sw: 248px; } body.mini .side-brand span, body.mini .nav-h, body.mini .nav-a span { display: initial; }
}
@media (prefers-reduced-motion: reduce) { .page-in, .side, .main { animation: none; transition: none; } }

/* ---------- Building blocks ---------- */
.ph1 { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ph1 h1 { font-size: 20px; font-weight: 700; } .ph1 p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1180px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span2 { grid-column: auto; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h3 { font-size: 14px; font-weight: 700; } .card-h .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--p-soft); color: var(--p); }
.card-h .ci svg { width: 16px; height: 16px; } .card-h .ex { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card.flat { box-shadow: none; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -22px; top: -22px; width: 76px; height: 76px; border-radius: 50%; background: var(--cs, var(--p-soft)); }
.stat .si { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--c, var(--p)); position: relative; z-index: 1; margin-bottom: 10px; } .stat .si svg { width: 16px; height: 16px; }
.stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; } .stat small { color: var(--muted); font-size: 12px; font-weight: 500; }
.c-ok { --c: var(--ok); --cs: var(--ok-soft); } .c-bad { --c: var(--bad); --cs: var(--bad-soft); } .c-warn { --c: var(--warn); --cs: var(--warn-soft); } .c-info { --c: var(--info); --cs: var(--info-soft); } .c-vio { --c: var(--vio); --cs: var(--vio-soft); } .c-gold { --c: #a57f2c; --cs: #faf3df; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; background: linear-gradient(135deg, var(--p-l), var(--p)); color: #fff; box-shadow: 0 4px 12px -6px var(--p); text-decoration: none; white-space: nowrap; transition: filter .15s; }
.btn:hover { filter: brightness(1.06); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.alt { background: var(--card); color: var(--ink); border: 1px solid var(--input-line); box-shadow: none; } .btn.alt:hover { border-color: var(--p); color: var(--p); }
.btn.ghost { background: transparent; color: var(--p); box-shadow: none; padding: 6px 10px; } .btn.ghost:hover { background: var(--p-soft); }
.btn.danger { background: var(--bad); box-shadow: none; } .btn.sm { padding: 5px 10px; font-size: 12px; } .btn.block { width: 100%; padding: 10px; }
.btn svg { width: 15px; height: 15px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.info { background: var(--info-soft); color: var(--info); } .chip.vio { background: var(--vio-soft); color: var(--vio); } .chip.p { background: var(--p-soft); color: var(--p-2); }
.muted { color: var(--muted); } .small { font-size: 12px; } .b { font-weight: 600; } .mt { margin-top: 12px; } .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > .grow { flex: 1; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); } .empty svg { width: 34px; height: 34px; color: #b5c9c5; margin-bottom: 6px; } .empty b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 2px; }
.sk { background: linear-gradient(90deg, var(--line-2) 25%, var(--card-2) 50%, var(--line-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; } @keyframes sk { to { background-position: -200% 0; } }

/* tables */
.tw { overflow-x: auto; margin: 0 -2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--th-bg, color-mix(in srgb, var(--card) 92%, var(--ink) 8%)); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; } tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: var(--hover); }
td .sub { display: block; color: var(--muted); font-size: 11.5px; }

/* forms */
label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: #3a4a47; }
input, select, textarea { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--card); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-glow); }
input[type=radio], input[type=checkbox] { width: auto; box-shadow: none; accent-color: var(--p); }
.form { display: grid; gap: 12px; } .form.two { grid-template-columns: 1fr 1fr; } .form .full { grid-column: 1 / -1; } @media (max-width: 640px) { .form.two { grid-template-columns: 1fr; } }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .switch:last-child { border-bottom: 0; }
.switch b { display: block; font-size: 13px; font-weight: 600; } .switch small { color: var(--muted); font-size: 12px; }
.tg { position: relative; width: 38px; height: 22px; flex: none; } .tg input { opacity: 0; width: 0; height: 0; } .tg span { position: absolute; inset: 0; border-radius: 99px; background: #cfdcd9; cursor: pointer; transition: background .2s; }
.tg span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); } .tg input:checked + span { background: var(--p); } .tg input:checked + span::after { transform: translateX(16px); }
.file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .file .chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* tabs & segments */
.tabs { display: inline-flex; background: var(--tabs-bg); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(16,40,36,.1); }

/* progress */
.bar { height: 8px; background: var(--tabs-bg); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--side-active), var(--p)); transition: width .8s ease; }
.ring { --v: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--p) calc(var(--v) * 1%), var(--tabs-bg) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--card); } .ring b { position: relative; font-size: 22px; font-weight: 700; } .ring small { position: relative; display: block; font-size: 11px; color: var(--muted); text-align: center; margin-top: -4px; }
.legend { display: grid; gap: 8px; } .legend div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; } .legend i { width: 10px; height: 10px; border-radius: 3px; } .legend b { margin-left: auto; }

/* hero */
.hero { position: relative; overflow: hidden; color: #fff; border: 0; padding: 22px; border-radius: 16px;
  background: radial-gradient(60% 120% at 100% 0%, rgba(196,161,79,.35), transparent 55%), radial-gradient(60% 100% at 0% 100%, rgba(45,212,191,.35), transparent 60%), linear-gradient(135deg, var(--side), var(--hero-2, #0f4a44)); }
.hero .chev { position: absolute; right: 26px; bottom: -34px; width: 200px; opacity: .14; pointer-events: none; }
.hero-in { position: relative; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.photo { width: 104px; height: 104px; border-radius: 22px; overflow: hidden; border: 3px solid rgba(255,255,255,.25); flex: none; background: linear-gradient(135deg, var(--gold-soft), #b38a35); color: var(--side); display: grid; place-items: center; font-size: 40px; font-weight: 700; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.hero .hi { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-soft); font-weight: 700; } .hero h2 { font-size: 22px; font-weight: 700; margin: 2px 0 8px; color: #fff; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 18px; flex: 1; min-width: 260px; }
.facts div small { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.6); } .facts div b { font-size: 13px; font-weight: 600; }
.clock { position: relative; margin-left: auto; text-align: right; padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); min-width: 180px; }
.clock .t { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .clock small { display: block; font-size: 12px; opacity: .8; } .clock .g { font-size: 11px; color: var(--gold-soft); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 760px) { .clock { margin-left: 0; width: 100%; text-align: left; } .photo { width: 84px; height: 84px; } }

/* lists */
.li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .li:last-child { border-bottom: 0; } .li:first-child { padding-top: 0; }
.li .lic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--p-soft); color: var(--p); flex: none; } .li .lic svg { width: 16px; height: 16px; }
.li .lt { flex: 1; min-width: 0; } .li .lt b { display: block; font-size: 13px; font-weight: 600; } .li .lt small { color: var(--muted); font-size: 12px; } .li .lr { text-align: right; flex: none; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--card-2); border-left: 3px solid var(--gold); margin-bottom: 10px; cursor: pointer; }
.notice.un { background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); } .notice.urgent { border-left-color: var(--bad); } .notice.important { border-left-color: var(--warn); }
.notice b { display: block; font-size: 13.5px; } .notice p { margin: 4px 0 0; color: var(--chip-ink); font-size: 13px; white-space: pre-wrap; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; } .cal .dh { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; padding-bottom: 2px; }
.cal .d { height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--card) 90%, var(--ink) 10%); color: var(--muted); position: relative; }
.cal .d.PRESENT { background: var(--ok-soft); color: var(--ok); } .cal .d.ABSENT { background: var(--bad-soft); color: var(--bad); } .cal .d.LATE { background: var(--warn-soft); color: var(--warn); } .cal .d.LEAVE { background: var(--info-soft); color: var(--info); }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--p); }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(11,36,34,.5); z-index: 80; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal .box { background: var(--card); border-radius: 16px; width: min(560px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: fin .2s ease; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal .box.wide { width: min(980px, 100%); }
.modal .mh2 { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; } .modal .mh2 h3 { font-size: 15px; flex: 1; }
.modal .mb { padding: 16px 18px; overflow-y: auto; } .modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; z-index: 99; box-shadow: 0 12px 30px rgba(0,0,0,.25); max-width: 92vw; animation: fin .2s ease; }
.toast.err { background: var(--bad); } .toast.ok { background: var(--p-2); }

/* tests */
.q { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; } .q p { margin: 0 0 8px; font-weight: 600; }
.q label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; } .q label:hover { background: var(--bg); }
.timer { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-variant-numeric: tabular-nums; }
.qbox { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; margin-top: 10px; background: color-mix(in srgb, var(--card) 96%, var(--ink) 4%); }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 0% 0%, rgba(45,212,191,.12), transparent 60%), radial-gradient(60% 50% at 100% 100%, rgba(196,161,79,.14), transparent 60%), var(--bg); }
.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 900px; width: 100%; background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(16,40,36,.35); border: 1px solid var(--line); }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  background: radial-gradient(80% 60% at 0% 0%, rgba(45,212,191,.35), transparent 60%), radial-gradient(70% 50% at 100% 100%, rgba(196,161,79,.4), transparent 60%), linear-gradient(160deg, var(--side), var(--hero-2, #0f4a44)); }
.auth-side .brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; } .auth-side .brand svg, .auth-side .brand img { width: 38px; height: 38px; } .auth-side .brand b { font-size: 15px; } .auth-side .brand small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--gold-soft); text-transform: uppercase; }
.auth-side h1 { font-size: 26px; line-height: 1.2; font-weight: 700; } .auth-side p { margin: 8px 0 0; opacity: .78; font-size: 13.5px; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .auth-side li { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 13px; }
.auth-side li span { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: var(--gold-soft); } .auth-side li svg { width: 14px; height: 14px; }
.auth-side .chev { position: absolute; right: -40px; bottom: -40px; width: 230px; opacity: .13; }
.auth-form { padding: 34px; display: grid; gap: 12px; align-content: center; }
.auth-form h2 { font-size: 22px; font-weight: 700; } .auth-form .sub { margin: -4px 0 4px; color: var(--muted); font-size: 13px; }
.tag { justify-self: start; padding: 3px 10px; border-radius: 99px; background: var(--p-soft); color: var(--p-2); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--line-2); padding: 3px; border-radius: 10px; gap: 3px; }
.seg button { border: 0; background: none; padding: 7px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; } .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(16,40,36,.1); }
.otp-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.alt-link { text-align: center; font-size: 12.5px; color: var(--muted); margin: 4px 0 0; } .alt-link a { font-weight: 600; text-decoration: none; }
.msg { font-size: 12.5px; border-radius: 8px; padding: 8px 10px; } .msg:empty { display: none; } .msg.err { color: var(--bad); background: var(--bad-soft); } .msg.ok { color: var(--p-2); background: var(--p-soft); }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 24px; } .auth-side ul, .auth-side .foot { display: none; } .auth-form { padding: 24px; } }

/* receipt (student) */
.rc { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rc-h { padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #0b2422, #0f5c54 60%, var(--p)); display: flex; gap: 14px; align-items: center; }
.rc-h svg { width: 42px; height: 42px; } .rc-h .n { flex: 1; } .rc-h .n b { font-size: 17px; display: block; } .rc-h .n small { opacity: .75; font-size: 11.5px; }
.rc-h .r { text-align: right; } .rc-h .r .pill { display: inline-block; padding: 2px 10px; border-radius: 99px; border: 1px solid rgba(227,201,127,.5); color: #f1dca0; font-size: 10px; font-weight: 700; letter-spacing: .14em; } .rc-h .r b { display: block; font-size: 14px; margin-top: 4px; } .rc-h .r small { font-size: 11px; opacity: .8; }
.rc-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; padding: 16px 20px 8px; } .rc-g small { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; } .rc-g b { font-size: 13px; }
.rc-t { margin: 8px 20px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } .rc-t div { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 12.5px; } .rc-t div:nth-child(odd) { background: var(--card-2); }
.rc-a { margin: 10px 20px 16px; padding: 12px 14px; border-radius: 10px; background: var(--p-soft); border: 1px dashed #8fd3c8; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rc-a small { display: block; font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--p-2); } .rc-a b { font-size: 22px; color: #0b5a51; }
.rc-f { height: 5px; background: linear-gradient(90deg, var(--gold), var(--gold-soft), var(--gold)); }
@media print { body * { visibility: hidden; } .rc, .rc * { visibility: visible; } .rc { position: absolute; left: 0; top: 0; width: 100%; } }

/* ---------- Notice banner pop-up ---------- */
.nb-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(11,36,34,.45); display: grid; place-items: center; padding: 16px; animation: fin .25s ease; }
.nb-wrap.out { opacity: 0; transition: opacity .25s; }
.nb { position: relative; width: min(560px, 100%); background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: nbIn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes nbIn { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.nb-top { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: center; padding: 22px 54px 20px 22px; color: #fff; background: radial-gradient(70% 140% at 100% 0%, rgba(196,161,79,.45), transparent 60%), linear-gradient(135deg, #0b2422, #0f5c54); }
.nb.urgent .nb-top { background: radial-gradient(70% 140% at 100% 0%, rgba(255,255,255,.18), transparent 60%), linear-gradient(135deg, #7f1d1d, #dc2626); }
.nb.important .nb-top { background: radial-gradient(70% 140% at 100% 0%, rgba(255,255,255,.2), transparent 60%), linear-gradient(135deg, #78350f, #c27803); }
.nb-top .chev { position: absolute; right: -20px; bottom: -50px; width: 160px; opacity: .18; }
.nb-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: var(--gold-soft); flex: none; } .nb-ic svg { width: 22px; height: 22px; }
.nb-k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--gold-soft); }
.nb h3 { font-size: 18px; margin-top: 3px; color: #fff; }
.nb-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s; }
.nb-x:hover { background: rgba(255,255,255,.25); transform: rotate(90deg); } .nb-x svg { width: 16px; height: 16px; }
.nb-body { padding: 18px 22px 20px; } .nb-body p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--nb-ink, #2b3a37); max-height: 45vh; overflow: auto; }
.nb-f { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.today { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.today .tbox { padding: 10px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); min-width: 120px; } .today .tbox small { display: block; font-size: 11px; color: var(--muted); } .today .tbox b { font-size: 15px; }
.stars { display: inline-flex; gap: 2px; } .stars button { border: 0; background: none; font-size: 26px; cursor: pointer; color: #d4dcda; padding: 0 2px; line-height: 1; } .stars button.on { color: #f5a524; }
.pp { display: flex; gap: 14px; align-items: center; } .pp .photo { width: 84px; height: 84px; border-radius: 18px; margin: 0; }

/* ---------- v9: themes (dark, high contrast), language direction, pop-up queue, Arrow AI, translator ---------- */
html[data-mode="dark"] { color-scheme: dark; }
html[data-mode="dark"] .ok, html[data-mode="dark"] .chip.ok { background: rgba(34,197,94,.16); color: #4ade80; }
html[data-mode="dark"] .chip.bad { background: rgba(248,113,113,.16); color: #fca5a5; }
html[data-mode="dark"] .chip.warn { background: rgba(251,191,36,.16); color: #fcd34d; }
html[data-mode="dark"] .chip.info, html[data-mode="dark"] .chip.p { background: rgba(56,189,248,.16); color: #7dd3fc; }
html[data-mode="dark"] .sk { opacity: .5; }
html[data-mode="dark"] img { opacity: .96; }
html[data-theme="contrast"] .card, html[data-theme="contrast"] .stat, html[data-theme="contrast"] input, html[data-theme="contrast"] select, html[data-theme="contrast"] textarea, html[data-theme="contrast"] .btn.alt { border-color: #fff !important; }
html[data-theme="contrast"] a { text-decoration: underline; }
html[data-theme="contrast"] :focus-visible { outline: 3px solid #ffd400 !important; outline-offset: 2px; }
html[data-bg="soft-gradient"] body { background-image: radial-gradient(1200px 600px at 100% -10%, var(--p-glow), transparent 60%); background-attachment: fixed; }
html[data-bg="subtle-pattern"] body { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.btn { color: var(--on-p); }
.nav-a { color: var(--side-ink); opacity: .8; } .nav-a:hover, .nav-a.on { opacity: 1; } .nav-a.on svg { color: var(--side-active); } .nav-a.on::before { background: var(--side-active); }
html[dir="rtl"] .side { inset: 0 0 0 auto; } html[dir="rtl"] .main { margin-left: 0; margin-right: var(--sw); }
html[dir="rtl"] .menu { right: auto; left: 0; } html[dir="rtl"] .nav-a.on::before { left: auto; right: -10px; }
@media (max-width: 899px) { html[dir="rtl"] .main { margin-right: 0; } html[dir="rtl"] .side { transform: translateX(100%); } html[dir="rtl"] body.drawer .side { transform: none; } }
/* theme gallery */
.thm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thm { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); cursor: pointer; padding: 0; text-align: start; color: var(--ink); font: inherit; transition: transform .15s, border-color .15s; }
.thm:hover { transform: translateY(-2px); } .thm[aria-pressed="true"] { border-color: var(--p); } .thm:focus-visible { outline: 3px solid var(--p); }
.thm .pv { display: flex; height: 64px; } .thm .pv i { width: 22px; display: block; } .thm .pv span { flex: 1; padding: 8px; display: grid; gap: 5px; align-content: start; }
.thm .pv b { display: block; height: 9px; border-radius: 3px; } .thm .nm { padding: 6px 10px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; }
.clr { display: flex; align-items: center; gap: 8px; } .clr input[type=color] { width: 42px; height: 34px; padding: 0; border-radius: 8px; cursor: pointer; }
/* notice pop-up queue */
.nb-q { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 4px; } .nb .nb-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nb.urgent .nb-top { box-shadow: inset 0 -3px 0 var(--bad); } .nb.important .nb-top { box-shadow: inset 0 -3px 0 var(--warn); }
.nb-wrap.live .nb { animation: nbIn .35s cubic-bezier(.2,.9,.3,1.2), nbPulse 1.6s .4s 2; }
@keyframes nbPulse { 50% { box-shadow: 0 0 0 6px rgba(220,38,38,.18), 0 30px 80px rgba(0,0,0,.35); } }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notice .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; } .notice.pinned { border-left-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft), var(--shadow); }
/* Arrow AI chat + translator */
.ai-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 14px; min-height: calc(100vh - 170px); }
@media (max-width: 999px) { .ai-wrap { grid-template-columns: 1fr; } .ai-side { order: 2; } }
.ai-side { display: flex; flex-direction: column; gap: 8px; } .ai-side .list { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.ai-conv { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; } .ai-conv:hover { background: var(--hover); } .ai-conv.on { border-color: var(--p); background: var(--p-soft); }
.ai-conv b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-main { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-height: 520px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ai-m { display: flex; gap: 10px; animation: fin .25s ease; } .ai-m.me { justify-content: flex-end; }
.ai-bub { max-width: min(78%, 760px); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-m.me .ai-bub { background: var(--p-soft); border-color: transparent; white-space: pre-wrap; }
.ai-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--p); color: var(--on-p); flex: none; } .ai-ic svg { width: 16px; height: 16px; }
.ai-tools { display: flex; gap: 4px; margin-top: 4px; } .ai-tools button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; display: inline-flex; gap: 4px; align-items: center; } .ai-tools button:hover { background: var(--hover); color: var(--ink); }
.ai-tools svg { width: 13px; height: 13px; }
.ai-in { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; } .ai-in .row { gap: 8px; } .ai-in textarea { resize: none; min-height: 42px; max-height: 160px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; } .ai-chips button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; } .ai-chips button.on { background: var(--p); color: var(--on-p); border-color: var(--p); }
.ai-empty { margin: auto; text-align: center; max-width: 520px; padding: 24px 8px; } .ai-empty .ai-ic { width: 50px; height: 50px; margin: 0 auto 10px; } .ai-empty .ai-chips { justify-content: center; margin-top: 12px; }
.ai-img { display: block; max-width: 100%; width: 420px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: tblink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes tblink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-md h1, .ai-md h2, .ai-md h3, .ai-md h4 { font-size: 1.02em; margin: .8em 0 .3em; } .ai-md p { margin: .45em 0; } .ai-md ul, .ai-md ol { margin: .35em 0; padding-inline-start: 1.4em; }
.ai-md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--chip-bg); padding: .1em .35em; border-radius: 5px; } .ai-md pre { background: var(--chip-bg); padding: 10px; border-radius: 8px; overflow-x: auto; } .ai-md pre code { background: none; padding: 0; }
.ai-md table { border-collapse: collapse; display: block; overflow-x: auto; margin: .5em 0; } .ai-md th, .ai-md td { border: 1px solid var(--line); padding: 4px 8px; } .ai-md > :first-child { margin-top: 0; } .ai-md > :last-child { margin-bottom: 0; }
.tr-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; } @media (max-width: 799px) { .tr-grid { grid-template-columns: 1fr; } .tr-grid .swap { justify-self: center; transform: rotate(90deg); } }
.tr-grid textarea { min-height: 180px; } .tr-out { min-height: 180px; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--card-2); white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.tr-h { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: grid; gap: 4px; } .tr-h:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .ai-m, .nb, .nb-wrap.live .nb, .typing i { animation: none !important; } }
.btn.danger { color: #fff; }
html[data-mode="dark"] .stat::after { opacity: .16; }
html[data-mode="dark"] .nb-body p { color: var(--ink); }
html[data-mode="dark"] .empty svg { color: var(--muted); opacity: .6; }
html[data-mode="dark"] .auth-wrap { background-color: var(--bg); }

/* Right-to-left languages: names, notices and messages typed in English (or any language) keep their own direction,
   so punctuation stays at the right end of the sentence. */
html[dir="rtl"] :is(p, h1, h2, h3, h4, h5, h6, li, td, th, label, b, strong, span, small, a, button, figcaption, blockquote, .chip):not(.side *) { unicode-bidi: plaintext; }

/* v10.2 wide dialogs (test editor, answer checking, previews) */
.modal .box.xwide { width: min(1100px, 96vw); max-width: 96vw; }
.qbox textarea, .qbox input:not([type=checkbox]):not([type=radio]), .qbox select { width: 100%; }
.qbox .row > input { flex: 1; }

/* =====================================================================
   v1.15 New look (same style as the website): Figtree, mint colours, flat buttons, no spaced capitals.
   Switched on for every panel by Admin › My account › Look of all panels (html[data-look="new"]);
   "Old look" removes the attribute and the panels stay exactly as before.
   ===================================================================== */
html[data-look="new"] { --font: 'Figtree', 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif; --r: 14px; }
html[data-look="new"] body { font-size: 14px; }
html[data-look="new"] .nav-h { font-size: 11.5px; letter-spacing: .02em; text-transform: none; font-weight: 600; color: rgba(255,255,255,.5); }
html[data-look="new"] .nav-a { font-size: 13.5px; }
html[data-look="new"] .nav-a.on svg { color: var(--side-active); }
html[data-look="new"] .nav-a.on::before { background: var(--side-active); }
html[data-look="new"] .side-brand small, html[data-look="new"] .auth-side .brand small { font-size: 11px; letter-spacing: .02em; text-transform: none; }
html[data-look="new"] .btn { background: var(--p); box-shadow: none; border-radius: 10px; font-size: 13.5px; }
html[data-look="new"] .btn:hover { filter: none; background: var(--p-2); }
html[data-look="new"] .btn.alt { background: var(--card); } html[data-look="new"] .btn.alt:hover { background: var(--card); }
html[data-look="new"] .btn.ghost { background: transparent; } html[data-look="new"] .btn.ghost:hover { background: var(--p-soft); }
html[data-look="new"] th { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 600; }
html[data-look="new"] :is(.hero .hi, .facts div small, .cal .dh, .tag, .rc-g small, .nb-k) { text-transform: none; letter-spacing: .01em; }
html[data-look="new"] .hero .hi { font-size: 12.5px; font-weight: 600; }
html[data-look="new"] .facts div small { font-size: 12px; }
html[data-look="new"] .tag { font-size: 11.5px; font-weight: 600; }
html[data-look="new"] .hero { color: var(--ink); border: 1px solid var(--line); background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--p) 9%, var(--card)), var(--card)); }
html[data-look="new"][data-mode="dark"] .hero { color: #fff; border: 0; background: linear-gradient(135deg, var(--side), var(--hero-2, #0f4a44)); }
html[data-look="new"]:not([data-mode="dark"]) .hero h2 { color: var(--ink); }
html[data-look="new"]:not([data-mode="dark"]) .hero .hi { color: var(--p); }
html[data-look="new"]:not([data-mode="dark"]) .facts div small { color: var(--muted); }
html[data-look="new"]:not([data-mode="dark"]) .hero .chev { opacity: .1; color: var(--p); }
html[data-look="new"] .photo { border-color: #fff; background: var(--p-soft); color: var(--p-2); }
html[data-look="new"] .av.gold { background: var(--gold-soft); }
html[data-look="new"] .auth-wrap { background: radial-gradient(60% 50% at 0% 0%, rgba(19,162,127,.12), transparent 60%), var(--bg); }
html[data-look="new"] .auth-side { background: radial-gradient(80% 60% at 0% 0%, rgba(19,162,127,.4), transparent 60%), radial-gradient(70% 50% at 100% 100%, rgba(127,209,178,.22), transparent 60%), linear-gradient(160deg, var(--side), var(--side-2)); }
html[data-look="new"] .rc-h { background: linear-gradient(135deg, var(--side), var(--p)); }
html[data-look="new"] .rc-f { background: linear-gradient(90deg, var(--p), var(--gold-soft), var(--p)); }
html[data-look="new"] .nb-top { background: linear-gradient(135deg, var(--side), var(--p)); }
/* v1.15 Light / Dark / Auto in the account menu */
.menu .mode-row { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
.menu .mode-row .mode-b { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 4px; font-size: 12px; cursor: pointer; }
.menu .mode-row .mode-b.on { background: var(--p); border-color: var(--p); color: var(--on-p, #fff); }
/* v1.15 the sidebar takes its text colour from the template (light-sidebar templates have dark text) */
html[data-look="new"] .side { color: var(--side-ink); }
html[data-look="new"] .side-brand { color: var(--side-ink); }
html[data-look="new"] .side-brand small { color: color-mix(in srgb, var(--side-ink) 60%, transparent); }
html[data-look="new"] .side nav { border-top-color: color-mix(in srgb, var(--side-ink) 9%, transparent); }
html[data-look="new"] .side nav::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--side-ink) 18%, transparent); }
html[data-look="new"] .nav-h { color: color-mix(in srgb, var(--side-ink) 50%, transparent); }
html[data-look="new"] .nav-a { color: var(--side-ink); }
html[data-look="new"] .nav-a:hover { background: color-mix(in srgb, var(--side-ink) 7%, transparent); color: var(--side-ink); }
html[data-look="new"] .nav-a.on { color: var(--side-ink); }
html[data-look="new"] .side-foot { background: color-mix(in srgb, var(--side-ink) 5%, transparent); border-color: color-mix(in srgb, var(--side-ink) 10%, transparent); }
html[data-look="new"] .side-foot small { color: color-mix(in srgb, var(--side-ink) 60%, transparent); }
html[data-look="new"] .side-foot button { color: color-mix(in srgb, var(--side-ink) 65%, transparent); }
html[data-look="new"] .side-foot button:hover { color: var(--side-ink); background: color-mix(in srgb, var(--side-ink) 8%, transparent); }
html[data-look="new"][data-side="light"] .side { border-right: 1px solid var(--line); }

/* v1.17 phones: every screen of the student / teacher panel fits the width (no side scroll, nothing cut) */
html, body { max-width: 100%; overflow-x: clip; }
@media (max-width: 640px) {
  .card, .panel, section.card { padding: 14px !important; border-radius: 16px; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  h1 { font-size: 22px !important; } h2 { font-size: 19px !important; }
  .btn, button.btn { min-height: 42px; }
  input, select, textarea { font-size: 16px !important; }   /* no zoom-in on iPhone */
  img, video, iframe { max-width: 100%; height: auto; }
  .modal-box, .dlg { width: calc(100vw - 20px) !important; max-height: calc(100dvh - 20px); overflow-y: auto; }
}

/* =====================================================================
   v1.30 Phones (all panels: student, teacher, driver) and the Android / Windows app
   - every table row becomes a card ("Column: value"), so nothing needs a side scroll
   - a bottom bar with the main pages, like an app; "Menu" opens the side menu
   - inside the app the screen starts below the phone's status bar (safe area)
   ===================================================================== */
.bnav { display: none; }
@media (max-width: 899px) {
  .shell.has-bnav .content { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--card, #fff); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px))); box-shadow: 0 -6px 20px -12px rgba(16,40,36,.25); }
  .bnav a, .bnav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); font: 600 11px/1.2 inherit; text-decoration: none; border-radius: 12px; cursor: pointer; }
  .bnav a span, .bnav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav svg { width: 22px; height: 22px; }
  .bnav a.on { color: var(--p); background: var(--p-soft); }
  body.drawer .bnav { display: none; }
}
@media (max-width: 640px) {
  table.rt { display: block; white-space: normal; overflow: visible; border: 0; }
  table.rt thead { display: none; }
  table.rt tbody { display: grid; gap: 10px; }
  table.rt tr { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
  table.rt td { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 0 !important; border: 0 !important; min-width: 0; text-align: right; overflow-wrap: anywhere; }
  table.rt td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; }
  table.rt td:not([data-label])::before, table.rt td[data-label=""]::before { display: none; }
  table.rt td:not([data-label]), table.rt td[data-label=""] { justify-content: flex-end; }
  table.rt td:first-child { font-weight: 600; }
  .tw { overflow: visible !important; border: 0 !important; }
  /* the welcome card: photo and name in one row, details in two columns, nothing empty */
  .hero { padding: 16px; } .hero-in { gap: 12px; } .hero .photo { width: 64px !important; height: 64px !important; font-size: 26px !important; }
  .hero-txt { flex: 1 1 200px; min-width: 0; } .hero .clock { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; min-width: 0 !important; gap: 8px 14px; }
  .facts div b { overflow-wrap: anywhere; }
  .content { padding-top: 14px !important; padding-left: 12px !important; padding-right: 12px !important; }
  .ph1 { flex-wrap: wrap; gap: 10px; } .ph1 > div { min-width: 0; }
  .grid, .grid > *, .card, .row { min-width: 0; }
  .row { flex-wrap: wrap; }
  .drv-acts { width: 100%; } .drv-acts .btn { flex: 1 1 140px; }
  .drv-who { min-width: 0; }
  .top { padding-left: 10px !important; padding-right: 10px !important; } .top .me .nm { display: none; }
}
.hero-txt { flex: 1; min-width: 240px; }
/* app: below the status bar and above the gesture bar (Capacitor sets --safe-area-inset-*; env() in other browsers) */
html.in-app .top { padding-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px)); height: calc(58px + max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px))); }
html.in-app .side { padding-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px)); }
html.in-app .auth-wrap { padding-top: calc(20px + max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px))); padding-bottom: calc(20px + max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px))); }
html.in-app body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
/* app login: only the form (no big picture side) on a phone */
@media (max-width: 760px) { html.in-app .auth-side { display: none !important; } html.in-app .auth { grid-template-columns: 1fr !important; } }
/* links never show an underline under every section */
.alt-link a, .nav-a, .bnav a, .side-brand, .brand { text-decoration: none; }
@media (max-width: 640px) {
  .grid.g4, .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .grid.g4 .stat, .grid.g3 .stat { padding: 12px !important; }
}
/* v1.30 app login: logo and name above the form */
.app-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: -4px 0 16px; text-align: center; }
.app-brand img, .app-brand svg { width: 64px; height: 64px; border-radius: 16px; background: #fff; padding: 6px; box-shadow: 0 8px 22px -12px rgba(0,0,0,.35); object-fit: contain; }
.app-brand b { font-size: 18px; letter-spacing: -.01em; }
