/* Trang Cảnh báo: một cột cho điện thoại như trang kho, chốt ca (chữ hệ thống, thẻ có viền màu trạng thái);
   màu chính tím than để khỏi nhầm với kho (xanh lá) và chốt ca (xanh dương). Giống trang mẫu Bố duyệt 30/10. */
:root {
  --nen: #f3f3f7; --the: #ffffff; --chu: #1c1d26; --chu-mo: #5d6070; --vien: #d6d7e0;
  --chinh: #463a78; --chinh-nhat: #ebe8f6; --tren-chinh: #ffffff;
  --tot: #2e7d4f; --tot-nen: #e2f3e8;
  --vang: #8a5f00; --vang-nen: #fff2cc;
  --do: #b3261e; --do-nen: #fde3e1;
  --xam: #6b6f7d; --xam-nen: #ececf1;
  --mau: #f2c94c; --tren-mau: #3b2f00;
  --chu-he: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nen: #121218; --the: #1c1c25; --chu: #e6e6ef; --chu-mo: #a5a7b6; --vien: #353646;
    --chinh: #b3a7e8; --chinh-nhat: #2a2540; --tren-chinh: #15131f;
    --tot: #7fd3a1; --tot-nen: #183327; --vang: #f1c75b; --vang-nen: #3a3016;
    --do: #ff8b82; --do-nen: #43201d; --xam: #a5a7b6; --xam-nen: #2a2b36;
    --mau: #c9a43a; --tren-mau: #1e1700; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { background: var(--nen); color: var(--chu); font: 16px/1.45 var(--chu-he); -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--nen); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--chinh); outline-offset: 2px; border-radius: 6px; }
a { color: var(--chinh); }

.khung { max-width: 680px; margin: 0 auto; padding-block: 12px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }

.dau { background: var(--chinh); color: var(--tren-chinh); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dau-tren { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ten-app { font-weight: 700; font-size: 1.05rem; }
.dau-mo { font-size: .88rem; opacity: .85; }
.chon-ngay { display: flex; align-items: center; gap: 8px; }
.chon-ngay strong { flex: 1; text-align: center; font-size: 1.05rem; }

.dong-tai { display: flex; gap: 10px; align-items: flex-start; background: var(--tot-nen); color: var(--tot); border-radius: 10px; padding: 9px 12px; font-size: .92rem; font-weight: 600; }

.tab-con { display: flex; border-bottom: 1px solid var(--vien); }
.tab2 { flex: 1; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 9px 4px 7px; font-weight: 700; font-size: .98rem; color: var(--chu-mo); cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 6px; }
.tab2[aria-current="page"] { color: var(--chinh); border-bottom-color: var(--chinh); }
.dem { background: var(--do); color: var(--the); border-radius: 999px; font-size: .78rem; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.th-nho { display: block; font-size: .8rem; color: var(--chu-mo); font-weight: 600; }

.o-tong { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.o { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-top: 5px solid var(--xam); }
.o.do { border-top-color: var(--do); } .o.vang { border-top-color: var(--vang); } .o.tot { border-top-color: var(--tot); }
.o-nhan { font-size: .82rem; color: var(--chu-mo); font-weight: 600; letter-spacing: .02em; }
.o-so { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.o-phu { font-size: .85rem; color: var(--chu-mo); }

.trang { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.muc { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.muc-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.muc-dau h2 { font-size: 1.12rem; }
.muc-dau .mo { font-size: .85rem; color: var(--chu-mo); }
.nhom-th { font-size: .8rem; font-weight: 700; color: var(--chu-mo); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

.the { background: var(--the); border: 1px solid var(--vien); border-left: 6px solid var(--xam); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.the.do { border-left-color: var(--do); } .the.vang { border-left-color: var(--vang); } .the.tot { border-left-color: var(--tot); }
.the-dau { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.the-dau h3 { font-size: 1.02rem; }
.nhan { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.nhan.do { background: var(--do-nen); color: var(--do); } .nhan.vang { background: var(--vang-nen); color: var(--vang); }
.nhan.tot { background: var(--tot-nen); color: var(--tot); } .nhan.xam { background: var(--xam-nen); color: var(--xam); }
.dong-ttt { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 8px; font-size: .92rem; }
.dong-ttt dt { color: var(--chu-mo); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dong-ttt dd { margin: 0; min-width: 0; }
.cham { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--xam); }
.cham.do { background: var(--do); } .cham.vang { background: var(--vang); } .cham.tot { background: var(--tot); }
details.chi-tiet > summary { cursor: pointer; color: var(--chinh); font-weight: 600; font-size: .92rem; padding: 4px 0; list-style: none; }
details.chi-tiet > summary::-webkit-details-marker { display: none; }
details.chi-tiet > summary::before { content: "▸ "; }
details.chi-tiet[open] > summary::before { content: "▾ "; }
.phieu { border-top: 1px solid var(--vien); padding-block: 8px; display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.phieu-dau { font-weight: 600; font-variant-numeric: tabular-nums; }
.phieu .mo { color: var(--chu-mo); }
.dan { border-radius: 8px; padding: 4px 8px; font-size: .9rem; margin-top: 3px; }
.dan.sua { background: var(--do-nen); color: var(--do); } .dan.xem { background: var(--vang-nen); color: var(--vang); }
.tieu-muc { font-size: .8rem; font-weight: 700; color: var(--chu-mo); letter-spacing: .04em; text-transform: uppercase; margin-top: 6px; }

.cuon { overflow-x: auto; border: 1px solid var(--vien); border-radius: 12px; background: var(--the); }
table.luoi { border-collapse: separate; border-spacing: 3px; font-size: .82rem; font-variant-numeric: tabular-nums; }
table.luoi th { font-weight: 600; color: var(--chu-mo); padding: 3px 4px; white-space: nowrap; text-align: center; }
table.luoi th.ten { text-align: left; position: sticky; left: 0; background: var(--the); z-index: 1; }
table.luoi td.ten { position: sticky; left: 0; background: var(--the); white-space: nowrap; padding-right: 6px; z-index: 1; }
table.luoi td.ten small { color: var(--chu-mo); }
.oluoi { width: 34px; height: 30px; border-radius: 6px; border: 0; cursor: pointer; font-weight: 700; font-size: .8rem; padding: 0; }
.oluoi.khop { background: var(--tot-nen); color: var(--tot); }
.oluoi.cho { background: var(--xam-nen); color: var(--xam); }
.oluoi.chua { background: var(--vang-nen); color: var(--vang); }
.oluoi.xem { background: var(--vang-nen); color: var(--vang); outline: 1px dashed var(--vang); outline-offset: -3px; }
.oluoi.lech { background: var(--do-nen); color: var(--do); }
.oluoi.qua { background: var(--do); color: var(--the); }
.oluoi[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--chinh); }
.chu-giai { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: var(--chu-mo); }
.chu-giai span { display: inline-flex; align-items: center; gap: 5px; }
.chu-giai .oluoi { width: 26px; height: 22px; cursor: default; }
.o-chon { background: var(--chinh-nhat); border-radius: 10px; padding: 9px 12px; font-size: .92rem; min-height: 2.6em; }

.thanh { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 2em; gap: 6px; align-items: center; font-size: .9rem; }
.thanh-ve { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--xam-nen); }
.thanh-ve span { height: 100%; }
.v-vay { background: var(--chinh); } .v-tra { background: var(--vang); } .v-bep { background: var(--tot); }
.thanh b { text-align: right; font-variant-numeric: tabular-nums; }

.chan { font-size: .85rem; color: var(--chu-mo); border-top: 1px solid var(--vien); padding-top: 10px; }

@media (min-width: 560px) { .o-tong { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

body { margin: 0; }
.khung > .dau { margin-top: 4px; }
.nut-ngay { border: 1px solid currentColor; border-radius: 8px; padding: 4px 10px; color: var(--tren-chinh); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.nut-ngay.tat { opacity: .4; }
.nut-chu { background: transparent; border: 0; color: var(--tren-chinh); text-decoration: underline; cursor: pointer; font-size: .88rem; padding: 2px 0; }
.dau form { margin: 0; }
.tab2 { text-decoration: none; }
.dong-tai.do { background: var(--do-nen); color: var(--do); }
.dong-tai.xam { background: var(--xam-nen); color: var(--chu-mo); }
.dong-tai a { color: inherit; }
.thong-bao { border-radius: 10px; padding: 9px 12px; font-size: .92rem; }
.thong-bao.vang { background: var(--vang-nen); color: var(--vang); }
.thong-bao.do { background: var(--do-nen); color: var(--do); }
.mo { color: var(--chu-mo); }
.oluoi.trong { display: inline-block; background: transparent; cursor: default; }
.cham.v-vay { background: var(--chinh); } .cham.v-tra { background: var(--vang); } .cham.v-bep { background: var(--tot); }
.thanh-ve .r1 { width: 5%; }
.thanh-ve .r2 { width: 10%; }
.thanh-ve .r3 { width: 15%; }
.thanh-ve .r4 { width: 20%; }
.thanh-ve .r5 { width: 25%; }
.thanh-ve .r6 { width: 30%; }
.thanh-ve .r7 { width: 35%; }
.thanh-ve .r8 { width: 40%; }
.thanh-ve .r9 { width: 45%; }
.thanh-ve .r10 { width: 50%; }
.thanh-ve .r11 { width: 55%; }
.thanh-ve .r12 { width: 60%; }
.thanh-ve .r13 { width: 65%; }
.thanh-ve .r14 { width: 70%; }
.thanh-ve .r15 { width: 75%; }
.thanh-ve .r16 { width: 80%; }
.thanh-ve .r17 { width: 85%; }
.thanh-ve .r18 { width: 90%; }
.thanh-ve .r19 { width: 95%; }
.thanh-ve .r20 { width: 100%; }

.dang-nhap { gap: 10px; }
.dang-nhap h1 { font-size: 1.2rem; }
.dang-nhap input[type="password"] { font: inherit; padding: 10px 12px; border: 1px solid var(--vien); border-radius: 10px; background: var(--nen); color: var(--chu); }
.nut-chinh { background: var(--chinh); color: var(--tren-chinh); border: 0; border-radius: 10px; padding: 11px 14px; font-weight: 700; cursor: pointer; }
