:root {
  --bg1: #eaf2fb; --bg2: #f4effb; --bg3: #eaf7f1;
  --card: rgba(255,255,255,.86); --text: #1f2d3d; --muted: #66768a; --line: #dbe4ee;
  --brand: #2f6fc0; --brand-d: #1f4f93; --brand-l: #e3eefb; --green: #5aa63c;
  --l-pink: #f6b9c9; --l-green: #a6dcc0; --l-blue: #9cc7ee; --l-lav: #cdbdf2;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --radius: 16px;
  --shadow: 0 6px 24px rgba(60,90,140,.09);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3)) fixed; min-height: 100vh; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Khung: thanh ga bên trái */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, #f9fbfd, #dde5ee); border-right: 1px solid #cdd7e3; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; box-shadow: 4px 0 24px rgba(60,90,140,.07); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.brand img { width: 46px; height: auto; flex: none; }
.brand b { display: block; font-size: .98rem; letter-spacing: .03em; color: var(--brand-d); line-height: 1.2; white-space: nowrap; }
.brand span { display: block; font-size: .66rem; color: var(--muted); line-height: 1.3; }
.stations { position: relative; display: flex; flex-direction: column; gap: 3px; }
.stations::before { content: ''; position: absolute; left: 27px; top: 16px; bottom: 16px; width: 4px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, #9aa9bb 0 6px, transparent 6px 10px); opacity: .55; }
.side a { position: relative; color: #2a3a4d; text-decoration: none; padding: 5px 10px 5px 12px; border-radius: 14px; display: flex; align-items: center; gap: 11px; }
.stations a:nth-child(4n+1) { --c: #fbd5df; --cd: #e58aa5; } .stations a:nth-child(4n+2) { --c: #cfe3f7; --cd: #5b9bdc; }
.stations a:nth-child(4n+3) { --c: #d3efe0; --cd: #4fb283; } .stations a:nth-child(4n+4) { --c: #e4dbf8; --cd: #9b84dd; }
/* Mỗi mục là một toa tàu có bánh xe */
.ic { position: relative; flex: none; display: inline-grid; place-items: center; width: 34px; height: 28px; margin-bottom: 4px; border-radius: 9px 9px 6px 6px;
  background: var(--c, #cfe3f7); color: var(--cd, #3d6fb0); border: 1.5px solid var(--cd, #5b9bdc); font-style: normal; transition: transform .15s; }
.ic svg { width: 17px; height: 17px; }
.ic::after { content: ''; position: absolute; bottom: -5px; left: 6px; width: 6px; height: 6px; border-radius: 50%; background: #51637a; box-shadow: 16px 0 0 #51637a; }
.side a:hover { background: rgba(255,255,255,.7); } .side a:hover .ic { transform: translateY(-1px) rotate(-4deg); }
.side a.on { background: #fff; box-shadow: 0 2px 10px rgba(60,90,140,.14); font-weight: 600; color: var(--brand-d); }
.side a.on .ic { background: var(--cd, var(--brand)); color: #fff; }.side .sep { margin: 14px 12px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side .who { margin-top: auto; padding: 12px; font-size: .85rem; background: rgba(255,255,255,.7); border: 1px solid #d3dce8; border-radius: 14px; }
.side .who button { margin-top: 6px; }
main { padding: 26px; max-width: 1120px; width: 100%; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.head h1 { margin: 0; color: var(--brand-d); }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Thẻ & bảng */
.card { background: var(--card); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); padding: 14px 16px 14px 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--l-blue); }
.grid .stat:nth-child(4n+1)::before { background: var(--l-pink); } .grid .stat:nth-child(4n+3)::before { background: var(--l-green); }
.grid .stat:nth-child(4n+4)::before { background: var(--l-lav); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; color: var(--brand); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.pre { white-space: pre-wrap; word-break: break-word; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .78rem; background: var(--brand-l); color: var(--brand-d); }
.tag.ok { background: #dcf5e6; color: var(--ok); } .tag.warn { background: #fdf0cf; color: var(--warn); } .tag.bad { background: #fde1e1; color: var(--bad); }

/* Form */
input, select, textarea { font: inherit; padding: 8px 12px; border: 1px solid #c5d1df; border-radius: 12px; background: #fff; color: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 10px; }
label > input:not([type=checkbox]), label > select, label > textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { font: inherit; padding: 8px 16px; border-radius: 99px; border: 1px solid #c5d1df; background: #fff; color: var(--text); cursor: pointer; }
.btn:hover { background: #f0f5fb; }
.btn.primary { background: linear-gradient(135deg, #4a8be0, var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(47,111,192,.3); }
.btn.primary:hover { background: linear-gradient(135deg, #3b7ccf, var(--brand-d)); }
.btn.danger { color: var(--bad); border-color: #f0b4b4; }
.btn.sm { padding: 3px 11px; font-size: .85rem; }
/* việc đã làm xong: chìm xuống, việc chưa làm giữ màu nổi (.primary) */
.btn.done, .btn.done:hover { background: #eef2f6; border-color: #dbe3ec; color: #7d8da1; box-shadow: none; font-weight: 400; }
span.btn.done { cursor: default; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; margin: -4px 0 10px; }
.filters { margin-bottom: 12px; } .filters input[type=search] { min-width: 180px; }
.nowrap { white-space: nowrap; }
/* Giáo viên: trang Hôm nay, thẻ buổi dạy, việc cần làm */
a.btn { display: inline-block; text-decoration: none; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs a { padding: 7px 18px; border-radius: 99px; background: rgba(255,255,255,.7); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.shift { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bigbtn { font-size: 1.15rem; padding: 14px 34px; }
.sess { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-left: 6px solid; border-radius: 12px; background: #f8fbff; padding: 10px 12px; margin-bottom: 10px; }
.sess-time { font-weight: 700; text-align: center; min-width: 52px; line-height: 1.2; } .sess-time span { font-weight: 400; color: var(--muted); }
.sess-main { flex: 1; min-width: 180px; } .chips { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.sess-act { display: flex; gap: 6px; flex-wrap: wrap; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.btn.ghost-dark { border-color: transparent; background: transparent; color: var(--muted); text-decoration: underline; padding: 3px 6px; }
.okc { color: var(--ok); } .warnc { color: var(--warn); } .badc { color: var(--bad); }
.inl { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; } .inl input { width: auto; margin: 0; }
.sgvlabel { margin: 4px 0 8px; font-weight: 400; font-size: .85rem; } .sgvlabel select { margin-top: 2px; }
.prow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lcontent { min-width: 220px; max-width: 420px; }
.filechip { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 99px; background: var(--brand-l); color: var(--brand-d); text-decoration: none; font-size: .88rem; word-break: break-all; }
.filechip:hover { background: #d3e4fa; }
.chk { width: 34px; } .chk input { width: 18px; height: 18px; cursor: pointer; }
.bulk { margin-bottom: 8px; }
.sblock { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #f8fbff; }
.sblock[hidden] { display: none; }
.sname { margin-bottom: 6px; }
.srow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.srow select { padding: 6px 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--bad); }

/* Thời khóa biểu: 3 buổi (Sáng / Trưa / Tối), ô lớp cao theo thời lượng, lớp cùng giờ xếp cạnh nhau */
.tt-scroll { overflow-x: auto; }
.tt { min-width: 1500px; background: #fff; padding: 14px; border-radius: 12px; }
.tt-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tt-title img { width: 44px; height: auto; } .tt-title b { color: var(--brand-d); letter-spacing: .04em; }
.tt-days, .tt-row { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 6px; }
.tt-head { text-align: center; font-weight: 700; padding: 8px 4px; border-radius: 10px; background: linear-gradient(135deg, var(--l-blue), var(--l-lav)); color: #1f2d3d; }
.tt-band { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(90deg, #eef4fc, #f7f1fc); font-weight: 700; color: var(--brand-d); }
.tt-band small { font-weight: 400; color: var(--muted); }
.tt-none { text-align: center; color: var(--muted); font-size: .85rem; padding: 6px; }
.tt-axis { position: relative; font-size: .72rem; color: var(--muted); }
.tt-axis span { position: absolute; right: 4px; transform: translateY(-50%); background: #fff; padding: 0 2px; }
.tt-cell { position: relative; border-radius: 8px; background: #fbfdff;
  background-image: repeating-linear-gradient(to bottom, #e3ebf5 0, #e3ebf5 1px, transparent 1px, transparent 78px); }
.tt-cell.over { outline: 2px dashed var(--bad); outline-offset: -2px; }
.tt-card { position: absolute; overflow: hidden; box-sizing: border-box; border: 1px solid rgba(40, 70, 110, .18); border-left: 5px solid; border-radius: 8px; padding: 4px 6px; font-size: .78rem; line-height: 1.25; }
.tt-card.bad { border-color: var(--bad); }
.tt-time { font-weight: 700; font-size: .72rem; }
.tt-card b { display: block; font-size: .84rem; }
.tt-cls, .tt-gv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-gv { color: #44566b; font-size: .72rem; }
.tt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: .8rem; color: #44566b; }
.tt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ok-box { background: #e8f7ec; border: 1px solid #9dd4ab; color: #16622c; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: .88rem; }
.warn-box { background: #fff4e5; border: 1px solid #f3c98b; color: #8a5200; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: .88rem; }
.modal ul { margin: 4px 0 10px; padding-left: 20px; }

/* Điểm danh */
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg label { margin: 0; font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 4px 11px; border: 1px solid #c5d1df; border-radius: 99px; cursor: pointer; font-size: .85rem; background: #fff; }
.seg input:checked + span.s-present { background: #dcf5e6; border-color: var(--ok); color: var(--ok); }
.seg input:checked + span.s-late { background: #fdf0cf; border-color: var(--warn); color: var(--warn); }
.seg input:checked + span.s-excused { background: #dbeafe; border-color: #1d4ed8; color: #1d4ed8; }
.seg input:checked + span.s-absent { background: #fde1e1; border-color: var(--bad); color: var(--bad); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* Hộp thoại, thông báo */
.modal-back { position: fixed; inset: 0; background: rgba(25,40,70,.45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; padding: 22px; border-top: 6px solid var(--l-blue); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1f2d3d; color: #fff; padding: 10px 20px; border-radius: 99px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; } #toast.err { background: var(--bad); }

/* Đăng nhập: cổng ga */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; }
.gate::before, .gate::after { content: ''; position: absolute; left: -5%; right: -5%; height: 10px; border-radius: 5px; opacity: .8; }
.gate::before { top: 18%; background: linear-gradient(90deg, var(--l-pink), var(--l-blue), var(--l-lav)); transform: rotate(-2deg); }
.gate::after { bottom: 16%; background: linear-gradient(90deg, var(--l-green), var(--l-blue), var(--l-pink)); transform: rotate(1.5deg); }
.login { position: relative; z-index: 1; width: 100%; max-width: 400px; text-align: center; }
.login img { width: 96px; height: auto; }
.login h1 { font-size: 2.1rem; letter-spacing: .06em; margin: 6px 0 4px; text-transform: uppercase;
  background: linear-gradient(180deg, #8a99ab, #dfe6ee 45%, #6f7f93); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.9)); }
.login .tagline { display: inline-block; padding: 4px 16px; border-radius: 99px; background: rgba(255,255,255,.75); border: 1px solid #d3dce8; color: var(--brand-d); font-size: .85rem; margin-bottom: 18px; }
.login .card { padding: 24px; text-align: left; }


/* ---------- Đợt 1: giao diện trạm tàu ---------- */
.ic.big { width: 46px; height: 38px; border-radius: 12px 12px 8px 8px; margin-bottom: 6px; }
.ic.big svg { width: 24px; height: 24px; } .ic.big::after { left: 9px; box-shadow: 22px 0 0 #51637a; }
.ic.sm { width: 28px; height: 22px; margin: 0 8px 4px 0; vertical-align: middle; border-radius: 7px 7px 5px 5px; }
.ic.sm svg { width: 14px; height: 14px; } .ic.sm::after { left: 5px; width: 5px; height: 5px; bottom: -4px; box-shadow: 13px 0 0 #51637a; }
.head-t { display: flex; align-items: center; gap: 14px; }
.head-t .ic { --c: #cfe3f7; --cd: #5b9bdc; }
.head .sub { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.empty-art { display: flex; justify-content: center; margin-bottom: 6px; opacity: .85; }
.empty-art .scene { width: 260px; height: auto; border-radius: 12px; } .empty-art .train { animation: none; }
.scene { width: 100%; display: block; }
.train { animation: drive 30s linear infinite; animation-delay: -9s; }
@keyframes drive { from { transform: translateX(-290px); } to { transform: translateX(540px); } }
@media (prefers-reduced-motion: reduce) { .train { animation: none; transform: translateX(120px); } }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); align-items: end; gap: 8px; overflow: hidden;
  background: linear-gradient(135deg, #d9ebfb 0%, #e9e2fa 55%, #fbe3ea 100%); border-radius: 22px; margin-bottom: 18px; min-height: 170px;
  border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); }
.hero-t { padding: 24px 0 22px 26px; align-self: center; position: relative; z-index: 1; }
.hero-kicker { display: inline-block; padding: 2px 12px; border-radius: 99px; background: rgba(255,255,255,.75); color: var(--brand-d); font-size: .8rem; font-weight: 600; }
.hero h1 { margin: 8px 0 4px; font-size: 1.7rem; color: var(--brand-d); } .hero p { margin: 0; color: #44566c; }
.hero .scene { align-self: end; height: auto; }

.tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ticket { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); background: var(--card); border-radius: 14px;
  border: 1px solid #fff; box-shadow: var(--shadow); position: relative; transition: transform .15s, box-shadow .15s;
  background-image: radial-gradient(circle at 0 50%, transparent 7px, transparent 7px); }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #eef2f9; }
.ticket::before { left: -8px; } .ticket::after { right: -8px; }
.ticket:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(60,90,140,.16); }
.ticket b { display: block; font-size: 1.7rem; line-height: 1.05; color: var(--brand-d); } .ticket span { font-size: .86rem; color: var(--muted); }
.tickets .ticket:nth-child(4n+1) .ic { --c: #fbd5df; --cd: #e58aa5; } .tickets .ticket:nth-child(4n+2) .ic { --c: #cfe3f7; --cd: #5b9bdc; }
.tickets .ticket:nth-child(4n+3) .ic { --c: #d3efe0; --cd: #4fb283; } .tickets .ticket:nth-child(4n+4) .ic { --c: #e4dbf8; --cd: #9b84dd; }

/* Bảng giờ tàu kiểu nhà ga */
.board { background: #14323b; color: #e8f1f2; border-radius: 18px; padding: 14px 16px 10px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(20,50,59,.28); border: 3px solid #26505c; }
.board-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; letter-spacing: .14em; color: #ffd36b; margin-bottom: 8px; }
.clock { font: 700 1.3rem ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; background: #0c2127; padding: 2px 12px; border-radius: 8px; color: #ffd36b; }
.brow { display: grid; grid-template-columns: 90px 1.5fr 1fr 1fr 1.2fr; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px dashed rgba(255,255,255,.18); font-size: .92rem; }
.brow.bhead { border-top: 0; font-size: .7rem; letter-spacing: .12em; color: #8fb0b7; padding: 2px 4px; }
.btime { font: 700 1.05rem ui-monospace, Consolas, monospace; color: #ffd36b; } .btime small { display: block; font-size: .72rem; color: #8fb0b7; font-weight: 400; }
.bnone { display: block; color: #8fb0b7; padding: 14px 4px; }
.bs { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 9px; border-radius: 6px; font: 700 .68rem/1.6 system-ui, sans-serif; letter-spacing: .08em; font-style: normal; }
.bs.run { background: #3ecf8e; color: #07301f; } .bs.soon { background: #ffd36b; color: #3d2c00; } .bs.done { background: #4b6770; color: #dfeaec; }
.bs.wait { background: #9cc7ee; color: #0c2d4d; } .bs.ok { background: transparent; color: #7be2b0; border: 1px solid #3a8f6c; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .two > .card { margin-bottom: 16px; }
.card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.alerts { list-style: none; margin: 0; padding: 0; } .alerts li { border-bottom: 1px solid var(--line); } .alerts li:last-child { border-bottom: 0; }
.alerts a { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 4px; text-decoration: none; color: var(--text); }
.alerts a:hover { background: #fff8ec; border-radius: 8px; } .alerts em { font-style: normal; color: var(--brand); font-size: .85rem; white-space: nowrap; }
.allgood { color: var(--ok); font-weight: 600; margin: 4px 0; } .allgood .ic { --c: #d3efe0; --cd: #4fb283; }
.chips .person { display: inline-flex; align-items: center; gap: 8px; background: #f0f6fd; border: 1px solid #d6e4f4; padding: 4px 12px 4px 4px; border-radius: 99px; }
.person b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--l-blue); color: #fff; }
.person small { color: var(--muted); }
.bar-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr 54px; gap: 10px; align-items: center; margin: 7px 0; font-size: .88rem; }
.bar-row .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bar-row b { text-align: right; }
.track { height: 12px; border-radius: 99px; background: #e8eef6; overflow: hidden; } .track.big { height: 18px; }
.fill { display: block; height: 100%; border-radius: 99px; background: var(--l-blue); }
.fill.g { background: linear-gradient(90deg, #7fd0a6, #4fb283); } .fill.y { background: linear-gradient(90deg, #ffd98a, #f0b04a); }
.fill.r { background: linear-gradient(90deg, #f6a6a6, #e16a6a); } .fill.b { background: linear-gradient(90deg, #9cc7ee, #5b9bdc); }
.fee-n { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* Đăng nhập */
.login { max-width: 460px; }
.login-scene { border-radius: 22px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); background: linear-gradient(135deg, #d9ebfb, #e9e2fa 60%, #fbe3ea); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
  .side { align-self: start; position: sticky; top: 0; z-index: 20; height: auto; flex-direction: column; padding: 8px 8px 6px; gap: 4px; box-shadow: 0 4px 16px rgba(60,90,140,.12); }
  .brand { padding: 0 6px; } .brand img { width: 34px; } .brand span, .side .sep { display: none; }
  .stations { flex-direction: row; overflow-x: auto; gap: 2px; padding-bottom: 0; scrollbar-width: none; } .stations::-webkit-scrollbar { display: none; }
  .stations::before { display: none; }
  .side a { flex-direction: column; gap: 2px; padding: 4px 8px; font-size: .72rem; min-width: 68px; text-align: center; white-space: nowrap; }
  .side .who { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0; padding: 4px 10px; font-size: .75rem; } .side .who br { display: none; } .side .who .small { margin-left: 6px; }
  main { padding: 14px; }
  .row2, .two { grid-template-columns: minmax(0, 1fr); }
  .row2 > *, .two > * { min-width: 0; }
  .hero { grid-template-columns: 1fr; } .hero-t { padding: 18px 18px 0; } .hero h1 { font-size: 1.35rem; }
  .brow { grid-template-columns: 70px 1fr 1fr; } .brow .bt { display: none; } .brow > span:last-child { grid-column: 1 / -1; }
  .bhead > span:last-child { display: none; }
  .head-t .ic.big { display: none; }
}
/* Đợt 2: chấm đỏ nhắc việc */
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #e5484d; color: #fff; font-size: .72rem; line-height: 20px; text-align: center; font-weight: 700; }
@media (max-width: 800px) { .badge { position: absolute; top: 0; right: 6px; margin: 0; } }
/* Giao diện điện thoại: giống ứng dụng, thanh trên + thanh menu dưới */
.appbar { display: none; }
@media (max-width: 800px) {
  body { font-size: 16px; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
  .appbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: linear-gradient(135deg, #2f6fc0, #4a8be0); color: #fff; box-shadow: 0 2px 12px rgba(30,70,130,.25); }
  .appbar-b { display: flex; align-items: center; gap: 8px; min-width: 0; } .appbar-b img { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 9px; padding: 2px; }
  .appbar-b b { font-size: 1rem; letter-spacing: .02em; white-space: nowrap; }
  .appbar-u { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .appbar-u span { display: flex; flex-direction: column; text-align: right; line-height: 1.15; min-width: 0; margin-right: 2px; }
  .appbar-u b { font-size: .82rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .appbar-u small { font-size: .68rem; opacity: .85; }
  .appbar .btn { white-space: nowrap; flex: none; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); color: #fff; padding: 6px 10px; font-size: .78rem; }
  .shell { display: block; }
  /* Thanh menu cố định phía dưới, vuốt ngang để chọn mục */
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; height: auto; flex-direction: row; align-items: stretch; overflow-x: auto; overflow-y: hidden;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; border-right: 0; border-top: 1px solid #cdd7e3; scrollbar-width: none;
    background: rgba(249,251,253,.97); backdrop-filter: blur(10px); box-shadow: 0 -4px 18px rgba(60,90,140,.14); scroll-snap-type: x proximity; }
  .side::-webkit-scrollbar { display: none; }
  .side .brand, .side .who, .side .sep { display: none; }
  .stations { display: contents; } .stations::before { display: none; }
  .side a { flex: 0 0 auto; min-width: 66px; padding: 4px 6px; border-radius: 12px; font-size: .68rem; scroll-snap-align: center; }
  .side a .ic { margin-bottom: 5px; }
  .side a.on { box-shadow: 0 2px 8px rgba(60,90,140,.18); }
  .badge { top: -1px; right: 8px; }
  main { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); }
  .head h1 { font-size: 1.25rem; }
  .head > *, .bar { min-width: 0; max-width: 100%; } .bar select, .bar input { min-width: 0; max-width: 100%; }
  .card { padding: 14px; border-radius: 18px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .stat b { font-size: 1.5rem; }
  /* Nhập liệu: chữ 16px để iPhone không tự phóng to, nút bấm đủ lớn cho ngón tay */
  input, select, textarea { font-size: 16px; padding: 10px 12px; }
  .btn { padding: 10px 16px; } .btn.sm { padding: 7px 13px; font-size: .88rem; }
  .tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; } .tabs a { white-space: nowrap; flex: none; }
  .table-wrap { margin: 0 -4px; -webkit-overflow-scrolling: touch; } th, td { padding: 9px 8px; }
  /* Hộp thoại trượt lên từ đáy màn hình */
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet .22s ease-out; }
  .modal .actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 10px 0; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  #toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .gate { padding-top: calc(24px + env(safe-area-inset-top)); }
}
@media (max-width: 440px) { .appbar-u span { display: none; } .appbar-b b { font-size: .95rem; } }
/* Mở từ màn hình chính (đã cài như app) */
@media (display-mode: standalone) { body { user-select: none; -webkit-user-select: none; } input, textarea, .pre, td, p { user-select: text; -webkit-user-select: text; } }
code { background: #f0f6fd; padding: 1px 7px; border-radius: 6px; }
/* Đợt 3: học bạ, cổng phụ huynh */
.pchart { width: 100%; max-width: 620px; height: auto; display: block; margin: 6px 0 12px; }
.parent { max-width: 720px; margin: 0 auto; padding: 0 14px 30px; }
.parent .hero { grid-template-columns: 1fr; } .parent .hero .scene { max-width: 420px; justify-self: end; }
.parent .prow { align-items: flex-start; }
.parent-pay { display: flex; gap: 18px; align-items: center; margin-top: 12px; flex-wrap: wrap; } .parent-pay img { width: 170px; height: 170px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }