/* Maktab — "Samarqand" look: lapis + turquoise + gold on warm sand.
   Colour carries meaning: turquoise = money in / all good, gold = needs attention, red = an error you must fix.
   Fonts are served from /app/fonts (no outside downloads: school internet can be slow). */

@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/unbounded-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/unbounded-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/unbounded-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }

:root {
  --sand: #F3ECDF;
  --paper: #FFFCF6;
  --white: #FFFFFF;
  --ink: #1E2333;
  --muted: #5B5446;
  --line: #E3D8C3;
  --line-soft: #EEE5D3;
  --lapis: #1D3E8F;
  --lapis-dark: #142C66;
  --lapis-soft: #DCE3F5;
  --on-lapis: #C9D5F2;
  --turq: #1A9A97;
  --turq-ink: #0F6E6B;
  --turq-deep: #0B5552;
  --turq-soft: #D5EEEC;
  --gold: #C8902E;
  --gold-bright: #E2B04A;
  --gold-ink: #8A5A12;
  --gold-soft: #F6E4C2;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --night: #1E2333;
  --on-night: #CFC6B4;
  --r-card: 22px;
  --r-ctl: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --disp: "Unbounded", "Golos Text", "Segoe UI", system-ui, sans-serif;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--sand); }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { margin: 0 0 10px; font-family: var(--disp); font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
a { color: var(--lapis); }
a:hover { color: var(--lapis-dark); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.disp { font-family: var(--disp); }
.error { color: var(--danger); min-height: 1.2em; margin: 6px 0; font-weight: 500; }
.neg { color: var(--gold-ink); }
.pos { color: var(--turq-ink); }
kbd { font-family: var(--body); font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--sand); color: var(--muted); }

/* ------------------------------------------------------------------ controls */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
input, select { font: inherit; font-weight: 500; color: var(--ink); padding: 10px 14px; min-height: 48px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--white); min-width: 0; transition: border-color 150ms ease-out; }
input:hover, select:hover { border-color: #CDBF9F; }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--lapis); }
input:focus, select:focus { outline: none; border-color: var(--lapis); }
button:focus-visible, a:focus-visible, .method:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.row.between { justify-content: space-between; align-items: center; margin-top: 0; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 120ms ease-out; }
.btn:hover { border-color: #CDBF9F; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--lapis); color: var(--white); border-color: var(--lapis); }
.btn.primary:hover { background: var(--lapis-dark); border-color: var(--lapis-dark); }
.btn.primary kbd { background: rgba(255,255,255,.18); color: var(--white); }
.btn.big { min-height: 60px; font-size: 17px; padding: 0 26px; border-radius: 16px; }
.btn.danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn.link { border: none; background: none; color: var(--lapis); padding: 6px 2px; min-height: 36px; }
.btn.link:hover { text-decoration: underline; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.wide { width: 100%; }
a.btn { text-decoration: none; }
a.btn.primary, a.btn.primary:hover { color: var(--white); }
.btn:disabled { opacity: .55; cursor: default; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 28px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(30,35,51,.10); }
.login-art { position: relative; background: var(--lapis); color: var(--white); padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 420px; }
.login-art .girih { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art > :not(.girih) { position: relative; }
.login-art h1 { font-size: 30px; margin: 0; }
.logo-chip { width: 64px; height: 64px; border-radius: 18px; background: var(--sand); display: grid; place-items: center; margin-bottom: 6px; }
.login-art p { margin: 0; color: var(--on-lapis); font-size: 16px; line-height: 1.5; max-width: 300px; }
.login-card { padding: 40px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.login-card h2 { font-size: 22px; margin: 0; }

/* ------------------------------------------------------------------ top bar */
.topbar { max-width: 1320px; margin: 0 auto; padding: 18px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-name { font-family: var(--disp); font-weight: 700; font-size: 16px; }
/* a long school name takes two short lines instead of pushing the menu onto a second row */
.brand-sub { font-size: 12px; line-height: 1.25; color: var(--muted); max-width: 104px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
#nav a { padding: 10px 13px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; min-height: 44px; display: flex; align-items: center;
  white-space: nowrap; transition: background-color 150ms ease-out; }
#nav a:hover { background: #E9DFCB; }
#nav a.active { background: var(--ink); color: var(--sand); font-weight: 600; }
.user { margin-left: auto; position: relative; }
.user > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 999px;
  padding: 3px 3px 3px 12px; }
.user > summary::-webkit-details-marker { display: none; }
.user > summary:hover { background: #E9DFCB; }
.user > summary:focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; background: var(--paper); border-radius: 16px;
  box-shadow: 0 12px 36px rgba(30,35,51,.18); padding: 10px; min-width: 230px; display: flex; flex-direction: column; gap: 2px; }
.user-pop .btn { justify-content: flex-start; text-align: left; width: 100%; }
.user-pop #user-role { padding: 6px 12px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.user-name { font-size: 14px; font-weight: 600; margin-right: 6px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--lapis); color: var(--sand); display: grid; place-items: center; font-weight: 700; flex: none; }
main { max-width: 1320px; margin: 0 auto; padding: 4px 32px 48px; }

/* ------------------------------------------------------------------ cards, tiles, tables */
.card { background: var(--paper); border-radius: var(--r-card); padding: 24px; margin-bottom: 20px; overflow-x: auto; }
.card.night { background: var(--night); color: var(--sand); }
.card.night .muted, .card.night .k { color: var(--on-night); }
.totals { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.tile { background: var(--sand); border-radius: 16px; padding: 12px 16px; min-width: 140px; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-family: var(--disp); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile.main { background: var(--lapis); color: var(--white); }
.tile.main .k { color: var(--on-lapis); }
.warn { background: var(--gold-soft); color: #4A3410; border-radius: 14px; padding: 12px 16px; margin: 8px 0; font-weight: 500; }
.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; border-bottom-color: var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.tnum { white-space: nowrap; }
#day-table, #debt-table, #audit-table, #users-table, #tg-recent { min-width: 600px; }
.remind-row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.remind-row summary { cursor: pointer; color: var(--lapis); font-size: 13px; margin-top: 4px; }
.remind-row pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--sand); padding: 12px 14px; border-radius: 12px; margin: 6px 0 0; }
.table tr.cancelled td { text-decoration: line-through; color: var(--muted); }
.table tr.reversal td { color: var(--danger); }
.table tbody tr { transition: background-color 120ms ease-out; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover, .table tbody tr:hover { background: #F7F1E6; }
.table tr.fresh td { animation: fresh 1600ms ease-out both; }
@keyframes fresh { from { background: var(--turq-soft); } to { background: transparent; } }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ------------------------------------------------------------------ cashier */
.kassa-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 24px; align-items: start; margin-bottom: 20px; }
.kassa-grid > .card { margin-bottom: 0; overflow: visible; }
.pay-card { display: flex; flex-direction: column; gap: 14px; }
.pay-card h1 { margin: 0; }
.search-box { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 16px; padding: 0 16px; background: var(--white); min-height: 60px;
  transition: border-color 150ms ease-out; }
.search-box:focus-within { border-color: var(--lapis); }
.search-box input { border: 0; padding: 0; min-height: 56px; font-size: 19px; font-weight: 600; flex: 1; background: transparent; }
.search { width: 100%; }
.search-label { display: block; }
.small-search { width: 280px; margin: 0; }
.results { list-style: none; margin: -4px 0 0; padding: 6px; max-height: 360px; overflow: auto; background: var(--white); border-radius: 16px; border: 2px solid var(--line-soft); }
.results:empty { display: none; }
.results li { padding: 10px 12px; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; min-height: 52px; }
.results li .sub { color: var(--muted); font-size: 13px; font-weight: 500; }
.results li.sel, .results li:hover { background: var(--lapis-soft); }
.results li.none { color: var(--muted); cursor: default; }
.empty { color: var(--muted); text-align: center; padding: 36px 8px; line-height: 1.8; border: 2px dashed var(--line); border-radius: 18px; }
.student-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--sand); }
.st-name { font-size: 18px; font-weight: 700; }
.balance-box { text-align: right; }
.balance { font-family: var(--disp); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  transition: border-color 150ms ease-out; }
.chip:hover { border-color: var(--lapis); }
.part { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.part + .part { border-top: 2px dashed var(--line); padding-top: 14px; }
.part .amount { font-family: var(--disp); font-size: 34px; font-weight: 600; min-height: 76px; padding: 0 20px; border-color: var(--lapis); border-radius: 18px; font-variant-numeric: tabular-nums; width: 100%; }
.methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.method { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; min-height: 76px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--white); color: var(--ink); cursor: pointer; transition: border-color 150ms ease-out, background-color 150ms ease-out, transform 120ms ease-out; }
.method:hover { border-color: #B9A983; }
.method:active { transform: scale(.98); }
.method .mt { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; }
.method .mh { font-size: 12px; color: var(--muted); }
.method.on { background: var(--lapis); border-color: var(--lapis); color: var(--white); }
.method.on .mh { color: var(--on-lapis); }
.method.on kbd { background: rgba(255,255,255,.18); color: var(--white); }
.remove-part { color: var(--danger) !important; align-self: flex-start; }

/* receipt preview */
.kassa-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.slip-wrap { position: relative; filter: drop-shadow(0 10px 24px rgba(30,35,51,.08)); }
.slip { background: var(--white); border-radius: 18px 18px 0 0; padding: 24px 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.slip-edge { display: block; width: 100%; height: 12px; }
.slip-head { text-align: center; padding-bottom: 12px; border-bottom: 1px dashed #D9CDB4; }
.slip-head .s1 { font-family: var(--disp); font-weight: 600; font-size: 15px; }
.slip-head .s2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.slip dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 14px; }
.slip dt { color: var(--muted); }
.slip dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.slip-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 12px; border-top: 1px dashed #D9CDB4; }
.slip-total .v { font-family: var(--disp); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; }
.slip-foot { text-align: center; font-size: 13px; color: var(--muted); }
.slip-idle { text-align: center; color: var(--muted); padding: 28px 8px; line-height: 1.7; }
.slip-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; min-height: 112px; margin-top: 2px; }
.stamp { position: absolute; left: 28px; bottom: 30px; width: 112px; height: 112px; border-radius: 50%; border: 4px solid var(--lapis); color: var(--lapis);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(255,255,255,.55);
  box-shadow: inset 0 0 0 6px var(--white), inset 0 0 0 8px var(--lapis); transform: rotate(-12deg); pointer-events: none;
  animation: stamp 420ms var(--ease) both; }
.stamp b { font-family: var(--disp); font-size: 16px; letter-spacing: .04em; }
.stamp span { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.6) rotate(-4deg); } 55% { opacity: 1; transform: scale(.94) rotate(-13deg); } 100% { opacity: 1; transform: scale(1) rotate(-12deg); } }

/* day tally (dark) */
.tally-total { font-family: var(--disp); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.tally { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: 14px; }
.tally div { display: flex; justify-content: space-between; gap: 8px; }
.tally span { color: var(--on-night); }
.tally b { font-variant-numeric: tabular-nums; }
.tally .refund b { color: var(--gold-bright); }
.night-note { margin: 14px 0 0; font-size: 13px; color: var(--on-night); line-height: 1.5; }

/* ------------------------------------------------------------------ home (owner / director) */
.hero { position: relative; overflow: hidden; border-radius: 28px; background: var(--lapis); color: var(--white); padding: 34px 40px; margin-bottom: 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.hero .girih { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero > :not(.girih) { position: relative; }
.hero-main { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--on-lapis); font-size: 15px; }
.hero-top input { min-height: 40px; padding: 4px 10px; border-radius: 10px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: var(--white); color-scheme: dark; }
.hero h1 { font-family: var(--body); font-size: 18px; font-weight: 600; color: #E6ECFA; margin: 0; }
.hero-num { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-num .v { font-family: var(--disp); font-size: 52px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-num .u { font-family: var(--disp); font-size: 20px; color: var(--on-lapis); }
.bar { height: 12px; border-radius: 6px; background: rgba(255,255,255,.16); overflow: hidden; max-width: 560px; }
.bar > div { height: 100%; border-radius: 6px; background: var(--gold-bright); transform-origin: left; animation: fillx 900ms var(--ease) 150ms both; }
@keyframes fillx { from { transform: scaleX(0); } }
.hero-sub { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; max-width: 560px; color: var(--on-lapis); }
.hero-sub b { color: #F3DDA8; }
.hero-methods { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--on-lapis); }
.hero-methods b { color: var(--white); font-weight: 600; }
.seals { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.seal { width: 148px; height: 148px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.45); background: rgba(255,255,255,.06); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 12px; animation: seal 380ms var(--ease) both; }
.seal:nth-child(2) { animation-delay: 120ms; }
.seal:nth-child(3) { animation-delay: 240ms; }
.seal svg { color: #7FD6D3; }
.seal strong { font-size: 13px; line-height: 1.25; }
.seal span { font-size: 11.5px; color: var(--on-lapis); line-height: 1.3; }
.seal.s-warn { border: 2px solid var(--gold-bright); background: rgba(226,176,74,.14); }
.seal.s-warn svg { color: var(--gold-bright); }
.seal.s-warn span { color: #F3DDA8; }
.seal.s-none { border-style: dotted; }
.seal.s-none svg { color: var(--on-lapis); }
@keyframes seal { 0% { opacity: 0; transform: scale(1.25) rotate(-8deg); } 60% { opacity: 1; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi { background: var(--paper); border-radius: var(--r-card); padding: 24px; display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: var(--ink);
  transition: transform 150ms ease-out, box-shadow 150ms ease-out; animation: rise 300ms var(--ease) both; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(30,35,51,.08); color: var(--ink); }
.kpi:nth-child(2) { animation-delay: 60ms; }
.kpi:nth-child(3) { animation-delay: 120ms; }
.kpi .k { font-size: 15px; font-weight: 600; color: var(--muted); }
.kpi .v { font-family: var(--disp); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi .d { font-size: 14px; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.home-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.home-split > .card { margin-bottom: 0; }
.grades { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.grades li { border-radius: 16px; padding: 14px 16px; background: var(--sand); display: flex; flex-direction: column; gap: 8px; }
.grades li.low { background: var(--gold-soft); }
.grades .gt { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 14px; font-weight: 600; color: #3D3A33; }
.grades .gt b { font-family: var(--disp); font-size: 18px; font-weight: 600; color: var(--ink); }
.grades li.low .gt b { color: var(--gold-ink); }
.grades .gb { height: 6px; border-radius: 3px; background: rgba(30,35,51,.08); overflow: hidden; }
.grades .gb div { height: 100%; border-radius: 3px; background: var(--turq); transform-origin: left; animation: fillx 700ms var(--ease) 200ms both; }
.grades li.low .gb div { background: var(--gold); }
.grades .gs { font-size: 12px; color: var(--muted); }
.attention { list-style: none; margin: 0; padding: 0; }
.attention a, .attention .item { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid rgba(243,236,223,.14); color: var(--sand); text-decoration: none; min-height: 44px; }
.attention li:last-child a, .attention li:last-child .item { border-bottom: 0; }
.attention a:hover strong { text-decoration: underline; }
.attention .n { font-family: var(--disp); font-size: 14px; color: var(--gold-bright); font-weight: 600; width: 24px; flex: none; }
.attention .n.lv-info { color: #7FD6D3; }
.attention strong { display: block; font-size: 15px; }
.attention span.t { display: block; font-size: 13px; color: var(--on-night); margin-top: 3px; }
.attention .calm { color: var(--on-night); padding: 8px 0; }

/* ------------------------------------------------------------------ admissions + papers */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; margin-top: 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .row { grid-column: 1 / -1; }
.sign-first { margin-top: 6px; color: #4A3410; background: var(--gold-soft); border-radius: 10px; padding: 6px 10px;
  font-weight: 600; line-height: 1.4; }
.docs-box { margin-top: 14px; border: 2px solid var(--line); border-radius: 16px; padding: 10px 16px; }
.docs-box summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 4px 0 6px; }
.docs h3 { grid-column: 1 / -1; font-family: var(--body); font-size: 13px; color: var(--muted); margin: 10px 0 2px; }
.doc { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; margin: 0; padding: 7px 0;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.dlg .doc { margin-top: 0; }
.doc input { flex: none; width: 20px; height: 20px; min-height: 0; padding: 0; margin: 1px 0 0; accent-color: var(--turq); }
.doc input:disabled + span { opacity: .8; }
.doc .when { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.doc .first { display: block; color: var(--gold-ink); font-size: 12px; font-weight: 700; }
.fields-help { margin-top: 14px; }
.fields-help summary { cursor: pointer; color: var(--lapis); font-weight: 600; font-size: 14px; }
.fields-help ul { padding-left: 18px; margin: 6px 0 0; line-height: 1.7; }
.fields-help code { font-size: 12.5px; background: var(--sand); padding: 1px 6px; border-radius: 6px; }
.miss { color: var(--muted); font-size: 13px; }
#adm-table { min-width: 620px; }
.tile.need-tile { background: var(--gold-soft); }
.cmp-h { font-family: var(--body); font-size: 15px; margin: 18px 0 0; }
.ok-line { color: var(--turq-ink); background: var(--turq-soft); display: inline-block; }
.ok-badge { background: var(--turq-soft, #DDF1EF); color: var(--turq-ink); }
.need-badge { background: var(--gold-soft); color: var(--gold-ink); }

/* ------------------------------------------------------------------ attendance */
.marks { margin-top: 8px; }
.mark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft); transition: background-color 120ms ease-out; }
.mark-row.off { background: #FBF3E3; }
.mr-name { font-weight: 600; display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 220px; flex-wrap: wrap; }
.mr-n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; width: 22px; text-align: right; flex: none; }
.mr-sub { display: block; width: 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.mr-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mr-time { width: 110px; min-height: 40px; padding: 6px 10px; }
.mr-note { width: 170px; min-height: 40px; padding: 6px 10px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white); }
.seg-b { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--muted);
  padding: 9px 12px; min-height: 42px; cursor: pointer; border-right: 1px solid var(--line-soft); }
.seg-b:last-child { border-right: 0; }
.seg-b:hover { background: var(--sand); color: var(--ink); }
.seg-b.on.s-present { background: var(--turq-soft); color: var(--turq-ink); }
.seg-b.on.s-absent { background: var(--danger); color: var(--white); }
.seg-b.on.s-late { background: var(--gold-soft); color: var(--gold-ink); }
.seg-b.on.s-excused { background: var(--lapis-soft); color: var(--lapis); }
.roll-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 14px 0 4px; margin-top: 6px; background: var(--paper); border-top: 2px solid var(--line-soft); }
.chip.chip-on { background: var(--ink); border-color: var(--ink); color: var(--sand); }
ul.plain { list-style: none; padding: 0; margin: 6px 0 0; line-height: 1.5; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
ul.plain.cols2 { columns: 2; column-gap: 28px; }
ul.plain.cols2 li { break-inside: avoid; }
.st-absent { color: var(--danger); font-weight: 600; }
.st-late { color: var(--gold-ink); font-weight: 600; }
.st-excused { color: var(--lapis); font-weight: 600; }
.st-unmarked { color: var(--muted); }
.pp-list { max-height: 55vh; overflow-y: auto; margin: 6px 0; }

/* ------------------------------------------------------------------ dialogs + toast */
.dlg { border: none; border-radius: var(--r-card); padding: 26px; max-width: 480px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); }
.dlg[open] { animation: rise 220ms var(--ease) both; }
.dlg label { margin-top: 12px; }
.wide-dlg { max-width: 920px; }
.dlg::backdrop { background: rgba(30, 35, 51, .45); }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: calc(100% - 48px); background: var(--ink); color: var(--sand); padding: 14px 16px 14px 18px; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(30,35,51,.35); display: flex; gap: 14px; align-items: center; z-index: 10; font-weight: 500; animation: toast 240ms var(--ease) both; }
.toast .ok { width: 30px; height: 30px; border-radius: 50%; background: var(--turq); display: grid; place-items: center; flex: none; }
.toast .btn { background: var(--sand); border-color: var(--sand); min-height: 40px; }
@keyframes toast { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* receipt: only visible when printing */
.receipt { display: none; }
.topbar .user-name { display: none; }   /* the name is in the account menu */
/* timetable, lessons, payroll */
.tt-wrap { overflow-x: auto; margin-top: 12px; }
table.tt { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 640px; }
table.tt th { font-size: 13px; color: var(--muted); font-weight: 600; text-align: left; padding: 2px 6px; }
table.tt th.tt-p { width: 46px; text-align: center; }
table.tt td { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 7px 9px; vertical-align: top; height: 54px; }
table.tt td.free { background: transparent; border-style: dashed; }
table.tt td.cell { cursor: pointer; }
table.tt td.cell:hover, table.tt td.cell:focus-visible { border-color: var(--lapis); outline: none; background: var(--lapis-soft); }
table.tt .les + .les { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
table.tt .les b { display: block; font-size: 13.5px; line-height: 1.25; }
table.tt .les span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.cell-row { gap: 10px; margin: 0 0 6px; }
.table tr.need-row td { background: var(--gold-soft); }
.table tr.ls-off td { color: var(--muted); }
.table tr.ls-off td:nth-child(3) { text-decoration: line-through; }
#ls-table select { max-width: 260px; }
.table tr.grp td { background: var(--sand); font-weight: 700; font-size: 13px; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.table tr.grp.total td { color: var(--ink); font-size: 14.5px; }
.warn-list ul { columns: 2; column-gap: 28px; }
.bk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; max-height: 52vh; overflow-y: auto; margin: 10px 0; padding-right: 6px; }
.bk-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; font-weight: 400; }
.bk-row input { width: 140px; text-align: right; }
#pd-explain { line-height: 1.6; margin: 10px 0 0; }
#pd-items li { padding: 4px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.tab.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tl-head { padding-top: 18px; padding-bottom: 18px; }
.warn-note { background: var(--gold-soft); color: var(--gold-ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.lb-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lb-form .confirm { font-weight: 600; }
.lb-form > .btn { align-self: flex-start; }
ul.courses li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.obs { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.obs-scores { columns: 2; margin: 6px 0; font-size: 14px; }
.nowrap { white-space: nowrap; }
#ob-rubric .mark-row { padding: 8px 0; }
.council-badge { background: var(--danger-soft); color: var(--danger); }
#xd-table td { vertical-align: middle; }
#gs-bounds label, #gs-quarters label { font-size: 13px; }
.user-pop a.btn { text-decoration: none; justify-content: flex-start; }

@media print {
  body > *:not(.receipt) { display: none !important; }
  html, body { background: #fff; }
  .receipt { display: block; font-family: var(--body); font-size: 13px; width: 72mm; color: #000; }
  .receipt h3 { margin: 0 0 6px; font-size: 15px; }
  .receipt table { width: 100%; }
  .receipt td.num { text-align: right; }
}

/* ------------------------------------------------------------------ phone */
@media (min-width: 761px) {
  .topbar { column-gap: 20px; }
  #nav { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* never two rows */
  #nav a { white-space: nowrap; }
}
@media (max-width: 1440px) {
  #nav a { padding: 10px 12px; }
}
@media (max-width: 1360px) and (min-width: 761px) {
  #nav { gap: 2px; }
  #nav a { padding: 9px 9px; font-size: 14.5px; }
  .brand-sub { display: none; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .brand > div { display: none; }            /* small laptops: the logo alone, so every menu item fits */
  #nav a { padding: 8px 7px; font-size: 14px; }
}
@media (max-width: 900px) {
  .kassa-grid, .home-split, .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 14px 16px; gap: 12px; }
  #nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .user-name, .brand-sub { display: none; }
  main { padding: 4px 16px 32px; }
  .card { padding: 20px 16px; border-radius: 18px; }
  .hero { padding: 24px 20px; border-radius: 22px; gap: 22px; }
  .hero-num .v { font-size: 34px; }
  .seals { flex-direction: column; gap: 8px; width: 100%; }
  .seal { width: 100%; height: auto; border-radius: 16px; display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; row-gap: 0;
    justify-items: start; text-align: left; padding: 10px 14px; }
  .seal svg { grid-row: span 2; width: 22px; height: 22px; }
  .seal span { font-size: 12px; }
  .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part .amount { font-size: 28px; min-height: 66px; }
  .small-search { width: 100%; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span2 { grid-column: 1 / -1; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .mark-row { padding: 12px 0; }
  .seg { width: 100%; }
  .seg-b { flex: 1; padding: 10px 4px; font-size: 13.5px; }
  .mr-right { width: 100%; }
  .mr-time, .mr-note { flex: 1; width: auto; }
  ul.plain.cols2 { columns: 1; }
  .login-box { grid-template-columns: 1fr; }
  .login-art { min-height: 0; padding: 28px; }
  .login-card { padding: 28px; }
  .table th:nth-child(6), .table td:nth-child(6) { display: none; }
  .bk-list, .warn-list ul { grid-template-columns: minmax(0, 1fr); columns: 1; }
  .obs-scores { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ menu groups (Bosh · Pul · Maktab · Odamlar) */
.nav-group { position: relative; display: flex; }
.nav-g { font: inherit; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; border-radius: 999px; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.nav-g::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: .7; }
.nav-g:hover { background: #E9DFCB; }
.nav-g:focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; }
.nav-group.active > .nav-g { background: var(--ink); color: var(--sand); font-weight: 600; }
.nav-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 200px; flex-direction: column;
  gap: 2px; padding: 6px; background: var(--white, #fff); border-radius: 16px; box-shadow: 0 12px 32px rgba(23, 32, 51, .16); }
.nav-group.open .nav-pop { display: flex; }
.nav-pop a { border-radius: 10px !important; }
.nav-pop a.active { background: #E9DFCB !important; color: var(--ink) !important; }
#nav:not(.flat) { overflow: visible !important; }                        /* the drop-down must not be clipped */
/* few pages, or one page in a group: plain links in one row */
#nav.flat .nav-group, #nav .nav-group.single, #nav.flat .nav-pop, #nav .nav-group.single .nav-pop { display: contents; }
#nav.flat .nav-g, #nav .nav-group.single .nav-g { display: none; }
#nav.flat .nav-pop a.active, #nav .nav-group.single .nav-pop a.active { background: var(--ink) !important; color: var(--sand) !important; }
#nav .nav-group[hidden] { display: none !important; }
@media (max-width: 760px) {    /* phones: one scrolling row, no drop-downs */
  #nav .nav-group, #nav .nav-pop { display: contents; }
  #nav .nav-g { display: none; }
  #nav .nav-pop a.active { background: var(--ink) !important; color: var(--sand) !important; }
  #nav:not(.flat) { overflow-x: auto !important; }
}
/* forms laid out in a grid (Xarajatlar) */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.badge.ok { background: #D7EFE9; color: #0E5E52; }
.badge.warn { background: #F6E3B8; color: #7A4F00; }
.badge.muted { background: #ECE6DA; color: var(--muted); }
.small-btn { min-height: 36px; padding: 6px 12px; }

/* my pay slips */
.payslip { border-top: 1px solid var(--line); padding: 18px 0 6px; }
.payslip:first-child { border-top: 0; }
.payslip-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.payslip-h h2 { margin: 0; font-size: 20px; }
.payslip-t { max-width: 560px; margin-top: 10px; }
.payslip-t td:first-child { padding-right: 16px; }
.payslip-t tr.sum td { border-top: 1px solid var(--line); }
.payslip-t tr.main td { font-size: 17px; color: var(--lapis); }
#nav.flat a[data-view=oyligim] { order: 9; }   /* a teacher's own work first, her pay last */

/* homework */
.hw-row { border-top: 1px solid var(--line-soft); padding: 12px 0; display: grid; gap: 8px; }
.hw-row:first-child { border-top: 0; }
.hw-row textarea { width: 100%; font: inherit; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; resize: vertical; background: var(--white); }
.hw-row textarea:disabled { opacity: .75; }
.hw-peek { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav.flat a[data-view=qabul] { order: -1; }       /* the admissions team: its own page first */
details.fold > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.fold[open] > summary { margin-bottom: 10px; }

/* debtors: how old the debt is */
.age-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 16px; }
.age { text-align: left; border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; cursor: pointer; font: inherit; color: inherit; }
.age .k { font-size: 13px; color: var(--muted); }
.age b { font-size: 17px; font-variant-numeric: tabular-nums; }
.age .n { font-size: 12px; color: var(--muted); }
.age.on { border-color: var(--lapis); box-shadow: 0 0 0 2px var(--lapis-soft); }
.age-31-60.has b { color: #8A5A00; }
.age-61-90.has b, .age-90p.has b { color: #A3271B; }
.tile-btn { border: 0; font: inherit; text-align: left; cursor: pointer; }
.tile-btn.on { outline: 3px solid var(--lapis); }
.badge.bad { background: #F6D0CC; color: #8E1F14; }
@media (max-width: 760px) { .age-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* announcements */
#an-card textarea { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); resize: vertical; }
.an-aud { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 6px; }
.an-aud label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.an-classes { display: grid; gap: 6px; margin: 6px 0 10px; }
.an-grade { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.an-grade .chip.on { background: var(--lapis); color: #fff; border-color: var(--lapis); }
.an-preview { border: 2px dashed var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 10px; display: grid; gap: 10px; }
.bubble-prev { background: #E6F0FA; color: #17212B; border-radius: 16px 16px 16px 4px; padding: 12px 14px; white-space: pre-wrap; max-width: 460px; overflow-wrap: anywhere; }
.an-txt { max-width: 380px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* compact tag list (e.g. classes that have not sent attendance) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--sand); font-size: 13px; font-weight: 700; color: var(--ink); }
.tag.tag-warn { background: #F6E3B8; color: var(--gold-ink); }

/* long page help folded under "Batafsil" so pages open with the content, not paragraphs */
details.how { margin: -2px 0 10px; }
details.how > summary { cursor: pointer; color: var(--lapis); font-size: 13px; font-weight: 600; width: fit-content; list-style-position: inside; }
details.how > p { margin: 6px 0 0; max-width: 80ch; }

/* investor (read-only): everything that changes data is hidden; reads (filters, tabs, Excel/PDF, close) are marked
   data-ro / data-tab / data-close. New buttons are hidden by default, so a forgotten write control never shows. */
.ro-only { display: none; }
body.ro .ro-only { display: revert; }
body.ro [data-write],
body.ro main form:not([data-ro]),
body.ro main button:not([data-ro]):not([data-tab]):not([data-close]),
body.ro dialog form:not([data-ro]),
body.ro dialog button:not([data-ro]):not([data-tab]):not([data-close]),
body.ro main td select, body.ro main textarea, body.ro .c-phone { display: none !important; }
.ro-banner { background: #E6ECF8; color: var(--lapis); border-radius: 14px; padding: 10px 16px; margin-bottom: 14px;
  font-weight: 600; font-size: 14px; }

/* teacher: today's to-do list */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.todo li.done .dot { background: var(--turq); }
.todo li.done b { color: var(--muted); font-weight: 600; }

.grid-form .span2 { grid-column: 1 / -1; }
.sub-h { font-size: 15px; margin: 18px 0 4px; }
.ok-box { background: var(--turq-soft); color: var(--turq-deep); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 8px 0; }

/* login slips (shown once, printed in a separate window) */
.dlg.wide { width: min(760px, 94vw); }
.slips { max-height: 55vh; overflow: auto; }
.slipx { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--white); }
.slipx-h { font-size: 12px; color: var(--muted); }
.slipx-n { font-size: 17px; font-weight: 700; margin: 4px 0 6px; }
.slipx-n span { font-weight: 500; font-size: 13px; color: var(--muted); }
.slipx table td { padding: 2px 14px 2px 0; }
.slipx .mono { font-family: ui-monospace, Consolas, monospace; font-size: 16px; letter-spacing: .5px; }
.slipx ol { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
/* timetable: the "who teaches what" list next to the grid upload */
.ta-row { align-items: center; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.ta-row .btn { margin: 0; }
#tt-result ul { margin: 4px 0 0; }
/* unit tests: the lesson choice can be long ("Saidov guruhi (8-B, 8-D, 9-B, 10-B, 11-B)") */
#un-form label { max-width: 100%; }
#un-opt { max-width: min(460px, 100%); text-overflow: ellipsis; }
/* the school's own logo (header, login, settings) */
.brand-logo { width: 44px; height: 44px; border-radius: 12px; display: block; object-fit: contain; }
.brand.branded .brand-name { font-size: 15px; line-height: 1.2; max-width: 180px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brand.branded .brand-sub { display: none; }
/* login on the school's own colour: its logo large, its name, Maktab only as the small print */
.login-default { display: flex; flex-direction: column; gap: 10px; }
.login-art.branded { background: var(--brand, var(--lapis)); color: var(--on-brand, var(--white)); justify-content: center; align-items: center; text-align: center; }
.login-art.branded .girih { display: none; }          /* a clean field of the school's colour; the logo sits on it */
/* a dark school colour also takes the sign-in button and focus ring, so the card reads as one */
.login-box.brand-dark { --lapis: var(--brand-btn); --lapis-dark: color-mix(in srgb, var(--brand-btn) 82%, black); }
.login-school { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-school img { width: 176px; height: 176px; border-radius: 40px; object-fit: contain; }
.login-school h1 { font-size: 28px; line-height: 1.2; max-width: 330px; }
.login-art p.login-powered { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: inherit; opacity: .75; margin-top: 4px; max-width: none; }
.login-powered svg { flex-shrink: 0; }
@media (max-width: 760px) {
  .login-school img { width: 108px; height: 108px; border-radius: 26px; }
  .login-school h1 { font-size: 22px; }
}
#brand-mark { display: grid; place-items: center; }
.logo-chip.has-img { background: transparent; overflow: hidden; }
.logo-chip img { width: 64px; height: 64px; border-radius: 18px; display: block; object-fit: contain; }
.logo-preview { width: 72px; height: 72px; border-radius: 16px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

/* who paid: six status buttons */
.ry-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 760px) { .ry-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.st-paid { color: var(--ok, #1f7a4d); font-weight: 600; }
.st-part { color: #a86a00; font-weight: 600; }
.st-none { color: var(--bad, #b3261e); font-weight: 600; }
.st-free, .st-nodue { color: var(--muted); }
