/* =========================================================
   Lopio — hệ thiết kế chung (app thầy cô, trang học sinh, trang đặt chỗ)
   Nền trung tính, một màu nhấn xanh Lopio, đường kẻ mảnh thay bóng đổ, bo góc 10–16px.
   Sáng / tối theo máy, hoặc chọn tay (html[data-theme]).
   ========================================================= */
:root {
  --bg: #F4F6F5;
  --bg-2: #EEF1EE;
  --surface: #FFFFFF;
  --surface-2: #F5F7F6;
  --input: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #475569;
  --muted: #64748B;
  --line: #E6E9E7;
  --line-2: #D3D9E2;
  --line-3: #BCC5D2;
  --primary: #0A7D57;
  --primary-2: #0A7D57;
  --primary-ink: #FFFFFF;
  --primary-soft: #E8F3EE;
  --brand-grad: #0A7D57;
  --brand-grad-hover: #086B4A;
  --sky: #2563EB; --sky-soft: #EAF1FE;
  --mint: #058C62; --mint-soft: #E2F6EE;
  --sun: #B76E00; --sun-soft: #FDF3DC;
  --coral: #E5484D; --coral-soft: #FDECEC;
  --grape: #7C3AED; --grape-soft: #F1EAFE;
  --pink: #D6408A; --pink-soft: #FCE9F2;
  --danger: #DC2626;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px -4px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 56px -12px rgba(15, 23, 42, .28);
  --shadow-pop: 0 2px 6px rgba(15, 23, 42, .06), 0 20px 48px -8px rgba(15, 23, 42, .22);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F1A; --bg-2: #121A29; --surface: #0F1624; --surface-2: #131C2D; --input: #0C1320;
    --ink: #E8EDF5; --ink-2: #C2CBD9; --muted: #8592A8; --line: #1D2738; --line-2: #2A3649; --line-3: #3A4760;
    --primary: #34D399; --primary-2: #6EE7B7; --primary-ink: #04261A; --primary-soft: #0D2A22;
    --sky: #60A5FA; --sky-soft: #132440; --mint: #34D399; --mint-soft: #0D2A22; --sun: #FBBF24; --sun-soft: #2B2311;
    --coral: #FB7185; --coral-soft: #3A1820; --grape: #A78BFA; --grape-soft: #231B42; --pink: #F472B6; --pink-soft: #38172F;
    --danger: #F87171;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 28px 64px -12px rgba(0, 0, 0, .7);
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 56px -8px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F1A; --bg-2: #121A29; --surface: #0F1624; --surface-2: #131C2D; --input: #0C1320;
  --ink: #E8EDF5; --ink-2: #C2CBD9; --muted: #8592A8; --line: #1D2738; --line-2: #2A3649; --line-3: #3A4760;
  --primary: #34D399; --primary-2: #6EE7B7; --primary-ink: #04261A; --primary-soft: #0D2A22;
  --sky: #60A5FA; --sky-soft: #132440; --mint: #34D399; --mint-soft: #0D2A22; --sun: #FBBF24; --sun-soft: #2B2311;
  --coral: #FB7185; --coral-soft: #3A1820; --grape: #A78BFA; --grape-soft: #231B42; --pink: #F472B6; --pink-soft: #38172F;
  --danger: #F87171;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 64px -12px rgba(0, 0, 0, .7);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 56px -8px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--primary) 26%, transparent); }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
kbd { font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--surface); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 650; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }

/* ---------- icon nét ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.h-ic { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary-2); }
.h-ic .i { width: 17px; height: 17px; vertical-align: 0; }
.h-ic.tone-sky { background: var(--sky-soft); color: var(--sky); }
.h-ic.tone-sun { background: var(--sun-soft); color: var(--sun); }
.h-ic.tone-grape { background: var(--grape-soft); color: var(--grape); }
.h-ic.tone-pink { background: var(--pink-soft); color: var(--pink); }
.h-ic.tone-mint { background: var(--mint-soft); color: var(--mint); }
.h-ic.tone-coral { background: var(--coral-soft); color: var(--coral); }
h2.has-ic, h3.has-ic { display: flex; align-items: center; gap: 10px; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s, transform .08s;
}
.btn .i { width: 17px; height: 17px; vertical-align: 0; }
.btn:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--brand-grad); border-color: #0C8F63; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(15, 23, 42, .12), 0 4px 12px -4px rgba(14, 156, 108, .55);
}
.btn-primary:hover { background: var(--brand-grad-hover); border-color: #0A7D57; color: #fff; }
.btn-primary:focus-visible { box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); box-shadow: none; }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--bg-2); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: color-mix(in srgb, var(--danger) 40%, var(--line-2)); background: var(--coral-soft); color: var(--danger); }
.btn-ok { background: linear-gradient(180deg, #12B07A, #0B9466); border-color: #0A8A5E; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), var(--shadow-xs); }
.btn-ok:hover { background: linear-gradient(180deg, #0FA370, #098558); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; position: relative; text-decoration: none !important; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-2); border-color: var(--line); color: var(--ink); }
.icon-btn .i { width: 19px; height: 19px; vertical-align: 0; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- ô nhập ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--input); color: var(--ink); box-shadow: var(--shadow-xs);
  font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.input:hover { border-color: var(--line-3); }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
input[data-search].input, .search-input {
  padding-left: 38px; background-repeat: no-repeat; background-position: 12px 50%; background-size: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.75'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E");
}
input[type="range"] { accent-color: var(--primary); }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- thẻ ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 32px; }
.card-head h2 { font-size: 16px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-head > a.small { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card.clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s, border-color .15s; }
.card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }

.stat {
  position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lbl ic" "num ic"; column-gap: 12px; row-gap: 4px; align-items: start;
}
.stat .emoji { grid-area: ic; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; font-size: 18px; }
.stat .emoji .i { width: 20px; height: 20px; vertical-align: 0; }
.stat .num { grid-area: num; font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .lbl { grid-area: lbl; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, var(--c-soft, transparent), transparent); opacity: .7; pointer-events: none; }
.stat:has(.c-sky) { --c-soft: var(--sky-soft); } .stat:has(.c-mint) { --c-soft: var(--mint-soft); } .stat:has(.c-grape) { --c-soft: var(--grape-soft); }
.stat:has(.c-sun) { --c-soft: var(--sun-soft); } .stat:has(.c-coral) { --c-soft: var(--coral-soft); } .stat:has(.c-pink) { --c-soft: var(--pink-soft); }

/* màu theo lớp */
.c-sky { --c: var(--sky); --c-soft: var(--sky-soft); }
.c-mint { --c: var(--mint); --c-soft: var(--mint-soft); }
.c-sun { --c: var(--sun); --c-soft: var(--sun-soft); }
.c-coral { --c: var(--coral); --c-soft: var(--coral-soft); }
.c-grape { --c: var(--grape); --c-soft: var(--grape-soft); }
.c-pink { --c: var(--pink); --c-soft: var(--pink-soft); }
.tint { background: var(--c-soft); color: var(--c); }
.badge-emoji { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--c-soft, var(--bg-2)); }
.badge-emoji.sm { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }

.class-card { position: relative; overflow: hidden; padding: 0; }
.class-card .band {
  height: 58px; border-bottom: 1px solid var(--line);
  background-color: var(--c-soft);
  background-image: radial-gradient(color-mix(in srgb, var(--c) 24%, transparent) 1px, transparent 1.4px), linear-gradient(120deg, transparent 40%, color-mix(in srgb, var(--surface) 55%, transparent));
  background-size: 12px 12px, auto;
}
.class-card .body { padding: 0 18px 18px; }
.class-card .body > .row.top { align-items: flex-end; }
.class-card .body > .row.top > .grow { padding-top: 10px; }
.class-card .badge-letter { margin-top: -26px; width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 18px; }
.class-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.class-card .small.mt-sm { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.class-card.archived { opacity: .6; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); border: 0; font-family: inherit; white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent); vertical-align: middle;
}
.chip .i { width: 13px; height: 13px; vertical-align: 0; }
.chip.c { background: var(--c-soft); color: var(--c); }
.chip.ok { background: var(--mint-soft); color: var(--mint); }
.chip.warn { background: var(--sun-soft); color: var(--sun); }
.chip.bad { background: var(--coral-soft); color: var(--coral); }
.chip.info { background: var(--sky-soft); color: var(--sky); }
.chip.grape { background: var(--grape-soft); color: var(--grape); }
button.chip { cursor: pointer; }

/* ---------- danh sách ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); transition: background .12s; }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.list-item .title { font-weight: 600; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; letter-spacing: -.01em;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c, var(--primary)) 72%, #fff), var(--c, var(--primary)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 1px 2px rgba(15, 23, 42, .12);
}

.empty { text-align: center; padding: 32px 18px; color: var(--muted); }
.empty .big {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.empty .big .i { width: 24px; height: 24px; vertical-align: 0; }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.empty p { font-size: 13.5px; max-width: 380px; margin: 0 auto; }

/* =========================================================
   Khung ứng dụng: thanh bên tối + thanh trên
   ========================================================= */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 16px 12px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  background: #0B1220;
  background-image: radial-gradient(120% 50% at 0% 0%, rgba(16, 185, 129, .14), transparent 60%), radial-gradient(90% 40% at 100% 100%, rgba(59, 130, 246, .08), transparent 60%);
  border-right: 1px solid rgba(255, 255, 255, .06); color: #A5B0C3; scrollbar-width: none;
}
:root[data-theme="dark"] .sidebar { background-color: #060B14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar { background-color: #060B14; } }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink); text-decoration: none !important; }
.sidebar .brand { color: #fff; }
.brand .logo { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; }
img.logo { object-fit: contain; flex: none; background: none; border-radius: 0; box-shadow: none; }   /* logo sổ + bút đứng tự do, không nền ô vuông */
.nav-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5F6D85; padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 9px; color: #A5B0C3;
  font-weight: 500; font-size: 14px; text-decoration: none !important; position: relative; transition: background .15s, color .15s;
}
.nav-link .i { width: 18px; height: 18px; color: #74829B; transition: color .15s; vertical-align: 0; }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #E7ECF4; }
.nav-link:hover .i { color: #C5CEDC; }
.nav-link.active { background: linear-gradient(90deg, rgba(52, 211, 153, .16), rgba(52, 211, 153, .03)); color: #fff; font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #34D399; box-shadow: 0 0 12px rgba(52, 211, 153, .7); }
.nav-link.active .i { color: #34D399; }
.nav-link .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #F43F5E; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar .spacer { flex: 1; min-height: 12px; }
.side-card { margin: 0 2px 10px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; line-height: 1.45; color: #C6D0DE;
  background: linear-gradient(140deg, rgba(16, 185, 129, .18), rgba(59, 130, 246, .08)); }
.side-card b { color: #fff; display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 3px; }
.side-card b .i { color: #34D399; width: 16px; height: 16px; }
.side-card button { margin-top: 9px; width: 100%; height: 30px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.side-card button:hover { background: rgba(255, 255, 255, .14); }
.side-card button .i { width: 14px; height: 14px; }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.sidebar .me .avatar { width: 34px; height: 34px; font-size: 13px; }
.sidebar .me .nm { color: #F1F5F9; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .em { color: #7D8AA1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .icon-btn { color: #8E9AB0; width: 32px; height: 32px; }
.sidebar .me .icon-btn:hover { background: rgba(255, 255, 255, .08); border-color: transparent; color: #fff; }

.main-col { min-width: 0; display: flex; flex-direction: column;
  background: radial-gradient(900px 320px at 60% -160px, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%); }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { padding: 0; font-size: 18px; }
.topbar .brand .logo { width: 30px; height: 30px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 500; min-width: 0; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .i { width: 14px; height: 14px; opacity: .55; vertical-align: 0; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; height: 36px; width: 290px; padding: 0 7px 0 11px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--line-3); box-shadow: var(--shadow-md); }
.search-trigger .i { width: 17px; height: 17px; vertical-align: 0; }
.search-trigger span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 2px; }

.main { padding: 26px 32px 64px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 5px; font-size: 14px; }
.page-head .sub .chip { margin-left: 2px; }
.page-head > .row.wrap { gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 12px; cursor: pointer; background: none; border: 0; padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 8px; font-family: inherit; }
.back:hover { color: var(--ink); background: var(--bg-2); }
.back .i { width: 16px; height: 16px; vertical-align: 0; }

.bottom-nav { display: none; }
.mobile-top { display: none; }

/* bảng lệnh ⌘K */
.cmd-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(15, 23, 42, .42); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  display: flex; justify-content: center; align-items: flex-start; padding: 11vh 16px 16px; animation: fade .12s ease; }
.cmd { width: 100%; max-width: 640px; max-height: min(72vh, 620px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); animation: pop .16s cubic-bezier(.2, .8, .2, 1); }
.cmd-in { display: flex; align-items: center; gap: 10px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); }
.cmd-in > .i { width: 19px; height: 19px; color: var(--muted); }
.cmd-in input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.cmd-in input::placeholder { color: var(--muted); }
.cmd-list { overflow-y: auto; padding: 6px 8px 8px; overscroll-behavior: contain; }
.cmd-group { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 6px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); min-height: 46px; }
.cmd-item .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
.cmd-item .ic .i { width: 16px; height: 16px; vertical-align: 0; }
.cmd-item .ic.av { border: 0; background: none; }
.cmd-item .ic .avatar { width: 30px; height: 30px; font-size: 12px; }
.cmd-item .ic .badge-emoji { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.cmd-item .tx { flex: 1; min-width: 0; }
.cmd-item .tt { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item .sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item .go { color: var(--muted); opacity: 0; display: flex; }
.cmd-item .go .i { width: 16px; height: 16px; }
.cmd-item.active { background: var(--primary-soft); }
.cmd-item.active .ic { background: var(--surface); color: var(--primary-2); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.cmd-item.active .go { opacity: 1; color: var(--primary-2); }
.cmd-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.cmd-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.cmd-foot span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1100px) { .search-trigger { width: 220px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px 16px 104px; }
  h1 { font-size: 21px; }
  .topbar { height: 56px; padding: 0 12px 0 16px; gap: 6px; }
  .crumbs, .top-sep { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger .i { width: 19px; height: 19px; }
  .top-right .btn-create { width: 34px; padding: 0; }
  .top-right .btn-create .lbl { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--muted);
    font-size: 10.5px; font-weight: 600; text-decoration: none !important; background: none; border: 0; font-family: inherit; position: relative; cursor: pointer;
  }
  .bottom-nav .ico { height: 26px; display: grid; place-items: center; }
  .bottom-nav .ico .i { width: 22px; height: 22px; vertical-align: 0; }
  .bottom-nav .active { color: var(--primary-2); }
  .bottom-nav .active .ico::after { content: ""; position: absolute; top: -7px; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .bottom-nav .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--surface); }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .card { padding: 16px; }
  .hide-mobile { display: none !important; }
  .cmd-backdrop { padding: 10px; align-items: flex-start; }
  .cmd { max-height: 80vh; }
  .cmd-foot { display: none; }
}
@media (min-width: 861px) { .show-mobile { display: none !important; } }

/* ---------- hộp thoại ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { max-width: 780px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 14px 22px; position: sticky; top: 0; z-index: 2;
  background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.modal-head [data-close].btn-icon { width: 34px; height: 34px; color: var(--muted); }
.modal-body { padding: 18px 22px 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 10px;
  position: sticky; bottom: 0; z-index: 2; }
@media (max-width: 600px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; animation: up .22s cubic-bezier(.2, .8, .2, 1); border-bottom: 0; }
  .modal-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-2); }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

.sheet-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-menu a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: 12.5px; text-decoration: none !important; text-align: center; }
.sheet-menu a .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); font-size: 20px; }
.sheet-menu a .ico .i { width: 20px; height: 20px; vertical-align: 0; }

/* ---------- thông báo ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 600; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 12px; background: #0F172A; color: #F1F5F9; font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .45), inset 0 0 0 1px rgba(255, 255, 255, .06); animation: toast-in .28s cubic-bezier(.2, .8, .2, 1); }
.toast .i { width: 18px; height: 18px; color: #34D399; vertical-align: 0; }
.toast.err { background: #2A0F14; color: #FFE4E6; box-shadow: 0 12px 32px -8px rgba(127, 29, 29, .5), inset 0 0 0 1px rgba(251, 113, 133, .25); }
.toast.err .i { color: #FB7185; }
:root[data-theme="dark"] .toast:not(.err) { background: #1E293B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast:not(.err) { background: #1E293B; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* ---------- tabs ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color .15s, background .15s, box-shadow .15s; }
.seg button:hover { color: var(--ink); }
.seg button .i { width: 16px; height: 16px; vertical-align: 0; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--line); }
.seg .n { font-size: 11px; font-weight: 700; background: var(--line); color: var(--ink-2); border-radius: 999px; padding: 1px 7px; }
.seg button.on .n { background: var(--primary-soft); color: var(--primary-2); }

/* ---------- lịch tuần ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 190px; box-shadow: var(--shadow-xs); }
.day-col.today { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow); }
.day-col .dname { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; padding-left: 2px; }
.day-col .dnum { font-size: 17px; font-weight: 700; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; margin: 2px 0 8px -3px; font-variant-numeric: tabular-nums; }
.day-col.today .dnum { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 10px -2px rgba(14, 156, 108, .5); }
.lesson-pill { display: block; padding: 8px 9px 8px 10px; border-radius: 9px; margin-bottom: 7px; cursor: pointer; transition: transform .12s, box-shadow .12s;
  background: color-mix(in srgb, var(--c-soft) 75%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); }
.lesson-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.lesson-pill .t { font-size: 11.5px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.lesson-pill .n { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-top: 2px; }
.lesson-pill .tiny { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lesson-pill.cancelled { opacity: .45; text-decoration: line-through; }
.lesson-pill.done .t .tm::after { content: " ✓"; }
.lesson-pill .t { display: flex; align-items: center; justify-content: space-between; gap: 4px 6px; flex-wrap: wrap; }
.lesson-pill .tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.empty-day { display: none; }
@media (max-width: 1100px) {
  .week { grid-template-columns: 1fr; gap: 8px; }
  .day-col { min-height: 0; display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: start; }
  .day-col .dnum { margin: 2px 0 0 -3px; }
  .day-col .empty-day { display: block; color: var(--muted); font-size: 13px; padding-top: 8px; }
}

/* ---------- buổi học ---------- */
.lesson-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  position: relative; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lesson-row::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.lesson-row:hover { border-color: color-mix(in srgb, var(--c) 35%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lesson-row .time { min-width: 58px; font-weight: 700; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.lesson-row .time small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.lesson-row .bold { font-weight: 600; }
@media (max-width: 600px) {
  .lesson-row { flex-wrap: wrap; row-gap: 10px; }
  .lesson-row .grow { flex: 1 1 150px; }
  .lesson-row > .btn, .lesson-row > .chip { margin-left: auto; }
  .stat { padding: 14px; grid-template-areas: "lbl ic" "num num"; }
  .stat .emoji { width: 34px; height: 34px; border-radius: 10px; }
  .stat .emoji .i { width: 18px; height: 18px; }
  .stat .num { font-size: 21px; overflow-wrap: anywhere; }
}

.att-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.att-row:first-child { border-top: 0; }
.att-btns { display: flex; gap: 4px; margin-left: auto; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.att-btns button {
  height: 32px; min-width: 38px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.att-btns button .i { width: 15px; height: 15px; vertical-align: 0; }
.att-btns button:hover { color: var(--ink); background: var(--surface); }
.att-btns button.on { color: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .15), inset 0 1px 0 rgba(255, 255, 255, .2); }
.att-btns button.on.present { background: #0FA372; }
.att-btns button.on.late { background: #D98B06; }
.att-btns button.on.absent { background: #E5484D; }
.att-btns button.on.excused { background: #2F7BEA; }

/* ---------- AI ---------- */
.ai-hero { background: linear-gradient(140deg, color-mix(in srgb, var(--grape-soft) 85%, var(--surface)), color-mix(in srgb, var(--sky-soft) 70%, var(--surface)) 55%, color-mix(in srgb, var(--mint-soft) 80%, var(--surface))); }
.q-card { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.q-card .q { font-weight: 600; white-space: pre-wrap; }
.q-card ol { margin: 10px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.q-card ol li { padding: 7px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.q-card ol li.right { border-color: color-mix(in srgb, var(--mint) 45%, transparent); background: var(--mint-soft); }
.q-card .ans { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); padding: 9px 11px; border-radius: 9px; background: var(--sun-soft); white-space: pre-wrap; }
.thinking { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 10px; text-align: center; }
.thinking .bubbles { font-size: 30px; display: flex; gap: 8px; color: var(--grape); }
.thinking .bubbles .i { width: 30px; height: 30px; }
.thinking .bubbles span { display: inline-block; animation: bob 1.1s ease-in-out infinite; }
.thinking .bubbles span:nth-child(2) { animation-delay: .15s; color: var(--sky); }
.thinking .bubbles span:nth-child(3) { animation-delay: .3s; color: var(--sun); }
@keyframes bob { 50% { transform: translateY(-9px); } }

/* ---------- học phí ---------- */
.money { font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.qr { width: 190px; height: 190px; border-radius: 12px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.msg-box { white-space: pre-wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: 14px; }
.progress { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0FA372, #34D399); }

/* ---------- trang ngoài (đặt chỗ, vào lớp) ---------- */
.public-wrap { max-width: 1060px; margin: 0 auto; padding: 22px 16px 60px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; padding: 30px 0; }
.hero h1 { font-size: 42px; line-height: 1.12; letter-spacing: -.035em; }
.hero h1 .hl { background: linear-gradient(transparent 62%, var(--sun-soft) 62%); padding: 0 4px; }
.hero .lead { font-size: 17px; color: var(--ink-2); margin-top: 14px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.feature-list div { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.feature-list .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.auth-card { padding: 26px; }
.sticker { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--mint-soft); color: var(--mint); font-weight: 700; font-size: 13px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding: 10px 0; }
  .hero h1 { font-size: 30px; }
  .feature-list { grid-template-columns: 1fr; }
}

.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .no-print, .sidebar, .bottom-nav, .mobile-top, .topbar, .modal-backdrop, .toasts { display: none !important; }
  .print-only { display: block; }
  .main { padding: 0; }
}

/* =========================================================
   Điểm danh mở rộng
   ========================================================= */
.att-card { padding-bottom: 0; }
.att-hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--mint-soft); color: var(--ink-2); font-size: 13.5px; margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--mint) 18%, transparent); }
.att-hint > span:first-child { color: var(--mint); display: flex; padding-top: 1px; }
.att-hint > span:first-child .i { width: 17px; height: 17px; }
.att-tally { display: flex; gap: 6px; flex-wrap: wrap; }
.att-list { display: flex; flex-direction: column; }
.att-item { border-top: 1px solid var(--line); padding: 10px 8px; transition: background .25s ease; border-radius: 10px; }
.att-item:first-child { border-top: 0; }
.att-item.is-absent { background: color-mix(in srgb, var(--coral-soft) 70%, transparent); }
.att-item.is-excused { background: color-mix(in srgb, var(--sky-soft) 70%, transparent); }
.att-item.is-late { background: color-mix(in srgb, var(--sun-soft) 60%, transparent); }
.att-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 170px; }
.att-who .avatar { position: relative; }
.att-who .flag-dot { position: absolute; right: -5px; top: -5px; font-size: 13px; color: var(--sun); display: flex; }
.att-who .flag-dot .i { width: 15px; height: 15px; fill: var(--surface); }
.att-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.att-tags .chip { height: 21px; font-size: 11.5px; padding: 0 7px; }
.att-more { background: none; border: 0; padding: 4px 0 0 48px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-2); cursor: pointer; }
.att-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.att-extra { margin: 8px 0 4px 48px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; animation: rise .25s ease both; }
.att-extra .lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.opt { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-xs); }
.opt .i { width: 15px; height: 15px; vertical-align: 0; }
.opt:hover { border-color: var(--line-3); color: var(--ink); }
.opt.on { background: var(--ink); border-color: var(--ink); color: var(--bg); animation: pop-in .25s ease; }
.opt.on.good, .opt.on.done { background: #0FA372; border-color: #0FA372; color: #fff; }
.opt.on.fair, .opt.on.partial { background: #2F7BEA; border-color: #2F7BEA; color: #fff; }
.opt.on.pass { background: #D98B06; border-color: #D98B06; color: #fff; }
.opt.on.weak, .opt.on.missing { background: #E5484D; border-color: #E5484D; color: #fff; }
.opt.on.flag { background: var(--sun-soft); border-color: var(--sun); color: var(--sun); }
.att-btns button.on { animation: pop-in .25s ease; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 10px -20px 0; padding: 12px 20px; background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
@media (max-width: 860px) { .save-bar { bottom: 66px; margin: 10px -16px 0; padding: 12px 16px; } .att-more, .att-extra { margin-left: 0; padding-left: 0; } .att-extra { padding: 12px; } }

/* Trang điểm danh nhanh */
.att-lesson { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.att-lesson .meta { flex: 1; min-width: 180px; }
.big-time { font-size: 24px; font-weight: 700; color: var(--c); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* Bảng tháng */
.grid-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table.month { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.month th, table.month td { padding: 8px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.month th { position: sticky; top: 0; background: var(--surface-2); font-weight: 650; color: var(--ink-2); z-index: 1; font-size: 12.5px; }
table.month th.name, table.month td.name { position: sticky; left: 0; text-align: left; background: var(--surface); z-index: 2; min-width: 160px; border-right: 1px solid var(--line); }
table.month th.name { z-index: 3; background: var(--surface-2); }
table.month tbody tr:hover td { background: var(--surface-2); }
table.month td.cell { cursor: pointer; min-width: 52px; transition: transform .1s; }
table.month td.cell:hover { transform: scale(1.08); }
.cell-in { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 40px; padding: 4px 6px; border-radius: 8px; font-weight: 700; }
.cell-in .i { width: 14px; height: 14px; vertical-align: 0; }
.cell-in.present { background: var(--mint-soft); color: var(--mint); }
.cell-in.late { background: var(--sun-soft); color: var(--sun); }
.cell-in.absent { background: var(--coral-soft); color: var(--coral); }
.cell-in.excused { background: var(--sky-soft); color: var(--sky); }
.cell-in.none { color: var(--muted); font-weight: 500; }
.cell-in small { font-size: 10.5px; font-weight: 600; opacity: .9; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 12px 0; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .i { width: 14px; height: 14px; }

/* =========================================================
   Hiệu ứng động
   ========================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent); } 80%, 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float-y { 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); } }
@keyframes drift { from { transform: translate3d(0, 0, 0) rotate(0); } to { transform: translate3d(var(--dx, 40px), -110vh, 0) rotate(var(--rot, 180deg)); } }
@keyframes confetti { to { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

.anim > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 50ms); }
.anim .grid > *, .anim .stack > .lesson-row, .anim .att-item, .anim .list > .list-item { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(100ms + var(--j, 0) * 40ms); }
.pulse { animation: pulse-ring 1.8s ease-out infinite; }
.wiggle:hover { animation: wiggle .4s ease; }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-layer i { position: absolute; width: 9px; height: 13px; border-radius: 3px; font-style: normal; animation: confetti 1.3s cubic-bezier(.15, .7, .3, 1) forwards; }
.confetti-layer i.e { width: auto; height: auto; font-size: 18px; background: none !important; }

.done-pop { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; pointer-events: none; }
.done-pop .box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 30px; text-align: center; box-shadow: var(--shadow-lg); animation: pop-in .35s ease; min-width: 240px; }
.done-pop svg { width: 74px; height: 74px; }
.done-pop circle { fill: var(--mint-soft); }
.done-pop path { fill: none; stroke: var(--mint); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .15s ease forwards; }

.doodles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.doodles span { position: absolute; bottom: -60px; font-size: 26px; opacity: .14; animation: drift linear infinite; }
.public-wrap, .wrap { position: relative; z-index: 1; }

/* điều hướng dưới: nút điểm danh nổi ở giữa */
@media (max-width: 860px) {
  .bottom-nav a.center .ico { width: 50px; height: 50px; margin-top: -26px; border-radius: 16px; display: grid; place-items: center; color: #fff;
    background: var(--brand-grad); box-shadow: 0 8px 20px -4px rgba(14, 156, 108, .6), inset 0 1px 0 rgba(255, 255, 255, .25); border: 3px solid var(--surface); }
  .bottom-nav a.center .ico .i { width: 24px; height: 24px; }
  .bottom-nav a.center { color: var(--primary-2); }
  .bottom-nav a.center.active .ico::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .doodles, .confetti-layer { display: none; }
}

/* =========================================================
   Dropdown tự vẽ (thay menu mặc định của trình duyệt)
   ========================================================= */
.dd { position: relative; min-width: 0; }
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip-path: inset(50%); margin: 0 !important; }
.dd-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font-weight: 500; color: var(--ink); }
.dd-btn:hover { border-color: var(--line-3); }
.dd-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.dd-btn[disabled] { opacity: .55; cursor: not-allowed; }
.dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-label.ph { color: var(--muted); }
.dd-chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .22s cubic-bezier(.2, .8, .2, 1), color .2s; }
.dd.open .dd-chev { transform: rotate(180deg); color: var(--primary-2); }
.dd.open .dd-btn, .dd-combo.open .input { border-color: var(--primary); box-shadow: var(--ring); background: var(--input); }
.dd-combo .input { padding-right: 40px; }
.dd-combo .dd-chev { position: absolute; right: 12px; top: 50%; margin-top: -9px; cursor: pointer; }

.dd-menu {
  position: fixed; z-index: 400; padding: 5px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  transform-origin: top center; animation: dd-in .17s cubic-bezier(.2, .8, .2, 1);
}
.dd-menu.up { transform-origin: bottom center; animation-name: dd-in-up; }
.dd-menu.closing { animation: dd-out .12s ease forwards; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes dd-out { to { opacity: 0; transform: scale(.97); } }
.dd-search { position: sticky; top: -5px; z-index: 1; margin: -5px -5px 5px; padding: 7px 7px 6px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dd-search .input { min-height: 36px; padding: 7px 11px; font-size: 14px; border-radius: 8px; box-shadow: none; }
.dd-list { display: flex; flex-direction: column; gap: 1px; }
.dd-opt { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); transition: background .12s; }
.dd-opt .dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.dd-opt .dd-text .i { width: 16px; height: 16px; color: var(--muted); vertical-align: 0; }
.dd-opt.active { background: var(--bg-2); }
.dd-opt.sel { color: var(--primary-2); font-weight: 650; background: var(--primary-soft); }
.dd-opt.sel.active { background: color-mix(in srgb, var(--primary-soft) 70%, var(--bg-2)); }
.dd-opt.ph { color: var(--muted); }
.dd-opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.dd-check { width: 17px; height: 17px; flex: none; color: var(--primary); opacity: 0; transform: scale(.6); transition: all .18s; }
.dd-opt.sel .dd-check { opacity: 1; transform: none; }
.dd-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ô chữ cái đầu của môn (thay biểu tượng lớp) */
.badge-letter { font-weight: 750; font-size: 16px; letter-spacing: -.02em; color: var(--c); background: var(--c-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 14%, transparent); }
.badge-letter.sm { font-size: 13px; }

/* chọn loại buổi: buổi lẻ / cố định */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s; position: relative; box-shadow: var(--shadow-xs); }
.choice:hover { border-color: var(--line-3); }
.choice:active { transform: scale(.99); }
.choice.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface)); box-shadow: var(--ring); }
.choice.on::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; animation: pop-in .25s ease;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.choice-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: var(--bg-2); color: var(--ink-2); }
.choice-ic .i { width: 18px; height: 18px; vertical-align: 0; }
.choice.on .choice-ic { background: var(--surface); color: var(--primary-2); box-shadow: var(--shadow-xs); }
.choice b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.choice small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; padding-right: 18px; }
.repeat-hint { padding: 10px 14px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; color: var(--ink-2); border: 1px solid var(--line); }
.repeat-hint .i { color: var(--primary-2); }
.once-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--sun-soft); color: var(--sun); font-size: 11px; font-weight: 700; vertical-align: 1px; }
@media (max-width: 600px) { .choices { grid-template-columns: 1fr; } }

/* lớp học online */
.online-card { background: linear-gradient(120deg, color-mix(in srgb, var(--sky-soft) 85%, var(--surface)), color-mix(in srgb, var(--mint-soft) 80%, var(--surface))); }
.join-link { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-3);
  font-weight: 600; font-size: 14px; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.once-tag.online { background: var(--sky-soft); color: var(--sky); }

/* badge chữ: Online / Buổi lẻ (thay cho icon) */
.badge-tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; line-height: 1; white-space: nowrap; vertical-align: 1px; }
.badge-tag.lg { height: 24px; padding: 0 9px; font-size: 12px; }
.badge-tag.online { background: #2563EB; color: #fff; box-shadow: 0 2px 6px -1px rgba(37, 99, 235, .45); }
.badge-tag.online::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); animation: blink 1.6s ease-in-out infinite; }
.badge-tag.once { background: var(--sun-soft); color: var(--sun); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 30%, transparent); }
@keyframes blink { 50% { opacity: .35; } }

/* nút thao tác trên thanh tiêu đề hộp thoại */
.modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.modal-head.has-actions { flex-wrap: wrap; }
.modal-head.has-actions h2 { flex: 1; min-width: 140px; }
.btn-danger.btn-ghost:hover { background: var(--coral-soft); }

/* trang buổi học: Điểm danh (rộng hơn) · Tài liệu · Bài tập về nhà — 3 cột trên màn rộng */
.lesson-cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px) minmax(240px, 280px); align-items: start; }
@media (max-width: 1360px) { .lesson-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lesson-cols > .att-card { grid-column: 1 / -1; } }
/* danh sách điểm danh cuộn riêng trong ô, nút Lưu luôn ở ngay dưới */
@media (min-width: 861px) {
  .att-card .att-list { max-height: max(340px, calc(100vh - 380px)); overflow-y: auto; overscroll-behavior: contain; margin-right: -10px; padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
  .att-card .att-list::-webkit-scrollbar { width: 8px; }
  .att-card .att-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--surface); }
  .att-card .att-list::-webkit-scrollbar-thumb:hover { background: var(--line-3); }
  .att-card .save-bar { position: static; }
}
@media (max-width: 860px) { .lesson-cols { grid-template-columns: 1fr; } }
/* cột điểm danh hẹp: nút chỉ còn icon (có chú thích khi rê chuột), tên em không bị đẩy xuống */
.att-card { container: att / inline-size; }
@container att (max-width: 560px) { .att-btns button { padding: 0 8px; gap: 3px; } .att-who { min-width: 140px; } }
@container att (max-width: 420px) { .att-btns .lbl { display: none; } .att-btns button { min-width: 36px; padding: 0 9px; } .att-who { min-width: 120px; } }
/* tài liệu của buổi: tên ở trên, nút ở dưới khi hẹp — chữ không bị ép, nút không đè chữ */
.mat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.mat-row:first-child { border-top: 0; padding-top: 4px; }
.mat-main { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 220px; min-width: 0; }
.mat-main .chip { flex: none; margin-top: 1px; }
.mat-title { font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
.mat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
/* thanh nút trên đầu kết quả AI soạn bài (dính trên cùng khi cuộn danh sách câu hỏi) */
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 8px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 70px; z-index: 2; }

/* =========================================================
   Trình chiếu (máy chiếu): nền sáng, chữ to, tương phản cao
   ========================================================= */
body.pres-open { overflow: hidden; }
.pres {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; color: #14161F;
  background: #FFFFFF radial-gradient(#E9EDF2 1.2px, transparent 1.2px); background-size: 28px 28px;
  --accent: #12B07A; --accent-soft: #DCF5EA;
}
.pres:fullscreen { width: 100vw; height: 100vh; }
.pres-progress { height: 6px; background: #EEF1F5; flex: none; }
.pres-progress > div { height: 100%; background: linear-gradient(90deg, #12B07A, #3EE0A4); transition: width .35s ease; }
.pres-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3vh 6vw; overflow: auto; cursor: pointer; }
.pres-slide { width: 100%; max-width: 1400px; animation: pres-fade .35s ease both; }
.pres-slide.in-right { animation-name: pres-right; }
.pres-slide.in-left { animation-name: pres-left; }
@keyframes pres-fade { from { opacity: 0; } }
@keyframes pres-right { from { opacity: 0; transform: translateX(40px); } }
@keyframes pres-left { from { opacity: 0; transform: translateX(-40px); } }
.pres-kicker { display: inline-block; font-weight: 800; font-size: clamp(16px, 1.5vw, 24px); color: var(--accent); background: var(--accent-soft);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 2.4vh; letter-spacing: .02em; }
.pres-title { text-align: center; }
.pres-title h1 { font-size: clamp(36px, 5vw, 84px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 2vh; }
.pres-intro { font-size: clamp(18px, 1.8vw, 30px); color: #3B4152; max-width: 1100px; margin: 0 auto 2vh; line-height: 1.5; }
.pres-sub { font-size: clamp(16px, 1.5vw, 24px); color: #6B7385; }
.pres-start { margin-top: 5vh; font-size: clamp(15px, 1.3vw, 20px); color: #8A92A3; }
.pres-end { font-size: clamp(60px, 8vw, 120px); }
.pres-qtext { font-size: clamp(26px, 3.3vw, 56px); font-weight: 700; line-height: 1.32; white-space: pre-wrap; letter-spacing: -.01em; }
.pres-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh 2vw; margin-top: 4vh; }
.pres-choice { display: flex; align-items: center; gap: 1.2vw; padding: 2vh 1.6vw; border-radius: 22px; border: 3px solid #E3E7EE; background: #fff;
  font-size: clamp(20px, 2.3vw, 40px); font-weight: 600; transition: all .3s ease; }
.pres-letter { flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; display: grid; place-items: center; background: #EEF1F5; font-weight: 800; font-size: .85em; }
.pres-choices.revealed .pres-choice { opacity: .38; }
.pres-choices.revealed .pres-choice.right { opacity: 1; border-color: var(--accent); background: var(--accent-soft); transform: scale(1.03); box-shadow: 0 10px 30px rgba(18, 176, 122, .22); }
.pres-choices.revealed .pres-choice.right .pres-letter { background: var(--accent); color: #fff; }
.pres-answer { margin-top: 3.5vh; padding: 2.2vh 2vw; border-radius: 20px; background: #FFF6D6; border: 2px solid #F5D46A; font-size: clamp(18px, 1.9vw, 32px);
  line-height: 1.45; white-space: pre-wrap; animation: pres-fade .3s ease; }
.pres-answer b { display: block; margin-bottom: .4em; }
.pres-text .pres-body { font-size: clamp(22px, 2.5vw, 44px); line-height: 1.5; white-space: pre-wrap; font-weight: 500; }
.pres-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: rgba(20, 22, 31, .92); color: #fff; transition: opacity .35s, transform .35s; }
.pres.idle .pres-bar { opacity: 0; transform: translateY(100%); }
.pres.idle { cursor: none; }
.pres-btn { height: 42px; min-width: 46px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.pres-btn:hover:not([disabled]) { background: rgba(255, 255, 255, .26); }
.pres-btn[disabled] { opacity: .35; cursor: default; }
.pres-btn.wide { padding: 0 18px; }
.pres-count { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.pres-hint { flex: 1; text-align: center; font-size: 13px; opacity: .7; }
.pres kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1.5px solid currentColor; background: none; color: inherit; font: inherit; font-size: .8em; font-weight: 800; opacity: .85; }
@media (max-width: 760px) {
  .pres-choices { grid-template-columns: 1fr; }
  .pres-hint { display: none; }
}

/* hồ sơ học sinh: mã cổng phụ huynh */
.portal-box { padding: 16px; border-radius: 12px; background: linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 90%, var(--surface)), color-mix(in srgb, var(--sky-soft) 80%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line)); margin-bottom: 18px; }
.portal-box .bold { display: flex; align-items: center; gap: 8px; }
.portal-code { font-size: 24px; font-weight: 800; letter-spacing: .18em; padding: 6px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--primary); color: var(--primary-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; box-shadow: var(--shadow-xs); }
.share-toggle { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); align-items: flex-start; border: 1px solid var(--line); }
.score-in { max-width: 160px; }

/* =========================================================
   Zalo gửi tin tự động (Cài đặt, hộp gửi tin, nhắc học phí cả loạt)
   ========================================================= */
.zalo-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2);
  background: color-mix(in srgb, var(--sky-soft) 80%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sky) 20%, transparent); }
.zalo-note > .i { color: var(--sky); width: 17px; height: 17px; margin-top: 2px; }
.zalo-note.bad { background: var(--coral-soft); border-color: color-mix(in srgb, var(--coral) 25%, transparent); }
.zalo-note.bad > .i { color: var(--coral); }
.zalo-acc { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.zalo-acc .avatar { width: 44px; height: 44px; object-fit: cover; }
.zalo-qr { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.zalo-qr > img { width: 200px; height: 200px; border-radius: 14px; background: #fff; padding: 8px; border: 1px solid var(--line); box-shadow: var(--shadow-md); image-rendering: pixelated; }
.zalo-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.zalo-risks { margin: 10px 0 0; padding: 12px 14px 12px 30px; border-radius: 10px; background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 22%, transparent);
  display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.zalo-bulk { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: min(46vh, 420px); }
.zb-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); transition: opacity .2s; }
.zb-row:first-child { border-top: 0; }
.zb-row .avatar { width: 32px; height: 32px; font-size: 12px; }
.zb-row.is-skip { opacity: .5; }
.zb-row [data-detail]:empty { display: none; }
.chip.skip { background: var(--bg-2); color: var(--muted); }

/* điểm danh: dòng có mặt nền xanh nhạt; bài về nhà tự động theo bài em nộp */
.att-item.is-present { background: color-mix(in srgb, var(--mint-soft) 55%, transparent); }
.att-item.is-present + .att-item.is-present { border-top-color: color-mix(in srgb, var(--mint) 14%, var(--line)); }
.hw-auto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
button.chip.ok:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 45%, transparent); }
.sub-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sub-file { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.sub-file:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); box-shadow: var(--shadow-md); }
.sub-file img, .sub-pdf { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.sub-pdf { display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--coral); background: var(--coral-soft); letter-spacing: .06em; }
.sub-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Lịch tháng: vừa một màn hình, không cuộn trang
   ========================================================= */
.main.fit { padding-bottom: 20px; }
.view-seg button { min-width: 64px; justify-content: center; }
.mcal { display: flex; flex-direction: column; min-height: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.mcal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); flex: none; }
.mcal-head div { padding: 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mcal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--weeks, 5), minmax(0, 1fr)); }
.mtop { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex: none; }
.mday { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; padding: 4px 6px 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.mday:nth-child(7n) { border-right: 0; }
.mday:nth-last-child(-n+7) { border-bottom: 0; }
.mday.wknd { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.mday.out { background: var(--surface-2); }
.mday.out .mnum { color: var(--line-3); }
.mday.out .mchip { opacity: .5; }
.mnum { align-self: flex-start; flex: none; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; border: 0; background: none; font: inherit; font-size: 12.5px;
  font-weight: 700; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s; }
.mnum:hover { background: var(--bg-2); }
.mday.today .mnum { background: var(--brand-grad); color: #fff; box-shadow: 0 3px 8px -2px rgba(14, 156, 108, .5); }
.mday.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.mlist { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.mchip { flex: none; display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px 0 5px; border-radius: 6px; font-size: 11.5px; line-height: 1; white-space: nowrap;
  overflow: hidden; cursor: pointer; color: var(--ink); background: color-mix(in srgb, var(--c-soft) 85%, var(--surface)); border-left: 3px solid var(--c); transition: box-shadow .12s, transform .12s; }
.mchip:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mchip b { flex: none; color: var(--c); font-weight: 700; font-variant-numeric: tabular-nums; }
.mchip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mchip .mon { flex: none; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #2563EB; box-shadow: 0 0 0 2px color-mix(in srgb, #2563EB 25%, transparent); }
.mchip.cancelled { opacity: .45; text-decoration: line-through; }
.mmore { flex: none; height: 22px; padding: 0 7px; background: var(--primary-soft) !important; border: 0; border-radius: 6px; background: none; text-align: left; font: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--primary-2); cursor: pointer; }
.mmore:hover { background: var(--primary-soft); }
.mdots { display: none; }
@media (max-width: 860px) {
  .mcal { height: auto !important; min-height: 0; }
  .mcal-head div { padding: 7px 0; text-align: center; font-size: 10.5px; }
  .mcal-grid { grid-template-rows: none; grid-auto-rows: minmax(56px, auto); }
  .mday { align-items: center; padding: 4px 2px 6px; cursor: pointer; }
  .mday:active { background: var(--primary-soft); }
  .mtop { justify-content: center; }
  .mnum { align-self: center; height: 24px; min-width: 24px; padding: 0 5px; font-size: 12px; }
  .mmore { display: none; }
  .mlist { display: none; }
  .mdots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 34px; }
  .mdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
  .mdots i.cancelled { opacity: .3; }
  .page-head .view-seg { order: -1; }
}

/* thanh trên đầu trang (không còn tiêu đề to — tên trang nằm ở thanh đường dẫn) */
.page-head { align-items: center; min-height: 38px; margin-bottom: 16px; }
.page-head > .sub { margin: 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.page-head > .sub b { color: var(--ink); font-weight: 650; }

/* =========================================================
   Bảng học sinh: mỗi em một nhóm dòng, mỗi môn một dòng
   ========================================================= */
.st-search { flex: 1 1 320px; max-width: 460px; }
.st-card { overflow: hidden; }
.st-scroll { overflow-x: auto; }
.st-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.st-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.st-table td { padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.st-table .num { text-align: right; white-space: nowrap; }
.st-group { cursor: pointer; }
.st-group tr td { transition: background .12s; }
.st-group:hover td { background: var(--surface-2); }
.st-group tr:not(:last-child) td.st-subj, .st-group tr:not(:last-child) td.num { border-bottom-style: dashed; }
.st-group tr:last-child td, .st-group td[rowspan] { border-bottom: 1px solid var(--line-2); }
.st-who { min-width: 230px; }
.st-who .avatar { width: 36px; height: 36px; font-size: 13px; }
.st-subj > * { vertical-align: middle; }
.st-subj { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.st-table td.st-subj { display: table-cell; }
.st-subj > div { display: inline-block; }
.st-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--c-soft); vertical-align: 3px; }
.money.owe { color: var(--coral); }
.st-act { text-align: right; width: 1%; white-space: nowrap; }
.st-table tfoot td { background: var(--surface-2); border-bottom: 0; padding: 12px 14px; }
.st-table tfoot .money { font-size: 16px; }

/* trang Điểm danh: tiêu đề từng ngày */
.att-day { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 16px; }
#view > .page-head + .att-day { margin-top: 0; }

/* thêm học sinh: thời gian học */
.term-box { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; }
.term-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.term-head .i { color: var(--primary-2); }
.term-sum { padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--ink-2); font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.term-sum b { color: var(--ink); }
.term-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.term-line .i { color: var(--muted); width: 14px; height: 14px; }
.term-line .chip { height: 20px; font-size: 11px; }

/* thông báo chung (đặt ở /admin → Hệ thống) */
.announce { display: flex; align-items: center; gap: 10px; margin: 14px 32px 0; padding: 10px 10px 10px 14px; border-radius: 12px; font-size: 14px; color: var(--ink-2);
  background: color-mix(in srgb, var(--sky-soft) 85%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sky) 22%, transparent); }
.announce > .i { color: var(--sky); width: 18px; height: 18px; }
.announce.warn { background: var(--sun-soft); border-color: color-mix(in srgb, var(--sun) 30%, transparent); }
.announce.warn > .i { color: var(--sun); }
.announce .icon-btn { width: 30px; height: 30px; }
@media (max-width: 860px) { .announce { margin: 12px 16px 0; } }

/* Cài đặt: gói đang dùng */
.plan-card .plan-row { font-size: 14px; }
.plan-card .plan-row .progress { margin-top: 6px; height: 6px; }
.plan-card .progress.hot > div { background: linear-gradient(90deg, #F59E0B, #EF4444); }

/* trang chủ: thẻ Bài nộp mới */
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-list .list-item { padding: 10px 2px; gap: 10px; }
.sub-list .list-item .avatar { width: 34px; height: 34px; font-size: 13px; }
.sub-list .list-item.is-new { background: color-mix(in srgb, var(--mint-soft) 45%, transparent); border-radius: 10px; }
.sub-list .st-dot { margin-right: 6px; }

/* Tab Bài tập về nhà */
.hw-class { width: auto; min-width: 170px; height: 38px; padding-top: 0; padding-bottom: 0; }
.ai-soon { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: linear-gradient(110deg, var(--grape-soft), var(--surface) 72%); }
.ai-soon-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grape-soft); color: var(--grape); }
.ai-soon-ic .i { width: 22px; height: 22px; }
.ai-soon .chip { margin-left: 6px; vertical-align: 1px; }
.hw-list .st-dot { margin-right: 6px; }
.hw-item.is-new { background: color-mix(in srgb, var(--mint-soft) 45%, transparent); }
.hw-main { min-width: 0; }
.hw-act { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: none; }
.modal.xwide { max-width: 1060px; }
.hw-grade { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hw-stage { display: grid; place-items: center; min-height: 340px; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.hw-stage a { display: block; width: 100%; }
.hw-stage img { display: block; width: 100%; max-height: 64vh; object-fit: contain; }
.hw-stage iframe { display: block; width: 100%; height: 64vh; border: 0; background: #fff; }
.hw-stage-wrap { position: relative; display: flex; flex-direction: column; }
.hw-stage-wrap > .hw-stage { flex: 1 1 auto; }
.hw-zoom { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.hw-zoom button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 20px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.hw-zoom button:hover { background: var(--bg-2); color: var(--ink); }
.hw-zoom span { min-width: 44px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hw-stage.zoomed { display: block; overflow: auto; cursor: grab; }
.hw-stage.zoomed:active { cursor: grabbing; }
.hw-viewer .hw-stage.zoomed > a, .hw-viewer .hw-stage.zoomed .hw-marked { width: calc(var(--z, 1) * 100%); height: auto; max-height: none; overflow: visible; display: block; }
.hw-viewer .hw-stage.zoomed img { width: 100%; height: auto; max-height: none; }
.hw-file-bar { gap: 10px; margin-top: 8px; flex-wrap: nowrap; }
.hw-file-bar .ellip { min-width: 0; }
.hw-file-bar a { flex: none; white-space: nowrap; }
.hw-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.hw-thumb { width: 58px; height: 74px; flex: none; padding: 0; border-radius: 9px; border: 2px solid var(--line); background: var(--bg-2); overflow: hidden; cursor: pointer; }
.hw-thumb.on { border-color: var(--primary); }
.hw-thumb img, .hw-thumb .sub-pdf { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border-radius: 0; font-size: 12px; }
.hw-none { display: grid; place-items: center; min-height: 300px; border-radius: 12px; border: 1px dashed var(--line-2); }
.hw-task { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.hw-task .lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.ai-grade { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--grape) 45%, var(--line)); background: color-mix(in srgb, var(--grape-soft) 60%, transparent); }
.ai-grade .btn { color: var(--grape); opacity: .75; cursor: not-allowed; }
.ai-grade { padding: 8px 12px; }
.ai-grade .tiny { flex: 1; min-width: 140px; }
.hw-phr { gap: 6px; }
.hw-phr .opt { height: 30px; padding: 0 10px; font-size: 12.5px; }
.hw-note { resize: none; }
/* hộp chấm bài: bản chấm trên bài; nút liên lạc tròn (Zalo, Messenger, gọi) */
.ch-btn { width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 14px -8px rgba(15, 23, 42, .5); transition: transform .12s, filter .12s; }
.ch-btn svg { width: 24px; height: 24px; }
.ch-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.ch-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.ch-zalo { background: #0068FF; }
.ch-zalo svg { width: 28px; height: 28px; }
.ch-msgr { background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 100%); }
.ch-call { background: #10B981; }
.ch-call svg { width: 20px; height: 20px; }
.hw-left { min-width: 0; }
.hw-mark-bar { gap: 8px; margin-top: 10px; align-items: center; }
.hw-marked { display: flex; flex-direction: column; gap: 10px; width: 100%; max-height: 64vh; overflow-y: auto; padding: 0; }
.hw-marked a { display: block; }
.hw-marked img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; background: #fff; }
.hw-thumb { position: relative; }
.hw-thumb-mark { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%; background: #0FA372; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.modal.xwide.annotating { max-width: min(1500px, 98vw); }
.modal.annotating .hw-grade { grid-template-columns: minmax(0, 1fr); }
.modal.annotating .hw-form, .modal.annotating .modal-foot { display: none; }
/* khung chấm trên bài (markup.js) */
.mk { display: flex; flex-direction: column; gap: 10px; }
.mk-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.mk-group { display: flex; align-items: center; gap: 4px; }
.mk-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.mk-btn svg { width: 22px; height: 22px; }
.mk-btn:hover:not(:disabled) { background: var(--bg-2); color: var(--ink); }
.mk-btn.on { background: var(--surface); border-color: var(--line-2); color: var(--primary-2); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.mk-btn:disabled { opacity: .35; cursor: default; }
.mk-btn[data-tool="ok"] { color: #0FA372; }
.mk-btn[data-tool="bad"] { color: #E5484D; }
.mk-color { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.mk-color.on { box-shadow: 0 0 0 2px var(--c); }
.mk-size i { display: block; width: var(--d); height: var(--d); border-radius: 50%; background: currentColor; }
.mk-stage { display: grid; place-items: center; min-height: 260px; padding: 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.mk-stage.zoomed { display: block; overflow: auto; }
.mk-stage.zoomed .mk-paper { margin: 0 auto; }
.mk-zl { min-width: 46px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mk-paper[data-tool="pan"] canvas[data-live] { cursor: grab; }
.mk-paper[data-tool="pan"] canvas[data-live]:active { cursor: grabbing; }
.mk-loading { color: var(--muted); font-size: 14px; padding: 40px 10px; text-align: center; }
.mk-paper { position: relative; box-shadow: 0 10px 30px -14px rgba(15, 23, 42, .45); background: #fff; }
.mk-paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mk-paper canvas[data-live] { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.mk-paper[data-tool="text"] canvas[data-live] { cursor: text; }
.mk-paper[data-tool="ok"] canvas[data-live], .mk-paper[data-tool="bad"] canvas[data-live] { cursor: copy; }
.mk-paper[data-tool="eraser"] canvas[data-live] { cursor: cell; }
.mk-wait { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: #475569; font-size: 14px; font-weight: 700; }
.mk-wait[hidden] { display: none; }
.mk-text { position: absolute; z-index: 3; min-width: 160px; padding: 2px 6px; border: 1.5px dashed currentColor; border-radius: 6px; background: rgba(255, 255, 255, .85);
  font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 700; line-height: 1.25; resize: none; outline: none; }
.mk-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mk-foot .mk-hint { flex: 1; min-width: 160px; }
.mk-pager { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; }
.mk-pager[hidden] { display: none; }
/* hộp chấm bài vừa một màn hình (máy tính, iPad): không thanh cuộn — ảnh co giãn theo chỗ trống, cột phải gọn */
@media (min-width: 761px) {
  .modal.hw-modal { height: min(900px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
  .modal.hw-modal .modal-head, .modal.hw-modal .modal-foot { position: static; flex: none; }
  .modal.hw-modal .modal-foot { margin-top: 0; padding: 12px 22px; }
  .modal.hw-modal .modal-body { flex: 1; min-height: 0; overflow: hidden; padding: 14px 22px; }
  .hw-modal .hw-grade { height: 100%; align-items: stretch; }
  .hw-modal .hw-viewer { display: flex; flex-direction: column; min-height: 0; }
  .hw-modal .hw-viewer > * { flex: none; }
  .hw-modal .hw-viewer > .hw-stage-wrap, .hw-modal .hw-viewer > .hw-none, .hw-modal .hw-viewer > .mk { flex: 1 1 0; min-height: 0; }
  .hw-modal .hw-stage-wrap > .hw-stage { flex: 1 1 0; min-height: 0; }
  .hw-modal .hw-stage { min-height: 0; }
  .hw-modal .hw-stage > a { width: 100%; height: 100%; display: grid; place-items: center; }
  .hw-modal .hw-stage img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
  .hw-modal .hw-stage iframe { height: 100%; }
  .hw-modal .hw-marked { height: 100%; max-height: none; }
  .hw-modal .hw-none { min-height: 0; }
  .hw-modal .hw-form { min-height: 0; overflow-y: auto; scrollbar-width: none; gap: 12px; }
  .hw-modal .hw-form::-webkit-scrollbar { display: none; }
  .hw-modal .mk-stage { flex: 1 1 0; min-height: 0; }
}
@media (max-width: 760px) {
  .hw-grade { grid-template-columns: minmax(0, 1fr); }
  .hw-stage { min-height: 220px; }
  .hw-stage img { max-height: 46vh; }
  .hw-stage iframe { height: 52vh; }
  .mk-btn { width: 36px; height: 36px; }
}
@media (max-width: 600px) {
  .hw-item { flex-wrap: wrap; }
  .hw-act { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .hw-class { min-width: 0; flex: 1; }
}

/* tài liệu dạng file: 3 nút bằng nhau (Upload / Chọn từ kho / AI), xem PDF, ảnh */
.mat-add { display: grid; gap: 8px; margin-top: 14px; }
.mat-add .btn { width: 100%; justify-content: flex-start; padding: 0 12px; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.chip.file { background: var(--coral-soft); color: var(--coral); }
.mat-img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); }
.mat-pdf { display: block; width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* /admin: thẻ Zalo OA / Zalo cá nhân gọn một khối */
.adm-zalo { max-width: 880px; }

/* /admin: mã QR kết nối Zalo OA / Zalo cá nhân (giống ChatNow) */
.oa-qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); }
.oa-qr[hidden] { display: none; }
.oa-qr-code { flex: none; width: 218px; height: 218px; padding: 9px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-md); display: grid; place-items: center; }
.oa-qr-code img, .oa-qr-code canvas { width: 200px; height: 200px; display: block; image-rendering: pixelated; }
.oa-qr .grow { min-width: 220px; }
.adm-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm-more > summary::-webkit-details-marker { display: none; }
.adm-more > summary::after { content: "▾"; color: var(--muted); margin-left: 4px; transition: transform .15s; }
.adm-more[open] > summary::after { transform: rotate(180deg); }
.adm-more > summary .chip { margin-left: auto; }
.btn[hidden] { display: none; }

/* Học phí: bảng có cột Lớp (mỗi em một nhóm dòng, mỗi lớp một dòng), số lần gửi Zalo, tin nhắn mẫu */
.tu-group { cursor: default; }
.tu-table .st-act .btn + .btn { margin-left: 4px; }
.tu-remind { min-width: 190px; }
.chip.zalo-sent { background: color-mix(in srgb, var(--sky-soft) 85%, var(--surface)); color: var(--sky); font-weight: 650; }
.mt-xs { margin-top: 4px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-text { font-size: 14px; line-height: 1.55; resize: vertical; min-height: 220px; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-vars .chip { cursor: pointer; border: 1px dashed var(--line-2); background: var(--surface); }
.tpl-vars .chip:hover { border-color: var(--primary); color: var(--primary-2); }
.tpl-preview { white-space: pre-wrap; font-size: 14px; line-height: 1.55; padding: 14px 16px; border-radius: 16px 16px 16px 4px;
  background: color-mix(in srgb, var(--sky-soft) 70%, var(--surface)); border: 1px solid var(--line); min-height: 220px; color: var(--ink); }
.tpl-auto { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.tpl-auto input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
/* Cài đặt: ảnh mã QR nhận tiền */
.qr-up { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.qr-thumb { flex: none; width: 104px; height: 104px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.qr-thumb img { width: 100%; height: 100%; object-fit: contain; }
.qr-thumb .i { width: 30px; height: 30px; }
.tu-amt { display: inline-flex; align-items: center; gap: 6px; }
.tu-edit { width: 24px; height: 24px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px;
  opacity: .55; transition: opacity .12s, background .12s; }
.tu-group:hover .tu-edit, .tu-edit:focus-visible { opacity: 1; }
.tu-edit:hover { background: var(--bg-2); color: var(--ink); }
.tu-act { vertical-align: middle; border-left: 1px dashed var(--line); }

/* Đặt chỗ: đăng ký học chính thức, phụ huynh đã chuyển khoản */
.paid-box { padding: 9px 12px; border-radius: 10px; background: var(--mint-soft); color: var(--ink-2); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--mint) 25%, transparent); }
.chip.sky { background: var(--sky-soft); color: var(--sky); }
.tu-name { color: var(--ink); text-decoration: none; }
.tu-name:hover { color: var(--primary-2); text-decoration: underline; }
.tu-btns { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.tu-btns .btn { min-width: 92px; justify-content: center; }

/* =========================================================
   Hệ giao diện 11/2026 — khung yên tĩnh, đường kẻ mảnh, một màu nhấn.
   Lớp này đè lên các thành phần ở trên; màu, chữ và chi tiết dồn vào nội dung.
   ========================================================= */
body { font-size: 15px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.bold, .list-item .title { font-weight: 600; }

/* tiêu đề: bỏ ô icon màu, chỉ giữ chữ */
h2.has-ic .h-ic, h3.has-ic .h-ic { display: none; }

/* nút */
.btn { height: 36px; padding: 0 12px; gap: 8px; font-weight: 500; box-shadow: none; transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.btn .i { width: 16px; height: 16px; }
.btn:active { transform: scale(.99); }
.btn-primary, .btn-ok { background: var(--primary); border-color: transparent; color: var(--primary-ink); font-weight: 600; box-shadow: none; }
.btn-primary:hover, .btn-ok:hover { background: color-mix(in srgb, var(--primary) 86%, var(--ink)); border-color: transparent; color: var(--primary-ink); }
.btn-primary:focus-visible, .btn-ok:focus-visible { box-shadow: var(--ring); }
.btn-soft { background: var(--primary-soft); color: var(--primary-2); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.icon-btn { border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }

/* ô nhập */
.field { gap: 8px; }
.field > span { font-weight: 500; }
.input, select.input, textarea.input { border-color: var(--line-2); box-shadow: none; font-size: 15px; }
.input:hover { border-color: var(--line-3); }

/* thẻ */
.card { box-shadow: var(--shadow); }
.card-head h2 { font-size: 16px; }
.card-head > a.small { font-weight: 500; }
.card.clickable:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line-3); }

/* số liệu: nhãn, con số, dòng so sánh — không ô icon, không vệt màu */
.stat { display: flex; flex-direction: column; gap: 8px; padding: 20px; box-shadow: var(--shadow); }
.stat .emoji, .stat::after { display: none; }
.stat .lbl { order: -1; font-weight: 400; }
.stat .num { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }

/* nhãn trạng thái: chấm màu + chữ trên nền trung tính */
.chip { height: 22px; padding: 0 8px; gap: 6px; border-radius: 6px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.chip.c, .chip.ok, .chip.warn, .chip.bad, .chip.info, .chip.grape { background: var(--surface-2); }
.chip.c { color: var(--ink-2); }
.chip.ok { color: var(--mint); } .chip.warn { color: var(--sun); } .chip.bad { color: var(--coral); } .chip.info { color: var(--sky); } .chip.grape { color: var(--grape); }
.chip.c::before, .chip.ok::before, .chip.warn::before, .chip.bad::before, .chip.info::before, .chip.grape::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.chip.c::before { background: var(--c); }

/* ảnh đại diện chữ và ô chữ cái môn học: nền trung tính, chữ cái lớp mang màu lớp */
.avatar { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 13px; }
.badge-emoji { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.badge-letter { color: var(--c, var(--ink-2)); }
.class-card .band { height: 0; border: 0; background: none; }
.class-card .badge-letter { margin-top: 18px; width: 44px; height: 44px; border: 0; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.tint { background: var(--surface-2); color: var(--c); }

/* khung: thanh bên theo giao diện sáng/tối, menu gọn */
.sidebar, :root[data-theme="dark"] .sidebar { background: var(--surface); background-image: none; border-right: 1px solid var(--line); color: var(--ink-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar { background: var(--surface); } }
.sidebar .brand { color: var(--ink); font-weight: 600; font-size: 18px; letter-spacing: 0; }
.nav-sec { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); padding: 20px 8px 6px; }
.nav-link { height: 36px; padding: 0 8px; gap: 10px; border-radius: 8px; color: var(--ink-2); }
.nav-link .i { color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link:hover .i { color: var(--ink-2); }
.nav-link.active { background: var(--surface-2); color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.nav-link.active::before { display: none; }
.nav-link.active .i { color: var(--primary-2); }
.nav-link .count { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.side-card { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.side-card b { color: var(--ink); font-weight: 500; }
.side-card b .i { color: var(--muted); }
.side-card button { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 500; }
.side-card button:hover { background: var(--surface-2); }
.sidebar .me { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 8px 4px; }
.sidebar .me .nm { color: var(--ink); font-weight: 500; }
.sidebar .me .em { color: var(--muted); }
.sidebar .me .icon-btn { color: var(--muted); }
.sidebar .me .icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.main-col { background: none; }
.topbar { height: 56px; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.crumbs b { font-weight: 500; }
.search-trigger, .search-trigger:hover { box-shadow: none; }
.page-head .sub { margin-top: 4px; font-size: 15px; }
.back { font-weight: 500; }

/* hộp thoại, bảng lệnh */
.modal-backdrop, .cmd-backdrop { background: rgba(15, 23, 42, .4); -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal { box-shadow: var(--shadow-pop); }
.modal-head { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-foot { background: var(--surface); }
.cmd-group { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }

/* tab chọn */
.seg { border-radius: 10px; background: var(--surface-2); }
.seg button { height: 30px; font-weight: 500; font-size: 13px; }
.seg button.on { box-shadow: 0 0 0 1px var(--line), var(--shadow-xs); }
.seg .n, .seg button.on .n { background: transparent; color: var(--muted); font-weight: 500; padding: 0; }

.empty .big { box-shadow: none; background: var(--surface-2); }
.toast { font-weight: 500; }
@media (max-width: 860px) {
  h1 { font-size: 24px; }
  .input, select.input, textarea.input { font-size: 16px; }
  .bottom-nav { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .bottom-nav a, .bottom-nav button { font-weight: 500; font-size: 11px; }
  .bottom-nav .active .ico::after { display: none; }
}

/* lịch, buổi học, học phí, AI — cùng hệ */
.day-col { box-shadow: none; }
.day-col.today { border-color: var(--line); background: var(--primary-soft); box-shadow: none; }
.day-col .dname { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.day-col .dnum { font-weight: 600; }
.day-col.today .dnum { background: none; color: var(--primary-2); box-shadow: none; }
.lesson-pill { background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line); }
.lesson-pill:hover { transform: none; box-shadow: none; border-color: var(--line-3); }
.lesson-pill .t { color: var(--muted); font-weight: 500; }
.lesson-pill .t .tm { display: inline-flex; align-items: center; gap: 6px; }
.lesson-pill .t .tm::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.lesson-pill .n { font-weight: 500; }
.lesson-row { padding: 12px 16px; }
.lesson-row::before { display: none; }
.lesson-row:hover { transform: none; box-shadow: none; border-color: var(--line-3); }
.lesson-row .time { font-weight: 600; }
.lesson-row .time::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--c); vertical-align: 2px; }
.att-btns { background: var(--surface-2); }
.att-btns button { font-weight: 500; }
.att-btns button.on { box-shadow: none; }
.att-btns button.on.present { background: var(--primary); color: var(--primary-ink); }
.ai-hero { background: var(--surface); }
.progress > div { background: var(--primary); }
.money { font-weight: 600; letter-spacing: 0; }
.main .pulse, .main-col .pulse { animation: none; }

/* trang chủ app: cột chính + cột phụ */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.dash-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.stat .chg { font-size: 13px; color: var(--ink-2); }
.dash .today-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.dash .today-note b { font-weight: 500; color: var(--ink-2); }
.head-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.head-link .i { width: 14px; height: 14px; }
@media (max-width: 1180px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.chip:has(> .i)::before { display: none; }
.page-head h1 { font-size: 28px; }
@media (max-width: 860px) { .page-head h1 { font-size: 24px; } }

/* nhãn viết thường, nút "đã thu" yên tĩnh, nhãn online gọn */
.att-extra .lbl, .mcal-head div, .st-table th, .hw-task .lbl { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.btn-ok { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 500; }
.btn-ok .i { color: var(--mint); }
.btn-ok:hover { background: var(--surface-2); border-color: var(--line-3); color: var(--ink); }
.badge-tag { font-weight: 500; }
.badge-tag.online { background: var(--surface-2); color: var(--sky); box-shadow: inset 0 0 0 1px var(--line); }
.badge-tag.online::before { background: currentColor; box-shadow: none; animation: none; }
@media (max-width: 600px) { .stat { padding: 16px; } .stat .num { font-size: 22px; white-space: nowrap; overflow-wrap: normal; } }

/* nền trang bên trong: xanh lá rất nhạt + lưới xám mờ (không áp cho trang chủ giới thiệu và trang đăng nhập) */
:root { --bg: #EEF5F1; --bg-grid: rgba(15, 23, 42, .045); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0A1113; --bg-grid: rgba(232, 237, 245, .035); } }
:root[data-theme="dark"] { --bg: #0A1113; --bg-grid: rgba(232, 237, 245, .035); }
body:not(.landing):not(.auth-page):not(.fam)::before, body.fam.fam-in::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); }

/* hôm nay trong lịch: đậm hơn nền một chút */
.day-col.today { background: color-mix(in srgb, var(--primary) 11%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 32%, var(--line)); }
.day-col.today .lesson-pill { border-color: color-mix(in srgb, var(--primary) 18%, var(--line)); }
.mday.today { background: color-mix(in srgb, var(--primary) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 32%, transparent); }
.mday.today .mnum { background: none; color: var(--primary-2); box-shadow: none; font-weight: 600; }

/* lưới nền: ô to hơn, đậm phía trên rồi nhạt dần xuống dưới */
:root { --bg-grid: rgba(15, 23, 42, .07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg-grid: rgba(232, 237, 245, .055); } }
:root[data-theme="dark"] { --bg-grid: rgba(232, 237, 245, .055); }
body:not(.landing):not(.auth-page):not(.fam)::before, body.fam.fam-in::before {
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .55) 35%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .55) 35%, transparent 85%); }

/* không còn tiêu đề lớn: dòng mô tả canh giữa với các nút bên phải */
.page-head { align-items: center; }
.page-head .sub { margin-top: 0; }

/* hôm nay trong lịch: tách hẳn khỏi nền (nền xanh đậm hơn, viền xanh, số ngày trong ô tròn xanh) */
.day-col.today { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); border: 1.5px solid var(--primary); }
.day-col.today .dname { color: var(--primary-2); font-weight: 600; }
.day-col.today .dnum { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.day-col.today .lesson-pill { border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.mday.today { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--primary); }
.mday.today .mnum { background: var(--primary); color: var(--primary-ink); }

/* Quản lý học sinh: nút thêm học sinh, dưới là chọn tháng; bảng học phí co vừa khung, không cuộn ngang */
.tu-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.tu-table { min-width: 0; }
.tu-remind { min-width: 0; }
.tu-btns { flex-direction: column; align-items: stretch; gap: 6px; }
.tu-btns .btn { min-width: 0; width: 100%; }
@media (max-width: 860px) { .tu-side { align-items: stretch; width: 100%; } .tu-table { min-width: 720px; } }

/* cỡ mặc định 110% trên máy tính (chuột), giữ nguyên trên iPad và điện thoại */
@media (min-width: 1200px) and (pointer: fine) {
  .shell, body.fam.fam-in, body.bk-page { zoom: 1.1; }
  .shell { min-height: calc(100vh / 1.1); }
  .shell .sidebar { height: calc(100vh / 1.1); }
}
@media (max-width: 1439px) {
  .tu-table th, .tu-table td { padding-left: 8px; padding-right: 8px; }
  .tu-table .st-who .avatar { display: none; }
  .tu-table .chip { white-space: normal; height: auto; min-height: 22px; padding: 2px 8px; }
}
@media (min-width: 861px) and (max-width: 1439px) { .main { padding-left: 24px; padding-right: 24px; } }

/* bảng học phí: hai nút Nhắc / Đã thu nằm ngang, nhỏ gọn; dòng thấp hơn */
.tu-btns { flex-direction: row; align-items: center; gap: 6px; flex-wrap: nowrap; }
.tu-btns .btn { width: auto; height: 28px; padding: 0 9px; gap: 5px; font-size: 12.5px; border-radius: 8px; }
.tu-btns .btn .i { width: 14px; height: 14px; }
.tu-table td { padding-top: 8px; padding-bottom: 8px; }
.tu-act .btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.tu-btns .btn .i { display: none; }
.tu-remind { width: 150px; }
.tu-remind .chip { white-space: normal; height: auto; min-height: 22px; padding: 2px 8px; }
@media (max-width: 1439px) { .tu-remind { width: 128px; } .tu-table .st-subj b { white-space: normal; } }
@media (max-width: 1439px) { .tu-table .st-who .chip { white-space: normal; } .tu-table .st-who { width: 180px; } }
.tu-table .st-who, .tu-table .st-subj { min-width: 0; }
/* nút Thêm học sinh và ô chọn tháng rộng bằng nhau */
.tu-side { align-items: stretch; }
.tu-side .btn { justify-content: center; }
.tu-side .seg { display: flex; flex-wrap: nowrap; }
.tu-side .seg button.on { flex: 1; justify-content: center; }
/* cột Nhắc phí: nhãn "Đã gửi Zalo N lần" luôn nằm trên 1 dòng */
.tu-remind, .tu-table .tu-remind { width: auto; }
.tu-remind .chip, .tu-table .tu-remind .chip { white-space: nowrap; height: 22px; min-height: 0; padding: 0 8px; font-size: 12px; }
.tu-remind .tiny { white-space: nowrap; }
/* bảng học phí: kẻ dọc giữa các cột cho dễ dò */
.tu-table th:not(:last-child), .tu-table td:not(.tu-act) { border-right: 1px solid var(--line); }
.tu-table td.tu-act { border-left: 0; }
/* chấm màu lớp đứng liền trước tên lớp, kể cả khi tên xuống dòng */
.tu-table .st-subj .st-dot { display: none; }
.tu-table .st-subj b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--c); vertical-align: 2px; }
.tu-table .st-subj > div { display: block; }

/* Bài tập về nhà: chọn lớp, 7/30/90 ngày và Chấm lần lượt nằm bên phải hàng lọc */
.hw-tools { gap: 8px; align-items: center; }
.hw-tools .hw-class { width: auto; min-width: 160px; height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; font-size: 14px; }
.hw-tools .btn-primary.btn-sm { height: 36px; }
/* bỏ ảnh đại diện chữ cái trong danh sách bài nộp và bảng học sinh */
.hw-list .avatar, .st-who .avatar { display: none; }
@media (max-width: 860px) { .hw-tools { width: 100%; } .hw-tools .hw-class { flex: 1; } }

/* bảng học phí: nút Nhắc màu đỏ nhạt — phụ huynh chưa đóng */
.tu-btns [data-remind], .tu-btns .btn-soft { background: var(--coral-soft); color: var(--danger); border-color: transparent; font-weight: 600; }
.tu-btns [data-remind]:hover, .tu-btns .btn-soft:hover { background: color-mix(in srgb, var(--coral-soft) 75%, var(--danger) 14%); color: var(--danger); }

/* lưới nền: ô to hơn */
body:not(.landing):not(.auth-page):not(.fam)::before, body.fam.fam-in::before { background-size: 56px 56px; }

/* mã QR của link đặt chỗ */
.bq { display: flex; align-items: center; gap: 12px; }
.bq-new { flex-direction: column; align-items: flex-end; gap: 4px; }
.bq-img { width: 76px; height: 76px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: zoom-in; flex: none; }
.bq-img svg { width: 100%; height: 100%; display: block; }
.bq-tx { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 14px; }
.bq-tx b { font-weight: 500; }
.bq-tx .btn { margin-top: 6px; }
.bq.stale .bq-img { opacity: .4; }
.bq.stale .bq-tx b { color: var(--sun); }
.bq-big { width: min(320px, 100%); margin: 0 auto 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.bq-big svg { width: 100%; height: auto; display: block; }

/* Phân trang danh sách dài (Quản lý học sinh, Lịch sử thanh toán) */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); }
.pager-btns { display: flex; align-items: center; gap: 4px; }
.pager-btns button { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; }
.pager-btns button:hover:not(:disabled):not(.on) { border-color: var(--primary); color: var(--primary); }
.pager-btns button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); cursor: default; }
.pager-btns button:disabled { opacity: .4; cursor: default; }
.pager-gap { padding: 0 4px; color: var(--muted); }
.tu-table td.tu-merged { vertical-align: middle; }

/* Lịch sử thanh toán */
.pay-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.pay-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.pay-search .input { padding-left: 36px; }
.pay-table td { vertical-align: middle; }
.pay-table .pay-when { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Cài đặt: tab nhỏ phía trên */
.set-tabs { display: flex; gap: 2px; padding: 4px; margin-bottom: 18px; width: fit-content; max-width: 100%; overflow-x: auto;
  border-radius: 12px; background: var(--surface-2, var(--bg-2)); border: 1px solid var(--line); scrollbar-width: none; }
.set-tabs::-webkit-scrollbar { display: none; }
.set-tabs button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.set-tabs button .i, .set-tabs button svg { width: 16px; height: 16px; flex: none; }
.set-tabs button:hover { color: var(--ink); }
.set-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--line); }
.set-tabs button[aria-selected="true"] .i, .set-tabs button[aria-selected="true"] svg { color: var(--primary); }
.set-tabs button:focus-visible { outline: none; box-shadow: var(--ring); }
.set-pane { max-width: 880px; }
.set-pane[hidden] { display: none; }
.payos-steps { margin: 12px 0 4px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2, var(--ink)); }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* Gói thành viên */
.plan-now { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 24px;
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface) 60%); }
.pn-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary); }
.pn-eyebrow svg, .pn-eyebrow .i { width: 15px; height: 15px; }
.pn-name { margin-top: 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.pn-price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 6px; }
.pn-price b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pn-price span { color: var(--muted); font-size: 14px; }
.pn-usage { padding-left: 28px; border-left: 1px solid var(--line); }
.pn-title { margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.plans-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.plans-head h2 { margin: 0; font-size: 17px; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan-opt { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); }
.plan-opt h3 { margin: 0 0 4px; font-size: 17px; }
.plan-opt.cur { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-opt .btn-block { margin-top: auto; }
.po-badge { position: absolute; top: -11px; left: 18px; padding: 2px 10px; border-radius: 999px; background: var(--primary);
  color: var(--primary-ink); font-size: 12px; font-weight: 700; }
.po-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.po-list li { display: flex; gap: 8px; align-items: flex-start; }
.po-list li svg, .po-list li .i { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--primary); }
.po-list li.no { color: var(--muted); }
.po-list li.no svg, .po-list li.no .i { color: var(--muted); opacity: .7; }
@media (max-width: 720px) {
  .plan-now { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pn-usage { padding-left: 0; border-left: 0; padding-top: 18px; border-top: 1px solid var(--line); }
}
.set-pane [data-plans] { display: grid; gap: 14px; }
.set-pane [data-plans] .plans-head { margin-top: 14px; }
.set-pane [data-plans] .plans-grid { margin-top: 6px; }
@media (max-width: 600px) {
  .set-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; overflow: visible; }
  .set-tabs button { justify-content: center; padding: 0 8px; font-size: 13.5px; }
}

/* Hỏi lại nhẹ ngay cạnh nút (VD Hoàn tác ở Quản lý học sinh) */
.cpop { position: fixed; z-index: 90; width: max-content; max-width: min(300px, calc(100vw - 20px)); padding: 12px 14px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); animation: cpop-in .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top right; }
.cpop.up { transform-origin: bottom right; }
.cpop.out { opacity: 0; transform: scale(.96); transition: opacity .12s, transform .12s; }
.cpop-arrow { position: absolute; top: -6px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.cpop.up .cpop-arrow { top: auto; bottom: -6px; transform: rotate(225deg); }
.cpop-msg { font-size: 14px; font-weight: 600; line-height: 1.4; padding-right: 6px; }
.cpop-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.cpop-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.cpop-foot .btn { min-width: 64px; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: color-mix(in srgb, var(--danger) 88%, #000); color: #fff; }
@keyframes cpop-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }
.cpop.up { animation-name: cpop-in-up; }
@keyframes cpop-in-up { from { opacity: 0; transform: translateY(4px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cpop, .cpop.up { animation: none; } }

/* ===== Tính năng thêm: nhận xét tháng, nghỉ & học bù, trợ lý trả lời, đề thi thử, trợ giảng ===== */
.rp-table td { vertical-align: middle; }
.rp-peek { max-width: 320px; margin-top: 4px; line-height: 1.45; }
.mk-grid { align-items: start; }
.mk-list { list-style: none; margin: 0; padding: 6px 0; }
.mk-list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.mk-list li:first-child { border-top: 0; }
.mk-list li.new { background: color-mix(in srgb, var(--coral) 7%, transparent); }
.mk-list li.new b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 2px; background: var(--coral); vertical-align: 1px; }
.mk-list .mk-none { color: var(--muted); font-size: 13.5px; display: block; }
.mk-how { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2, var(--ink)); }
.mk-table td { vertical-align: middle; }
.mk-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.as-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.as-sec { margin-top: 12px; font-size: 14px; }
.as-sec b { display: block; margin-bottom: 4px; }
.as-ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; color: var(--ink-2, var(--ink)); }
.as-reply { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .as-grid { grid-template-columns: minmax(0, 1fr); } }
.qz-title { font-size: 18px; font-weight: 700; }
.qz-skills { display: grid; gap: 12px; }
.qz-sk .progress { margin-top: 6px; height: 7px; }
.qz-sk b.bad { color: var(--danger); }
.qz-score { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qz-score small { font-size: 12px; color: var(--muted); font-weight: 600; }
.qz-qs { margin: 0; padding-left: 22px; display: grid; gap: 18px; }
.qz-qs > li { padding-left: 4px; }
.qz-q { margin-top: 6px; font-weight: 600; line-height: 1.5; }
.qz-ch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.qz-ch > div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); font-size: 14px; }
.qz-ch > div.ok { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.qz-ch b { margin-right: 6px; }
@media (max-width: 600px) { .qz-ch { grid-template-columns: minmax(0, 1fr); } }
.qz-edit-ch { display: flex; align-items: center; gap: 8px; }
.qz-edit-ch input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.sf-card.off { opacity: .65; }
.sf-pay { text-align: right; }
.sf-pay .chip { margin-top: 6px; }
.sf-detail { margin-top: 10px; }
.sf-detail summary { cursor: pointer; color: var(--muted); }
.sf-cred { white-space: pre-wrap; padding: 12px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); }
.tu-disc { color: var(--mint); font-weight: 600; }
.att-makeup { color: var(--sky); font-weight: 600; }
/* tài khoản trợ giảng: ẩn các mục chỉ chủ lớp dùng */
body.is-staff .btn-create, body.is-staff .search-trigger, body.is-staff .top-sep, body.is-staff #top-right a[href="/app/dat-cho"], body.is-staff #side-card { display: none !important; }
/* menu dài (15 mục): màn hình thấp thì thu gọn khoảng cách, ẩn khung "Trang đặt chỗ" (đã có ở trang Đặt chỗ) */
@media (min-width: 861px) and (max-height: 1080px) {
  #side-nav .nav-sec { padding-top: 10px; padding-bottom: 3px; }
  #side-nav .nav-link { height: 31px; min-height: 31px; }
  #side-card { display: none; }
}
.grid.mk-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
@media (max-width: 860px) { .grid.mk-grid { grid-template-columns: minmax(0, 1fr); } }
.mk-table td.st-act { width: 1%; white-space: nowrap; }
.mk-acts { flex-wrap: nowrap; }
.qz-sk .progress.hot > div { background: linear-gradient(90deg, #F59E0B, #EF4444); }
/* trợ giảng: ẩn các nút chỉ chủ lớp dùng (máy chủ cũng chặn) */
body.is-staff [data-cancel], body.is-staff [data-status="planned"], body.is-staff .upload-btn, body.is-staff a[href^="/app/ai"],
body.is-staff [data-notify], body.is-staff [data-add], body.is-staff [data-add-lesson], body.is-staff [data-add-student],
body.is-staff [data-archive], body.is-staff [data-edit], body.is-staff [data-remove], body.is-staff [data-send-join] { display: none !important; }

/* nhận xét tháng: biểu đồ điểm; hộp gửi tin có ảnh kèm; đầu trang đề thi */
.rp-chart { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.msg-img { display: grid; gap: 8px; }
.msg-img img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
/* đầu trang đề thi: [quay về] [tên đề] [trạng thái] cùng một hàng, căn giữa theo ô tên đề; dòng phụ nằm ngay dưới tên đề */
.qz-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back title seg" ". meta ."; align-items: center; column-gap: 18px; row-gap: 6px; }
.qz-head .qz-back { grid-area: back; }
.qz-head .qz-title { grid-area: title; min-width: 0; }
.qz-head .qz-meta { grid-area: meta; padding-left: 2px; }
.qz-head .qz-seg { grid-area: seg; }
@media (max-width: 820px) {
  .qz-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "back" "title" "meta" "seg"; }
  .qz-head .qz-back, .qz-head .qz-seg { justify-self: start; }
}

/* gửi nhận xét hàng loạt: tổng kết ai gửi được, ai lỗi */
.rb-result { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; }
.rb-result.ok { background: var(--mint-soft); border-color: color-mix(in srgb, var(--mint) 25%, transparent); }
.rb-result.bad { background: var(--coral-soft); border-color: color-mix(in srgb, var(--coral) 25%, transparent); }
.rb-ok { color: var(--mint); }
.rb-bad { color: var(--coral); }
.rb-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }

/* nhãn Online: bỏ chấm, nền xanh nhạt + vệt sáng lướt chậm cho dễ nhận ra; thẻ buổi online ở Lịch dạy ánh xanh nhẹ */
.badge-tag.online { position: relative; overflow: hidden; isolation: isolate; font-weight: 600; color: var(--sky);
  background: var(--sky-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sky) 30%, transparent); }
.badge-tag.online::before { display: none; }
.badge-tag.online::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 25%, color-mix(in srgb, var(--sky) 38%, transparent) 50%, transparent 75%);
  transform: translateX(-130%); animation: online-sheen 3.6s ease-in-out infinite; }
@keyframes online-sheen { 0%, 50% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.day-col .lesson-pill.is-online { border-color: color-mix(in srgb, var(--sky) 32%, var(--line));
  background: linear-gradient(150deg, color-mix(in srgb, var(--sky-soft) 80%, var(--surface)) 0%, var(--surface) 65%); }
.day-col .lesson-pill.is-online:hover { border-color: color-mix(in srgb, var(--sky) 55%, var(--line)); }
@media (prefers-reduced-motion: reduce) { .badge-tag.online::after { animation: none; display: none; } }

/* ---------- trang chủ: các hàng ngang 2:1, thẻ trong cùng hàng cao bằng nhau ---------- */
.dash-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.dash-row > .card { display: flex; flex-direction: column; min-width: 0; }
.dash-row .card-foot { margin-top: auto; padding-top: 14px; }
.dash-row .today-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.dash-row .today-note b { font-weight: 500; color: var(--ink-2); }
@media (max-width: 1080px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
.stat .chg a { color: var(--primary); font-weight: 500; }
.stat .stat-bar { height: 6px; margin-top: auto; width: 100%; align-self: stretch; flex: none; }

/* dải 7 ngày trong tuần */
.wk-head { margin-bottom: 8px; }
.wk-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; border-radius: 8px; padding: 2px 0; }
.wk-day:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.wk-n { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wk-day.off .wk-n { color: var(--line-3); }
.wk-bar { height: 56px; width: 100%; max-width: 26px; display: flex; align-items: flex-end; border-radius: 6px; background: color-mix(in srgb, var(--line) 60%, transparent); }
.wk-bar > span { width: 100%; display: flex; align-items: flex-end; border-radius: 6px; background: color-mix(in srgb, var(--primary) 28%, var(--surface)); overflow: hidden; min-height: 0; }
.wk-bar > span > i { display: block; width: 100%; background: var(--primary); }
.wk-lbl { font-size: 12px; font-weight: 500; }
.wk-day.today .wk-lbl { color: var(--primary-ink, #fff); background: var(--primary); border-radius: 999px; padding: 1px 8px; }
.wk-day.today .wk-n { color: var(--primary); }

/* đặt chỗ mới: tối đa 3 em mỗi trang, nhãn không đè nút */
.bk-list { display: flex; flex-direction: column; }
.bk-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.bk-item:first-child { border-top: 0; padding-top: 2px; }
.bk-main { min-width: 0; display: grid; gap: 4px; }
.bk-chip { min-width: 0; }
.bk-chip .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 24px; vertical-align: top; }
.bk-foot { gap: 6px; border-top: 1px solid var(--line); padding-top: 12px !important; }
.bk-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 2px; }
.mini-pager { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-pager .btn { min-width: 30px; padding: 0 8px; }

/* học phí 6 tháng: cột chồng */
.fc-legend { display: inline-flex; gap: 14px; font-size: 12px; color: var(--muted); }
.fc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fc-legend i { width: 10px; height: 10px; border-radius: 3px; }
.fc-legend i.p, .fc-bar .p { background: var(--primary); }
.fc-legend i.u, .fc-bar .u { background: color-mix(in srgb, var(--sun) 60%, var(--surface)); }
.fc-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.fc-sum > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.fc-sum b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc { position: relative; height: 220px; margin-top: 14px; }
.fc-grid { position: absolute; inset: 0 0 26px 42px; display: flex; flex-direction: column; justify-content: space-between; }
.fc-grid > div { border-top: 1px dashed var(--line-2); position: relative; height: 0; }
.fc-grid > div:last-child { border-top-style: solid; }
.fc-grid span { position: absolute; left: -42px; top: -8px; width: 34px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-cols { position: absolute; inset: 0 0 0 42px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fc-col { display: flex; flex-direction: column; min-width: 0; }
.fc-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; }
.fc-val { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; white-space: nowrap; }
.fc-bar { width: min(40px, 56%); display: flex; flex-direction: column; border-radius: 7px 7px 2px 2px; overflow: hidden; min-height: 3px;
  transform-origin: bottom; animation: fc-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.fc-col:nth-child(2) .fc-bar { animation-delay: .05s; } .fc-col:nth-child(3) .fc-bar { animation-delay: .1s; }
.fc-col:nth-child(4) .fc-bar { animation-delay: .15s; } .fc-col:nth-child(5) .fc-bar { animation-delay: .2s; } .fc-col:nth-child(6) .fc-bar { animation-delay: .25s; }
.fc-bar span { display: block; min-height: 0; }
.fc-lbl { height: 26px; line-height: 26px; text-align: center; font-size: 12px; color: var(--muted); }
.fc-col.cur .fc-lbl { color: var(--ink); font-weight: 600; }
.fc-col.cur .fc-val { color: var(--primary); }
@keyframes fc-grow { from { transform: scaleY(0); } }
@media (max-width: 600px) {
  .fc-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fc-sum > div { padding: 8px 10px; }
  .fc-sum > div:last-child { grid-column: 1 / -1; }
  .fc-sum b { font-size: 15px; }
  .fc { height: 200px; }
}

/* chuyên cần 30 ngày: vòng tròn + chú thích */
.dn { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 6px; flex: 1; justify-content: center; }
.dn-ring { position: relative; width: 150px; height: 150px; }
.dn-ring svg { width: 100%; height: 100%; display: block; }
.dn-ring circle { transition: stroke-dasharray .6s; }
.dn-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dn-mid b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.dn-mid span { font-size: 12px; color: var(--muted); }
.dn-leg { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.dn-leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; align-items: center; gap: 10px; font-size: 13px; }
.dn-leg i { width: 10px; height: 10px; border-radius: 3px; }
.dn-leg span { color: var(--ink-2); }
.dn-leg b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dn-leg small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.unpaid-list .list-item { padding-top: 10px; padding-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .fc-bar { animation: none; } }

/* trang chủ: danh sách thẳng hàng với tiêu đề thẻ; dải tuần giãn hết phần còn trống của thẻ "Hôm nay dạy gì" */
.dash-row .list { margin: 0 -10px; }
.dash-row .list-item { padding: 11px 10px; border-radius: 10px; }
.unpaid-list .list-item { padding-top: 12px; padding-bottom: 12px; }
.wk-foot { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.wk-foot .wk-strip { flex: 1; min-height: 118px; max-height: 220px; }
.wk-foot .wk-day { height: 100%; }
.wk-foot .wk-bar { flex: 1; height: auto; min-height: 48px; }

/* lịch tháng: ô tự cao theo số buổi, badge Online nhỏ */
.mcal { height: auto; }
.mcal-grid { grid-template-rows: repeat(var(--weeks, 5), minmax(var(--row-min, 80px), auto)); }
.mday { overflow: visible; }
.mlist { overflow: visible; flex: none; }
.mchip .m-on { flex: none; margin-left: auto; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .02em; line-height: 14px; height: 14px;
  padding: 0 4px; border-radius: 4px; color: var(--sky); background: var(--sky-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sky) 30%, transparent); }
.mmore { display: none !important; }

/* popup thông tin đặt chỗ ở trang chủ */
.bk-item { cursor: pointer; border-radius: 10px; transition: background .12s; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.bk-item:hover, .bk-item[aria-expanded="true"] { background: var(--surface-2); }
.bk-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ipop { width: 320px; max-width: calc(100vw - 20px); padding: 14px 14px 12px; }
.ipop .ip-head { display: flex; align-items: center; gap: 10px; }
.ipop .ip-head .avatar { width: 36px; height: 36px; }
.ipop .ip-chip { margin-top: 10px; }
.ipop .ip-chip .chip { white-space: normal; height: auto; min-height: 24px; padding-top: 3px; padding-bottom: 3px; }
.ipop .ip-body { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.ipop .ip-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.ipop .ip-row > span { color: var(--muted); }
.ipop .ip-row > div { color: var(--ink); overflow-wrap: anywhere; }
.ipop .cpop-foot { margin-top: 12px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* gói học & học phí (thêm học sinh): cách đóng + số tiền từng tháng */
.seg.seg-sm button { height: 30px; padding: 0 12px; font-size: 13px; }
.fp { display: grid; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.fp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fp-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fp-total span { font-size: 13px; color: var(--muted); }
.fp-total b { font-size: 20px; }
.fp-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.fp-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 13.5px; border-top: 1px solid var(--line); }
.fp-rows > div:first-child { border-top: 0; }
.fp-rows span { color: var(--ink-2); }
.fp + .tiny, .fp .tiny { margin: 0; }
.sp-box > span { margin-bottom: 4px; }
.sp-list { display: grid; gap: 8px; }
.sp-row { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.sp-name { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sp-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-ctl input[type=number] { width: 132px; }
.sp-ctl .check { margin-left: 4px; }
.sp-ctl select { width: auto; min-width: 140px; }
.sp-sum { font-size: 13px; color: var(--ink-2); padding: 8px 10px; border-radius: 8px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.sp-sum b { color: var(--ink); font-weight: 600; }

/* hồ sơ học sinh: Họ tên · Trường · Khối lớp một hàng; Phụ huynh + SĐT xếp dọc bên trái, Ghi chú cao bằng hai ô đó bên phải */
.sf { display: grid; gap: 14px; }
.sf-r1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px; gap: 14px 16px; }
.sf-r2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; align-items: stretch; }
.sf-col { display: grid; gap: 14px; }
.sf-note { min-height: 0; }
.sf-note textarea { flex: 1; min-height: 0; height: auto; resize: none; }
@media (max-width: 600px) {
  .sf-r1 { grid-template-columns: minmax(0, 1fr) 110px; }
  .sf-r1 > .field:first-child { grid-column: 1 / -1; }
  .sf-r2 { grid-template-columns: minmax(0, 1fr); }
  .sf-note textarea { min-height: 88px; }
}

/* thẻ đặt chỗ: 3 nút một hàng */
.bk-acts { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.bk-acts .btn { flex: none; white-space: nowrap; }
.bk-acts .btn-ok { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bk-acts .btn-ghost { padding-left: 10px; padding-right: 10px; }
.bk-chips { min-width: 0; }
.bk-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bk-index { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bk-index input { margin-top: 3px; }
