/* Layout: bright corporate console — white left rail of stations, airy work area on a faint dotted ground; login is a split screen with an illustrated hero.
   Deliberately light-only (style B chosen by the client), so colors are set once here. */
:root {
  --bg: #f2f5fa; --surface: #ffffff; --raised: #f6f8fc; --ink: #15213b; --muted: #5a6a86; --line: #dfe5ef; --dot: #d5ddeb;
  --rail: #ffffff; --rail-ink: #1d2b4a; --rail-muted: #6b7a94; --rail-hover: #eef3fc;
  --hivis: #0a47b1; --hivis-ink: #ffffff; --hivis-soft: #e7eefb; --brand-orange: #f7a51c;
  --steel: #0e8577; --steel-soft: #dcf3ef;
  --ok: #1d7a49; --ok-soft: #e1f3e8; --bad: #b8372c; --bad-soft: #fbe5e2; --warn: #9a6207; --warn-soft: #fdf0d3;
  --av1: #dbe7fb; --av2: #fbe3d4; --av3: #dcf1df; --av4: #efe2f6; --av-ink: #22304d;
  --cam-a: #33507f; --cam-b: #0d1a34;
  --hero-a: rgba(9, 52, 140, .9); --hero-b: rgba(5, 26, 74, .94); --hero-ink: #ffffff; --hero-line: rgba(255, 255, 255, .22); --hero-fill: rgba(255, 255, 255, .1);
  --font-ui: "Be Vietnam Pro", system-ui, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 22px 22px; color: var(--ink); font-family: var(--font-ui); font-size: 14.5px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--hivis); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 16px; margin: 0; font-weight: 700; }
h3 { font-size: 14.5px; margin: 0; font-weight: 700; }

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); box-shadow: 2px 0 18px rgba(21, 33, 59, .04); }
.app.is-login { grid-template-columns: 1fr; }
.app.is-login .rail { display: none; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.brand .mark { width: 64px; height: auto; flex: none; } .brand { border-bottom: 3px solid var(--brand-orange); margin-bottom: 8px; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand span { font-size: 11.5px; color: var(--rail-muted); }
.nav { border: 0; background: none; color: var(--rail-ink); text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 500; white-space: nowrap; }
.nav:hover { background: var(--rail-hover); }
.nav[aria-current="page"] { background: var(--hivis); color: var(--hivis-ink); font-weight: 700; }
.nav .ic { width: 18px; text-align: center; flex: none; }
.rail .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.rail .me { margin-top: auto; padding: 10px; font-size: 12px; color: var(--rail-muted); border-top: 1px solid var(--line); display: grid; gap: 6px; }
.rail .me b { color: var(--rail-ink); display: block; font-size: 13px; }

.work { min-width: 0; padding-block: 18px 60px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; align-content: start; }
.demo-band { background: var(--hivis-soft); border: 1px solid var(--hivis); border-radius: 10px; padding: 8px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo-band b { font-weight: 700; }
.pagehead { display: flex; gap: 12px 20px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; min-width: 0; align-content: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-door { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 900px) { .g-door { grid-template-columns: 1fr; } }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; border-top: 4px solid var(--line); }
.kpi.k-ok { border-top-color: var(--ok); } .kpi.k-warn { border-top-color: var(--hivis); } .kpi.k-bad { border-top-color: var(--bad); } .kpi.k-steel { border-top-color: var(--steel); }
.kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--font-mono); font-size: 28px; font-weight: 600; line-height: 1.15; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 500; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.btn:hover { border-color: var(--steel); }
.btn.primary { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.panel, .kpi, .table-wrap { box-shadow: 0 1px 2px rgba(21, 33, 59, .04), 0 8px 24px rgba(21, 33, 59, .04); }

/* Login */
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: calc(100vh - 80px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(21, 33, 59, .10); }
.hero { position: relative; background: linear-gradient(180deg, rgba(5, 26, 74, .94) 0%, rgba(9, 52, 140, .62) 38%, rgba(9, 52, 140, .35) 62%, rgba(5, 26, 74, .92) 100%), url(shs-center.jpg) center 62% / cover no-repeat; color: var(--hero-ink); padding: 36px; display: grid; align-content: space-between; gap: 24px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--hero-line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--hero-line) 1px, transparent 1px) 0 0 / 32px 32px; opacity: .35; pointer-events: none; }
.hero > * { position: relative; } .hero::before { display: none; }
.hero .tag { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: var(--hero-fill); border: 1px solid var(--hero-line); padding: 5px 10px; border-radius: 999px; width: fit-content; }
.hero h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; color: var(--hero-ink); max-width: 16ch; }
.hero p { margin: 0; max-width: 46ch; opacity: .9; font-size: 15px; }
.hero svg { width: 100%; max-width: 520px; height: auto; }
.hero .facts { display: flex; gap: 22px; flex-wrap: wrap; }
.hero .facts b { display: block; font-family: var(--font-mono); font-size: 22px; }
.hero .facts span { font-size: 12.5px; opacity: .85; }
.signin { padding: 40px clamp(20px, 5vw, 56px); display: grid; align-content: center; gap: 18px; }
.signin .logo { width: 132px; height: auto; } .hero .tag { border-color: var(--brand-orange); } .hero .brandline { font-family: var(--font-mono); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; color: var(--brand-orange); font-weight: 600; } .contact { font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.signin h2 { font-size: 24px; letter-spacing: -0.01em; }
.signin label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.signin input { padding: 11px 13px; font-size: 15px; color: var(--ink); }
.signin .btn { justify-content: center; padding: 12px; font-size: 15px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; min-height: 0; } .hero { padding: 26px; } .hero svg { max-width: 360px; } }
.btn.hivis { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { color: var(--bad); }
input[type=search], input[type=text], select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 11px; min-width: 0; }
.row-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-bad { background: var(--bad-soft); color: var(--bad); }
.p-warn { background: var(--warn-soft); color: var(--warn); } .p-steel { background: var(--steel-soft); color: var(--steel); }
.p-muted { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--hivis); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--raised); font-weight: 600; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who .nm { font-weight: 600; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--av-ink); flex: none; }
.av.big { width: 72px; height: 72px; font-size: 24px; border-radius: 14px; }
.a1 { background: var(--av1); } .a2 { background: var(--av2); } .a3 { background: var(--av3); } .a4 { background: var(--av4); }

.bar { height: 8px; border-radius: 4px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar.warn i { background: var(--hivis); } .bar.bad i { background: var(--bad); }

.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
@media (max-width: 700px) { .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; } }
.tl { position: relative; padding: 12px 14px 4px; border-top: 4px solid var(--line); display: grid; gap: 2px; }
.tl.done { border-top-color: var(--ok); } .tl.now { border-top-color: var(--hivis); }
.tl .t { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }

.feed { display: grid; gap: 0; }
.feed .it { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.feed .it:last-child { border-bottom: 0; }
.feed .tm { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); width: 64px; flex: none; }

/* Door station */
.cam { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 90% at 50% 35%, var(--cam-a), var(--cam-b)); display: grid; place-items: center; }
.cam-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-wrap::after { content: ""; position: absolute; inset: 10% 27%; border: 3px dashed rgba(255, 255, 255, .75); border-radius: 50%; pointer-events: none; }
.cam-msg { font-weight: 600; text-align: center; min-height: 1.5em; font-size: 16px; }
.cam .oval { width: 42%; aspect-ratio: 3 / 4; border: 3px dashed rgba(255, 255, 255, .8); border-radius: 50%; }
.cam .hud { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cam .hud span { background: rgba(0, 0, 0, .55); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; }
.cam .live { position: absolute; top: 12px; left: 12px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; letter-spacing: .05em; }
.modebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.modebar button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 6px; font-weight: 700; cursor: pointer; }
.modebar button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.result { border-radius: 12px; padding: 14px; display: flex; gap: 14px; align-items: center; border: 2px solid var(--line); }
.result.ok { border-color: var(--ok); background: var(--ok-soft); }
.result.bad { border-color: var(--bad); background: var(--bad-soft); }
.result .big { font-size: 18px; font-weight: 800; }
.counter { display: flex; align-items: baseline; gap: 6px; }
.counter .n { font-family: var(--font-mono); font-size: 44px; font-weight: 600; line-height: 1; }
.suggest { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.suggest button { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 8px 12px; text-align: left; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--raised); }

.ring { width: 132px; height: 132px; flex: none; }
.ring text { fill: var(--ink); font-family: var(--font-mono); }

.cards-qr { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.idcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; background: var(--surface); border-left: 6px solid var(--brand-orange); }
.idcard canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.idcard .n { font-weight: 700; font-size: 13px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; display: grid; gap: 6px; background: var(--raised); }

.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.day { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; background: var(--surface); }
.day.done { border-left: 4px solid var(--ok); } .day.today { border-left: 4px solid var(--hivis); background: var(--hivis-soft); } .day.next { border-left: 4px solid var(--line); }
.day .d { font-family: var(--font-mono); font-weight: 600; }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { background: var(--surface); border-radius: 14px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; display: grid; gap: 14px; }
.paper { background: #fffdf8; color: #1b1b1b; border: 1px solid #d8d2c4; border-radius: 6px; padding: 22px; display: grid; gap: 12px; font-size: 13px; }
.paper h2 { font-size: 17px; text-align: center; letter-spacing: .02em; }
.paper table th { background: #f2eee4; color: #444; }
.paper td, .paper th { border-color: #e2dccf; }
.paper .pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.paper .ph { aspect-ratio: 4 / 3; border-radius: 4px; display: grid; place-items: center; font-size: 11px; color: #555; background: #ece6d8; text-align: center; padding: 4px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; z-index: 50; font-size: 13.5px; max-width: calc(100% - 32px); }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: sticky; top: env(safe-area-inset-top, 0px); height: auto; z-index: 20; flex-direction: row; overflow-x: auto; padding: 8px max(12px, env(safe-area-inset-left, 0px)); gap: 4px; }
  .brand, .rail .sep, .rail .me { display: none; }
  .nav { padding: 8px 10px; font-size: 13px; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--rail); }
}
@media (prefers-reduced-motion: no-preference) { .result { transition: background-color .2s, border-color .2s; } }
/* Bổ sung cho app chạy thật */
.notice-bad { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select { color: var(--ink); font-size: 15px; padding: 9px 11px; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; color: var(--ink); cursor: pointer; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-family: var(--font-mono); font-size: 13px; background: var(--surface); }
input[type=email], input[type=date], input[type=time], input[type=number], input[type=file] { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 11px; min-width: 0; }
.drop input[type=file] { justify-self: center; }
td input[type=text] { width: 100%; min-width: 160px; padding: 6px 9px; }
.idcard .qr { width: 84px; height: 84px; }
.idcard .qr svg { width: 100%; height: 100%; display: block; }
tr.muted td { color: var(--muted); }
.subtabs { display: flex; gap: 6px; }
.subtabs button { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--hivis-soft); color: var(--hivis); border-color: var(--hivis); }
.gbtn { justify-content: center; padding: 12px; font-size: 15px; width: 100%; }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 12px 14px; }
.signin input[type=tel], .signin input[type=password], .signin input[type=text] { width: 100%; }
.cam-wrap.qr-scan video { transform: none; }
.cam-wrap.qr-scan::after { inset: 18% 30%; border-radius: 14px; border-color: rgba(247, 165, 28, .9); }

.rail .nav-logout { display: none; }
@media (max-width: 820px) { .rail .nav-logout { display: flex; flex: none; color: var(--bad); } }

/* Màn hình máy chiếu kiểm tra bất chợt */
.projector { position: fixed; inset: 0; z-index: 900; background: #fff; color: #10204a; display: grid; grid-template-rows: auto 1fr; gap: 2vh; padding: 3vh 4vw; overflow: auto; }
.pj-head { display: flex; gap: 2vw; align-items: center; border-bottom: 6px solid #f7a51c; padding-bottom: 2vh; }
.pj-head img { width: clamp(90px, 10vw, 180px); }
.pj-head h1 { margin: 0; font-size: clamp(26px, 4vw, 64px); color: #0a47b1; letter-spacing: .01em; }
.pj-kicker { font-weight: 800; color: #f7a51c; letter-spacing: .12em; }
.pj-sub { font-size: clamp(16px, 1.8vw, 30px); color: #444; }
.pj-body { display: grid; grid-template-columns: minmax(0, auto) 1fr; gap: 4vw; align-items: center; }
.pj-qr { width: min(68vh, 52vw); aspect-ratio: 1; background: #fff; display: grid; place-items: center; }
.pj-qr svg { width: 100%; height: 100%; }
.pj-side { display: grid; gap: 2.4vh; font-size: clamp(18px, 2vw, 36px); }
.pj-side ol { margin: 0; padding-left: 1.2em; display: grid; gap: 1.2vh; font-weight: 600; }
.pj-stat { font-size: clamp(24px, 3vw, 54px); }
.pj-stat b { color: #1d7a49; }
.pj-small { font-size: clamp(14px, 1.3vw, 24px); color: #555; }
.pj-state { color: #b8372c; font-size: clamp(14px, 1.3vw, 24px); }
.pj-ended { font-size: clamp(22px, 3vw, 48px); font-weight: 800; color: #b8372c; text-align: center; }
.pj-close { position: fixed; right: 16px; bottom: 16px; }
@media (max-width: 760px) { .pj-body { grid-template-columns: 1fr; } .pj-qr { width: min(90vw, 60vh); justify-self: center; } }

/* Xem ảnh điểm danh phóng to */
img[data-zoom] { cursor: zoom-in; }
.zoom-view { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .85); display: grid; place-items: center; gap: 10px; padding: 16px; cursor: zoom-out; }
.zoom-view img { max-width: 100%; max-height: 85vh; width: min(720px, 100%); object-fit: contain; border-radius: 8px; background: #111; }
.zoom-hint { color: #ddd; font-size: 13px; }
@media print { .zoom-view { display: none !important; } }

/* Hồ sơ cá nhân (in thành PDF khổ A4) */
.dossier { background: #fff; color: #1b1b1b; border: 1px solid var(--line); border-radius: 10px; padding: 26px; display: grid; gap: 16px; font-size: 13px; max-width: 980px; }
.dz-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border-bottom: 3px solid #f7a51c; padding-bottom: 12px; }
.dz-logo { width: 96px; }
.dz-org b { color: #0a47b1; font-size: 14px; }
.dz-code { text-align: right; font-size: 12px; }
.dz-title { text-align: center; font-size: 17px; letter-spacing: .02em; margin: 4px 0; }
.dz-person { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: start; }
.dz-face { width: 130px; height: 160px; object-fit: cover; border-radius: 6px; border: 1px solid #ccc; }
.dz-face.empty { display: grid; place-items: center; background: #f2f2f2; color: #888; }
.dz-info th { width: 140px; background: #f4f6fa; color: #444; font-size: 12px; text-transform: none; letter-spacing: 0; }
.dz-info th, .dz-info td, .dz-table th, .dz-table td { border: 1px solid #d9dee8; padding: 6px 8px; white-space: normal; position: static; }
.dz-course { display: grid; gap: 8px; break-inside: avoid-page; }
.dz-course-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #f4f6fa; border-radius: 6px; padding: 10px 12px; }
.dz-verdict { font-weight: 800; font-size: 16px; text-align: right; display: grid; }
.dz-verdict small { font-weight: 500; font-size: 12px; color: #444; }
.dz-verdict.ok { color: #1d7a49; } .dz-verdict.bad { color: #b8372c; } .dz-verdict.warn { color: #9a6207; }
.dz-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dz-table th { background: #f4f6fa; color: #444; font-size: 11px; }
.dz-table tr { break-inside: avoid; }
.dz-cell { display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.ph { width: 54px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid #ccc; flex: none; }
.ph.empty { display: inline-grid; place-items: center; background: #f2f2f2; color: #999; }
.tiny { font-size: 10.5px; color: #555; }
.dz-foot { display: grid; grid-template-columns: 1fr auto; gap: 16px; border-top: 1px solid #d9dee8; padding-top: 12px; font-size: 11.5px; color: #333; }
.dz-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: center; min-width: 320px; padding-bottom: 60px; }
@media (max-width: 700px) { .dz-head, .dz-person, .dz-foot { grid-template-columns: 1fr; } .dz-code { text-align: left; } .dossier { padding: 14px; } }

/* In hồ sơ cả lớp: chỉ in khối hồ sơ, mỗi người một trang mới */
.batch-print { display: none; }
@media print {
  body.print-batch .app, body.print-batch #toast, body.print-batch .overlay { display: none !important; }
  body.print-batch .batch-print { display: block !important; }
  .batch-print .dossier { border: 0; padding: 0; max-width: none; break-after: page; }
  .batch-print .dossier:last-child { break-after: auto; }
}
@media print {
  body.print-dossier .app > .rail, body.print-dossier .no-print, body.print-dossier .pagehead, body.print-dossier #toast { display: none !important; }
  body.print-dossier .dossier { border: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .rail, .pagehead, .tabs, .row-tools, .grid.g4, #toast { display: none !important; }
  .app { display: block; }
  .work { padding: 0; }
  .cards-qr { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .idcard { break-inside: avoid; box-shadow: none; border: 1px solid #999; border-left: 6px solid #f7a51c; }
  .panel, .kpi, .table-wrap { box-shadow: none; }
}

/* ================= Giao diện chuyên nghiệp 2026 (màu theo logo SHS) ================= */
:root {
  --bg: #f3f5fa; --surface: #ffffff; --raised: #f5f7fb; --ink: #111c3a; --muted: #5b6886; --line: #e1e6f0;
  --hivis: #243d9b; --hivis-dark: #1a2d78; --hivis-soft: #e9edf9; --brand-orange: #f9a51a; --orange-soft: #fff3dc;
  --rail: #243d9b; --rail-ink: #ffffff; --rail-muted: rgba(255, 255, 255, .68); --rail-hover: rgba(255, 255, 255, .1);
  --steel: #127a8a; --steel-soft: #dff2f4; --test: #7a3db8; --test-soft: #f1e8fb;
  --shadow: 0 1px 2px rgba(17, 28, 58, .05), 0 6px 20px rgba(17, 28, 58, .05);
}
body { background: var(--bg); margin: 0; overflow-x: hidden; }
h1 { font-size: 24px; color: var(--ink); }
.crumb { color: var(--hivis); font-weight: 700; }

/* Thanh menu bên trái màu xanh thương hiệu */
.rail { background: var(--rail); border-right: 0; box-shadow: 4px 0 24px rgba(17, 28, 58, .12); padding: 0 12px 14px; }
.brand { flex-direction: column; align-items: stretch; gap: 0; padding: 0; margin: 0 -12px 10px; border-bottom: 3px solid var(--brand-orange); }
.mark-brand { width: 100%; height: 92px; object-fit: cover; object-position: center 50%; display: block; }
.brand-sub { padding: 0 16px 12px; margin-top: -6px; }
.brand-sub b { color: #fff; font-size: 13px; letter-spacing: .04em; }
.brand-sub span { color: var(--rail-muted); font-size: 11.5px; }
.nav { color: rgba(255, 255, 255, .86); border-radius: 10px; padding: 10px 12px; position: relative; }
.nav:hover { background: var(--rail-hover); color: #fff; }
.nav[aria-current="page"] { background: #fff; color: var(--hivis); font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.nav[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-orange); }
.nav .ic { opacity: .9; }
.rail .sep { background: rgba(255, 255, 255, .16); }
.rail .me { border-top: 1px solid rgba(255, 255, 255, .16); color: var(--rail-muted); }
.rail .me b { color: #fff; }
.rail .me .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; justify-content: center; }
.rail .me .btn:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 820px) {
  .rail { padding: 8px 12px; box-shadow: 0 4px 16px rgba(17, 28, 58, .15); }
  .nav[aria-current="page"]::before { display: none; }
  .rail .nav-logout { color: #ffd8d3; }
}

/* Khung nội dung */
.work { padding-top: 26px; gap: 20px; max-width: 1400px; width: 100%; }
@media (min-width: 821px) { .work { padding-left: 32px; padding-right: 32px; } }
.panel, .kpi, .table-wrap { box-shadow: var(--shadow); border-color: var(--line); }
.panel { border-radius: 14px; padding: 18px 20px; }
.panel h2 { color: var(--ink); }
.kpi { border-radius: 14px; border-top-width: 0; border-left: 4px solid var(--line); }
.kpi.k-ok { border-left-color: var(--ok); } .kpi.k-warn { border-left-color: var(--brand-orange); } .kpi.k-bad { border-left-color: var(--bad); } .kpi.k-steel { border-left-color: var(--hivis); }
.kpi .v { color: var(--ink); }

/* Nút */
.btn { border-radius: 10px; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--hivis); }
.btn.primary { background: var(--hivis); border-color: var(--hivis); box-shadow: 0 2px 8px rgba(36, 61, 155, .25); }
.btn.primary:hover { background: var(--hivis-dark); }
.btn.danger { color: var(--bad); border-color: #efc9c4; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
input[type=search], input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=tel], input[type=password], select, textarea { border-radius: 10px; border-color: #d5dbe8; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(36, 61, 155, .25); border-color: var(--hivis); }

/* Bảng */
.table-wrap { border-radius: 14px; }
th { background: #f6f8fc; color: #4a5878; }
tbody tr:hover td { background: #fafbfe; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hivis-soft); }
td.go { color: var(--hivis); font-size: 20px; font-weight: 700; width: 24px; }
.c-name { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
tr.dim td { opacity: .6; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(184, 55, 44, .5); }
tr.cancelled td:last-child, tr.cancelled td:nth-child(5) { text-decoration: none; }
tr.guess td { background: #fffaf0; }
table.dense td, table.dense th { padding: 6px 8px; }
table.dense select, table.dense input[type=time] { padding: 5px 7px; font-size: 13px; }
select.act { padding: 5px 8px; font-size: 12.5px; }

/* Nhãn & thông báo */
.p-test { background: var(--test-soft); color: var(--test); }
.notice-info { background: var(--hivis-soft); color: var(--hivis-dark); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.notice-test { background: var(--test-soft); color: var(--test); border-radius: 10px; padding: 10px 14px; font-size: 14px; border: 1px dashed rgba(122, 61, 184, .4); }
.test-chk { display: flex; align-items: flex-start; gap: 10px; border-style: dashed; padding: 10px 12px; }
.test-chk input { margin-top: 3px; }

/* Thanh chọn kiểu nút liền (segmented) */
.seg { display: inline-flex; background: #e8ecf5; border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 7px 14px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.seg button[aria-selected="true"] { background: #fff; color: var(--hivis); box-shadow: 0 1px 4px rgba(17, 28, 58, .12); }
.seg .cnt { font-size: 11.5px; background: rgba(36, 61, 155, .1); color: var(--hivis); border-radius: 999px; padding: 0 7px; font-family: var(--font-mono); }
.tabs button[aria-selected="true"] { color: var(--hivis); border-bottom-color: var(--brand-orange); border-bottom-width: 3px; }

/* Chọn ngày học */
.sess-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.addone { gap: 10px; }
.addone .row-tools input { flex: 1 1 140px; }

/* Màn hình đăng nhập */
.login-wrap { min-height: 100vh; align-content: center; padding-block: 24px; max-width: none; background: linear-gradient(160deg, #eef1f9 0%, #f7f8fc 50%, #fff6e6 100%); }
.login { max-width: 1120px; width: 100%; margin: 0 auto; min-height: min(680px, calc(100vh - 48px)); border-radius: 24px; border: 0; box-shadow: 0 30px 80px rgba(17, 28, 58, .16); }
.hero { background: linear-gradient(180deg, #243d9b 0%, #243d9b 50%, #1b2f7e 100%); /* nửa trên trùng màu nền logo */ padding: 40px; align-content: space-between; }
.hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; border: 40px solid rgba(249, 165, 26, .14); pointer-events: none; }
.hero .tag { border-color: rgba(249, 165, 26, .7); color: #ffe2ad; background: rgba(255, 255, 255, .06); }
.hero-brand { width: min(420px, 100%); aspect-ratio: 1000 / 360; object-fit: cover; object-position: center 50%; margin: 8px 0 0 -6%; }
.hero h1 { font-size: clamp(24px, 2.8vw, 34px); max-width: 20ch; }
.hero .facts { border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 18px; }
.hero .facts b { color: var(--brand-orange); }
.signin { gap: 16px; }
.signin-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signin .logo { width: 118px; }
.signin .chip { font-family: var(--font-mono); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--hivis); background: var(--hivis-soft); padding: 5px 10px; border-radius: 999px; }
.signin h2 { font-size: 26px; color: var(--ink); }
@media (max-width: 860px) {
  .login-wrap { padding: 0; align-content: start; }
  .login { border-radius: 0; min-height: 100vh; box-shadow: none; grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 24px 20px; gap: 14px; }
  .hero .facts, .hero p { display: none; }
  .hero-brand { width: min(300px, 80%); }
  .signin { padding: 24px 20px 40px; }
}

/* Điểm danh tại cửa */
.modebar button[aria-pressed="true"] { background: var(--hivis); border-color: var(--hivis); color: #fff; }
.cam { background: radial-gradient(120% 90% at 50% 35%, #34509f, #111d48); }
#toast { background: #111c3a; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.modal { border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal textarea { font-family: var(--font-ui); font-size: 14px; }
.modal .field input, .modal .field select { width: 100%; }

/* Máy chiếu cho lớp học chung nhiều nhóm: mỗi nhóm một mã QR */
.pj-qrs { display: flex; gap: 3vw; flex-wrap: wrap; justify-content: center; }
.pj-qr-item { display: grid; gap: 1vh; justify-items: center; }
.pj-qr-label { font-weight: 800; font-size: clamp(18px, 2.2vw, 40px); color: #fff; background: #243d9b; padding: .2em .8em; border-radius: 999px; }
.pj-multi .pj-qr { width: min(46vh, 30vw); }
.pj-multi .pj-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 760px) { .pj-multi .pj-body { grid-template-columns: 1fr; } .pj-multi .pj-qr { width: min(80vw, 40vh); } }

/* Nhập lịch tuần: chọn nhiều nhóm cho một lớp chung */
.gpick { display: grid; grid-template-columns: repeat(3, auto); gap: 2px 8px; }
.gpick label { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gpick input { margin: 0; accent-color: var(--hivis); }
.gcourse { display: grid; gap: 4px; min-width: 200px; }
.gcourse-row { display: flex; align-items: center; gap: 6px; }
.gcourse-row b { font-size: 12px; color: var(--hivis); width: 22px; flex: none; }
.gcourse select { width: 100%; }

/* ================= Chọn nhiều dòng + thanh hành động ================= */
th.selcell, td.selcell { width: 44px; padding-left: 12px; padding-right: 4px; cursor: default; }
.selcell input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--hivis); cursor: pointer; vertical-align: middle; margin: 0; }
tr.picked td, tr.click.picked td { background: var(--hivis-soft); }
.selbar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #111c3a; color: #fff; border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: 0 12px 32px rgba(17, 28, 58, .3); }
.selbar[hidden], .btn[hidden] { display: none; }
.selbar .btn.danger-solid { background: #d9443a; border-color: #d9443a; color: #fff; }
.selbar .btn:not(.primary):not(.danger-solid) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); color: #fff; }
.selbar .btn.primary { background: var(--brand-orange); border-color: var(--brand-orange); color: #111c3a; box-shadow: none; }
.selbar .btn.primary:hover { background: #ffb73b; }
.filters select { min-width: 0; max-width: 100%; }
.chips { max-width: 100%; }
.ask-list { margin: 0; padding: 8px 12px 8px 34px; max-height: 220px; overflow: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; display: grid; gap: 2px; }

/* ================= Giao diện điện thoại (màn hình ≤ 820px) =================
   Thanh xanh trên cùng (logo + tên + đăng xuất), thanh chức năng cố định ở đáy như app điện thoại,
   chữ và nút to hơn, không để nội dung tràn ngang. */
.mtop, .nav .lbs { display: none; }
.work { grid-template-columns: minmax(0, 1fr); }
.grid > *, .panel > *, .work > * { min-width: 0; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }

@media (max-width: 820px) {
  body { font-size: 15px; }
  body::before { background: var(--hivis); }

  /* Thanh trên cùng */
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 25;
    background: var(--hivis); color: #fff; border-bottom: 3px solid var(--brand-orange); box-shadow: 0 4px 16px rgba(17, 28, 58, .15);
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); }
  /* Ảnh logo vuông có nhiều nền xanh: chỉ cắt lấy phần chữ SHS */
  .mtop-logo { display: block; width: 86px; height: 38px; overflow: hidden; flex: none; }
  .mtop-logo img { display: block; width: 152px; height: 152px; max-width: none; margin: -58px 0 0 -34px; }
  .mtop-who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
  .mtop-who b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop-who span { font-size: 11.5px; color: rgba(255, 255, 255, .72); }
  .mtop .mtop-out { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; min-height: 36px; flex: none; }

  /* Thanh chức năng ở đáy màn hình */
  .rail { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; z-index: 30; display: flex; flex-direction: row; gap: 0; overflow: visible;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(17, 28, 58, .08);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .rail .brand, .rail .sep, .rail .me, .rail .nav-logout { display: none !important; }
  .rail .nav { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; justify-content: center; padding: 8px 2px 7px; border-radius: 0;
    color: var(--muted); font-weight: 600; background: none; box-shadow: none; white-space: nowrap; min-height: 58px; }
  .rail .nav .ic { width: auto; font-size: 20px; line-height: 1; opacity: 1; }
  .rail .nav .lb { display: none; }
  .rail .nav .lbs { display: block; font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .rail .nav:hover { background: var(--raised); color: var(--hivis); }
  .rail .nav[aria-current="page"] { background: none; color: var(--hivis); box-shadow: none; font-weight: 800; }
  .rail .nav[aria-current="page"]::before { display: block; left: 22%; right: 22%; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; }
  .rail .nav[aria-current="page"] .ic { transform: scale(1.1); }

  /* Khung nội dung */
  .work { gap: 16px; padding-top: 16px; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .app.is-login .work { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 21px; line-height: 1.25; }
  h2 { font-size: 16px; line-height: 1.35; }
  .pagehead { flex-direction: column; align-items: stretch; gap: 10px; }
  .pagehead > .row-tools { width: 100%; }
  .pagehead > .row-tools > .btn { flex: 1 1 auto; }
  .panel { padding: 14px; border-radius: 14px; gap: 12px; }
  .panel-head { align-items: flex-start; }

  /* Nút và ô nhập: to, dễ bấm bằng ngón tay */
  .btn { min-height: 44px; padding: 10px 14px; justify-content: center; text-align: center; white-space: normal; line-height: 1.3; }
  .btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  input[type=search], input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=tel], input[type=password], select, textarea { font-size: 16px; min-height: 44px; }
  table.dense select, table.dense input[type=time], select.act { font-size: 14px; min-height: 36px; }
  .row-tools > input[type=search], .row-tools > input[type=text] { flex: 1 1 100%; }
  .row-tools > .btn.primary { flex: 1 1 100%; }

  /* Ô số liệu: 3 ô nằm một hàng cho gọn */
  .g4 { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; gap: 2px; border-radius: 12px; }
  .kpi .k { font-size: 10.5px; letter-spacing: .04em; }
  .kpi .v { font-size: 23px; }
  .kpi .v small { display: block; font-size: 12px; line-height: 1.3; }

  .g2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .seg button { flex: 1 0 auto; justify-content: center; padding: 9px 12px; }
  .tabs { scrollbar-width: none; }
  .tabs button { padding: 11px 12px; }

  /* Thanh hành động nằm ngay trên thanh chức năng ở đáy */
  .selbar { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); padding: 10px 12px; gap: 8px; }
  .selbar > b { flex: 1 1 100%; font-size: 14px; }
  .selbar > .grow { display: none; }
  .selbar .btn { flex: 1 1 auto; }
  .filters select { flex: 1 1 140px; }
  .filters .grow { display: none; }

  /* Bảng: vuốt ngang, chữ vừa phải */
  .table-wrap { border-radius: 12px; -webkit-overflow-scrolling: touch; }
  th, td { padding: 9px 10px; }
  table { font-size: 14px; }

  /* Điểm danh tại cửa */
  .modebar button { padding: 12px 4px; font-size: 14px; }
  .cam-msg { font-size: 17px; }
  .result .big { font-size: 17px; }

  /* Hộp thoại trượt lên từ đáy màn hình */
  .overlay { place-items: end center; padding: 0; }
  .modal { width: 100% !important; max-width: none; max-height: calc(100vh - 24px); border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .app.is-login ~ #toast { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

  /* Trang học viên */
  .stu-head { flex-direction: row; align-items: center; gap: 12px; }
  .stu-head .who { flex: 1; align-items: center; }
  .stu-head .who img { width: 56px !important; }
  .stu-head > .btn { flex: none; min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .stu-act { display: grid; gap: 8px; }
  .stu-act > .btn { width: 100%; font-size: 16px; min-height: 52px; }
  .stu-act > .pill { justify-content: center; padding: 8px 12px; font-size: 13px; white-space: normal; border-radius: 10px; }
}
@media (max-width: 360px) { .rail .nav .lbs { font-size: 10px; } .kpi .v { font-size: 20px; } }
@media print { .mtop { display: none !important; } }
/* Trang học viên (điện thoại là chính) */
.app.is-login .work:has(> .stu) { padding: 0; max-width: none; gap: 0; }
.stu { width: 100%; min-height: 100vh; background: var(--bg); }
.stu-top { background: #1f3c94; color: #fff; padding: 12px 16px 22px; border-bottom: 4px solid var(--brand-orange); }
.stu-bar, .stu-me, .stu-body { max-width: 560px; margin: 0 auto; }
.stu-bar { display: flex; align-items: center; justify-content: space-between; }
.stu-logo { display: block; width: 86px; height: 38px; overflow: hidden; }
.stu-logo img { display: block; width: 152px; height: 152px; max-width: none; margin: -58px 0 0 -34px; }
.stu-out { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.stu-me { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.stu-av { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #1f3c94; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.stu-hi { font-size: 20px; font-weight: 700; line-height: 1.25; }
.stu-meta { font-size: 13px; opacity: .85; margin-top: 2px; }
.stu-body { display: grid; gap: 16px; padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px)); }
.stu-course { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 14px; }
.stu-c-head h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.stu-c-head span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.stu-today { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; background: var(--raised); }
.stu-today.calm { gap: 4px; }
.stu-t-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.stu-t-main { font-size: 15px; }
.stu-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.stu-chip { text-align: center; padding: 9px 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stu-chip.on { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.stu-big { width: 100%; min-height: 58px; border: 0; border-radius: 14px; background: #ef7d1a; color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; padding: 10px 14px; }
.stu-big:active { transform: scale(.98); }
.stu-wait { display: grid; gap: 3px; text-align: center; padding: 14px; border-radius: 14px; border: 2px dashed #f0b878; background: #fff7ee; color: #9a5a0f; }
.stu-wait b { font-size: 16px; }
.stu-wait span { font-size: 13px; opacity: .85; }
.stu-done { text-align: center; padding: 14px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 16px; }
.stu-prog { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--ink); }
.stu-ring { flex: none; line-height: 0; }
.stu-p-big { font-size: 26px; font-weight: 800; font-family: var(--font-mono); }
.stu-p-big small { font-size: 14px; color: var(--muted); font-family: var(--font-ui); font-weight: 600; }
.stu-p-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stu-l-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: -6px; }
.stu-list { display: grid; gap: 6px; }
.stu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--raised); border: 1px solid transparent; }
.stu-row.now { border-color: #ef7d1a; background: var(--surface); }
.stu-row b { display: block; font-size: 15px; }
.stu-row-t { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.stu-row .pill { flex: none; }
.stu-note { font-size: 13px; color: var(--muted); margin: 0 4px; line-height: 1.6; }
/* Lịch dạy theo giảng viên (Tổng quan) */
.tp-day { display: grid; gap: 6px; }
.tp-date { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 4px; }
.tp-date.today { color: var(--hivis); }
.tp-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.tp-row.dim { opacity: .6; }
.tp-gv { margin-left: 8px; vertical-align: 1px; }
@media (max-width: 820px) { .tp-row { grid-template-columns: minmax(0, 1fr) auto; } .tp-row > .mono { grid-column: 1 / -1; } }

/* Trang học viên: màu trạng thái, thông báo thành công, chân trang, chữ to hơn */
.stu { font-size: 16px; }
.stu-t-main { font-size: 16px; }
.stu-chip { font-size: 14px; }
.stu-row-t, .stu-note, .stu-meta, .stu-c-head span, .stu-p-sub { font-size: 14px; }
.stu-today.is-wait { background: var(--raised); }
.stu-today.is-go { border: 2px solid #ef7d1a; background: #fff7ee; }
.stu-today.is-done { border: 2px solid var(--ok); background: var(--ok-soft); }
.stu-t-note { font-size: 13px; color: var(--muted); }
.stu-pass { text-align: center; padding: 12px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.stu-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stu-legend .stu-t-note { flex-basis: 100%; }
.stu-face-ok { font-size: 14px; color: var(--ok); font-weight: 600; padding: 0 4px; }
.stu-tips { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.stu-foot { display: grid; gap: 6px; justify-items: center; text-align: center; font-size: 13px; color: var(--muted); padding: 4px 4px 0; }
.stu-link { background: none; border: 0; color: var(--hivis); font: inherit; font-size: 15px; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 6px; }
.res-modal { display: grid; gap: 10px; justify-items: center; text-align: center; }
.res-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #fff; }
.res-ok .res-icon { background: var(--ok); } .res-bad .res-icon { background: var(--bad); }
.res-title { font-size: 22px; font-weight: 800; }
.res-ok .res-title { color: var(--ok); } .res-bad .res-title { color: var(--bad); }
.res-photo { width: 160px; height: 120px; object-fit: cover; border-radius: 12px; }
.res-text { font-size: 16px; line-height: 1.5; }
.res-time { font-size: 13px; color: var(--muted); }

/* ---------- Trang học viên kiểu ứng dụng (09/11/2026) ---------- */
.sico { display: inline-flex; line-height: 0; flex: none; }
.stu { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.stu-top { padding: 12px 16px 52px; border-bottom: 0; }
.stu-bar, .stu-me, .stu-body { max-width: 560px; }
.stu-out { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.stu-av { overflow: hidden; border: 2px solid rgba(255,255,255,.6); }
.stu-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stu-av.big { width: 64px; height: 64px; font-size: 22px; background: #e7eefb; border: 0; }
.stu-me .stu-meta:first-child { opacity: .75; margin: 0 0 2px; }
.stu-body { margin-top: -38px; position: relative; padding-top: 0; }
.stu-pane { display: none; gap: 14px; }
.stu-pane.on { display: grid; }
.stu-p-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 4px -2px; }
.stu-course { background: none; border: 0; padding: 0; gap: 14px; }
.stu-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 2px 10px rgba(20,36,92,.07); }
.stu-card-t { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stu-hero { background: var(--surface); border: 2px solid #b4b2a9; border-radius: 18px; padding: 16px; display: grid; gap: 14px; box-shadow: 0 6px 20px rgba(20,36,92,.12); }
.stu-hero.is-go { border-color: #ef7d1a; background: var(--surface); }
.stu-hero.is-done { border-color: #639922; }
.stu-h-top { display: flex; gap: 14px; align-items: center; }
.stu-h-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--raised); color: #6b6a64; }
.is-go .stu-h-ico, .stu-h-ico.go { background: #fff1e3; color: #d4650a; }
.is-done .stu-h-ico { background: #eaf3de; color: #3b6d11; }
.stu-h-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.stu-h-clock { font-size: 14px; color: var(--muted); margin-top: 2px; }
.is-go .stu-h-clock { color: #b35708; font-weight: 600; }
.stu-chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.stu-chip span { overflow: hidden; text-overflow: ellipsis; }
.stu-big { display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 4px 12px rgba(239,125,26,.3); }
.stu-wait { border-color: #c9c7be; background: var(--raised); color: var(--muted); }
.stu-prog { border: 0; padding: 0; }
.stu-ring { color: var(--ink); }
.stu-seg { display: flex; gap: 3px; }
.stu-seg span { flex: 1; height: 10px; border-radius: 3px; background: #dcdad2; }
.stu-seg .sg-ok { background: #639922; } .stu-seg .sg-warn { background: #ef9f27; } .stu-seg .sg-bad { background: #d0453a; }
.stu-seg .now { outline: 2px solid #1f3c94; outline-offset: 1px; }
.stu-pass { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stu-tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 4px; }
.stu-tl::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.stu-tl li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 12px; }
.stu-tl li::before { content: ""; position: absolute; left: -21px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #dcdad2; border: 2px solid var(--surface); }
.stu-tl li.tl-ok::before { background: #639922; } .stu-tl li.tl-warn::before { background: #ef9f27; } .stu-tl li.tl-bad::before { background: #d0453a; }
.stu-tl li.now { background: #fff7ee; } .stu-tl li.now::before { box-shadow: 0 0 0 3px rgba(239,125,26,.35); }
.stu-tl b { display: block; font-size: 15px; }
.stu-tl .pill { flex: none; }
.stu-prof { display: flex; align-items: center; gap: 14px; }
.stu-kv { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.stu-kv b { margin-left: auto; color: var(--ink); font-weight: 600; }
.stu-menu { padding: 6px; gap: 0; }
.stu-menu button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-radius: 12px; padding: 13px 12px; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; text-align: left; }
.stu-menu button:hover { background: var(--raised); }
.stu-menu button + button { border-top: 1px solid var(--line); border-radius: 0; }
.stu-note .sico { vertical-align: -3px; }
.stu-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -2px 12px rgba(20,36,92,.06); }
.stu-nav button { flex: 1; max-width: 180px; display: grid; justify-items: center; gap: 2px; background: none; border: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 4px; border-radius: 12px; cursor: pointer; }
.stu-nav button.on { color: #1f3c94; }
.stu-nav button.on .sico { background: #e7eefb; border-radius: 10px; padding: 2px 14px; }
/* Máy tính: bỏ thanh dưới, chia 2 cột Hôm nay | Lịch học, Hồ sơ ở dưới */
@media (min-width: 900px) {
  .stu { padding-bottom: 28px; }
  .stu-bar, .stu-me, .stu-body { max-width: 1080px; }
  .stu-body { grid-template-columns: 1fr 1fr; align-items: start; }
  .stu-pane, .stu-pane.on { display: grid; }
  .stu-pane[data-tab="me"] { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: start; }
  .stu-pane[data-tab="me"] > .stu-p-title, .stu-pane[data-tab="me"] > .stu-note, .stu-pane[data-tab="me"] > .stu-foot { grid-column: 1 / -1; }
  .stu-pane[data-tab="me"] > .stu-p-title { color: var(--ink); margin-top: 8px; }
  .stu-pane[data-tab="home"] > .stu-pre { order: 2; }
  .stu-nav { display: none; }
}
.stu-c-name { font-size: 14px; font-weight: 700; color: var(--muted); margin: 4px 4px -6px; }
.stu-course:first-child > .stu-c-name { color: #fff; opacity: .85; }

/* ---------- Chỉnh sau lần xem lại giao diện (10/11/2026) ---------- */
/* Ô số điện thoại và mật khẩu cùng kiểu với các ô khác */
input[type=tel], input[type=password] { border: 1px solid #d5dbe8; background: var(--surface); border-radius: 10px; padding: 8px 11px; min-width: 0; }
td input[type=tel] { width: 100%; min-width: 130px; padding: 6px 9px; }
/* Bảng khóa học: tên khóa và lịch được xuống dòng, không tràn ngang */
.table-wrap td:has(> .c-name), .table-wrap td:has(> .c-sub) { white-space: normal; min-width: 200px; }
/* Màn Điểm danh: nút chính to, trên điện thoại đưa phần mở điểm danh lên trên */
.btn.door-main { min-height: 48px; font-size: 16px; padding: 0 20px; }
@media (max-width: 900px) {
  .g-door > .grid { display: contents; }
  .g-door .door-mode { order: -2; }
  .g-door .door-first { order: -1; }
}
.g-door { align-items: start; }
.g-door > .grid { align-content: start; }

/* ---------- Tổng quan mới + phân công giảng viên (11/11/2026) ---------- */
.ov-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ov-k .c { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 6px; box-shadow: 0 1px 2px rgba(21, 33, 59, .04); }
.ov-k .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.ov-k .v { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.ov-k .v small { font-size: 15px; color: var(--muted); font-weight: 500; }
.ov-k .s { font-size: 12.5px; color: var(--muted); }
.ov-k .warn .v { color: var(--warn); }
.ov-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ov-s { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 12px; }
.ov-s.live { border-color: var(--hivis); box-shadow: inset 4px 0 0 var(--hivis); }
.ov-s .top { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.ov-s .top .grow { flex: 1 1 160px; min-width: 0; }
.ov-s .tm { font-family: var(--font-mono); font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--ink); }
.ov-s .nm { font-weight: 700; font-size: 15.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ov-m { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ov-m .l { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.ov-m .l b { color: var(--ink); font-family: var(--font-mono); white-space: nowrap; }
.ov-m .bar { height: 6px; border-radius: 99px; background: #e9edf5; overflow: hidden; }
.ov-m .bar i { display: block; height: 100%; border-radius: 99px; background: var(--hivis); }
.ov-t { display: grid; }
.ov-t .r { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.ov-t .r:first-child { border-top: 0; padding-top: 0; }
.ov-t .n { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--warn-soft); color: var(--warn); }
.ov-t .n.b { background: var(--hivis-soft); color: var(--hivis); }
.ov-t .t { font-size: 14px; font-weight: 600; } .ov-t .d { font-size: 12.5px; color: var(--muted); }
.ov-c .r { display: grid; grid-template-columns: 64px 96px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; align-items: baseline; cursor: pointer; }
.ov-c .r:first-child { border-top: 0; padding-top: 0; }
.ov-c .dt { font-weight: 600; color: var(--ink); } .ov-c .hr { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.ov-c .gv { font-size: 12.5px; color: var(--muted); }
.assign-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
@media (max-width: 1100px) { .ov-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .ov-k { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ov-k .v { font-size: 24px; } .ov-m { gap: 10px; } .ov-m .l { flex-direction: column; gap: 0; } }

/* ---------- Trang đăng nhập mới (11/11/2026) ---------- */
.lg { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; max-width: none; padding: 0; }
.lg-side { background: #243d9b; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.lg-side::after { content: ""; position: absolute; right: -140px; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .05); pointer-events: none; }
.lg-side::before { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--brand-orange); }
.lg-side > * { position: relative; z-index: 1; }
.lg-logo { width: 210px; aspect-ratio: 1000 / 360; object-fit: cover; margin-left: -14px; display: block; }
.lg-kick { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: #ffd58a; font-weight: 600; margin-top: 4px; }
.lg-side h1 { font-size: clamp(26px, 2.7vw, 34px); line-height: 1.2; color: #fff; max-width: 17ch; margin: 0 0 26px; font-weight: 700; }
.lg-pts { display: grid; gap: 14px; max-width: 420px; }
.lg-pt { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: rgba(255, 255, 255, .92); }
.lg-pt > span:first-child { flex: none; margin-top: 2px; color: var(--brand-orange); line-height: 0; }
.lg-org { font-size: 13px; color: rgba(255, 255, 255, .75); line-height: 1.6; }
.lg-org b { display: block; color: #fff; font-size: 14px; }
.lg-main { display: grid; place-items: center; padding: 40px 24px; background: #f6f7fb; }
.lg-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 32px; display: grid; gap: 18px; box-shadow: 0 18px 50px rgba(17, 28, 58, .08); }
.lg-card h2 { font-size: 25px; margin: 0; color: var(--ink); }
.lg-card .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.lg-seg { display: grid; grid-template-columns: 1fr 1fr; background: #eef1f8; border-radius: 11px; padding: 4px; gap: 4px; }
.lg-seg button { border: 0; background: transparent; border-radius: 8px; padding: 10px 6px; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.lg-seg button[aria-selected="true"] { background: #fff; color: #243d9b; box-shadow: 0 1px 3px rgba(17, 28, 58, .14); }
.lg-btn { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 50px; padding: 0 14px; border-radius: 11px; font: inherit; font-weight: 600; font-size: 15.5px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
.lg-btn:hover { border-color: #243d9b; }
.lg-btn.pri { background: #243d9b; border-color: #243d9b; color: #fff; }
.lg-btn:disabled { opacity: .6; cursor: default; }
.lg-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lg-new { border: 1px dashed #c9d1e6; border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.lg-new b { display: block; font-size: 14.5px; color: var(--ink); } .lg-new span { font-size: 12.5px; color: var(--muted); }
.lg-new button { flex: none; border: 1px solid #243d9b; background: #fff; color: #243d9b; border-radius: 9px; padding: 9px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.lg-foot { font-size: 12.5px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: 14px; }
.lg-note { font-size: 13.5px; color: var(--muted); }
@media (max-width: 820px) {
  .lg { grid-template-columns: minmax(0, 1fr); background: #f6f7fb; align-content: start; }
  .lg-side { padding: 22px 20px 54px; }
  .lg-mid, .lg-org, .lg-side::after, .lg-side::before { display: none; }
  .lg-kick { margin-top: 8px; font-size: 11.5px; }
  .lg-logo { width: 170px; margin-left: -12px; }
  .lg-main { padding: 0 14px 24px; margin-top: -34px; place-items: start center; background: transparent; position: relative; z-index: 2; }
  .lg-card { padding: 24px 20px; border-radius: 16px; }
  .lg-card h2 { font-size: 22px; }
}

/* ---- Quét mặt toàn màn hình (16/11/2026) và thẻ kết quả trượt lên ---- */
/* Viết lại 17/11/2026 cho chắc trên điện thoại (thử thật thấy khung và chữ hướng dẫn không hiện rõ):
   - không dựa vào chiều cao 100% trong lưới, inset, aspect-ratio, hay bóng đổ cực lớn;
   - vùng tối quanh khung mặt vẽ bằng nền chuyển màu hình bầu dục; chữ có nền tối riêng và có viền bóng;
   - thứ tự lớp ghi rõ: hình (0) < vùng tối (1) < khung (2) < chữ, nút, thẻ kết quả (3). */
.overlay.fc, .overlay.fr { display: block; top: 0; left: 0; right: 0; bottom: 0; padding: 0; background: #0d1a34; }
.fc-stage { --fw: 62vw; position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: 560px; overflow: hidden; background: #000; }
@media (min-width: 452px) { .fc-stage { --fw: 280px; } }
@media (max-height: 640px) { .fc-stage { --fw: 36vh; } }
.fc-stage video, .fc-stage > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 0; }
.fc-stage::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse calc(var(--fw) / 2) calc(var(--fw) * 2 / 3) at 50% 42%, rgba(13, 26, 52, 0) 0, rgba(13, 26, 52, 0) 99%, rgba(13, 26, 52, .78) 100%); }
.fc-ring { position: absolute; z-index: 2; left: 50%; top: 42%; width: var(--fw); height: calc(var(--fw) * 4 / 3); transform: translate(-50%, -50%); box-sizing: border-box; border: 4px dashed #fff; border-radius: 50%; pointer-events: none; transition: border-color .2s; }
.fc-ring.busy { border-style: solid; border-color: #f7a51c; }
.fc-ring.ok { border-style: solid; border-color: #3ddc84; }
.fc-ring.bad { border-style: solid; border-color: #ff6b5e; }
.fc-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: 14px 16px 26px; padding-top: max(14px, env(safe-area-inset-top)); color: #fff; background: linear-gradient(rgba(13, 26, 52, .92), rgba(13, 26, 52, 0)); }
.fc-top h2 { margin: 0; font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.fc-bot { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 44px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); display: grid; gap: 10px; text-align: center; color: #fff; background: linear-gradient(rgba(13, 26, 52, 0), rgba(13, 26, 52, .94) 42px); }
.fc-bot .cam-msg { color: #fff; font-size: 20px; font-weight: 700; line-height: 1.35; min-height: 2.7em; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.fc-hint { font-size: 14px; color: #dbe5f6; }
.fc-bot .row-tools { justify-content: center; }
.fc-bot .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; min-height: 46px; padding: 0 22px; }
.fr-sheet { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; padding: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); display: grid; gap: 12px; box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); animation: fr-up .25s ease-out; }
/* Chỉ trượt một đoạn ngắn: nếu máy không chạy hiệu ứng thì thẻ vẫn nằm trong màn hình */
@keyframes fr-up { from { transform: translateY(36px); } }
.fr-head { display: flex; gap: 12px; align-items: center; }
.fr-icon { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.fr-ok .fr-icon { background: var(--ok-soft); color: var(--ok); } .fr-bad .fr-icon { background: var(--bad-soft); color: var(--bad); }
.fr-name { font-size: 17px; font-weight: 700; } .fr-sub { font-size: 13px; color: var(--muted); }
.fr-text { font-size: 15.5px; line-height: 1.5; }
.fr-tools { display: grid; gap: 8px; }
.fr-tools .btn { width: 100%; min-height: 48px; justify-content: center; }
.fr-tools .btn.fr-done { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-reduced-motion: reduce) { .fr-sheet { animation: none; } }

/* ---- Thanh báo có bản mới (16/11/2026) ---- */
.upd-bar { position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 24px); padding: 10px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 600 14px var(--font-ui); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

/* ---- Danh sách khóa dạng dòng gọn (17/11/2026): tên công ty làm tiêu đề, nhóm và loại là nhãn ---- */
.c-name { font-size: 15.5px; }
.c-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---- Thanh nhắc khi mở app trong Zalo, Facebook… (18/11/2026) ---- */
.inapp-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #fdf0d3; color: #6b4300; font-size: 14px; line-height: 1.45; border-bottom: 2px solid #f7a51c; }
.inapp-bar > div { flex: 1; }
.inapp-bar button { flex: none; border: 1px solid #c98a12; background: #fff; color: #6b4300; font: 600 13px var(--font-ui); padding: 8px 12px; border-radius: 8px; }

/* ---- Trang Điểm danh gọn (18/11/2026) ---- */
.door-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.door-title { font-size: 20px; font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.door-turn { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.door-turn b { font-size: 18px; }
.door-open { display: grid; gap: 8px; }
.btn.door-main { width: 100%; justify-content: center; min-height: 54px; font-size: 17px; }
.btn.door-on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.door-more { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 14px; }
.door-more > summary { cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--muted); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.door-more > summary::-webkit-details-marker { display: none; }
.door-more > summary::after { content: "▾"; }
.door-more[open] > summary::after { content: "▴"; }
.door-more[open] { padding-bottom: 14px; }
.door-more .btn { width: 100%; justify-content: center; min-height: 44px; }
.door-help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
@media (max-width: 900px) { .g-door .door-turn { order: -3; } }
.modebar[hidden] { display: none; }

/* ---- Lọc nhanh danh sách khóa: Hôm nay / Ngày mai / 7 ngày tới / Chưa phân công (18/11) ---- */
.day-chips { gap: 6px; flex-wrap: wrap; }
.day-chips .chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.day-chips .chip:hover { border-color: var(--steel); }
.day-chips .chip.on { background: var(--hivis); border-color: var(--hivis); color: var(--hivis-ink); }
.day-chips .chip.warn { color: var(--warn); border-color: var(--warn-soft); background: var(--warn-soft); }
.day-chips .chip.warn.on { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ===== 20/11/2026: link website SHS ===== */
.web-ad { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; border-radius: 14px; padding: 11px 14px; background: linear-gradient(135deg, #eef3ff, #fff4e8); border: 1px solid #d9e2f5; }
.web-ad img { width: 44px; height: 44px; border-radius: 10px; background: #fff; padding: 6px; object-fit: contain; flex: none; border: 1px solid #e3e8f1; }
.web-ad b { display: block; font-size: 14.5px; color: #1f3c94; }
.web-ad small { display: block; font-size: 12.5px; color: #5a6a86; line-height: 1.35; }
.web-ad .go { margin-left: auto; color: #f07c1c; font-weight: 800; font-size: 22px; }
.web-call { display: flex; gap: 8px; }
.web-call a { flex: 1; text-align: center; padding: 11px 6px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.web-call .a1 { background: #f07c1c; color: #fff; } .web-call .a2 { background: var(--surface); color: #1f3c94; border: 1px solid #b9c3d6; }
.web-card { display: grid; gap: 10px; }
.lg-foot a { color: #1f3c94; font-weight: 700; text-decoration: none; }

/* ===== Điểm danh thành công: tick bung ra, tự đóng ===== */
.fr-burst { position: absolute; z-index: 2; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.fr-burst i { position: absolute; left: 0; top: 0; width: 120px; height: 120px; margin: -60px; border-radius: 50%; border: 3px solid rgba(61, 220, 132, .8); animation: fr-wave 1.2s ease-out forwards; }
.fr-burst i:nth-child(2) { animation-delay: .15s; } .fr-burst i:nth-child(3) { animation-delay: .3s; }
.fr-burst b { position: absolute; width: 112px; height: 112px; margin: -56px; border-radius: 50%; display: grid; place-items: center; font-size: 62px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #4fe08f, #1d9a57); box-shadow: 0 0 0 12px rgba(79, 224, 143, .25), 0 12px 30px rgba(0, 0, 0, .35); animation: fr-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes fr-pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fr-wave { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.fr-auto { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: -4px; }
.fr-auto:empty { display: none; }
.fr-sheet .web-ad { padding: 9px 12px; }
.res-ok .res-icon { animation: fr-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@media (prefers-reduced-motion: reduce) { .fr-burst i, .fr-burst b, .res-ok .res-icon { animation: none; } }

/* ===== Thẻ hoàn thành khóa học ===== */
.stu-done-btn { width: 100%; min-height: 46px; font-weight: 700; color: #1f3c94; border-color: #f7a51c; background: #fff8ec; }
.overlay.dc { background: rgba(13, 21, 51, .9); overflow: hidden; align-items: center; justify-content: center; padding: 16px; }
.dc-box { position: relative; z-index: 2; width: min(430px, 100%); display: grid; gap: 14px; }
.dc-box img { width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: fr-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.dc-btns { display: flex; gap: 10px; } .dc-btns .btn { flex: 1; min-height: 50px; font-size: 16px; font-weight: 700; }
.dc-btns .btn.primary { background: #f07c1c; border-color: #f07c1c; }
.dc-cf { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; z-index: 1; animation: dc-fall 3s linear forwards; }
@keyframes dc-fall { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(105vh) rotate(540deg); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .dc-cf { display: none; } }

/* ===== Màn hình chiếu lớp ===== */
.pc { position: fixed; inset: 0; z-index: 900; overflow: auto; color: #fff; font-size: clamp(14px, 1.4vw, 24px);
  background: radial-gradient(circle at 80% 0%, #2c4fb8 0, #1a2f7a 45%, #121f55 100%); display: grid; grid-template-rows: auto 1fr auto; }
.pc-top { display: flex; align-items: center; justify-content: space-between; padding: 2.5vh 3.5vw 0; }
.pc-logo { background: #fff; border-radius: 12px; padding: .5em .9em; line-height: 0; } .pc-logo img { height: clamp(26px, 3vw, 52px); }
.pc-clock { font-size: clamp(30px, 3.8vw, 72px); font-weight: 800; text-align: right; line-height: 1.05; } .pc-clock small { display: block; font-size: clamp(12px, 1.1vw, 20px); font-weight: 500; opacity: .75; }
.pc-wrap { display: grid; grid-template-columns: auto 1fr; gap: 3.5vw; padding: 2vh 3.5vw; align-items: center; }
.pc-qrbox { background: #fff; border-radius: 28px; padding: 2.4vh 2vw; text-align: center; color: #15213b; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.pc-lu { display: inline-block; background: #f07c1c; color: #fff; font-weight: 800; font-size: clamp(15px, 1.5vw, 28px); padding: .3em 1.1em; border-radius: 30px; margin-bottom: 1.4vh; }
.pc-qr { width: min(56vh, 36vw); aspect-ratio: 1; margin: 0 auto; line-height: 0; } .pc-qr svg { width: 100%; height: 100%; }
.pc-qrbox p { font-size: clamp(14px, 1.3vw, 24px); font-weight: 700; margin: 1.2vh 0 0; } .pc-qrbox p span { display: block; color: #5a6a86; font-weight: 500; font-size: .8em; }
.pc-info h1 { margin: 0; font-size: clamp(24px, 3vw, 58px); line-height: 1.2; color: #fff; }
.pc-sub { font-size: clamp(15px, 1.5vw, 28px); opacity: .85; margin-top: .4em; }
.pc-count { margin-top: 3vh; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); border-radius: 22px; padding: 2.2vh 2vw; }
.pc-big { line-height: 1; } .pc-n { font-size: clamp(44px, 5.4vw, 110px); font-weight: 800; } .pc-big small { font-size: clamp(18px, 2.2vw, 42px); opacity: .7; font-weight: 600; }
.pc-t { opacity: .85; margin-top: .3em; }
.pc-bar { height: 1.6vh; min-height: 10px; background: rgba(255, 255, 255, .15); border-radius: 10px; margin-top: 1.6vh; overflow: hidden; }
.pc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f7a51c, #f07c1c); border-radius: 10px; transition: width .6s; }
.pc-rt { margin-top: 2.4vh; opacity: .8; font-size: .9em; }
.pc-names { display: flex; flex-wrap: wrap; gap: .6em; margin-top: 1vh; }
.pc-nm { display: inline-flex; align-items: center; gap: .5em; background: rgba(255, 255, 255, .1); padding: .35em .9em .35em .35em; border-radius: 30px; font-weight: 600; }
.pc-nm b { width: 2em; height: 2em; border-radius: 50%; background: #fff; color: #1f3c94; display: grid; place-items: center; font-size: .75em; }
.pc-nm.new { background: #1d7a49; animation: fr-pop .45s both; }
.pc-nm.new::after { content: "vừa xong"; font-size: .75em; opacity: .8; font-weight: 500; }
.pc-empty { opacity: .7; }
.pc-steps { margin: 3vh 0 0; padding-left: 1.2em; display: grid; gap: 1.4vh; font-size: clamp(16px, 1.8vw, 32px); font-weight: 600; }
.pc-foot { display: flex; justify-content: space-between; gap: 12px; padding: 1.4vh max(3.5vw, 200px) 2.2vh 3.5vw; font-size: clamp(12px, 1vw, 18px); opacity: .7; }
.pc-close { position: fixed; right: 16px; bottom: 16px; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
@media (max-width: 760px) { .pc-wrap { grid-template-columns: 1fr; } .pc-qr { width: min(80vw, 50vh); } .pc-foot { flex-direction: column; padding-bottom: 70px; } }

/* ===== Thống kê trang Tổng quan ===== */
.st { display: grid; gap: 14px; margin-top: 18px; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-head h2 { margin: 0; }
.st-seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.st-seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.st-seg button.on { background: #1f3c94; color: #fff; }
.st-body { display: grid; gap: 14px; }
.st-ks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.st-k { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.st-k .l { font-size: 13px; color: var(--muted); font-weight: 600; } .st-k .v { font-size: 32px; font-weight: 800; margin-top: 2px; }
.st-k .s { font-size: 12.5px; color: var(--muted); } .st-k .s.good { color: #1d7a49; font-weight: 600; } .st-k .s.bad { color: #b8372c; font-weight: 600; }
.st-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; } .st-2.eq { grid-template-columns: 1fr 1fr; }
.st-t { font-weight: 700; font-size: 15px; } .st-t small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.st-svg svg { display: block; color: var(--ink); }
.st-donut { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; color: var(--ink); }
.st-lg { display: grid; gap: 10px; font-size: 14px; } .st-lg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.st-tb { width: 100%; border-collapse: collapse; font-size: 13.5px; } .st-tb td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.st-tb td.num { text-align: right; font-weight: 700; width: 60px; }
.st-mini { height: 6px; background: var(--line); border-radius: 4px; margin-top: 5px; } .st-mini i { display: block; height: 100%; border-radius: 4px; }
@media (max-width: 900px) { .st-ks { grid-template-columns: 1fr 1fr; } .st-2, .st-2.eq { grid-template-columns: 1fr; } }

/* ===== Màn hình mở đầu (app đã cài ra màn hình chính) ===== */
#splash { display: none; }
@media (display-mode: standalone) {
  #splash { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff;
    background: radial-gradient(circle at 50% 35%, #2c4fb8, #1a2f7a 55%, #121f55); transition: opacity .4s; }
}
#splash.out { opacity: 0; pointer-events: none; }
.sp-logo { background: #fff; border-radius: 22px; padding: 16px 24px; line-height: 0; } .sp-logo img { height: 52px; }
#splash b { margin-top: 24px; font-size: 28px; font-weight: 800; letter-spacing: 1px; } #splash small { margin-top: 4px; opacity: .8; font-size: 15px; }
.sp-dots { display: flex; gap: 8px; margin-top: 36px; } .sp-dots i { width: 10px; height: 10px; border-radius: 50%; background: #f7a51c; animation: sp-b 1s infinite; }
.sp-dots i:nth-child(2) { animation-delay: .15s; } .sp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-b { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
#splash em { position: absolute; bottom: max(32px, env(safe-area-inset-bottom)); font-style: normal; font-size: 12px; opacity: .6; left: 0; right: 0; }
