/* PCF – giao diện theo bản vẽ đã chốt 28/11/2026 (thiet_ke_ui/pa_d_ket_hop): màu P&T, điện thoại trước, máy tính có ngăn trái.
   Chỉ hiển thị – mọi phép tính tiền ở máy chủ. */
:root {   /* MỌI màu ở đây (bài thử tests/nen/test_mau_mot_noi.py chặn màu viết cứng nơi khác). Sáng = mặc định. */
  --hieu: #741C17; --hieu-dam: #581410; --hieu-nhat: #F9ECEB; --hieu-chu: #741C17; --tren-hieu: #FFFFFF;
  --nen: #F7F5F2; --the: #FFFFFF; --the-nhat: #FBF9F7; --o-nhap: #FFFFFF; --vien: #DDD6CE; --vien-nhat: #ECE6E0;
  --chu: #1F1B18; --mo: #5C534C;
  --ok: #166534; --ok-nen: #E8F5EC; --ok-vien: #B7DFC3; --cho: #8A4B00; --cho-nen: #FEF3C7;
  --chinh: #5B21B6; --chinh-nen: #F1EBFE; --canh: #B23A06; --canh-nen: #FFEDD5; --canh-vien: #F5C9A0;
  --nguy: #C81E1E; --nguy-nen: #FEE2E2; --khoa: #334155; --khoa-nen: #E8ECF1;
  --nut-xanh: #166534; --nut-khoa: #334155; --nut-ra: #8A4B00; --bao-loi: #C81E1E;
  --tat-nen: #EEE9E4; --tat-vien: #DDD6CE; --tat-chu: #6F655D;
  --man-che: rgba(31, 27, 24, .45); --bao-nen: #1F1B18; --bao-chu: #FFFFFF; --qr-nen: #FFFFFF; --bong: rgba(31, 27, 24, .22);
  /* MÀU QUÁN + CHỈ TIÊU – sinh từ nen/mau.py (cong_cu/sinh_mau_css.py), KHÔNG sửa tay */
  --quan-0: #0F766E; --quan-1: #2457A6; --quan-2: #8E2F6B; --quan-3: #A8590F; --quan-4: #4D6B12; --quan-5: #6A3FA0; --quan-6: #3F5568; --quan-7: #0B6A85; --tren-quan: #FFFFFF;
  --ct-dau-nen: #EDF1F6; --ct-dau-vach: #64748B;
  --ct-doanh-thu-nen: #FFF4D2; --ct-doanh-thu-vach: #D99A06;
  --ct-tong-dt-nen: #FBE3A0; --ct-tong-dt-vach: #B97F04;
  --ct-khach-ck-du-nen: #F0EAFB; --ct-khach-ck-du-vach: #7C5CC4;
  --ct-chi-phi-nen: #FDE6DC; --ct-chi-phi-vach: #C2410C;
  --ct-chi-nhom-nen: #FEF1EA; --ct-chi-nhom-vach: #E7A486;
  --ct-tong-chi-nen: #FBD8C9; --ct-tong-chi-vach: #C2410C;
  --ct-con-lai-nen: #DDF1E3; --ct-con-lai-vach: #15803D;
  --ct-lai-gop-nen: #D3EDDB; --ct-lai-gop-vach: #15803D;
  --ct-thang-truoc-nen: #F0EEEB; --ct-thang-truoc-vach: #A8A29E;
  /* hết phần sinh từ nen/mau.py */
  color-scheme: light;
}
:root[data-giao-dien="toi"] {   /* Tối – đặt bởi giao_dien.js (chọn «Tối», hoặc «Theo máy» khi máy đang tối) */
  --hieu: #8E2A22; --hieu-dam: #6E1F19; --hieu-nhat: #3A1F1C; --hieu-chu: #F2A59C; --tren-hieu: #FFFFFF;
  --nen: #161413; --the: #211E1C; --the-nhat: #2A2623; --o-nhap: #1A1816; --vien: #48413B; --vien-nhat: #332E2A;
  --chu: #EDE7E1; --mo: #B9AFA6;
  --ok: #6EE7A0; --ok-nen: #143021; --ok-vien: #1F5C38; --cho: #FCD34D; --cho-nen: #3A2A0A;
  --chinh: #C4B5FD; --chinh-nen: #2B2145; --canh: #FDBA74; --canh-nen: #3A220F; --canh-vien: #6B3A14;
  --nguy: #FCA5A5; --nguy-nen: #3B1414; --khoa: #CBD5E1; --khoa-nen: #263040;
  --nut-xanh: #15803D; --nut-khoa: #475569; --nut-ra: #9A5508; --bao-loi: #B91C1C;
  --tat-nen: #2A2623; --tat-vien: #48413B; --tat-chu: #A39890;
  --man-che: rgba(0, 0, 0, .62); --bao-nen: #EDE7E1; --bao-chu: #161413; --qr-nen: #FFFFFF; --bong: rgba(0, 0, 0, .7);
  /* MÀU QUÁN + CHỈ TIÊU – sinh từ nen/mau.py (cong_cu/sinh_mau_css.py), KHÔNG sửa tay */
  --quan-0: #0F766E; --quan-1: #2457A6; --quan-2: #8E2F6B; --quan-3: #A8590F; --quan-4: #4D6B12; --quan-5: #6A3FA0; --quan-6: #3F5568; --quan-7: #0B6A85; --tren-quan: #FFFFFF;
  --ct-dau-nen: #232A33; --ct-dau-vach: #7C8BA1;
  --ct-doanh-thu-nen: #3A2F12; --ct-doanh-thu-vach: #E0A82A;
  --ct-tong-dt-nen: #4A3B10; --ct-tong-dt-vach: #E9B949;
  --ct-khach-ck-du-nen: #2C2440; --ct-khach-ck-du-vach: #9B82D9;
  --ct-chi-phi-nen: #3D2218; --ct-chi-phi-vach: #E06A3A;
  --ct-chi-nhom-nen: #33231C; --ct-chi-nhom-vach: #C98A6C;
  --ct-tong-chi-nen: #4A2616; --ct-tong-chi-vach: #E06A3A;
  --ct-con-lai-nen: #16301F; --ct-con-lai-vach: #3FAE6A;
  --ct-lai-gop-nen: #143A22; --ct-lai-gop-vach: #3FAE6A;
  --ct-thang-truoc-nen: #2A2725; --ct-thang-truoc-vach: #8C847D;
  /* hết phần sinh từ nen/mau.py */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--chu); background: var(--nen); -webkit-font-smoothing: antialiased; }
.so, table { font-variant-numeric: tabular-nums; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.nho { width: 18px; height: 18px; } svg.i.to { width: 28px; height: 28px; }
.logo { width: 34px; height: 34px; flex: none; display: block; }
h1 { font-size: 22px; margin: 4px 0 14px; } h2 { font-size: 17px; margin: 18px 0 8px; }
.mo { color: var(--mo); } .phai { text-align: right; } .dam { font-weight: 700; } .nho { font-size: 14px; }

/* Khung: điện thoại = đầu trang + thanh dưới; máy tính (≥ 1000 px) = ngăn trái */
#dau { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--hieu); color: var(--tren-hieu); position: sticky; top: 0; z-index: 3; }
#dau .ten { font-weight: 700; font-size: 18px; line-height: 1.2; } #dau .phu { font-size: 14px; opacity: .9; }
#ngan { display: none; }
main { padding: 16px 16px 96px; max-width: 1240px; margin: 0 auto; }
#duoi { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--the); border-top: 1px solid var(--vien); z-index: 3; padding-bottom: env(safe-area-inset-bottom); }
#duoi a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; color: var(--mo); text-decoration: none; font-size: 13px; position: relative; min-height: 60px; }
#duoi a.dang { color: var(--hieu-chu); font-weight: 600; } #duoi a.dang::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--hieu); border-radius: 0 0 3px 3px; }
.dem { position: absolute; top: 2px; left: 52%; min-width: 20px; height: 20px; border-radius: 10px; background: var(--hieu); color: var(--tren-hieu); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
@media (min-width: 1000px) {
  /* minmax(0, 1fr) + main min-width 0: cột nội dung KHÔNG được nở theo bảng / hàng nút bên trong (lỗi tràn ngang 1920 px, Kiệt 29/11/2026) –
     nội dung rộng thì tự xuống dòng, bảng rộng thì chỉ bảng cuộn trong khung .cuon của nó */
  body { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  #dau, #duoi { display: none; }
  body.chua-vao { display: block; } body.chua-vao #ngan { display: none; }    /* màn đăng nhập: không có ngăn trái trống */
  #ngan { display: flex; flex-direction: column; background: var(--the); border-right: 1px solid var(--vien); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
  #ngan .thuong-hieu { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; } #ngan .thuong-hieu b { display: block; }
  #ngan .nhom { font-size: 12px; font-weight: 700; color: var(--mo); letter-spacing: .04em; margin: 18px 12px 6px; }
  #ngan a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--chu); text-decoration: none; font-size: 15px; position: relative; }
  #ngan a.dang { background: var(--hieu); color: var(--tren-hieu); font-weight: 600; }
  #ngan a .dem { position: static; margin-left: auto; }
  #ngan .chan { margin-top: auto; border-top: 1px solid var(--vien); padding: 12px 12px 0; font-size: 14px; }
  main { padding: 20px 28px 40px; max-width: none; margin: 0; min-width: 0; }
}

/* Thành phần */
.the { background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.hang { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; } .hang > * { flex: 1 1 150px; }
.dau-man { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.dau-man h1 { margin: 0; }
.dau-man > .hang { justify-content: flex-end; } .dau-man > .hang > * { flex: 0 1 auto; }   /* cụm nút bên phải: không kéo dãn, chật thì xuống dòng */
label { display: block; font-size: 15px; font-weight: 600; color: var(--mo); margin: 12px 0 6px; }
input, select, textarea { font: inherit; width: 100%; min-height: 48px; border: 1.5px solid var(--vien); border-radius: 10px; background: var(--o-nhap); padding: 10px 12px; color: var(--chu); }
textarea { min-height: 96px; }
button, .nut { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 10px; border: 1.5px solid var(--hieu); background: var(--hieu); color: var(--tren-hieu); cursor: pointer; white-space: nowrap; text-decoration: none; }
button.phu, .nut.phu { background: var(--the); color: var(--hieu-chu); border-color: var(--hieu-chu); } button.nhat { background: transparent; color: var(--chu); border-color: var(--vien); }
button.xanh { background: var(--nut-xanh); border-color: var(--nut-xanh); } button.nguy { background: var(--the); color: var(--nguy); border-color: var(--nguy); }
button.khoa { background: var(--nut-khoa); border-color: var(--nut-khoa); }
button:disabled { background: var(--tat-nen); border-color: var(--tat-vien); color: var(--tat-chu); cursor: default; }
.nhan { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 99px; white-space: nowrap; }
.nhan svg.i { width: 15px; height: 15px; stroke-width: 2.4; }
.nhan.ok { color: var(--ok); background: var(--ok-nen); } .nhan.cho { color: var(--cho); background: var(--cho-nen); }
.nhan.chinh { color: var(--chinh); background: var(--chinh-nen); } .nhan.canh { color: var(--canh); background: var(--canh-nen); }
.nhan.nguy { color: var(--nguy); background: var(--nguy-nen); } .nhan.khoa { color: var(--khoa); background: var(--khoa-nen); }
.do { color: var(--nguy); } .xanh-chu { color: var(--ok); }

/* Dải quán + ngày */
.dai { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--vien); align-items: center; }
.dai button { min-height: 40px; border-radius: 99px; background: var(--the); color: var(--chu); border-color: var(--vien); padding: 0 14px; }
.dai button.dang { background: var(--hieu); color: var(--tren-hieu); border-color: var(--hieu); }
.dai .ngay { margin-left: auto; display: flex; align-items: center; gap: 4px; background: var(--the); border: 1px solid var(--vien); border-radius: 10px; padding: 0 4px; }
.dai .ngay button { border: 0; min-height: 40px; padding: 0 8px; background: transparent; color: var(--chu); }
.dai .ngay input { border: 0; min-height: 40px; width: 150px; padding: 0 4px; font-weight: 700; }

/* Bảng */
/* Bảng rộng hơn khung: chỉ BẢNG cuộn trong khung, có bóng mờ ở mép còn nội dung (CSS thuần: lớp «local» che bóng khi đã cuộn tới mép) */
.cuon { overflow-x: auto; background:
  linear-gradient(to right, var(--the) 30%, transparent) left center / 40px 100% no-repeat local,
  linear-gradient(to left, var(--the) 30%, transparent) right center / 40px 100% no-repeat local,
  radial-gradient(farthest-side at 0 50%, var(--bong), transparent) left center / 14px 100% no-repeat scroll,
  radial-gradient(farthest-side at 100% 50%, var(--bong), transparent) right center / 14px 100% no-repeat scroll, var(--the); }
.cuon > table.bang { background: transparent; }
table.bang { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--the); }
table.bang th { font-size: 14px; font-weight: 700; color: var(--mo); text-align: right; padding: 10px 12px; border-bottom: 1.5px solid var(--vien); white-space: nowrap; background: var(--the-nhat); }
table.bang td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--vien-nhat); white-space: nowrap; }
table.bang th:first-child, table.bang td:first-child { text-align: left; }
table.bang td.xuong { white-space: normal; min-width: 150px; }   /* ô chữ dài (lời nhắc, lý do) xuống dòng để bảng co theo khung */
table.bang tr.tong td { font-weight: 700; border-top: 1.5px solid var(--vien); background: var(--the-nhat); }
td.da-chinh, .o3 > div.da-chinh { background: var(--chinh-nen); color: var(--chinh); font-weight: 700; cursor: pointer; }
td.sua-tay, .o3 > div.sua-tay { background: var(--cho-nen); color: var(--cho); font-weight: 700; cursor: pointer; }     /* số sửa / nhập tay */
td.lech, .o3 > div.lech { background: var(--nguy-nen); color: var(--nguy); font-weight: 700; cursor: pointer; }       /* KiotViet đổi sau khi sửa tay */
td.o-sua, .o3 > div.o-sua { cursor: pointer; } td.o-sua:hover, .o3 > div.o-sua:hover { box-shadow: inset 0 0 0 2px var(--hieu-chu); }
table.bang td small, .o3 small { display: block; font-weight: 400; font-size: 12px; }

/* Màu QUÁN + màu CHỈ TIÊU nhất quán khắp PCF (Kiệt 29/11/2026) – biến ở phần sinh từ nen/mau.py trong hai khối :root.
   Màu quán: JS đặt style="--mq: var(--quan-N)" (PCF.mauQuan); chỉ dùng làm chấm / viền / NỀN dưới chữ trắng – không làm màu chữ. */
.cham-quan { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mq, var(--mo)); margin-right: 7px; vertical-align: 1px; flex: none; }
.nhan-quan { display: inline-block; background: var(--mq, var(--hieu)); color: var(--tren-quan); border-radius: 99px; padding: 1px 10px; font-weight: 700; font-size: 13px; }
table.bang th.cot-quan, table.bang.co-quan tr:first-child th { box-shadow: inset 0 4px var(--mq, var(--vien)); }   /* bảng của một quán: vạch màu quán trên đầu */
.ct-dau { --ct-nen: var(--ct-dau-nen); --ct-vach: var(--ct-dau-vach); } .ct-doanh-thu { --ct-nen: var(--ct-doanh-thu-nen); --ct-vach: var(--ct-doanh-thu-vach); }
.ct-tong-dt { --ct-nen: var(--ct-tong-dt-nen); --ct-vach: var(--ct-tong-dt-vach); } .ct-khach-ck-du { --ct-nen: var(--ct-khach-ck-du-nen); --ct-vach: var(--ct-khach-ck-du-vach); }
.ct-chi-phi { --ct-nen: var(--ct-chi-phi-nen); --ct-vach: var(--ct-chi-phi-vach); } .ct-con-lai { --ct-nen: var(--ct-con-lai-nen); --ct-vach: var(--ct-con-lai-vach); }
table.bang tr.ct td { background: var(--ct-nen); } table.bang tr.ct td:first-child { box-shadow: inset 4px 0 var(--ct-vach); }
.the.ct { background: var(--ct-nen); box-shadow: inset 4px 0 var(--ct-vach); }

/* Thẻ số lớn, ô cách trả */
.so-to { font-size: 36px; font-weight: 800; line-height: 1.15; }
.o3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.o3 > div { background: var(--nen); border-radius: 10px; padding: 8px 10px; } .o3 b { display: block; font-size: 17px; }
.o3 > div.chinh { background: var(--chinh-nen); color: var(--chinh); }
.dong-the { display: flex; gap: 12px; align-items: center; justify-content: space-between; }

/* Việc chờ */
.vc-nhom { font-size: 14px; font-weight: 700; padding: 10px 14px; background: var(--the-nhat); border-bottom: 1px solid var(--vien); display: flex; justify-content: space-between; }
.vc { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--vien-nhat); cursor: pointer; align-items: flex-start; }
.vc.dang { background: var(--hieu-nhat); box-shadow: inset 3px 0 0 var(--hieu-chu); }
.vc .tron { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--nen); }
.vc .noi { flex: 1; min-width: 0; } .vc .noi b { display: block; }
.ba-cot { display: grid; gap: 16px; } @media (min-width: 1000px) { .ba-cot { grid-template-columns: 400px minmax(0, 1fr) 280px; align-items: start; } }

/* Phiếu đề xuất kiểu tờ giấy */
.phieu { background: var(--the); border: 1.5px solid var(--chu); border-radius: 4px; padding: 0; }
.phieu .dau { text-align: center; padding: 14px; border-bottom: 1px dashed var(--vien); } .phieu .dau b { font-size: 18px; letter-spacing: .03em; }
.phieu .dong { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--vien-nhat); }
.phieu .tong { display: flex; justify-content: space-between; padding: 12px 14px; border-top: 2px solid var(--chu); font-size: 22px; font-weight: 800; }

/* Chấm công */
.gio-to { font-size: 64px; font-weight: 800; text-align: center; line-height: 1; margin: 6px 0 16px; }
.nut-to { width: 100%; min-height: 120px; font-size: 30px; border-radius: 22px; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.nut-to.ra { background: var(--nut-ra); border-color: var(--nut-ra); }
.trang-thai { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.trang-thai.ok { background: var(--ok-nen); border: 1px solid var(--ok-vien); } .trang-thai.canh { background: var(--canh-nen); border: 1px solid var(--canh-vien); }
.nv main { font-size: 18px; }

/* Hộp nổi (thay cho prompt / confirm của trình duyệt) */
.man-che { position: fixed; inset: 0; background: var(--man-che); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.hop { background: var(--the); color: var(--chu); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px; max-height: 90vh; overflow: auto; }
@media (min-width: 700px) { .man-che { align-items: center; } .hop { border-radius: 18px; } }
/* Hộp «Lương của …» / «Biến động tháng» (Việc L 29/11/2026): phụ cấp từng dòng, ô tích, khối tạm tính do máy chủ tính */
.hang.tren { align-items: flex-start; }   /* hộp có chữ ghi chú dưới ô: các ô thẳng hàng trên */
label.o-tich { display: flex; gap: 10px; align-items: center; color: var(--chu); font-weight: 500; }
label.o-tich input { width: 22px; min-height: 22px; flex: 0 0 22px; }
.pc-dong { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pc-dong small { grid-column: 1 / -1; margin-top: -4px; }
.tam-tinh { background: var(--the-nhat); margin: 14px 0 6px; } .tam-tinh .dong-the { padding: 4px 0; }
.tam-tinh .tt-thuc { border-top: 1.5px solid var(--vien); margin-top: 6px; padding-top: 8px; color: var(--hieu-chu); font-size: 18px; }
table.bang tr.bam { cursor: pointer; } table.bang tr.bam:hover td { background: var(--the-nhat); }
[hidden] { display: none !important; }
/* Ảnh báo giá đính kèm đề xuất chi (Việc G 29/11/2026): lưới ảnh nhỏ, nút bỏ góc trên, hộp phóng to */
.anh-dk { display: flex; flex-wrap: wrap; gap: 8px; }
.anh-nho { position: relative; margin: 0; width: 88px; height: 88px; }
.anh-nho .anh-bam { padding: 0; width: 100%; height: 100%; min-height: 0; border-radius: 10px; overflow: hidden; background: var(--the-nhat); border: 1px solid var(--vien); }
.anh-nho img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anh-nho .anh-bo { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 99px; display: grid; place-items: center; }
.phieu [data-anh-dx]:not(:empty) { padding: 0 14px 14px; }
.nut-anh { margin-top: 8px; } .nut-anh > * { flex: 0 1 auto; }
.hop.hop-anh { max-width: 960px; } .anh-to img { width: 100%; height: auto; max-height: 75vh; object-fit: contain; display: block; border-radius: 10px; }
.duoi-co-dinh { position: sticky; bottom: 0; background: var(--the); padding-top: 12px; }
#bao { position: fixed; left: 16px; right: 16px; bottom: 80px; padding: 12px 14px; border-radius: 12px; background: var(--bao-nen); color: var(--bao-chu); display: none; z-index: 20; max-width: 560px; margin: 0 auto; }
#bao.loi { background: var(--bao-loi); color: var(--tren-hieu); }
.the-tab { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); margin-bottom: 14px; overflow-x: auto; }
.the-tab button { background: transparent; color: var(--mo); border: 0; border-radius: 0; border-bottom: 3px solid transparent; min-height: 44px; }
.the-tab button.dang { color: var(--hieu-chu); border-bottom-color: var(--hieu-chu); }
.dem[hidden] { display: none !important; }
.dai { flex-wrap: wrap; }
table.bang td button { min-height: 40px; padding: 0 12px; }
table.bang td .nhan { margin-top: 4px; }
.dai .chips { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 100%; scrollbar-width: none; }
.dai .chips button { flex: none; }
@media (min-width: 1000px) { .dai { flex-wrap: nowrap; } .dai .chips { flex: 1 1 auto; flex-wrap: wrap; } }
[hidden] { display: none !important; }       /* thuộc tính hidden luôn thắng các luật display ở trên (thanh dưới, ô đếm…) */
.hang > .nhan { flex: 0 0 auto; }

/* Xem trước ảnh báo cáo: đúng tấm ảnh sẽ gửi (luôn nền sáng, kể cả giao diện tối) */
.xem-truoc { overflow: auto; max-height: 75vh; border: 1px solid var(--vien); border-radius: 10px; background: var(--nen); padding: 8px; text-align: center; }
.xem-truoc img { display: block; margin: 0 auto; height: auto; max-width: 100%; box-shadow: 0 1px 6px var(--bong); }
.xem-truoc img.doc { width: 720px; }

/* Bản đồ vị trí quán (Leaflet) */
.ban-do { height: 300px; border: 1px solid var(--vien); border-radius: 12px; margin-top: 10px; z-index: 0; }
a { color: var(--hieu-chu); }
/* Công tắc giao diện Sáng / Tối / Theo máy */
.cong-tac { display: inline-flex; border: 1.5px solid var(--vien); border-radius: 10px; overflow: hidden; }
.cong-tac button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 0; background: var(--the); color: var(--chu); font-weight: 500; font-size: 14px; }
.cong-tac button.dang { background: var(--hieu); color: var(--tren-hieu); font-weight: 700; }
:root[data-giao-dien="toi"] .leaflet-tile-pane { filter: brightness(.78) contrast(1.05); }   /* bản đồ bớt chói ở giao diện tối */

/* Lịch sử thao tác: cột «Trước → sau» rộng nhất, mỗi trường một dòng, giá trị ngắn không ngắt giữa chừng; điện thoại: mỗi dòng một thẻ dọc */
table.ls-bang td, table.ls-bang th { vertical-align: top; text-align: left; }
table.ls-bang td.ls-hep { white-space: normal; min-width: 96px; max-width: 170px; }
table.ls-bang td.ls-doi { white-space: normal; min-width: 360px; width: 45%; }
.ls-truong { padding: 1px 0; line-height: 1.45; } .ls-truong + .ls-truong { border-top: 1px dashed var(--vien-nhat); }
.ls-gt { white-space: nowrap; } .ls-gt.dai { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 699px) {
  table.ls-bang, table.ls-bang tbody, table.ls-bang tr, table.ls-bang td, table.ls-bang td.ls-hep, table.ls-bang td.ls-doi { display: block; width: auto; min-width: 0; max-width: none; }
  table.ls-bang tr.ls-dau { display: none; }
  table.ls-bang tr { border: 1px solid var(--vien); border-radius: 12px; margin: 10px; padding: 6px 0; background: var(--the); display: flex; flex-wrap: wrap; align-items: center; }
  table.ls-bang td { flex: 1 1 100%; } table.ls-bang td.ls-o-chon { flex: 0 0 auto; padding-right: 0; } table.ls-bang td.ls-luc { flex: 1 1 0; }
  table.ls-bang td.ls-trong { display: none; }   /* điện thoại: ô trống (quán, ghi chú…) không chiếm chỗ trong thẻ */
  table.ls-bang td { border: 0; padding: 4px 12px; }
  table.ls-bang td[data-nhan]::before { content: attr(data-nhan); display: block; font-size: 12px; font-weight: 700; color: var(--mo); }
  .ls-gt { white-space: normal; overflow-wrap: anywhere; }
}
