/* Showroom MS: bộ giao diện dùng chung. Trang nghiệp vụ chỉ dùng các lớp ở đây, không tự viết màu. */
:root {
  --nen: #f4f6f9; --mat: #ffffff; --mat-2: #f8fafc; --vien: #e2e8f0; --vien-dam: #cbd5e1;
  --chu: #0f172a; --chu-phu: #64748b; --chu-mo: #94a3b8;
  --chinh: #ea580c; --chinh-dam: #c2410c; --chinh-nhat: #fff1e8; --tren-chinh: #ffffff;
  --thanh: #0f172a; --tren-thanh: #cbd5e1; --tren-thanh-chon: #ffffff;
  --tot: #15803d; --tot-nhat: #dcfce7; --canh-bao: #b45309; --canh-bao-nhat: #fef3c7;
  --xau: #b91c1c; --xau-nhat: #fee2e2; --tin: #1d4ed8; --tin-nhat: #dbeafe; --xam-nhat: #eef2f6;
  --bo: 12px; --bo-nho: 8px; --bong: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --chu-so: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nen: #0b1120; --mat: #131c2e; --mat-2: #182338; --vien: #25324a; --vien-dam: #33435f;
    --chu: #e8edf5; --chu-phu: #9aa8bd; --chu-mo: #6b7a92;
    --chinh: #fb923c; --chinh-dam: #f97316; --chinh-nhat: #3a2414; --tren-chinh: #1a0f06;
    --thanh: #0a0f1c; --tot: #4ade80; --tot-nhat: #12301f; --canh-bao: #fbbf24; --canh-bao-nhat: #3a2c0c;
    --xau: #f87171; --xau-nhat: #3b1618; --tin: #7fb0ff; --tin-nhat: #15264a; --xam-nhat: #1c2740;
    --bong: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--chu-so); color: var(--chu); background: var(--nen); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
p { margin: 0; }
a { color: var(--chinh-dam); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--chinh); outline-offset: 2px; }
.so, td.so, th.so { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mo { color: var(--chu-phu); } .nho { font-size: .85rem; } .dam { font-weight: 650; }
.an { display: none !important; }
.dang-tai-trang, .dang-tai { padding: 48px 16px; text-align: center; color: var(--chu-phu); }

/* ----- Khung ứng dụng ----- */
.khung-ung-dung { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.thanh-ben { background: var(--thanh); color: var(--tren-thanh); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.thuong-hieu { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; color: #fff; font-weight: 700; font-size: 1.08rem; letter-spacing: .01em; }
.thuong-hieu img { width: 32px; height: 32px; }
.thuong-hieu .dong-menu { display: none; margin-left: auto; background: rgba(255, 255, 255, .08); border: 0; border-radius: 10px; color: #fff; width: 38px; height: 38px; cursor: pointer; place-items: center; }
.thuong-hieu .dong-menu svg { width: 18px; height: 18px; }

/* Menu gom nhóm: tiêu đề nhóm lớn, bấm để xổ các mục con */
.menu { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 12px; flex: 1; }
.nhom-dau { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 10px 7px 8px; border: 0; border-radius: 12px; background: none;
  color: var(--tren-thanh); font: inherit; font-size: .98rem; font-weight: 600; text-align: left; cursor: pointer;
  transition: background .16s ease, color .16s ease; }
.nhom-dau .o-bieu { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .06);
  transition: background .16s ease, color .16s ease, transform .16s ease; }
.nhom-dau .o-bieu svg { width: 19px; height: 19px; }
.nhom-dau .ten { flex: 1; min-width: 0; }
.nhom-dau .mui { display: grid; place-items: center; opacity: .55; transition: transform .22s ease, opacity .16s ease; }
.nhom-dau .mui svg { width: 16px; height: 16px; }
.nhom-dau:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nhom-dau:hover .o-bieu { background: rgba(249, 115, 22, .24); color: #fdba74; transform: scale(1.07); }
.nhom-dau:hover .mui { opacity: 1; }
.nhom.mo > .nhom-dau .mui { transform: rotate(90deg); }
/* Nhóm đang chứa trang hiện tại, và mục đơn đang chọn: ô biểu tượng tô cam */
.nhom.co-chon > .nhom-dau, a.nhom-dau.chon { color: #fff; }
.nhom.co-chon > .nhom-dau .o-bieu, a.nhom-dau.chon .o-bieu { background: #ea580c; color: #fff; }
a.nhom-dau.chon { background: rgba(249, 115, 22, .16); }
/* Phần xổ xuống: co giãn mượt bằng lưới 0fr -> 1fr */
.nhom-than { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
.nhom.mo > .nhom-than { grid-template-rows: 1fr; }
.nhom-trong { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; margin-left: 26px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nhom-trong > :first-child { margin-top: 4px; }
.nhom-trong > :last-child { margin-bottom: 8px; }
.muc-con { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--tren-thanh); font-size: .88rem;
  transition: background .16s ease, color .16s ease, padding-left .16s ease; }
.muc-con svg { width: 16px; height: 16px; flex: none; opacity: .7; transition: opacity .16s ease; }
.muc-con:hover { background: rgba(255, 255, 255, .08); color: #fff; padding-left: 15px; text-decoration: none; }
.muc-con:hover svg { opacity: 1; }
.muc-con.chon { background: rgba(249, 115, 22, .16); color: #fdba74; font-weight: 600; }
.muc-con.chon svg { opacity: 1; }
.muc-con.chon::before { content: ''; position: absolute; left: -13px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: #f97316; }
.menu .dem, .bang-nhom .dem { margin-left: auto; background: var(--chinh); color: #fff; border-radius: 99px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }
.nhom.mo > .nhom-dau .dem { display: none; }      /* đã xổ thì số chờ hiện ở mục con */
.nhom-dau:focus-visible, .muc-con:focus-visible { outline: 2px solid #fb923c; outline-offset: 1px; }
.nguoi-dang-nhap { padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.nguoi-dang-nhap b { display: block; color: #fff; font-size: .92rem; }
.noi-dung { min-width: 0; display: flex; flex-direction: column; }
.thanh-tren { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--mat); border-bottom: 1px solid var(--vien); position: sticky; top: 0; z-index: 20; min-height: 52px; }
.thanh-tren .ten-trang { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thanh-tren select { max-width: 220px; }
.thanh-tren .ten-nhom { color: var(--chu-phu); font-weight: 500; }
.thanh-tren .ten-nhom::after { content: '/'; margin: 0 8px; color: var(--chu-mo); }
.trang { padding: 20px 24px 48px; max-width: 1280px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.thanh-duoi { display: none; }
.bang-nhom { display: none; }
@keyframes bang-len { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .khung-ung-dung { grid-template-columns: minmax(0, 1fr); }
  .thanh-ben { display: none; }
  .thanh-ben.mo-ra { display: flex; position: fixed; inset: 0; z-index: 60; height: auto; }
  .thanh-ben.mo-ra .dong-menu { display: grid; }
  .thanh-ben.mo-ra .nhom-dau { padding-top: 9px; padding-bottom: 9px; font-size: 1.02rem; }
  .thanh-ben.mo-ra .muc-con { padding-top: 10px; padding-bottom: 10px; font-size: .95rem; }
  .thanh-tren { padding: 8px 14px; }
  .trang { padding: 14px 14px 96px; gap: 12px; }
  .thanh-duoi { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--mat); border-top: 1px solid var(--vien); padding-bottom: env(safe-area-inset-bottom); }
  .thanh-duoi a, .thanh-duoi button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: .68rem; color: var(--chu-phu); background: none; border: 0; cursor: pointer; position: relative; }
  .thanh-duoi a:hover { text-decoration: none; }
  .thanh-duoi svg { width: 22px; height: 22px; }
  .thanh-duoi .chon { color: var(--chinh-dam); font-weight: 650; }
  .thanh-duoi a:active, .thanh-duoi button:active { background: var(--xam-nhat); }
  .bang-nhom { position: fixed; left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 29; background: var(--mat); border: 1px solid var(--vien);
    border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); padding: 8px; display: flex; flex-direction: column; gap: 2px; animation: bang-len .18s ease; }
  .bang-nhom .ten-bang { padding: 6px 10px 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--chu-phu); }
  .bang-nhom .muc-bang { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--chu); font-weight: 600; }
  .bang-nhom .muc-bang:hover, .bang-nhom .muc-bang:active { background: var(--xam-nhat); text-decoration: none; }
  .bang-nhom .muc-bang .o-bieu { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--chinh-nhat); color: var(--chinh-dam); }
  .bang-nhom .muc-bang .o-bieu svg { width: 20px; height: 20px; }
  .bang-nhom .muc-bang.chon { background: var(--chinh-nhat); color: var(--chinh-dam); }
  .thanh-duoi .dem { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--chinh); color: #fff; border-radius: 99px; font-size: .62rem; font-weight: 700; padding: 0 5px; }
}

/* ----- Đầu trang, khối, lưới ----- */
.dau-trang { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dau-trang .phu-de { color: var(--chu-phu); font-size: .9rem; margin-top: 2px; }
.hanh-dong { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.khoi { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong); padding: 16px; min-width: 0; }
.khoi > h2, .khoi > .dau-khoi { margin-bottom: 12px; }
.dau-khoi { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.khoi.sat { padding: 0; overflow: hidden; }
.khoi.sat > h2, .khoi.sat > .dau-khoi { padding: 14px 16px 0; }
.luoi { display: grid; gap: 14px; }
.luoi.hai { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.luoi.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.luoi-so { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 860px) { .luoi.hai, .luoi.ba { grid-template-columns: minmax(0, 1fr); } .luoi-so { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Thẻ số (KPI) */
.the-so { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px 16px; box-shadow: var(--bong); min-width: 0; }
.the-so .nhan { color: var(--chu-phu); font-size: .82rem; }
.the-so .gia-tri { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.2; }
.the-so .phu { color: var(--chu-phu); font-size: .8rem; margin-top: 4px; }
.the-so.tot .gia-tri { color: var(--tot); } .the-so.xau .gia-tri { color: var(--xau); } .the-so.chinh .gia-tri { color: var(--chinh-dam); }

/* ----- Nút ----- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--bo-nho); border: 1px solid var(--vien-dam);
  background: var(--mat); color: var(--chu); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; min-height: 38px; }
.nut:hover { background: var(--mat-2); text-decoration: none; }
.nut.chinh { background: var(--chinh); border-color: var(--chinh); color: var(--tren-chinh); }
.nut.chinh:hover { background: var(--chinh-dam); border-color: var(--chinh-dam); }
.nut.tot { background: var(--tot); border-color: var(--tot); color: #fff; }
.nut.nguy-hiem { color: var(--xau); border-color: var(--xau); background: transparent; }
.nut.nguy-hiem:hover { background: var(--xau-nhat); }
.nut.nhe { border-color: transparent; background: transparent; color: var(--chinh-dam); }
.nut.nhe:hover { background: var(--chinh-nhat); }
.nut.be { padding: 4px 10px; min-height: 30px; font-size: .82rem; }
.nut.rong { width: 100%; }
.nut:disabled { opacity: .55; cursor: not-allowed; }
.nut svg { width: 16px; height: 16px; }

/* ----- Nhãn trạng thái ----- */
.nhan-tt { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 650; white-space: nowrap; background: var(--xam-nhat); color: var(--chu-phu); }
.nhan-tt.tot { background: var(--tot-nhat); color: var(--tot); }
.nhan-tt.canh-bao { background: var(--canh-bao-nhat); color: var(--canh-bao); }
.nhan-tt.xau { background: var(--xau-nhat); color: var(--xau); }
.nhan-tt.tin { background: var(--tin-nhat); color: var(--tin); }
.nhan-tt.chinh { background: var(--chinh-nhat); color: var(--chinh-dam); }

/* ----- Bảng: máy tính là bảng, điện thoại thành danh sách thẻ ----- */
.cuon-ngang { overflow-x: auto; }
table.bang { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.bang th { text-align: left; font-weight: 600; color: var(--chu-phu); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--vien); white-space: nowrap; background: var(--mat-2); }
table.bang td { padding: 10px 14px; border-bottom: 1px solid var(--vien); vertical-align: top; }
table.bang tr:last-child td { border-bottom: 0; }
table.bang tbody tr.bam { cursor: pointer; }
table.bang tbody tr.bam:hover { background: var(--mat-2); }
table.bang tfoot td { font-weight: 700; background: var(--mat-2); border-top: 1px solid var(--vien-dam); }
table.bang .phu { color: var(--chu-phu); font-size: .82rem; }
@media (max-width: 700px) {
  table.bang.the-hoa thead { display: none; }
  table.bang.the-hoa, table.bang.the-hoa tbody, table.bang.the-hoa tr, table.bang.the-hoa td { display: block; width: 100%; }
  table.bang.the-hoa tr { padding: 10px 14px; border-bottom: 1px solid var(--vien); }
  table.bang.the-hoa td { padding: 2px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.bang.the-hoa td::before { content: attr(data-nhan); color: var(--chu-phu); font-size: .8rem; text-align: left; flex: none; }
  table.bang.the-hoa td.chinh-dong { font-weight: 650; text-align: left; font-size: .97rem; padding-bottom: 4px; }
  table.bang.the-hoa td.chinh-dong::before { content: none; }
  table.bang.the-hoa td:empty { display: none; }
}
.trong { padding: 36px 16px; text-align: center; color: var(--chu-phu); }

/* ----- Biểu mẫu ----- */
.luoi-form { display: grid; gap: 12px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.luoi-form.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.luoi-form .ca-hang { grid-column: 1 / -1; }
@media (max-width: 700px) { .luoi-form, .luoi-form.ba { grid-template-columns: minmax(0, 1fr); } }
.truong { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.truong > span { font-size: .82rem; font-weight: 600; color: var(--chu-phu); }
.truong > span i { color: var(--xau); font-style: normal; }
.truong small { color: var(--chu-mo); font-size: .78rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=tel], input[type=search], input[type=time], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--vien-dam); border-radius: var(--bo-nho); background: var(--mat); min-height: 38px; }
textarea { min-height: 72px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--xam-nhat); color: var(--chu-phu); }
.hop-kiem { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.hop-kiem input { width: 18px; height: 18px; accent-color: var(--chinh); }
.thanh-loc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thanh-loc > *, .thanh-loc > input[type], .thanh-loc > select { flex: 0 1 auto; width: auto; }
.thanh-loc input[type=search] { flex: 1 1 180px; }
.chan-form { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Tab */
.tab { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); overflow-x: auto; }
.tab button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; font-weight: 600; color: var(--chu-phu); cursor: pointer; white-space: nowrap; }
.tab button.chon { color: var(--chinh-dam); border-bottom-color: var(--chinh); }
.tab .dem { background: var(--chinh); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 6px; margin-left: 5px; }

/* Dòng thông tin dạng nhãn : giá trị */
.thong-tin { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: .92rem; }
.thong-tin dt { color: var(--chu-phu); } .thong-tin dd { margin: 0; overflow-wrap: anywhere; }
.dong-tong { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.dong-tong.lon { font-size: 1.1rem; font-weight: 700; border-top: 1px solid var(--vien); margin-top: 4px; padding-top: 10px; }

/* Thanh tiến độ và biểu đồ cột đơn giản */
.tien-do { height: 8px; background: var(--xam-nhat); border-radius: 99px; overflow: hidden; }
.tien-do > i { display: block; height: 100%; background: var(--chinh); border-radius: 99px; }
.tien-do.tot > i { background: var(--tot); }
.bieu-do-cot { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bieu-do-cot .cot { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bieu-do-cot .cot i { display: block; width: 100%; max-width: 44px; background: var(--chinh); border-radius: 4px 4px 0 0; min-height: 2px; }
.bieu-do-cot .cot.am i { background: var(--xau); }
.bieu-do-cot .cot span { font-size: .7rem; color: var(--chu-phu); white-space: nowrap; }
.bieu-do-cot .cot b { font-size: .72rem; font-variant-numeric: tabular-nums; }

/* ----- Hộp thoại, thông báo ----- */
.nen-hop-thoai { position: fixed; inset: 0; background: rgba(8, 12, 22, .55); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.hop-thoai { background: var(--mat); border-radius: 14px; width: min(560px, 100%); max-height: 90dvh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.hop-thoai.rong-hon { width: min(860px, 100%); }
.hop-thoai > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--vien); }
.hop-thoai > header button { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--chu-phu); padding: 2px 8px; }
.hop-thoai > .than { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.hop-thoai > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--vien); flex-wrap: wrap; }
@media (max-width: 700px) { .nen-hop-thoai { align-items: flex-end; padding: 0; } .hop-thoai { border-radius: 14px 14px 0 0; max-height: 92dvh; } .hop-thoai > footer .nut { flex: 1; } }
.vung-thong-bao { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 28px)); pointer-events: none; }
.thong-bao { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); font-size: .92rem; border-left: 4px solid var(--tot); }
.thong-bao.loi { border-left-color: #ef4444; }
.ghi-chu { background: var(--tin-nhat); color: var(--tin); border-radius: var(--bo-nho); padding: 10px 12px; font-size: .88rem; }
.ghi-chu.canh-bao { background: var(--canh-bao-nhat); color: var(--canh-bao); }
.ghi-chu.xau { background: var(--xau-nhat); color: var(--xau); }

/* ----- Đăng nhập ----- */
.man-dang-nhap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, #1e293b, #0b1120); }
.the-dang-nhap { background: var(--mat); border-radius: 16px; padding: 28px 26px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.the-dang-nhap .logo { display: flex; align-items: center; gap: 12px; }
.the-dang-nhap .logo img { width: 44px; height: 44px; }
.the-dang-nhap .logo b { font-size: 1.3rem; display: block; line-height: 1.1; }
.the-dang-nhap .logo span { color: var(--chu-phu); font-size: .85rem; }
.bao-loi { color: var(--xau); font-size: .88rem; min-height: 1.2em; }

/* ----- Hiệu ứng khi rê chuột và phân cấp kích cỡ ----- */
.khoi { transition: border-color .16s ease, box-shadow .16s ease; }
.khoi:hover { border-color: var(--vien-dam); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 10px 28px rgba(15, 23, 42, .08); }
.the-so { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.the-so:hover { transform: translateY(-2px); border-color: var(--chinh); box-shadow: 0 10px 26px rgba(15, 23, 42, .12); }
/* Thẻ số chính: rộng gấp đôi, số to hơn, có vạch nhấn */
.the-so.lon { grid-column: span 2; padding: 18px 20px; border-left: 4px solid var(--chinh); }
.luoi-so.bon { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .luoi-so.bon { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.the-so.lon .nhan { font-size: .9rem; }
.the-so.lon .gia-tri { font-size: 2.1rem; }
.the-so.lon .phu { font-size: .86rem; }
@media (max-width: 860px) { .the-so.lon .gia-tri { font-size: 1.8rem; } }
.nut { transition: background .14s ease, border-color .14s ease, color .14s ease, transform .08s ease, box-shadow .14s ease; }
.nut:hover { border-color: var(--chinh); }
.nut.chinh:hover { box-shadow: 0 4px 14px rgba(234, 88, 12, .32); }
.nut:active { transform: translateY(1px); }
table.bang tbody tr { transition: background .12s ease; }
table.bang tbody tr:hover { background: var(--mat-2); }
table.bang tbody tr.bam:hover { background: var(--chinh-nhat); }
.tab button { transition: color .14s ease, border-color .14s ease, background .14s ease; border-radius: 8px 8px 0 0; }
.tab button:hover { color: var(--chu); background: var(--xam-nhat); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--chu-mo); }
input:focus, select:focus, textarea:focus { border-color: var(--chinh); outline: 2px solid color-mix(in srgb, var(--chinh) 30%, transparent); outline-offset: 0; }
.dong-tong { border-radius: 6px; transition: background .12s ease; }
.khoi .dong-tong:hover { background: var(--mat-2); }

/* Nhóm thông tin thu gọn được: tiêu đề lớn kèm vài con số tóm tắt, bấm để mở hoặc gập */
.nhom-gap { display: block; min-width: 0; }
.nhom-gap > summary { list-style: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; cursor: pointer;
  background: var(--mat); border: 1px solid var(--vien); border-left: 4px solid var(--vien-dam); box-shadow: var(--bong);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.nhom-gap > summary::-webkit-details-marker { display: none; }
.nhom-gap > summary .mui { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--xam-nhat); color: var(--chu-phu); flex: none;
  transition: transform .22s ease, background .16s ease, color .16s ease; }
.nhom-gap > summary .mui svg { width: 16px; height: 16px; }
.nhom-gap > summary h2 { font-size: 1.12rem; }
.nhom-gap > summary .tom-tat { margin-left: auto; display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: flex-end; color: var(--chu-phu); font-size: .86rem; }
.nhom-gap > summary .tom-tat b { color: var(--chu); font-variant-numeric: tabular-nums; font-size: .95rem; }
.nhom-gap > summary .tom-tat b.xau { color: var(--xau); } .nhom-gap > summary .tom-tat b.tot { color: var(--tot); }
.nhom-gap > summary:hover { border-color: var(--chinh); border-left-color: var(--chinh); background: var(--chinh-nhat); }
.nhom-gap > summary:hover .mui { background: var(--chinh); color: var(--tren-chinh); }
.nhom-gap[open] > summary { border-left-color: var(--chinh); }
.nhom-gap[open] > summary .mui { transform: rotate(90deg); }
.nhom-gap > .than-nhom { display: flex; flex-direction: column; gap: 14px; padding: 14px 0 6px; animation: nhom-mo .2s ease; }
@keyframes nhom-mo { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .nhom-gap > summary .tom-tat { margin-left: 40px; justify-content: flex-start; width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* In phiếu */
@media print {
  .thanh-ben, .thanh-tren, .thanh-duoi, .bang-nhom, .khong-in, .hanh-dong { display: none !important; }
  .khung-ung-dung { display: block; } body { background: #fff; } .trang { padding: 0; max-width: none; }
  .khoi { box-shadow: none; border-color: #999; break-inside: avoid; }
  /* Đang mở hộp thoại (ví dụ phiếu lương một người) thì chỉ in hộp thoại */
  body:has(.nen-hop-thoai) #ung-dung { display: none; }
  .nen-hop-thoai { position: static; background: none; padding: 0; display: block; }
  .hop-thoai { width: 100%; max-height: none; box-shadow: none; background: #fff; color: #000; }
  .hop-thoai > .than { overflow: visible; }
  .hop-thoai > footer, .hop-thoai > header button, .vung-thong-bao, .hop-thoai .nut { display: none; }
}
