@font-face { font-family: Manrope; src: url(fonts/manrope-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Manrope; src: url(fonts/manrope-latin-ext-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }

/* Hadil Teachs dashboard. Brand: red #F10C45, charcoal #222222. Layout idea: the CarDalil dashboard
   (sidebar + top bar, page header with an icon tile, one card per list with filter tabs, calm tables). */
:root {
  --red: #F10C45; --red-d: #C40838; --ink: #1F1F1F; --body: #3A3A3A; --muted: #6E6A6B;
  --bg: #F6F4F3; --card: #FFFFFF; --line: #ECE6E7; --line2: #F3EEEF; --tint: #FDE7EC; --tint2: #FFF4F6; --head: #FBF7F6;
  --ok: #17643A; --ok-bg: #E4F4EA; --warn: #8A5A00; --warn-bg: #FFF2D6; --r: 14px; --side: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 15px/1.55 Manrope, system-ui, sans-serif; color: var(--body); background: var(--bg); }
a { color: var(--red); }
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; font-weight: 800; }
h2 { font-size: 18px; margin: 0; font-weight: 800; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 800; }
.i { flex: none; }
.muted { color: var(--muted); }
.sub { color: var(--muted); margin: 4px 0 0; }
[hidden] { display: none !important; }

/* ---------- Shell: sidebar + main (top bar, page) ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.mini { --side: 76px; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--card); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; flex: none; }
.brand b { display: block; font-size: 15px; line-height: 1.2; } .brand small { color: var(--muted); font-size: 12px; }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--red); color: #fff; font-weight: 800; text-decoration: none; }
.cta:hover { background: var(--red-d); }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a, .menu-group summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; }
.menu a:hover, .menu-group summary:hover { background: var(--tint2); }
.menu a.on { background: var(--tint); color: var(--red); font-weight: 800; }
.menu a .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--red); color: #fff; font: 800 12px/22px Manrope, sans-serif; text-align: center; font-style: normal; }
.menu-group { border-top: 1px solid var(--line); padding-top: 12px; }
.menu-group summary { list-style: none; font-size: 15px; color: var(--ink); } .menu-group summary::-webkit-details-marker { display: none; }
.menu-group summary > .i:last-child { margin-left: auto; color: var(--muted); transition: transform .15s; }
.menu-group[open] summary > .i:last-child { transform: rotate(180deg); }
.menu.sub { margin-top: 2px; } .menu.sub a { padding-left: 22px; font-size: 14px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.side-link:hover, .side-link[aria-current] { background: var(--tint2); color: var(--red); }
.me { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--tint); color: var(--red); font-weight: 800; font-size: 14px; flex: none; }
.av.lg { width: 60px; height: 60px; font-size: 21px; }
.who { min-width: 0; flex: 1; } .who b { display: block; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .who small { color: var(--muted); font-size: 12px; }
.me form { margin: 0; }
/* Small menu: icons only */
.mini .side { padding: 16px 12px; align-items: stretch; }
.mini .brand { justify-content: center; padding: 8px; } .mini .brand span, .mini .cta span, .mini .menu span, .mini .menu-group summary span, .mini .menu-group summary > .i:last-child, .mini .side-link span, .mini .who { display: none; }
.mini .menu a, .mini .menu-group summary, .mini .side-link { justify-content: center; padding: 10px; position: relative; }
.mini .menu.sub a { padding-left: 10px; }
.mini .menu a .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 4px; }
.mini .me { flex-direction: column; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 clamp(16px, 3vw, 36px); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumb { margin-right: auto; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { display: flex; align-items: center; gap: 8px; width: min(360px, 40vw); padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); }
.top-search input { border: 0; outline: 0; padding: 10px 0; width: 100%; background: transparent; }
.top-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--tint); }
.site-btn { white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { color: var(--red); border-color: var(--red); background: var(--card); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.page { padding: 28px clamp(16px, 3vw, 36px) 64px; max-width: 1280px; width: 100%; }

/* ---------- Page header ---------- */
.phead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ptile { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); }
.ptext { flex: 1; min-width: 200px; }
.pact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.backlink:hover { color: var(--red); }

/* ---------- Cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.stat-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 30px; line-height: 1.1; color: var(--ink); margin: 12px 0 6px; font-weight: 800; }
.stat b.long { font-size: 18px; line-height: 1.35; }
.stat small { color: var(--muted); font-size: 13px; }
.chip { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; }
.chip.red { background: var(--tint); color: var(--red); } .chip.ink { background: #F0EEEE; color: var(--ink); } .chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.panel, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-h p { margin: 2px 0 0; }
.bars { display: grid; grid-auto-flow: column; gap: 6px; margin: -4px 0 12px; }
.bars i { height: 4px; border-radius: 4px; background: var(--line); } .bars i.on { background: var(--red); }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.step .sq { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.step > .i { margin-left: auto; color: var(--muted); }
.step.done { color: var(--muted); text-decoration: line-through; }
.step.done .sq { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.item, .todo { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line2); }
.item:first-of-type, .todo:first-of-type { border-top: 0; }
.item .grow, .todo .grow { flex: 1; min-width: 0; } .item .grow b, .todo .grow b { display: block; color: var(--ink); }
.todo .grow b a { color: var(--ink); text-decoration: none; } .todo .grow b a:hover { color: var(--red); }
.todo .muted { font-size: 13px; }
.todo-a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .todo-a form { margin: 0; }
.item:has(p) { align-items: flex-start; } .item p { margin: 6px 0 0; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.done-state { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.callout { border: 1px solid #F6C3D0; background: linear-gradient(120deg, var(--tint2), #fff 70%); }

/* Books */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.book { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.book .chip { width: 46px; height: 46px; }
.book b { display: block; font-size: 16px; } .book span.s { color: var(--muted); font-size: 13px; }
.book:hover { border-color: var(--red); box-shadow: 0 0 0 3px var(--tint); }
.progress { height: 8px; border-radius: 8px; background: var(--tint); overflow: hidden; margin: 12px 0 8px; } .progress i { display: block; height: 100%; background: var(--red); border-radius: 8px; }
.progress.big { height: 10px; margin: 4px 0 16px; }
.mini-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.mini-bar .progress { width: 72px; height: 6px; margin: 0; }

/* ---------- Pills, tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 700; white-space: nowrap; background: #F1EEEE; color: var(--ink); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.red { background: var(--tint); color: #A10830; } .pill.ink { background: var(--ink); color: #fff; } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.plain i { display: none; }
.tag { display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 700; border-radius: 99px; background: #F0EEEE; color: var(--ink); }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.no { background: var(--tint); color: #A10830; }

/* ---------- List card: filter tabs, search, view toggle, table ---------- */
.listcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 16px; overflow: hidden; }
.listbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ftabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ftabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; background: #fff; }
.ftabs a span { color: var(--muted); font-weight: 600; }
.ftabs a:hover { border-color: var(--ink); }
.ftabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; } .ftabs a[aria-current] span { color: #CFCACB; }
.lsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); min-width: 240px; }
.lsearch input { border: 0; outline: 0; padding: 9px 0; width: 100%; background: transparent; }
.lsearch:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--tint); }
.vtoggle { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.vtoggle button { display: grid; place-items: center; width: 34px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.vtoggle button[aria-pressed=true] { background: var(--ink); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 700; text-decoration: none; }
table.rows th { background: var(--head); padding-top: 14px; padding-bottom: 14px; }
table.rows th:first-child, table.rows td:first-child { padding-left: 20px; } table.rows th:last-child, table.rows td:last-child { padding-right: 20px; }
table.rows tbody tr:hover { background: #FDFBFB; }
table.rows td { padding-top: 14px; padding-bottom: 14px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); text-decoration: none; }
.person b { display: block; color: var(--ink); font-size: 15px; } .person small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
a.person:hover b { color: var(--red); }
.cell-s { display: block; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
details.pop { position: relative; }
details.pop summary { list-style: none; } details.pop summary::-webkit-details-marker { display: none; }
.pop-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(31,31,31,.12); display: grid; }
.pop-menu a, .pop-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 600 14px Manrope, sans-serif; text-decoration: none; text-align: left; cursor: pointer; }
.pop-menu a:hover, .pop-menu button:hover { background: var(--tint2); color: var(--red); }
.pop-menu form { margin: 0; }
/* Grid view of the same list */
.cards { display: none; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding: 18px; }
.is-grid .cards { display: grid; } .is-grid table.rows { display: none; }
.scard { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; }
.scard:hover { border-color: var(--red); box-shadow: 0 0 0 3px var(--tint); }
.scard .row { justify-content: space-between; }
.list-empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* ---------- Tabs on a page ---------- */
.ptabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 20px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ptabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 700; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptabs a:hover { color: var(--ink); }
.ptabs a[aria-current] { color: var(--red); border-bottom-color: var(--red); }
.ptabs a em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.tabs a:hover { border-color: var(--red); color: var(--red); }

/* ---------- Forms, buttons ---------- */
form.stack { display: grid; gap: 14px; max-width: 560px; }
.modal form.stack { max-width: none; }
label { display: grid; gap: 5px; font-weight: 700; font-size: 13px; color: var(--ink); }
label small { font-weight: 500; color: var(--muted); }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid #DCD2D5; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint); border-color: var(--red); }
textarea { min-height: 90px; resize: vertical; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; background: var(--red); color: #fff; border: 0; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { background: var(--red-d); }
button.ghost, .btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover, .btn.ghost:hover { border-color: var(--red); color: var(--red); background: var(--card); }
button.danger { background: #fff; color: #A10830; border: 1px solid #F3B9C7; } button.danger:hover { background: var(--tint); }
button.sm, .btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
button.wa, .btn.wa { background: #128C4A; color: #fff; } button.wa:hover, .btn.wa:hover { background: #0D6E39; }
button:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
label.grow { flex: 1; min-width: 220px; }
.copy { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; }
.units { display: flex; gap: 6px; flex-wrap: wrap; }
.units label { display: flex; gap: 6px; align-items: center; font-weight: 600; background: var(--tint2); padding: 6px 10px; border-radius: 99px; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 10px; background: #000; }
.flash { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); padding: 12px 16px; margin: 0 0 20px; border-radius: 10px; color: var(--ink); box-shadow: 0 6px 20px rgba(31,31,31,.05); font-weight: 600; }
details summary { cursor: pointer; color: var(--red); font-weight: 700; font-size: 13px; }
.danger-zone { border-color: #F3B9C7; }

/* Pop-up windows */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 22px; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(31,31,31,.25); color: var(--body); }
dialog.modal:focus, dialog.modal:focus-visible { outline: none; }
dialog.modal::backdrop { background: rgba(31,31,31,.45); }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

/* Message pop-up: presets on the left, the text on the right */
dialog#message { width: min(940px, calc(100vw - 24px)); }
.msgbox { display: grid; grid-template-columns: 300px 1fr; gap: 18px; min-height: 0; }
.plist { display: grid; align-content: start; gap: 6px; max-height: min(62vh, 560px); overflow-y: auto; padding-right: 6px; }
.pgroup { margin: 10px 0 2px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pgroup:first-child { margin-top: 0; }
.preset { display: grid; gap: 2px; justify-items: start; justify-content: stretch; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; font-weight: 700; white-space: normal; }
.preset:hover { border-color: var(--red); background: #fff; color: var(--ink); }
.preset small { font-size: 12px; font-weight: 600; color: var(--muted); }
.preset .why { color: #A10830; }
.preset.fit { background: var(--tint2); border-color: #F6C3D0; }
.preset[aria-pressed=true] { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); background: var(--tint2); }
.pedit { display: grid; gap: 12px; align-content: start; }
.pedit textarea { min-height: 300px; font-size: 15px; line-height: 1.5; background: #F3FBF6; }
@media (max-width: 860px) { .msgbox { grid-template-columns: 1fr; } .plist { max-height: 40vh; } .pedit textarea { min-height: 220px; } }

/* ---------- To do on a student ---------- */
.next-box { padding: 4px 20px; }
.next-box .todo { padding: 16px 0; }

/* Onboarding */
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tr-step { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.tr-step .sq { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #F0EEEE; color: var(--muted); margin-bottom: 6px; }
.tr-step.done .sq { background: var(--ok-bg); color: var(--ok); }
.tr-step b { color: var(--ink); font-size: 14px; } .tr-step small { color: var(--muted); }
.item.msg { align-items: flex-start; } .item.msg form { margin: 0; }
pre.wa { white-space: pre-wrap; font: 500 14px/1.5 Manrope, sans-serif; background: #E7F8EE; border-radius: 10px; padding: 12px 14px; margin: 8px 0 0; color: var(--ink); }

/* Progress: unit tiles */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.unit { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s; }
.unit:hover { border-color: var(--red); }
.unit input { position: absolute; opacity: 0; pointer-events: none; }
.unit .u-box { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid #D9CDD1; color: transparent; background: #fff; }
.unit .u-txt { display: grid; min-width: 0; } .unit small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; } .unit b { color: var(--ink); font-size: 14px; line-height: 1.3; }
.unit:has(input:checked) { background: var(--ok-bg); border-color: #BFE3CD; }
.unit:has(input:checked) .u-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.unit:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.tests { max-width: 640px; grid-template-columns: 1fr 1fr auto; }
.gain { align-self: end; padding: 10px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 800; white-space: nowrap; }

/* Certificate */
.cert-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cert-card .chip { width: 46px; height: 46px; }
.cert-card .grow { flex: 1; min-width: 200px; } .cert-card .grow b { display: block; color: var(--ink); font-size: 16px; }
.panel.cert-hi { background: linear-gradient(120deg, var(--tint2), #fff 60%); border-color: #F6C3D0; }

/* Student: unit list */
.unit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.unit-list li { display: flex; align-items: center; gap: 10px; }
.unit-list .u-box { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: #F0EEEE; color: var(--muted); font-size: 12px; font-weight: 800; }
.unit-list li.done .u-box { background: var(--ok); color: #fff; }
.unit-list b { display: block; color: var(--ink); font-size: 14px; line-height: 1.3; } .unit-list small { color: var(--muted); font-size: 12px; }

/* ---------- Calendar: hour grid like Google Calendar (assets/calendar.js) ---------- */
.cal-bar { gap: 12px; }
.cal-title { font-size: 20px; margin-right: auto; }
.seg { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.seg a { padding: 6px 14px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.seg a[aria-current] { background: var(--ink); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--red); }
.legend i.k-speaking { background: var(--ink); }
.cal { --hh: 52px; --ppm: calc(var(--hh) / 60); --gut: 58px; user-select: none; -webkit-user-select: none; }
.cal-head { display: grid; grid-template-columns: var(--gut) repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-right: var(--sbw, 0px); }
.cal-dh { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cal-dh b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink); font-size: 20px; letter-spacing: 0; }
.cal-dh:hover b { background: var(--tint2); }
.cal-dh.today { color: var(--red); } .cal-dh.today b { background: var(--red); color: #fff; }
.cal-scroll { height: min(70vh, 720px); overflow-y: auto; overscroll-behavior: contain; }
.cal-body { display: grid; grid-template-columns: var(--gut) repeat(var(--days), minmax(0, 1fr)); height: calc(var(--hours) * var(--hh)); position: relative; }
.cal-gut { position: relative; }
.cal-gut span { display: block; height: var(--hh); padding-right: 8px; text-align: right; font-size: 11px; font-weight: 700; color: var(--muted); transform: translateY(-7px); }
.cal-gut span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--line2); cursor: cell; touch-action: pan-y;
  background-image: linear-gradient(to bottom, var(--line2) 1px, transparent 1px), linear-gradient(to bottom, transparent calc(var(--hh) / 2), #F8F5F5 calc(var(--hh) / 2), #F8F5F5 calc(var(--hh) / 2 + 1px), transparent calc(var(--hh) / 2 + 1px));
  background-size: 100% var(--hh); }
.cal-col.today { background-color: #FFFBFC; }
.ev { position: absolute; z-index: 2; overflow: hidden; display: block; padding: 4px 8px 6px; margin-left: 2px; border-radius: 8px; background: var(--red); color: #fff; font-size: 12px; line-height: 1.3; cursor: grab; box-shadow: 0 1px 2px rgba(31,31,31,.15); touch-action: pan-y; transition: box-shadow .15s; }
.ev:hover { box-shadow: 0 4px 14px rgba(31,31,31,.22); }
.ev:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-t { font-weight: 700; opacity: .9; } .ev-n { font-weight: 800; font-size: 13px; } .ev-k { opacity: .85; }
.ev.short { padding-top: 2px; } .ev.short span { display: inline; } .ev.short .ev-k { display: none; } .ev.short .ev-n { margin-left: 4px; }
.ev.k-speaking { background: var(--ink); }
.ev.k-other { background: #7A7475; }
.ev.s-done { background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--ok); cursor: pointer; }
.ev.s-cancelled { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #F6F2F3 6px, #F6F2F3 12px); color: var(--muted); border: 1px dashed #D9CDD1; cursor: pointer; }
.ev.s-cancelled .ev-n { text-decoration: line-through; }
.ev.due { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); }
.ev.dragging { z-index: 5; opacity: .92; cursor: grabbing; box-shadow: 0 12px 28px rgba(31,31,31,.3); }
.ev.bad { background: #fff !important; color: #A10830; border: 2px solid var(--red); }
.ev.saving { opacity: .6; }
.ev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.ev .rz::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: rgba(255,255,255,.6); opacity: 0; }
.ev:hover .rz::after { opacity: 1; }
.cal-now { position: absolute; left: -1px; right: 0; z-index: 3; height: 2px; background: var(--red); pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.cal-sel { position: absolute; left: 2px; right: 4px; z-index: 4; padding: 4px 8px; border-radius: 8px; background: rgba(241,12,69,.14); border: 2px dashed var(--red); color: var(--red-d); font-size: 12px; font-weight: 800; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 12px 32px rgba(31,31,31,.3); }
.toast.bad { background: #A10830; }
.evd { display: grid; gap: 14px; }
.evd-when { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.evd-move input, .evd-move select { width: auto; }

/* ---------- Login and other pages without a menu ---------- */
body.bare { background: var(--bg); }
.bare-top { display: flex; align-items: center; gap: 10px; padding: 18px 24px; font-weight: 800; color: var(--ink); }
.bare-top img { width: 32px; height: 32px; }
.bare-main { max-width: 440px; margin: 4vh auto 64px; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.bare-main form.stack button { justify-content: center; }
.bare-main h1 { margin-bottom: 4px; }

/* ---------- Website editor ---------- */
table.texts td { vertical-align: top; padding: 8px 6px; }
table.texts textarea { width: 100%; min-height: 0; padding: 8px 10px; font-size: 14px; line-height: 1.45; }
table.texts code { font-size: 12px; color: var(--muted); word-break: break-all; }
table.texts tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 0; margin-top: 8px; background: linear-gradient(to top, var(--card) 70%, transparent); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) { table.rows .hide-m { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(31,31,31,.2); }
  .side-open .side { transform: none; }
  .mini { --side: 264px; }
  .mini .side .brand span, .mini .side .cta span, .mini .side .menu span, .mini .side .menu-group summary span, .mini .side .side-link span, .mini .side .who { display: revert; }
  .topbar { padding: 0 12px; gap: 8px; }
  .top-search { width: auto; flex: 1; min-width: 0; } .crumb { display: none; } .site-btn { display: none; }
  .topbar .icon-btn[href] { display: none; }
  .page { padding-top: 20px; }
  h1 { font-size: 25px; } .ptile { width: 48px; height: 48px; border-radius: 14px; }
  .pact { width: 100%; } .pact > .btn, .pact > button, .pact > form { flex: 1; } .pact > form > button { width: 100%; }
  .cols, .cols.even { grid-template-columns: 1fr; }
  .lsearch { margin-left: 0; min-width: 0; flex: 1; } .vtoggle { display: none; }
  .ftabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; scrollbar-width: none; } .ftabs a { white-space: nowrap; }
  /* Phones always get the cards, not the table */
  .cards { display: grid; padding: 12px; } table.rows { display: none; }
  .cal { --gut: 46px; } .cal-scroll { height: 64vh; } .legend { display: none; } .cal-title { font-size: 16px; width: 100%; order: -1; }
  .row.two, .tests { grid-template-columns: 1fr; }
  .track { grid-template-columns: 1fr 1fr; }
  .todo { flex-wrap: wrap; } .todo .grow { flex-basis: calc(100% - 52px); } .todo-a { width: 100%; padding-left: 48px; justify-content: flex-start; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px; } .stat b { font-size: 22px; margin: 8px 0 4px; } .stat b.long { font-size: 15px; } .stat .chip { width: 30px; height: 30px; }
  .listbar { padding: 12px; } .ptabs a { padding: 12px 10px; }
  table.texts th:first-child, table.texts td:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Progress reports (admin/report.php, student Reports tab) */
.lt-card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--head); }
.lt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lt-grid label { font-size: 13px; } .lt-grid input { text-align: center; font-weight: 800; }
.rp-big { font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rp-big b { font-size: 26px; color: var(--ink); }
.rp-due { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.rp-lab { display: block; margin-bottom: 6px; color: var(--ink); }
.rp-mist { width: 100%; } .rp-mist td { padding: 4px 4px 4px 0; border: 0; } .rp-mist th { padding: 4px 4px 6px 0; }
.rp-mist td:last-child { width: 36px; } .rp-mist input { width: 100%; }
.rp-said { display: block; color: var(--red-d); text-decoration: line-through; text-decoration-color: rgba(196,8,56,.4); }
.rp-ok { color: var(--ok); font-weight: 700; }
td.rp-said { display: table-cell; }
.rp-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-pick label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; margin: 0; }
.rp-pick label:has(input[value="1"]:checked) { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); font-weight: 800; }
.rp-pick label:has(input[value="0"]:checked) { background: var(--tint); border-color: var(--red); color: var(--red-d); font-weight: 800; }
.rp-pick input { margin: 0; }
.rp-actions { gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .lt-grid { grid-template-columns: 1fr 1fr; }
  .rp-mist thead { display: none; } .rp-mist tr { display: grid; grid-template-columns: 1fr 36px; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .rp-mist td { padding: 0; } .rp-mist td:last-child { grid-row: 1 / span 3; grid-column: 2; }
}
/* Weekly editor: one full-width column; last week's mistakes on top, delete at the bottom */
.cols.rp-cols { grid-template-columns: minmax(0, 1fr); }
.rp-cols > div { display: contents; }
.rp-cols > div > section:first-child { order: -1; }
.rp-cols > div > .danger-zone { order: 2; }
form.stack.rp-form { max-width: none; }
