@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/be-vietnam-pro-400-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/be-vietnam-pro-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/be-vietnam-pro-500-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/be-vietnam-pro-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/be-vietnam-pro-600-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/be-vietnam-pro-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e3e6eb;
  --primary: #25335a;
  --primary-ink: #ffffff;
  --primary-soft: #eceff5;
  --ok: #1f8a63;
  --ok-soft: #e6f2ed;
  --warn: #a8630b;
  --warn-soft: #fbf0dc;
  --bad: #c73a3a;
  --bad-soft: #fbeaea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .06);
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117; --card: #161b24; --ink: #e6e9ef; --muted: #8d97a8; --line: #262d3a;
    --primary: #9db0d8; --primary-ink: #0e1117; --primary-soft: #1e2635;
    --ok: #4cb08c; --ok-soft: #12261f; --warn: #d9a23a; --warn-soft: #2a2312;
    --bad: #e26a6a; --bad-soft: #2d1819;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, b, strong { font-weight: 600; }
a { color: var(--primary); }
[hidden] { display: none !important; }

#app { max-width: 1180px; margin: 0 auto; min-height: 100dvh; }
.screen { display: flex; flex-direction: column; min-height: 100dvh; }
.page { padding: 14px 16px calc(var(--nav-h) + var(--safe-b) + 28px); display: grid; gap: 14px; align-content: start; flex: 1; width: 100%; max-width: 760px; margin: 0 auto; }
.page.no-nav { padding-bottom: calc(96px + var(--safe-b)); }

/* ── Thanh trên ── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 12px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); min-height: 56px;
}
.topbar h1 { font-size: 15.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; font-size: 20px;
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { background: var(--line); }
.savestate { font-size: 11px; color: var(--muted); white-space: nowrap; }
.savestate.err { color: var(--bad); font-weight: 500; }

/* ── Nav dưới ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabbar-in { display: flex; width: 100%; max-width: 760px; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 500;
}
.tab .ico { font-size: 22px; line-height: 1; }
.tab.on { color: var(--primary); }

/* ── Thẻ, nút, ô nhập ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-h h2 { font-size: 13.5px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.sep { height: 1px; background: var(--line); border: 0; margin: 2px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 500; text-decoration: none; color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: 11.5px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-size: 16px; outline: none;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.hint { font-size: 11px; color: var(--muted); }
.err-text { color: var(--bad); font-size: 12.5px; font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-weight: 500; font-size: 13.5px; flex: none; white-space: nowrap;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.chip .dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 34px; border-radius: 9px; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.seg button.on { background: var(--primary); color: var(--primary-ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.pri { background: var(--primary-soft); color: var(--primary); }

/* ── Điểm ── */
.score { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score.good { color: var(--ok); } .score.ok { color: var(--warn); } .score.bad { color: var(--bad); }
.hero {
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "big a" "big b" "bar bar"; column-gap: 14px; row-gap: 1px; align-items: center;
}
.hero .big { grid-area: big; font-size: 29px; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero .big small { font-size: 13.5px; font-weight: 400; color: var(--muted); }
.hero .cap { font-size: 11px; color: var(--muted); min-width: 0; }
.hero .cap:first-child { grid-area: a; align-self: end; }
.hero .cap:last-child { grid-area: b; align-self: start; color: var(--ink); }
.hero .bar { grid-area: bar; height: 4px; margin-top: 8px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .3s; }
.bar.good > i { background: var(--ok); } .bar.ok > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.metric { display: grid; gap: 4px; }
.metric .top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 500; }

/* ── Danh sách ── */
.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 0; width: 100%; text-align: left;
}
.item:active { transform: scale(.99); }
.item .t { font-weight: 600; }
.item .ico-box { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.item .right { text-align: right; flex: none; }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 11.5px; display: grid; place-items: center; flex: none; }
.rank.top { background: var(--ok-soft); color: var(--ok); }
.rank.low { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 480px) { .rank-row .spark { display: none !important; } } /* màn hẹp: nhường chỗ cho tên quán */
.rank-row .right { min-width: 62px; display: grid; justify-items: end; gap: 1px; }
.rank-row .right .score { font-size: 16px; }
.zgroup { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.zroutes summary { cursor: pointer; font-size: 13px; color: var(--primary); padding: 4px 0; }
.prob-list { display: grid; gap: 12px; }
.prob { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.prob:first-child { padding-top: 0; border-top: 0; }
.prob-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.prob-h .score { font-size: 15px; min-width: 46px; text-align: right; }
.prob-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ntag.w-bad { background: var(--bad-soft); color: var(--bad); }
.ntag.w-ok { background: var(--warn-soft); color: var(--warn); }
.ntag.other { background: var(--warn-soft); color: var(--warn); }
.rank-gap { border: 1px dashed var(--line); background: transparent; border-radius: var(--radius); padding: 9px 12px; font-size: 12px; color: var(--muted); text-align: center; width: 100%; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .em { font-size: 40px; display: block; margin-bottom: 6px; }

/* ── Tầng / nhóm tiêu chí ── */
.group-h { font-size: 11.5px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.room-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.room-pills::-webkit-scrollbar { display: none; }
.floor-h { font-size: 11px; font-weight: 500; color: var(--muted); margin: 6px 0 2px; }

/* ── Thanh hành động dưới ── */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + var(--safe-b));
}
.actionbar-in { width: 100%; max-width: 728px; display: flex; gap: 10px; }
.actionbar-in .btn { flex: 1; }
.actionbar-in .btn.fixed { flex: none; }

/* ── Bottom sheet & modal ── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet {
  width: 100%; max-width: 760px; max-height: 92dvh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(18px + var(--safe-b)); display: grid; gap: 14px; animation: up .22s ease-out; overscroll-behavior: contain;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 0; }
.sheet h3 { font-size: 15.5px; }
.dialog { width: calc(100% - 40px); max-width: 360px; margin: auto; background: var(--card); border-radius: 18px; padding: 20px; display: grid; gap: 14px; animation: pop .16s ease-out; }
.overlay.center { align-items: center; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

#toasts { position: fixed; left: 0; right: 0; top: calc(10px + var(--safe-t)); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); max-width: 440px; animation: pop .15s; }
.toast.err { background: #b91c1c; } .toast.ok { background: #047857; }

/* ── Ảnh / video ── */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; background: #0f172a; border: 0; padding: 0; flex: none; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 26px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); background: rgba(0, 0, 0, .18); }
.tw { position: relative; display: inline-block; flex: none; }
.tw > .x { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .85); color: #fff; font-size: 11.5px; display: grid; place-items: center; z-index: 2; }
.thumb .tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, .65); color: #fff; font-size: 10px; text-align: center; padding: 1px 0; }
.thumb.up::after { content: ""; position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.media-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-btns .btn { flex-direction: column; gap: 2px; min-height: 64px; font-size: 11.5px; padding: 0 6px; }
.media-btns .btn .ico { font-size: 22px; }
.prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; animation: fade .15s; }
.lightbox .stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; touch-action: pan-y; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .cap { color: #fff; padding: 12px 16px calc(14px + var(--safe-b)); background: linear-gradient(transparent, rgba(0, 0, 0, .85)); font-size: 13px; white-space: pre-line; }
.lightbox .lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(8px + var(--safe-t)) 12px 8px; color: #fff; z-index: 2; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 26px; border-radius: 12px; z-index: 2; }
.lightbox .nav.l { left: 8px; } .lightbox .nav.r { right: 8px; }

/* ── Chữ ký ── */
.sigpad { position: relative; border: 2px dashed var(--line); border-radius: 14px; background: #fff; height: 190px; overflow: hidden; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.sigpad .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; font-size: 13.5px; pointer-events: none; }
.sigimg { width: 100%; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* ── Bảng điểm (ma trận) ── */
.matrix-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px 4px; -webkit-overflow-scrolling: touch; }
table.matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 12px; background: var(--card); }
.matrix th, .matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.matrix thead th { position: sticky; top: 0; background: var(--primary-soft); color: var(--primary); font-size: 11px; z-index: 2; }
.matrix .c-name { text-align: left; min-width: 170px; max-width: 220px; position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.matrix thead .c-name { background: var(--primary-soft); z-index: 3; }
.matrix tr.sec td { background: var(--primary); color: var(--primary-ink); font-weight: 600; text-align: left; position: sticky; left: 0; }
.matrix tr.grp td.c-name { color: var(--primary); font-weight: 600; font-size: 11px; text-transform: uppercase; background: var(--card); }
.matrix td.pts { color: var(--muted); }
.matrix td.cell { min-width: 46px; }
.matrix td.cell.fail { background: var(--bad-soft); color: var(--bad); font-weight: 600; cursor: pointer; }
.matrix td.cell.na { color: var(--line); }
.matrix td.tb { font-weight: 600; }
.matrix td.tb.lost { color: var(--bad); }
.matrix tr.total td { background: var(--primary-soft); font-weight: 600; font-size: 13.5px; border-bottom: 0; }
.matrix tr.total td.c-name { background: var(--primary-soft); }
.matrix .sub { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ── Lỗi ── */
.fail-card { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.fail-card .t { font-weight: 600; }
.fail-card .why { color: var(--ink); }
.fail-card .pt { color: var(--bad); font-weight: 600; font-size: 11.5px; }
.problem { display: flex; gap: 8px; font-size: 12.5px; padding: 8px 10px; background: var(--bad-soft); color: var(--bad); border-radius: 10px; font-weight: 500; }
.sig-box { display: grid; gap: 6px; text-align: center; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spark { width: 84px; height: 28px; flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 400; text-align: right; }
.kv dd .kv-select { width: auto; max-width: 100%; min-height: 36px; padding: 4px 10px; font-size: 12.5px; font-weight: 400; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; }
.login-in { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.logo { width: 80px; height: 80px; border-radius: 22px; display: block; margin: 0 auto; box-shadow: var(--shadow); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 40px 0; }
@media (min-width: 761px) { .page { padding-top: 22px; } .topbar { border-radius: 0 0 14px 14px; } }

/* ───────────────────── Giao diện kiểu POS ───────────────────── */
.page.pos-page { max-width: none; padding: 8px 12px calc(92px + var(--safe-b)); }
.pos { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.pos-main { display: grid; gap: 12px; min-width: 0; }

/* Thanh mục (4 mục chấm) */
.rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; position: sticky; top: calc(56px + var(--safe-t)); z-index: 15; padding: 6px 0; background: var(--bg); }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.rail-btn .r-ico { font-size: 20px; line-height: 1.1; }
.rail-btn .r-name { font-size: 11px; font-weight: 500; text-align: center; line-height: 1.15; }
.rail-btn .r-sc { font-size: 10.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-btn.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.rail-btn.on .r-sc { color: inherit; opacity: .85; }
.rail-btn.done:not(.on) { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }

/* Ô tiêu chí: xanh = đạt, đỏ = bị trừ */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; min-height: 96px; padding: 12px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); width: 100%; }
.tile:active { transform: scale(.97); }
.tile .t-ico { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; }
.tile .t-name { font-weight: 500; line-height: 1.28; font-size: 14px; }
.tile .t-pts { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .t-why { font-size: 11px; font-weight: 400; color: var(--bad); line-height: 1.3; }
.tile .t-meta { font-size: 11px; color: var(--muted); font-weight: 400; }
.tile.fail { background: var(--bad-soft); border-color: var(--bad); }
.tile.fail .t-ico { background: var(--bad); }
.tile.wide { grid-column: 1 / -1; min-height: 0; }
.tile.wide .t-name { padding-right: 46px; }

/* Ô phòng */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.rtile { min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rtile.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.rtile:active { transform: scale(.96); }
.room-pills .chip { min-height: 42px; padding: 0 15px; font-size: 15px; font-weight: 500; border-width: 2px; }

/* Ô quán, ô mục */
.stores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stile-big { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); text-align: left; box-shadow: var(--shadow); }
.stile-big:active { transform: scale(.97); }
.stile-big .sb-code { min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-weight: 600; display: grid; place-items: center; }
.stile-big .sb-name { font-size: 15.5px; line-height: 1.2; }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sec-tile { display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.sec-tile:active { transform: scale(.98); }
.sec-tile .s-ico { font-size: 28px; line-height: 1; }
.sec-tile .s-name { font-size: 16px; }
.sec-tile .s-score { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-tile .s-score small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.sec-tile.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.sec-tile.doing { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }

/* Phiếu tính điểm (như hoá đơn POS) */
.ticket { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + var(--safe-b)); }
.ticket .t-full { display: none; }
.t-bar { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 0 auto; }
.t-sum { flex: 1; min-width: 0; display: grid; text-align: left; background: transparent; border: 0; padding: 2px 4px; }
.t-sum small { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.t-sum b { font-size: 22.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t-sum b small { font-size: 11.5px; }
.t-sum .t-cnt { font-size: 11px; font-weight: 500; color: var(--bad); }
.t-sum .t-cnt.zero { color: var(--ok); }
.t-bar .btn { flex: none; min-height: 52px; padding: 0 16px; max-width: 58%; line-height: 1.2; text-align: center; }
.t-head { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 2px dashed var(--line); }
.t-head b { font-size: 15.5px; }
.t-lines { display: grid; }
.t-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.t-line .amt { font-weight: 500; }
.t-lbl { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.t-fails { display: grid; gap: 4px; }
.t-fail { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; background: var(--bad-soft); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.t-fail b { color: var(--bad); font-variant-numeric: tabular-nums; }
.t-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px dashed var(--line); padding-top: 10px; font-weight: 600; }
.t-total b { font-size: 29px; font-variant-numeric: tabular-nums; }
.t-total b small { font-size: 12.5px; }

/* Thanh chọn quán + ngày */
.fbar { display: grid; gap: 10px; }
.stores-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.stores-row::-webkit-scrollbar { display: none; }
.stab { flex: none; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.stab.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.dnav { display: flex; gap: 8px; align-items: stretch; }
.navbtn { width: 52px; flex: none; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-size: 26px; font-weight: 500; line-height: 1; }
.navbtn[disabled] { opacity: .35; pointer-events: none; }
.dinput { flex: 1; min-width: 0; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); text-align: center; font-size: 16px; font-weight: 500; padding: 0 8px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range label { display: grid; gap: 4px; }
.range .dinput { width: 100%; }

@media (min-width: 900px) {
  .pos { grid-template-columns: 190px minmax(0, 1fr) 350px; gap: 16px; }
  .rail { grid-template-columns: 1fr; position: sticky; top: 76px; padding: 0; background: transparent; align-self: start; }
  .rail-btn { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 14px 12px; }
  .rail-btn .r-ico { font-size: 22px; }
  .rail-btn .r-name { text-align: left; font-size: 13.5px; flex: 1; }
  .rail-btn .r-sc { margin-left: auto; }
    .ticket { position: sticky; top: 76px; left: auto; right: auto; bottom: auto; border: 2px dashed var(--line); border-radius: 18px; background: var(--card); padding: 16px; max-height: calc(100dvh - 96px); overflow-y: auto; align-self: start; }
  .ticket .t-bar { display: none; }
  .ticket .t-full { display: grid; gap: 10px; }
  .page.pos-page { padding-bottom: 28px; }
}

/* ───── Ô thả xuống: thời gian + chi nhánh ───── */
.frow { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.frow.one { grid-template-columns: 1fr; }
.dsel { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 48px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.dsel:focus-within { border-color: var(--primary); }
.dsel::after { content: ""; position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: var(--muted); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.dsel-ico { display: grid; place-items: center; color: var(--primary); flex: none; }
.dsel select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; box-shadow: none; min-height: 46px; padding: 0; width: 100%; min-width: 0; font-size: 13.5px; font-weight: 500; text-overflow: ellipsis; }
.dsel select:focus { box-shadow: none; border: 0; }
.fcap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.fcap .grow { flex: 1 1 110px; min-width: 0; }

/* ───── Biểu đồ tròn ───── */
.page.page-wide { max-width: 980px; }
.page.page-xl { max-width: 1360px; }
.pies { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .pies { grid-template-columns: 1fr 1fr; } }
.pie-card { align-content: start; }
.pie-wrap { display: grid; place-items: center; }
.pie-wrap svg { width: min(100%, 250px); height: auto; overflow: visible; }
.slice { cursor: pointer; outline: none; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.slice:focus-visible { stroke-opacity: .8; }
.pie-main { font-size: 26px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.pie-sub { font-size: 13px; font-weight: 400; fill: var(--muted); }
.pie-pct { font-size: 14px; font-weight: 600; pointer-events: none; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legend button { width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 8px 6px; border-radius: 10px; text-align: left; font-size: 13px; }
.legend li.on button { background: var(--primary-soft); }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legend .nm { font-weight: 500; }
.legend .pc { color: var(--muted); }
.legend .vl { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ───────────────────── Icon SVG ───────────────────── */
.ic { flex: none; display: inline-block; vertical-align: middle; }
.chev { color: var(--muted); }
.tab .ico { display: grid; place-items: center; height: 26px; }
.empty .em { display: grid; place-items: center; margin: 0 auto 8px; color: var(--muted); opacity: .6; }
.empty .em.ok { color: var(--ok); opacity: 1; }
.ico-box { color: var(--primary); }
.item .t, .btn { line-height: 1.25; }
.media-btns .btn .ico { display: grid; place-items: center; color: var(--primary); }
.t-ico svg, .thumb .play svg { display: block; }
.thumb .play { color: #fff; }
.r-done { position: absolute; top: 4px; right: 5px; color: var(--ok); line-height: 0; }
.rail-btn.on .r-done { color: inherit; }
.rail-btn { overflow: hidden; }
.badge .ic { margin-right: -1px; }
.savestate { display: inline-flex; align-items: center; gap: 3px; }
.problem .ic { flex: none; margin-top: 1px; }
.t-cnt { display: inline-flex; align-items: center; gap: 3px; }
.small.row .ic { flex: none; color: var(--primary); }

/* Ô icon của 4 mục chấm — cùng bảng màu với biểu đồ tròn */
.sec-ic { --c: #e11d48; --bg: rgba(255, 99, 132, .16); display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--bg); color: var(--c); }
.sec-ic.xs { width: 22px; height: 22px; border-radius: 7px; }
.sec-ic.sm { width: 28px; height: 28px; border-radius: 9px; }
.sec-ic.lg { width: 46px; height: 46px; border-radius: 14px; }
.sec-room { --c: #e11d48; --bg: rgba(255, 99, 132, .16); }
.sec-common { --c: #0b7fd0; --bg: rgba(54, 162, 235, .16); }
.sec-service { --c: #b45309; --bg: rgba(255, 206, 86, .30); }
.sec-staff { --c: #0f8f8f; --bg: rgba(75, 192, 192, .20); }
@media (prefers-color-scheme: dark) {
  .sec-room { --c: #ff8aa2; --bg: rgba(255, 99, 132, .20); }
  .sec-common { --c: #7cc7f7; --bg: rgba(54, 162, 235, .20); }
  .sec-service { --c: #ffd666; --bg: rgba(255, 206, 86, .18); }
  .sec-staff { --c: #7fdcdc; --bg: rgba(75, 192, 192, .20); }
}
.rail-btn.on .sec-ic { background: color-mix(in srgb, currentColor 18%, transparent); color: inherit; }
.rail-btn .r-ico { line-height: 0; }
.sec-tile .s-ico { line-height: 0; }

/* ───── Ghi chú lưu ý (không trừ điểm) ───── */
.note-card { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); }
.note-main { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: transparent; border: 0; padding: 0; color: inherit; }
.note-ic { color: var(--warn); line-height: 0; margin-top: 2px; flex: none; }
.note-tag { display: block; font-size: 11px; font-weight: 500; color: var(--warn); margin-bottom: 2px; }
.note-text { display: block; font-weight: 400; white-space: pre-wrap; line-height: 1.38; }
.t-note { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--ink); }
.t-note .ic { color: var(--warn); margin-top: 2px; flex: none; }

/* Khối "Tài khoản phim" nằm trong thẻ phòng: viền đứt màu vàng để phân biệt (tính vào Dịch vụ) */
.svc-block { padding: 12px; border-radius: 14px; border: 2px dashed color-mix(in srgb, #ffce56 60%, transparent); background: color-mix(in srgb, #ffce56 7%, transparent); }
.svc-h { align-items: center; gap: 10px; }
.svc-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); }

/* ───── Bảng điểm đúng form Google Sheet + trình xem toàn màn hình ───── */
.sheet-fit { overflow: hidden; position: relative; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
table.gsheet { border-collapse: collapse; table-layout: fixed; font-size: 12px; color: #0f172a; background: #fff; transform-origin: 0 0; font-variant-numeric: tabular-nums; }
table.gsheet.abs { position: absolute; left: 0; top: 0; }
.gsheet th, .gsheet td { border: 1px solid #cbd5e1; padding: 3px 4px; text-align: center; vertical-align: middle; line-height: 1.25; overflow-wrap: anywhere; }
.gsheet th.ttl { background: #312e81; color: #fff; font-size: 15px; font-weight: 600; text-align: left; padding: 8px 10px; }
.gsheet thead th { background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 600; }
.gsheet td.a { background: #eef2ff; color: #3730a3; font-size: 15px; font-weight: 600; }
.gsheet td.b { background: #eef2ff; font-weight: 500; font-size: 12.5px; }
.gsheet td.b .sub { font-weight: 400; font-size: 11px; color: #475569; margin-top: 2px; }
.gsheet td.c { font-weight: 500; }
.gsheet td.d { text-align: left; white-space: pre-line; }
.gsheet td.e { color: #475569; }
.gsheet td.fail { background: #fee2e2; color: #b91c1c; font-weight: 600; cursor: pointer; }
.gsheet td.na { background: #f1f5f9; }
.gsheet td.tb { font-weight: 600; }
.gsheet td.tb.lost { color: #b91c1c; }
.gsheet tr.total td { background: #eef2ff; font-weight: 600; font-size: 14px; }
.gsheet tr.total td.tl { text-align: right; color: #3730a3; padding-right: 10px; }
.gsheet tr.total td.tb.good { color: #047857; }
.gsheet tr.total td.tb.ok { color: #b45309; }
.gsheet tr.total td.tb.bad { color: #b91c1c; }

.sv { position: fixed; inset: 0; z-index: 70; background: #0e1117; display: flex; flex-direction: column; animation: fade .15s; }
.sv-bar { display: flex; align-items: center; gap: 2px; padding: calc(8px + var(--safe-t)) 8px 8px 14px; color: #fff; background: #161b24; border-bottom: 1px solid #26304a; }
.sv-bar .icon-btn { color: #fff; }
.sv-title { font-weight: 600; font-size: 16px; }
.sv-hint { font-size: 11.5px; opacity: .7; line-height: 1.3; }
.sv-pct { font-size: 12px; font-weight: 500; color: #cbd5e1; min-width: 44px; text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.sv-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; background: #1e2745; cursor: grab; }
@media (max-height: 520px) { .sv-hint { display: none; } .sv-bar { padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; } }

/* ───── Lịch sử: bảng các lần audit ───── */
.hist-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--card); -webkit-overflow-scrolling: touch; }
table.hist { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1020px; font-size: 12.5px; }
.hist th, .hist td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.hist thead th { position: sticky; top: 0; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 600; z-index: 2; white-space: normal; line-height: 1.25; }
.hist thead th .tiny { font-weight: 400; opacity: .75; margin-top: 2px; }
.hist td.stt, .hist th.stt { width: 46px; text-align: center; color: var(--muted); font-weight: 400; position: sticky; left: 0; background: var(--card); z-index: 1; }
.hist thead th.stt { background: var(--primary-soft); z-index: 3; }
.hist td.store, .hist th.store { position: sticky; left: 46px; background: var(--card); z-index: 1; min-width: 124px; box-shadow: 1px 0 0 var(--line); }
.hist thead th.store { background: var(--primary-soft); z-index: 3; }
.hist td.when { font-variant-numeric: tabular-nums; }
.hist td.n { text-align: center; font-variant-numeric: tabular-nums; font-weight: 400; }
.hist td.n.lost { color: var(--bad); }
.hist td.n.prov { opacity: .55; font-style: italic; }
.hist td.total { font-size: 15.5px; }
.hist td.act .row { gap: 6px; flex-wrap: nowrap; }
.hist tr:last-child td { border-bottom: 0; }
.hist tr.draft-row td { background: color-mix(in srgb, var(--warn-soft) 55%, var(--card)); }
.hist tr.draft-row td.stt, .hist tr.draft-row td.store { background: color-mix(in srgb, var(--warn-soft) 55%, var(--card)); }
.hist td.act { padding-right: 12px; }

.hist th.sc { text-align: center; min-width: 62px; }
.hist th.sc .tiny { white-space: nowrap; }

/* Bảng Lịch sử gọn hơn: chữ nhỏ, dữ liệu không in đậm (tiêu đề cột vẫn đậm) */
table.hist { font-size: 11px; }
table.hist th, table.hist td { padding: 8px 9px; }
table.hist thead th { font-size: 10.5px; }
table.hist td, table.hist td b, table.hist td .score, table.hist td.stt, table.hist td.n, table.hist td.total { font-weight: 400; }
table.hist td.total, table.hist td.total .score { font-size: 11px; }
table.hist td .tiny { font-size: 10.5px; }
table.hist td .badge { font-weight: 500; font-size: 10.5px; padding: 2px 8px; }
table.hist td .btn { font-weight: 500; font-size: 11px; min-height: 30px; padding: 0 10px; gap: 5px; }
table.hist td.store, table.hist th.store { min-width: 108px; }

/* 2 nút trong bảng Lịch sử chỉ có icon (rê chuột để xem tên) */
table.hist td .btn.ico { width: 32px; min-width: 32px; min-height: 32px; padding: 0; gap: 0; }
table.hist td.act .row { gap: 6px; }
table.hist { min-width: 880px; }

/* ── Mất mạng / đồng bộ ── */
.topbar { flex-wrap: wrap; }
.netbar {
  flex: 1 0 100%; display: flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 6px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 500; line-height: 1.3; background: var(--warn-soft); color: var(--warn);
}
.netbar.sync { background: var(--primary-soft); color: var(--primary); }
.netbar.err { background: var(--bad-soft); color: var(--bad); }
.netbar .ic { flex: none; }
.netbtn { flex: none; border: 1px solid currentColor; border-radius: 8px; padding: 4px 10px; background: transparent; color: inherit; font-size: 11px; font-weight: 600; }
.netbtn:active { background: color-mix(in srgb, currentColor 14%, transparent); }
.spin.sm { width: 14px; height: 14px; border-width: 2px; flex: none; }
.savestate.off { color: var(--warn); font-weight: 500; }
.tile .t-meta.lack { color: var(--bad); font-weight: 500; }
.hint.warn { color: var(--bad); font-weight: 500; }

/* ── So sánh, lỗi lặp lại, khắc phục ── */
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cmp-t { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.cmp-t .cl { font-size: 11px; color: var(--muted); }
.cmp-t b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.cov { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cov.thin { color: var(--warn); }
.rep-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-rep { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--bad); background: var(--bad-soft); border-radius: 999px; padding: 2px 9px; }
.tag-rep.soft { color: var(--warn); background: var(--warn-soft); }
.fix-item { align-items: flex-start; text-align: left; width: 100%; }
.fix-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.fix-meta span { display: inline-flex; align-items: center; gap: 4px; }
.fix-meta .late { color: var(--bad); font-weight: 500; }
.fix-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.fix-item .t { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fix-why { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); }
.fix-why .rep-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--bad); }
.fstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fstat { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; padding: 6px 2px; color: inherit; font: inherit; }
.fstat b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fstat span { font-size: 10.5px; color: var(--muted); text-align: center; }
.fstat.bad b { color: var(--bad); } .fstat.ok b { color: var(--ok); }
.linkbtn { border: 0; background: transparent; color: var(--primary); display: inline-flex; align-items: center; gap: 2px; padding: 0; font: inherit; font-size: 11.5px; }

/* ── Đường xu hướng tăng / giảm ── */
.trend { display: grid; gap: 4px; }
.trend-svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend-top { display: flex; align-items: center; gap: 8px; }
.trend-top .delta { font-size: 12.5px; font-weight: 500; }
.trend-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trend-box { display: grid; gap: 4px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── Khối trọng tâm: Phòng / Nhân viên có vấn đề gì? ── */
.focus-card { align-content: start; }
.verdict { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.verdict .big { font-size: 27px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.verdict .big.good { color: var(--ok); } .verdict .big.ok { color: var(--warn); } .verdict .big.bad { color: var(--bad); }
.rbar { display: grid; gap: 4px; }
.rbar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.rbar-l { font-weight: 500; }
.rbar-v { font-weight: 500; font-variant-numeric: tabular-nums; }
.rbar-v.good { color: var(--ok); } .rbar-v.ok { color: var(--warn); } .rbar-v.bad { color: var(--bad); }
.chip .cnt { margin-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.tone-bad { color: var(--bad); } .chip.tone-warn { color: var(--warn); } .chip.tone-ok { color: var(--ok); }
.chip.on.tone-bad { background: var(--bad-soft); border-color: var(--bad); }
.chip.on.tone-warn { background: var(--warn-soft); border-color: var(--warn); }
.chip.on.tone-ok { background: var(--ok-soft); border-color: var(--ok); }
.chip.on.tone-plain { background: var(--primary-soft); border-color: var(--primary); }
.quote { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.quote .q-text { font-size: 13px; line-height: 1.4; }
.quote .q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ntag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.ntag.repair { background: var(--bad-soft); color: var(--bad); }
.ntag.decor, .ntag.clean, .ntag.scent { background: var(--warn-soft); color: var(--warn); }
.ntag.praise { background: var(--ok-soft); color: var(--ok); }
.flat-item { cursor: default; align-items: flex-start; }
