/* Học Sinh Ngoan — giao diện độc quyền của thatvidieu.win.
   Fingerprint: sha256:c78687c9c8d301f2d38d72233362e5d557c65ab61593b7e422109ebf47402e89
   Giao diện sáng theo tinh thần phong trào trường học. Trang tổng dùng đỏ - vàng; mỗi trường chọn màu chính + màu nhấn.
   Bộ biến dưới đây là mặc định (đỏ viền vàng); máy chủ chèn bộ biến đã tính cho đúng trường vào <body style> (lib/theme.js). */
:root {
  --hsn-provenance: "tvd-hsn-c78687c9c8d301f2";
  --top-bg: #c8202b; --top-ink: #ffffff; --top-chip: #ffffff; --stripe: #ffec00;
  --accent: #c8202b; --accent-ink: var(--accent-ink); --on-accent: #ffffff; --accent-soft: #f9e9ea; --tint: #eebcc0; --tint-line: #e4a0a5;
  --bg: #fdf6f6; --line: #f2d3d5; --grid: #f6e4e5;
  --card: #fff; --ink: #1f2328; --ink-2: #4b5563; --ink-3: #6b7280; --danger: #b3261e; --good-soft: #e6f4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; } .grow { flex: 1; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--top-bg); box-shadow: 0 3px 0 var(--stripe); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--top-ink); font-size: 15px; min-width: 0; flex: 0 1 auto; } .brand-mark { display: inline-flex; flex-shrink: 0; } .brand-mark img { display: block; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); } .brand-text { line-height: 1.15; }
.top-link { flex-shrink: 0; font-size: 13px; font-weight: 700; border: 2px solid var(--top-chip); border-radius: 999px; padding: 5px 12px; color: var(--top-chip); background: transparent; }
main { max-width: 640px; margin: 0 auto; padding: 14px 14px 80px; }
h1 { font-size: 24px; margin: 8px 0 12px; color: var(--ink); line-height: 1.2; }
h2 { font-size: 17px; margin: 0 0 8px; color: var(--ink); }
h2.sec { margin: 22px 0 10px; color: var(--accent); font-size: 16px; }
.muted { color: var(--ink-2); font-size: 14px; } .fine { font-size: 12px; color: var(--ink-3); } .center { text-align: center; }
.back { display: inline-block; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.empty { text-align: center; color: var(--ink-2); padding: 22px 8px; }
.notice { background: #fff9c4; border: 1px solid #e6d600; color: #5a5000; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; } .notice.good { background: var(--good-soft); border-color: #9ccf93; color: #1d5a26; }

/* trang đầu */
.home-hero { text-align: center; padding: 14px 0 6px; } .hero-mark { display: inline-block; margin-bottom: 4px; } .hero-mark img { display: block; border-radius: 6px; box-shadow: 0 8px 22px rgba(31, 45, 31, 0.28); }
.home-hero h1 { color: var(--accent); font-size: 26px; margin: 12px 0 4px; }
.khan { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 14px 0 4px; padding: 20px 20px 66px; clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); }
.khan-ghi { background: var(--top-bg); color: var(--top-ink); --edge: var(--stripe); }
.khan-xem { background: var(--tint); color: var(--accent-ink); --edge: var(--accent); }
.khan-edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; } .khan-edge polyline { fill: none; stroke: var(--edge); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
.khan-text { display: flex; flex-direction: column; gap: 4px; } .khan-text b { font-size: 23px; } .khan-text span { font-size: 14px; opacity: 0.92; max-width: 220px; } .khan-cross { flex-shrink: 0; margin-top: 2px; }
.card { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 12px 0; box-shadow: 0 2px 10px rgba(31, 45, 31, 0.06); }
.stack { display: flex; flex-direction: column; gap: 10px; } .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.me-card .who { margin-bottom: 8px; } .me-card h2 { margin: 0; font-size: 18px; }

/* nút + ô nhập */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--accent); background: #fff; color: var(--accent); border-radius: 12px; padding: 10px 16px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.wide { width: 100%; margin-top: 8px; } .btn.big { padding: 15px; font-size: 18px; }
.btn.small { padding: 5px 10px; font-size: 12px; border-width: 1px; } .btn.danger { color: var(--danger); border-color: #e3a29d; } .btn.link { border: none; background: none; text-decoration: underline; font-weight: 400; color: var(--ink-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field input, .field select, .field textarea, .datebar input, .admin-row input, .admin-row select, select { font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #cdd9c4; background: #fff; color: var(--ink); width: 100%; font-family: inherit; }
.field input:focus, select:focus, .admin-row input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; } .form-error:empty { display: none; }
.fine ul { margin: 4px 0; padding-left: 18px; }

/* chọn lớp */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .tiles-wide { grid-template-columns: repeat(2, 1fr); }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: #fff; border: 2.5px solid var(--c); color: var(--ink); min-height: 92px; justify-content: center; box-shadow: 0 2px 8px rgba(31, 45, 31, 0.06); }
.tile-short { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 50%; background: var(--c); color: var(--on, #fff); font-size: 20px; font-weight: 800; line-height: 1; } .tile-name { font-size: 12px; font-weight: 700; } .tile-meta { font-size: 11px; color: var(--ink-3); }
.tile { min-width: 0; }
.tiles-wide .tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "s n" "s m"; column-gap: 10px; row-gap: 0; align-items: center; justify-items: start; text-align: left; min-height: 62px; padding: 10px 12px; } .tiles-wide .tile-short { grid-area: s; border-radius: 12px; min-width: 46px; font-size: 16px; } .tiles-wide .tile-name { grid-area: n; font-size: 14px; align-self: end; } .tiles-wide .tile-meta { grid-area: m; align-self: start; }
.unit-head { display: flex; align-items: center; gap: 12px; margin: 8px 0; } .unit-head h1 { margin: 0; }
.unit-badge { display: grid; place-items: center; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 14px; background: var(--c); color: var(--on, #fff); font-size: 18px; font-weight: 800; }
.unit-chip { display: inline-block; background: var(--c); color: var(--on, #fff); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.people { display: grid; gap: 8px; margin-top: 12px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 8px rgba(31, 45, 31, 0.05); }
.pinfo { flex: 1; min-width: 0; } .pinfo b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pinfo .muted, .person .muted { font-size: 12px; color: var(--ink-3); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e9efe3; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent); } .avatar-lg { width: 72px; height: 72px; } .avatar-sm { width: 34px; height: 34px; box-shadow: 0 0 0 1.5px var(--line); border-width: 1px; }
.who { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; } .who h1 { margin: 0 0 2px; font-size: 22px; }

/* nhập việc tốt */
.day-line { text-align: center; color: var(--accent); margin: 10px 0 4px; font-weight: 700; }
.flowers { padding: 6px 12px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--grid); } .frow:last-of-type { border-bottom: none; }
.fdot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.flabel { flex: 1; font-weight: 700; font-size: 16px; }
.step { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); background: #fff; color: var(--accent); font-size: 24px; line-height: 1; cursor: pointer; font-family: inherit; font-weight: 700; }
.step:active { background: var(--accent-soft); }
.frow input { width: 64px; text-align: center; font-size: 20px; font-weight: 800; padding: 7px 4px; }
.sum { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 6px; font-size: 16px; border-top: 2px solid var(--grid); } .sum b { font-size: 24px; color: var(--accent); }
.done { text-align: center; } .done-mark { display: inline-block; margin-bottom: 6px; } .done-mark img { display: block; border-radius: 5px; box-shadow: 0 6px 16px rgba(31, 45, 31, 0.25); } .done h1 { color: var(--accent); }
.done-list { margin: 12px 0; display: grid; gap: 6px; } .dline { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--accent-soft); border-radius: 10px; } .dline span:nth-child(2) { flex: 1; text-align: left; }
.sum-big { font-size: 18px; font-weight: 800; color: var(--accent); margin: 10px 0 0; }
.fixer { background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; margin: 6px 0; } .fixer summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; }

/* xem (infographic cho điện thoại; theme hồng + đỏ) */
.has-nav main { padding-bottom: 104px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 4px; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--tint); }
.nav-item { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border-radius: 12px; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.nav-item[aria-current="true"] { color: #fff; background: var(--accent); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 24px 0 10px; } .sec-head h2 { margin: 0; font-size: 17px; color: var(--accent); } .sec-head span { font-size: 12px; color: var(--ink-3); }
.hero-card { text-align: center; padding: 20px 14px 16px; margin: 4px 0; border-radius: 22px; background: linear-gradient(180deg, var(--tint), var(--accent-soft)); border: 2px solid var(--tint-line); }
.hero-label { color: var(--accent-ink); font-size: 14px; font-weight: 600; } .hero-num { font-size: 72px; font-weight: 800; line-height: 1.05; color: var(--accent); margin: 2px 0 8px; }
.pill { display: inline-block; background: #fff; color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; margin-bottom: 12px; border: 1px solid var(--tint-line); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; } .kpi { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; background: #fff; border-radius: 14px; color: var(--ink-2); } .kpi svg { color: var(--accent); } .kpi b { font-size: 20px; color: var(--ink); line-height: 1.2; } .kpi span { font-size: 11px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .fgrid .fcard:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 2px 8px rgba(120, 30, 50, 0.06); } .fcard-top { display: flex; align-items: center; gap: 10px; }
.ficon { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; flex-shrink: 0; }
.fcard-label { font-weight: 800; font-size: 14px; } .fcard-pct { font-size: 11px; color: var(--ink-3); }
.fcard-num { font-size: 34px; font-weight: 800; line-height: 1.15; margin: 8px 0 6px; }
.meter { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; } .meter i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 3px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px 10px; }
.cols { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 190px; }
.col { flex: 1; min-width: 0; max-width: 40px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.col-bar { width: 100%; max-width: 24px; flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--grid); } .col-bar i { display: block; width: 100%; background: #a58f96; border-radius: 4px 4px 0 0; min-height: 4px; }
.col.on .col-bar i { background: var(--accent); } .col-num { font-size: 11px; font-weight: 800; color: var(--ink); height: 14px; line-height: 14px; white-space: nowrap; } .col-day { font-size: 10px; color: var(--ink-3); } .col.on .col-day { color: var(--accent); font-weight: 800; }
.podium { display: grid; gap: 8px; } .pod { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; } .pod-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pod-total { font-size: 20px; color: var(--accent); }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #efe6e9; color: var(--ink-2); font-size: 13px; flex-shrink: 0; } .medal.medal-top { color: #2a1d08; }
.badge { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 11px; background: var(--c); color: var(--on, #fff); font-size: 14px; font-weight: 800; flex-shrink: 0; }
.board { display: grid; gap: 8px; } .board-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; } .board-total { font-size: 18px; color: var(--accent); } .board .pinfo b { font-size: 14px; }
.unit-tag { display: inline-block; background: var(--c); color: var(--on, #fff); border-radius: 6px; padding: 0 6px; font-size: 10px; font-weight: 800; margin-right: 2px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px; margin: 0 -14px; scrollbar-width: none; } .strip::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 56px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); font-size: 11px; text-align: center; font-weight: 600; } .chip b { font-size: 20px; color: var(--ink); line-height: 1.1; }
.chip-all { flex-basis: 78px; justify-content: center; } .chip-all b { font-size: 15px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; } .chip.on b { color: #fff; } .chip-bar { width: 80%; height: 4px; background: var(--grid); border-radius: 2px; overflow: hidden; } .chip-bar i { display: block; height: 100%; background: #e58aa3; border-radius: 0 2px 2px 0; } .chip.on .chip-bar { background: rgba(255, 255, 255, 0.35); } .chip.on .chip-bar i { background: #fff; }
.day-title { font-size: 20px; text-align: center; margin: 6px 0 4px; color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 12px; font-size: 12px; color: var(--ink-2); } .lg { display: inline-flex; align-items: center; gap: 5px; } .lg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ranking { display: grid; gap: 8px; }
.unit-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(120, 30, 50, 0.05); }
.unit-head-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; background: none; border: none; color: inherit; text-align: left; font-family: inherit; cursor: pointer; }
.unit-mid { flex: 1; min-width: 0; } .unit-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; } .unit-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .unit-total { font-size: 22px; color: var(--accent); }
.sbar { height: 14px; background: var(--grid); border-radius: 0 4px 4px 0; } .sbar-fill { height: 100%; display: flex; gap: 2px; min-width: 3px; } .sbar-fill i { display: block; height: 100%; min-width: 2px; } .sbar-fill i:last-child { border-radius: 0 4px 4px 0; }
.unit-mid .fine { margin-top: 5px; }
.unit-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); background: #fffafb; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; } .fchip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12px; color: var(--ink-2); } .fchip b { color: var(--ink); }
.person-stat { display: flex; align-items: center; gap: 10px; padding: 7px 0; } .person-stat .pinfo b { font-weight: 700; font-size: 14px; } .person-stat > b { color: var(--accent); }
.tableview { margin: 22px 0 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; } .tableview summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; }
.table-wrap { overflow-x: auto; margin-top: 8px; } .tableview table { border-collapse: collapse; font-size: 12px; min-width: 520px; width: 100%; } .tableview th, .tableview td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; } .tableview th { color: var(--ink-3); font-weight: 700; } .tableview td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; flex-wrap: wrap; gap: 0 2px; border-bottom: 2px solid var(--line); margin: 6px 0 12px; }
.tabs a, .tabs button { background: none; border: none; padding: 9px 10px; font-size: 14px; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; font-family: inherit; font-weight: 600; }
.tabs [aria-selected="true"] { color: var(--accent); font-weight: 800; border-bottom-color: var(--accent); }

/* quản lý */
.admin-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .admin-row input { flex: 1; min-width: 0; } .admin-row .short { flex: 0 0 76px; width: 76px; }
.unit-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.admin-list { display: grid; gap: 6px; margin-top: 8px; } .admin-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; }
.flower-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; } .flower-row.off { background: #f4f4f1; } .flower-row .fname { flex: 1 1 140px; min-width: 0; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #cdd9c4; }
.flower-row .fchip { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.flower-row input[type=color] { width: 38px; height: 34px; padding: 2px; border: 1.5px solid #cdd9c4; border-radius: 8px; background: #fff; cursor: pointer; }
.icon-pick { display: flex; gap: 4px; flex-wrap: wrap; } .icon-pick button { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid #cdd9c4; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; } .icon-pick button[aria-pressed=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, #fff); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; } .swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #cdd9c4; cursor: pointer; } .swatches button[aria-pressed=true] { box-shadow: 0 0 0 2.5px var(--ink); } .swatches button.auto { width: auto; height: 30px; border-radius: 999px; padding: 0 12px; box-shadow: none; border: 1.5px solid #cdd9c4; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; } .swatches button.auto[aria-pressed=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, #fff); }
.entry-edit { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; } .edate { width: 78px; } .mini { display: flex; flex-direction: column; font-size: 10px; color: var(--ink-3); width: 58px; } .mini input { width: 100%; padding: 5px 4px; font-size: 14px; }

/* hộp thoại + thông báo */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 35, 20, 0.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; color: var(--ink); border-radius: 18px; padding: 18px; width: min(92vw, 420px); max-height: 90dvh; overflow-y: auto; } .modal.wide { width: min(96vw, 640px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; } .modal-head h2 { margin: 0; font-size: 18px; } .x-btn { background: none; border: none; font-size: 26px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: #243a26; color: #fff; border-radius: 14px; padding: 11px 16px; font-size: 14px; max-width: 90vw; text-align: center; transition: all 0.2s; z-index: 200; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.good { background: #1d6b2b; } .toast.bad { background: #a8281f; } .toast.warn { background: #7a5a00; }
@media (max-width: 420px) { .tiles { gap: 6px; } .bar-row { grid-template-columns: 100px 1fr 46px; } .hero-num { font-size: 56px; } .khan-text b { font-size: 21px; } }

/* ---- Học Sinh Ngoan (nhiều trường): chip tài khoản, danh sách trường, người có tài khoản ---- */
.account-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; max-width: 150px; border: 2px solid var(--top-chip); border-radius: 999px; padding: 3px 10px 3px 4px; background: transparent; color: var(--top-chip); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; } .account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .account-chip.login { padding: 5px 12px; }
.avatar-xs { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e8efe0; }
.brand-mark svg { display: block; }
.camp-list { display: grid; gap: 8px; } .camp { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); } .camp:hover { border-color: var(--accent); } .camp .pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.camp .pinfo b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; } .tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); } .tag.running { background: #dff3d8; color: #1d5a26; } .tag.upcoming { background: #fff3c4; color: #6b5600; } .tag.ended { background: #ececec; color: #555; } .tag.mgr { background: #fde1e3; color: #9a1b25; }
.person.locked { opacity: .72; cursor: default; }
.good-text { color: #1d5a26; } .bad-text { color: #b3261e; }
.card textarea, .field textarea { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #cdd9c4; background: #fff; color: var(--ink); width: 100%; resize: vertical; }
.card input[readonly] { font-size: 14px; padding: 9px 10px; border-radius: 10px; border: 1.5px solid #cdd9c4; background: #f6f9f1; color: var(--ink); width: 100%; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); margin: 10px 0 2px; } .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tile-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.3; overflow-wrap: anywhere; }
.admin-row.unit-edit { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); } .admin-row.unit-edit .acts { display: flex; gap: 6px; justify-content: flex-end; }
/* Danh sách lớp: mỗi lớp một hàng (huy hiệu bên trái; tên, chú thích, số học sinh bên phải) để chú thích dài vẫn đọc được */
.tiles-list { grid-template-columns: 1fr; }
.tiles-list .tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "s n" "s t" "s m"; column-gap: 12px; row-gap: 1px; align-items: center; justify-items: start; text-align: left; padding: 10px 14px; min-height: 64px; }
.tiles-list .tile-short { grid-area: s; } .tiles-list .tile-name { grid-area: n; font-size: 16px; } .tiles-list .tile-note { grid-area: t; } .tiles-list .tile-meta { grid-area: m; }
/* chọn màu trường: bản xem trước thanh đầu trang */
.theme-preview { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--tp-bg, #c8202b); color: var(--tp-ink, #fff); box-shadow: 0 4px 0 var(--tp-edge, #ffec00); margin-bottom: 4px; }
.theme-preview b { font-size: 15px; } .theme-chip { font-size: 12px; font-weight: 700; border: 2px solid currentColor; border-radius: 999px; padding: 3px 10px; }
.camp-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; box-shadow: 0 0 0 2px var(--cd-edge, #ffec00); background: var(--cd, #c8202b); }
.khan-cross img { display: block; border-radius: 4px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); }

/* Bộ nhận diện Học Sinh Ngoan: rõ ràng, khỏe khoắn, lấy đỏ - vàng - xanh làm màu chủ đạo. */
:root { --teal: #075d59; --teal-dark: #064844; --gold: #f3c623; --paper: #f3f6f4; }
html, body { background: var(--paper); }
body { background-image: linear-gradient(rgba(7, 93, 89, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(7, 93, 89, .025) 1px, transparent 1px); background-size: 28px 28px; }
.top { min-height: 62px; padding: calc(10px + env(safe-area-inset-top)) max(16px, calc((100vw - 920px) / 2)) 10px; border-bottom: 4px solid var(--stripe); box-shadow: 0 1px 0 rgba(0,0,0,.14); }
.brand { font-size: 16px; letter-spacing: .01em; }
.brand-mark img { border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--stripe); }
.top-link, .account-chip { border-radius: 6px; }
main { max-width: 760px; padding: 22px 18px 92px; }
h1 { font-size: clamp(24px, 4vw, 31px); }
h2.sec, .sec-head h2 { text-transform: uppercase; letter-spacing: .045em; font-size: 14px; }
.home-hero { padding: 20px 12px 14px; }
.hero-mark img { border-radius: 50%; box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--stripe), 0 10px 24px rgba(6,72,68,.18); }
.home-hero h1 { color: var(--accent); font-size: clamp(28px, 6vw, 38px); text-transform: uppercase; letter-spacing: .025em; }
.home-hero p { max-width: 540px; margin: 8px auto; line-height: 1.55; }
.card, .person, .fcard, .panel, .pod, .board-row, .unit-card, .camp, .admin-person, .flower-row, .tableview, .modal { border-radius: 8px; box-shadow: 0 2px 7px rgba(16, 47, 43, .06); }
.card { border-top: 4px solid var(--stripe); padding: 18px; }
.btn { border-radius: 6px; min-height: 42px; }
.btn.primary { box-shadow: inset 0 -3px 0 rgba(0,0,0,.13); }
.btn.google { background: #fff; border-color: #b8c1c7; color: #202124; box-shadow: none; }
.btn.google::before { content: 'G'; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: #4285f4; font-weight: 800; }
.field input, .field select, .field textarea, .datebar input, .admin-row input, .admin-row select, select, .card textarea { border-radius: 6px; border-color: #aebdb8; }
.khan { clip-path: none; align-items: center; min-height: 118px; margin: 16px 0 0; padding: 20px; border-radius: 8px; border: 2px solid transparent; box-shadow: 0 5px 0 rgba(0,0,0,.11); overflow: hidden; }
.khan::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 9px; background: var(--stripe); }
.khan-ghi { background: var(--top-bg); color: var(--top-ink); border-color: var(--stripe); }
.khan-xem { background: #fff; color: var(--teal-dark); border-color: var(--teal); }
.khan-xem::before { background: var(--teal); }
.khan-text { padding-left: 5px; }
.khan-text b { font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.khan-text span { max-width: 420px; line-height: 1.45; }
.khan-cross img { border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--stripe); }
.notice { border-radius: 6px; border-left-width: 5px; }
.tiles { gap: 10px; }
.tile, .tiles-wide .tile, .tiles-list .tile { border-radius: 8px; box-shadow: 0 2px 6px rgba(16,47,43,.06); }
.tile-short, .tiles-wide .tile-short, .unit-badge, .badge { border-radius: 6px; }
.hero-card { border-radius: 8px; background: var(--accent-soft); border-width: 1px; border-top: 5px solid var(--stripe); }
.kpi, .nav-item, .chip, .theme-preview, .entry-edit, .admin-row.unit-edit { border-radius: 6px; }
.bottom-nav { border-top: 4px solid var(--stripe); box-shadow: 0 -3px 14px rgba(0,0,0,.08); }
.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.tabs a, .tabs button { flex: 0 0 auto; }
.modal-overlay { background: rgba(4, 39, 37, .66); }
.theme-preview { box-shadow: 0 4px 0 var(--tp-edge, #ffec00); }

@media (min-width: 720px) {
  .khan { padding: 24px 28px; }
  .fgrid { grid-template-columns: repeat(3, 1fr); }
  .fgrid .fcard:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 560px) {
  .top { gap: 7px; min-height: 58px; padding-left: 10px; padding-right: 10px; }
  .brand-text { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-link { padding: 5px 8px; font-size: 12px; }
  .account-chip { max-width: 105px; padding-right: 7px; }
  main { padding: 16px 12px 88px; }
  .home-hero { padding-top: 14px; }
  .khan { min-height: 104px; padding: 16px 14px 16px 20px; }
  .khan-text b { font-size: 20px; }
  .khan-text span { font-size: 12px; }
  .khan-cross img { width: 52px; height: 52px; }
  .card { padding: 14px; }
  .row > .field { flex: 1 1 100%; }
  .admin-person .pinfo { flex-basis: calc(100% - 54px); }
  .admin-person > .btn, .admin-person > .acts { margin-left: 44px; }
  .fgrid { gap: 8px; }
  .hero-num { font-size: 58px; }
}
@media (max-width: 360px) {
  .brand-text { display: none; }
  .top-link { max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .account-chip { max-width: 92px; }
  .fgrid { grid-template-columns: 1fr; }
  .fgrid .fcard:last-child:nth-child(odd) { grid-column: auto; }
}
