/* Giao diện phần mềm quản lý Trang phục biểu diễn.
   Bố cục: một bàn làm việc dày như bảng tính. Thanh mục nằm ngang ở trên để dành hết bề ngang cho bảng; trạng thái của đơn
   là một ô tô đúng màu trên sheet, như nhân viên vẫn nhìn hằng ngày. Phần đầu tệp là bố cục; phần cuối tệp ("Màu, chiều sâu
   và chuyển động") là bề mặt: bo góc, bóng, màu khi rê chuột, chuyển động. */
:root {
  --nen: #f0f3f9;        /* mặt bàn */
  --mat: #ffffff;        /* mặt giấy của khung */
  --muc: #0f172a;        /* mực chữ */
  --phu: #475569;        /* chữ phụ */
  --mo: #8a94a8;
  --ke: #d6dce8;         /* viền khung */
  --ke-nhat: #e8ecf4;    /* đường kẻ giữa các hàng */
  --ke-dam: #a8b3c7;     /* viền ô nhập, nút viền */
  --dau-bang: #f5f7fb;   /* nền hàng tiêu đề */
  --cham: #2251e0;       /* xanh cô-ban: nút, liên kết, ô đang chọn */
  --cham-dam: #173bb0;
  --cham-sang: #4f7bff;
  --cham-nhat: #eaf0ff;
  --cham-mo: rgba(34, 81, 224, .18);   /* quầng quanh ô đang gõ */
  --re: #f1f5ff;         /* nền của hàng khi rê chuột */
  --nhan-manh: #ff9f1c;  /* cam hổ phách: nút Tạo đơn, vệt đèn ở thanh trên */
  --do: #c81e1e; --do-nhat: #fdeceb;
  --vang: #a15c00; --vang-nhat: #fff3d6;
  --xanh: #0c7a43; --xanh-nhat: #e2f6ea;
  --xam-nhat: #eef1f7;
  --bieu-do: #3b6cf6;
  --m1: #e6edff; --m2: #c9d8ff; --m3: #a3bcff; --m4: #7c9df5;   /* bốn mức đậm nhạt của ô lịch và bảng việc */
  --bong-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --bong-2: 0 8px 20px -6px rgba(15, 23, 42, .16), 0 2px 5px rgba(15, 23, 42, .06);
  --bong-3: 0 22px 44px -14px rgba(11, 20, 55, .32), 0 4px 10px rgba(15, 23, 42, .08);
  --chu: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --nhan-de: "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;   /* chữ hẹp như nhãn kệ, thẻ treo đồ: tên trang, mã, con số */
  --r: 6px;
  --r-lon: 10px;
  --nhanh: 140ms;
  --vua: 230ms;
  --em: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--muc); font-family: var(--chu); font-size: 13.5px; line-height: 1.4; }
a { color: var(--cham); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0; font-family: var(--nhan-de); font-size: 25px; font-weight: 600; line-height: 1.15; }
h2 { margin: 0; font-size: 14px; font-weight: 700; }
h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--phu); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.so { font-variant-numeric: tabular-nums; }
.phai { text-align: right; }
.phu { color: var(--phu); }
.mo { color: var(--mo); }
.nho { font-size: 12.5px; }
.rat-nho { font-size: 12px; }
.dam { font-weight: 700; }
.nua-dam { font-weight: 600; }
.cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bt { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bt.nho { width: 14px; height: 14px; }
.bt.lon { width: 26px; height: 26px; }
.an-doc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cham); outline-offset: 1px; }

/* ---------- Khung chung: hai hàng ở trên (tên shop + tìm + người dùng; các mục) */
.vo { min-height: 100vh; display: flex; flex-direction: column; }
.thanh-tren { position: sticky; top: 0; z-index: 30; background: var(--mat); border-bottom: 1px solid var(--ke); }
.hang-ten { display: flex; align-items: center; gap: 16px; height: 46px; padding: 0 18px; }
.nhan-hieu { display: flex; align-items: baseline; gap: 8px; color: var(--muc); white-space: nowrap; }
.nhan-hieu:hover { text-decoration: none; }
.nhan-hieu strong { font-family: var(--nhan-de); font-size: 19px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.nhan-hieu small { font-size: 12px; color: var(--phu); }
.tim-chung { position: relative; flex: 1 1 280px; max-width: 520px; }
.tim-chung .o-tim { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px; background: var(--mat); border: 1px solid var(--ke-dam); border-radius: var(--r); color: var(--phu); }
.tim-chung .o-tim:focus-within { border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); }
.tim-chung input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--muc); }
.tim-chung kbd { font: inherit; font-size: 11.5px; padding: 0 6px; border: 1px solid var(--ke); border-radius: var(--r); background: var(--dau-bang); color: var(--phu); }
.go-y { position: absolute; left: 0; right: 0; top: 35px; background: var(--mat); border: 1px solid var(--ke-dam); box-shadow: 0 6px 18px rgba(22, 24, 29, .18); max-height: min(70vh, 560px); overflow-y: auto; }
.go-y[hidden] { display: none; }
.go-y .dau-nhom { padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--phu); background: var(--dau-bang); border-top: 1px solid var(--ke-nhat); }
.go-y a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: var(--muc); border-top: 1px solid var(--ke-nhat); }
.go-y a:hover, .go-y a.dang-o { background: var(--cham-nhat); text-decoration: none; }
.go-y a .chu { min-width: 0; flex: 1; }
.go-y a .chu strong { display: block; }
.go-y a .chu span { display: block; font-size: 12px; color: var(--phu); }
.go-y .tat-ca { justify-content: center; font-weight: 600; color: var(--cham); }
.go-y .trong-rong { padding: 12px 10px; color: var(--phu); text-align: left; }
.hang-ten .nguoi { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 13px; }
.hang-ten .nguoi .ten strong { font-weight: 600; }
.hang-ten .nguoi .ten span { color: var(--phu); }
.nut-chu { background: none; border: 0; padding: 0; color: var(--cham); cursor: pointer; }
.nut-chu:hover { text-decoration: underline; }
.nut-bt { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--phu); cursor: pointer; }
.nut-bt:hover { background: var(--dau-bang); color: var(--muc); }
.nut-bt.nut-menu { display: none; }
.hang-muc { display: flex; align-items: stretch; gap: 2px; padding: 0 12px; border-top: 1px solid var(--ke-nhat); overflow-x: auto; scrollbar-width: none; }
.hang-muc a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; color: var(--phu); font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; }
.hang-muc a:hover { color: var(--muc); background: var(--dau-bang); text-decoration: none; }
.hang-muc a[aria-current="page"] { color: var(--muc); border-bottom-color: var(--cham); }
.hang-muc .ngan { width: 1px; margin: 8px 8px; background: var(--ke); }
.hang-muc .dem { font-weight: 400; font-variant-numeric: tabular-nums; color: var(--phu); }
.hang-muc .tuoi { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 0 6px; font-size: 12.5px; color: var(--phu); white-space: nowrap; }
.tuoi .cham { width: 8px; height: 8px; background: #2f9e5e; flex: none; }
.tuoi.cu .cham { background: #d98a00; }

.trang { padding: 14px 18px 40px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1760px; }
.dau-trang { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.dau-trang .ten-trang { margin-right: auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.duong-ve { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
.canh-bao-cu, .thong-bao { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid; border-radius: var(--r); }
.canh-bao-cu { background: var(--vang-nhat); border-color: #f1cf86; color: #4a3200; }
.thong-bao { background: var(--cham-nhat); border-color: #bfd0ff; color: var(--cham-dam); }

/* ---------- Nút, ô nhập */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r); border: 1px solid var(--cham); background: var(--cham); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.nut:hover { background: var(--cham-dam); border-color: var(--cham-dam); color: #fff; text-decoration: none; }
.nut.vien { background: var(--mat); color: var(--muc); border-color: var(--ke-dam); }
.nut.vien:hover { background: var(--dau-bang); color: var(--muc); border-color: var(--cham); }
.nut.nho { height: 26px; padding: 0 9px; font-size: 12.5px; }
.nut.do { background: var(--mat); color: var(--do); border-color: #f0b4ae; }
.nut.do:hover { background: var(--do-nhat); border-color: var(--do); color: var(--do); }
.nut.lon { height: 38px; padding: 0 18px; font-size: 14.5px; }
.nut kbd, .phim { font: inherit; font-size: 11px; padding: 0 5px; border: 1px solid currentColor; border-radius: var(--r); opacity: .75; }
.o { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.o > span { font-size: 12px; font-weight: 600; color: var(--phu); }
.o input, .o select, .o textarea, .o-don { height: 32px; padding: 0 8px; border: 1px solid var(--ke-dam); border-radius: var(--r); background: var(--mat); min-width: 0; width: 100%; }
.o textarea { height: auto; padding: 6px 8px; }
.o input:focus, .o select:focus, .o textarea:focus { outline: 0; border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); }
.o-tim-nho { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px; border: 1px solid var(--ke-dam); border-radius: var(--r); background: var(--mat); color: var(--phu); }
.o-tim-nho:focus-within { border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); }
.o-tim-nho input { border: 0; outline: 0; flex: 1; min-width: 0; height: 28px; padding: 0; background: transparent; color: var(--muc); box-shadow: none !important; }
.thanh-loc { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 9px 12px; background: var(--mat); border: 1px solid var(--ke); border-radius: var(--r); }
.thanh-loc.tran { padding: 0; border: 0; background: transparent; }
.buoc-thang { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--ke-dam); border-radius: var(--r); background: var(--mat); }
.buoc-thang a { width: 30px; height: 30px; display: grid; place-items: center; color: var(--phu); }
.buoc-thang a:hover { background: var(--dau-bang); color: var(--muc); }
.buoc-thang strong { padding: 0 10px; font-weight: 600; white-space: nowrap; border-left: 1px solid var(--ke-nhat); border-right: 1px solid var(--ke-nhat); line-height: 30px; }

/* ---------- Khung */
.the { background: var(--mat); border: 1px solid var(--ke); border-radius: var(--r); min-width: 0; container-type: inline-size; }
.the > .dau-the { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; background: var(--dau-bang); border-bottom: 1px solid var(--ke); }
.the > .dau-the .ghi { font-size: 12.5px; color: var(--phu); }
.the > .than { padding: 12px; }
.the > .than.sat { padding: 0; }
.luoi { display: grid; gap: 14px; }
.luoi.hai { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.luoi.deu { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.luoi.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.trong-rong { padding: 22px 12px; color: var(--phu); }
.trong-rong .bt { display: none; }
.dau-muc { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; background: var(--dau-bang); font-size: 12.5px; font-weight: 600; color: var(--phu); border-top: 1px solid var(--ke); border-bottom: 1px solid var(--ke-nhat); }

/* ---------- Dải số: các ô liền nhau, mỗi ô dẫn sang đúng chỗ của nó */
.dai-so { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--mat); border: 1px solid var(--ke); border-radius: var(--r); }
.dai-so > * { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 11px; border-left: 1px solid var(--ke-nhat); color: var(--muc); min-width: 0; }
.dai-so > :first-child { border-left: 0; }
.dai-so > a:hover { background: var(--re); text-decoration: none; }
.dai-so > a:hover .ten { color: var(--cham); text-decoration: underline; }
.dai-so .ten { font-size: 12.5px; font-weight: 600; color: var(--phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dai-so .gia-tri { font-family: var(--nhan-de); font-size: 31px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dai-so .gia-tri small { font-family: var(--chu); font-size: 12.5px; font-weight: 400; color: var(--phu); margin-left: 5px; }
.dai-so .duoi { font-size: 12.5px; color: var(--phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dai-so .t-do .gia-tri, .dai-so .t-do.gia-tri, .t-do > .gia-tri { color: var(--do); }
.t-vang > .gia-tri { color: var(--vang); }
.t-xanh > .gia-tri { color: var(--xanh); }
.thanh-tien { height: 4px; background: #dfe3e9; margin-top: 3px; }
.thanh-tien > i { display: block; height: 100%; background: var(--cham); }
/* Tên cũ của các thẻ số, giữ để các trang chưa sắp lại vẫn dùng chung kiểu dải số. */
.luoi-so { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--mat); border: 1px solid var(--ke); border-radius: var(--r); }
.luoi-so > .the-so { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 11px; border-left: 1px solid var(--ke-nhat); color: var(--muc); min-width: 0; }
.luoi-so > .the-so:first-child { border-left: 0; }
.luoi-so > a.the-so:hover { background: var(--re); text-decoration: none; }
.the-so .tren .ten { font-size: 12.5px; font-weight: 600; color: var(--phu); }
.the-so .o-bt { display: none; }
.the-so .gia-tri { font-family: var(--nhan-de); font-size: 31px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.the-so .gia-tri small { font-family: var(--chu); font-size: 12.5px; font-weight: 400; color: var(--phu); margin-left: 5px; }
.the-so .duoi { font-size: 12.5px; color: var(--phu); }
.the-so.t-do .gia-tri { color: var(--do); }
.the-so.t-vang .gia-tri { color: var(--vang); }
.the-so.dang-chon { box-shadow: inset 0 -3px 0 var(--cham); background: var(--re); }

/* ---------- Sơ đồ đường đi của đơn */
.so-do { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 12px; }
.so-do .nut-sd { flex: 1 1 0; min-width: 104px; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 9px; border: 1px solid var(--ke); background: var(--mat); color: var(--muc); position: relative; }
.so-do a.nut-sd:hover { border-color: var(--cham); background: var(--re); text-decoration: none; z-index: 1; }
.so-do .nut-sd .ten { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.so-do .nut-sd .so-lon { font-family: var(--nhan-de); font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.so-do .nut-sd .ghi { font-size: 12px; color: var(--phu); }
.so-do .mui-sd { flex: none; width: 22px; display: grid; place-items: center; color: var(--mo); }
.so-do .nut-sd.rong { color: var(--mo); background: var(--dau-bang); }
.so-do .nut-sd.cuoi { background: var(--dau-bang); }
.de-y { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 9px 12px; border-top: 1px solid var(--ke-nhat); }
.de-y > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--phu); margin-right: 2px; }
.de-y a { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border: 1px solid var(--ke); border-radius: var(--r); color: var(--muc); background: var(--mat); }
.de-y a:hover { border-color: var(--cham); text-decoration: none; background: var(--re); }
.de-y a b { font-family: var(--nhan-de); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.de-y a.do b { color: var(--do); }
.de-y a.vang b { color: var(--vang); }

/* ---------- Bảng việc theo ngày */
.ma-tran { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ma-tran th, .ma-tran td { border: 1px solid var(--ke-nhat); padding: 0; text-align: center; }
.ma-tran thead th { padding: 5px 2px; font-size: 12px; font-weight: 400; color: var(--phu); background: var(--dau-bang); line-height: 1.25; }
.ma-tran thead th b { display: block; color: var(--muc); font-weight: 600; font-variant-numeric: tabular-nums; }
.ma-tran thead th.hom-nay { background: var(--cham); color: #e4ecff; }
.ma-tran thead th.hom-nay b { color: #fff; }
.ma-tran thead th.cuoi-tuan b { color: var(--do); }
.ma-tran tbody th { width: 96px; padding: 0 10px; text-align: left; font-weight: 600; background: var(--dau-bang); white-space: nowrap; }
.ma-tran tbody th small { display: block; font-weight: 400; font-size: 11.5px; color: var(--phu); }
.ma-tran td a, .ma-tran td span { display: block; padding: 8px 0; color: var(--muc); font-family: var(--nhan-de); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ma-tran td span { color: #c3c8d1; font-weight: 400; }
.ma-tran td a:hover { box-shadow: inset 0 0 0 2px var(--cham); text-decoration: none; }
.ma-tran td.m1 a { background: var(--m1); }
.ma-tran td.m2 a { background: var(--m2); }
.ma-tran td.m3 a { background: var(--m3); }
.ma-tran td.m4 a { background: var(--m4); color: #0b1a4a; }
.ma-tran td.cot-hom-nay { box-shadow: inset 2px 0 0 var(--cham), inset -2px 0 0 var(--cham); }

/* ---------- Ô trạng thái (đúng màu trên sheet), nhãn */
.tt { display: inline-block; min-width: 92px; padding: 2px 8px; border: 1px solid; border-radius: var(--r); font-size: 12.5px; font-weight: 600; text-align: center; white-space: nowrap; }
.cham-tt { width: 11px; height: 11px; border: 1px solid; flex: none; display: inline-block; }
.vach { display: none; }
.nhan { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--xam-nhat); color: var(--phu); }
.nhan.do { background: var(--do-nhat); color: var(--do); }
.nhan.vang { background: var(--vang-nhat); color: var(--vang); }
.nhan.xanh { background: var(--xanh-nhat); color: var(--xanh); }
.nhan.lam { background: var(--cham-nhat); color: var(--cham-dam); }
.nhan.tim { background: var(--xam-nhat); color: var(--muc); border: 1px solid var(--ke); }
.nhan .bt { width: 12px; height: 12px; stroke-width: 2.2; }

/* ---------- Nút lọc và tab */
.day-loc { display: flex; flex-wrap: wrap; gap: 0; }
.loc { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--ke-dam); margin: 0 -1px -1px 0; background: var(--mat); color: var(--muc); white-space: nowrap; flex: none; }
.loc:hover { background: var(--dau-bang); text-decoration: none; }
.loc b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--phu); }
.loc[aria-current="true"] { background: var(--cham); border-color: var(--cham); color: #fff; z-index: 1; }
.loc[aria-current="true"] b { color: #e4ecff; }
.loc.bo { border-style: dashed; }
.tab { display: flex; gap: 0; padding: 0 6px; border-bottom: 1px solid var(--ke); overflow-x: auto; scrollbar-width: none; background: var(--mat); }
.tab a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--phu); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab a:hover { color: var(--muc); text-decoration: none; background: var(--dau-bang); }
.tab a[aria-current="true"] { color: var(--muc); border-bottom-color: var(--cham); }
.tab a b { font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- Danh sách dạng hàng (lưới) */
.ds { display: flex; flex-direction: column; }
.hang { display: grid; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--ke-nhat); color: var(--muc); position: relative; min-height: 38px; }
.ds > .hang:first-child, .the > .hang:first-child { border-top: 0; }
.hang.dau { padding: 5px 12px; min-height: 0; background: var(--dau-bang); font-size: 12px; font-weight: 600; color: var(--phu); border-top: 0; border-bottom: 1px solid var(--ke); position: sticky; top: 83px; z-index: 5; }
a.hang:hover { background: var(--re); text-decoration: none; }
a.hang.dang-xem { background: var(--cham-nhat); box-shadow: inset 0 0 0 2px var(--cham); }
.hang .khach { min-width: 0; display: flex; flex-direction: column; }
.hang .khach strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hang .khach span { font-size: 12.5px; color: var(--phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hang .ngay { display: flex; flex-direction: column; }
.hang .ngay strong { font-weight: 600; white-space: nowrap; }
.hang .ngay span { font-size: 12px; color: var(--phu); white-space: nowrap; }
.hang .mui { color: #b1b8c4; justify-self: end; }
a.hang:hover .mui { color: var(--cham); }
.cot-viec { grid-template-columns: minmax(0, 1.5fr) 100px 92px minmax(0, 1.5fr) 16px; }
.cot-don { grid-template-columns: minmax(0, 1.6fr) 100px 100px 208px minmax(56px, .6fr) 106px 126px 16px; }
.cot-don-gon { grid-template-columns: minmax(0, 1.6fr) 100px 88px 108px 16px; }
.cot-giu { grid-template-columns: minmax(0, 1.5fr) 100px 68px 144px minmax(0, .7fr) 16px; }
.chong-anh { display: flex; align-items: center; gap: 3px; min-width: 0; }
.chong-anh .them { margin-left: 6px; font-size: 12.5px; color: var(--phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.phan-trang { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 7px 12px; border-top: 1px solid var(--ke); background: var(--dau-bang); }
.phan-trang .dem { margin-right: auto; color: var(--phu); font-size: 12.5px; padding-right: 12px; }
.phan-trang a, .phan-trang span.so-trang { min-width: 30px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--ke-dam); margin-left: -1px; background: var(--mat); color: var(--muc); font-variant-numeric: tabular-nums; }
.phan-trang a:hover { background: var(--dau-bang); text-decoration: none; }
.phan-trang span.so-trang { background: var(--cham); border-color: var(--cham); color: #fff; font-weight: 600; z-index: 1; }
.phan-trang .cach { color: var(--mo); padding: 0 6px; }
@container (max-width: 620px) {
  .cot-don-gon { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "khach tt" "ngay tien"; gap: 3px 10px; }
  .cot-don-gon > .khach { grid-area: khach; } .cot-don-gon > .o-tt { grid-area: tt; justify-self: end; }
  .cot-don-gon > .ngay { grid-area: ngay; flex-direction: row; gap: 8px; align-items: baseline; } .cot-don-gon > .o-no { grid-area: tien; justify-self: end; }
  .cot-don-gon > .mui { display: none; }
}

/* ---------- Danh sách đơn kèm khung xem đơn */
.hai-khung { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.hai-khung.mo { grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); }
.hai-khung.mo .cot-don { grid-template-columns: minmax(0, 1.5fr) 100px 92px 104px 16px; }
.hai-khung.mo .cot-don .an-khi-mo { display: none; }
.khung-xem { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow-y: auto; }
.khung-xem[hidden] { display: none; }
.khung-xem .dau-khung { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--dau-bang); border-bottom: 1px solid var(--ke); position: sticky; top: 0; z-index: 3; }
.khung-xem .dau-khung strong { margin-right: auto; }
.khung-xem .than-khung { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.khung-xem .luoi.hai { grid-template-columns: minmax(0, 1fr); }

/* ---------- Ảnh */
.anh { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--ke-nhat); background: var(--xam-nhat); color: #a7afbc; object-fit: cover; overflow: hidden; }
.anh.nho { width: 30px; height: 30px; }
.anh.vua { width: 54px; height: 68px; }
.anh.trong .bt { width: 45%; height: 45%; }
img.anh[data-lon], img.anh-lon[data-lon] { cursor: zoom-in; }
.phong-anh { position: fixed; inset: 0; z-index: 90; background: rgba(22, 24, 29, .86); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.phong-anh img { max-width: min(92vw, 900px); max-height: 92vh; background: #fff; }

/* ---------- Lưới sản phẩm */
.luoi-sp { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.sp { display: flex; flex-direction: column; background: var(--mat); border: 1px solid var(--ke); border-radius: var(--r); overflow: hidden; color: var(--muc); }
a.sp:hover { border-color: var(--cham); box-shadow: 0 0 0 1px var(--cham); text-decoration: none; }
.sp .hinh { position: relative; aspect-ratio: 3 / 4; background: var(--xam-nhat); display: grid; place-items: center; color: #a7afbc; overflow: hidden; }
.sp .hinh img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sp .hinh .bt { width: 30px; height: 30px; }
.sp .hinh .goc { position: absolute; left: 0; bottom: 0; }
.sp .hinh .goc .nhan { border-radius: 0 var(--r) 0 0; padding: 2px 8px; }
.sp .chu { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-top: 1px solid var(--ke-nhat); }
.sp .ma { font-family: var(--nhan-de); font-size: 17px; font-weight: 600; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp .ten { font-size: 12.5px; color: var(--phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 17px; }
.sp .cuoi { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.sp .gia { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp .gia small { font-weight: 400; color: var(--phu); }

/* ---------- Trang một sản phẩm, một đơn */
.ho-so { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.ho-so .anh-lon { width: 100%; aspect-ratio: 3 / 4; border: 1px solid var(--ke); background: var(--xam-nhat); object-fit: cover; display: grid; place-items: center; color: #a7afbc; }
.ma-lon { font-family: var(--nhan-de); font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.05; }
.cap-thong-tin { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; }
.cap-thong-tin > :nth-child(odd) { color: var(--phu); }
.o-so { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border: 1px solid var(--ke); background: var(--mat); }
.o-so > div { padding: 8px 12px; border-left: 1px solid var(--ke-nhat); margin-left: -1px; display: flex; flex-direction: column; gap: 1px; }
.o-so > div span { font-size: 12px; color: var(--phu); font-weight: 600; }
.o-so > div strong { font-family: var(--nhan-de); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.o-so > div.do strong { color: var(--do); }
.o-so > div.xanh strong { color: var(--xanh); }
.buoc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ke); }
.buoc > div { padding: 7px 10px 8px; border-left: 1px solid var(--ke); display: flex; flex-direction: column; gap: 1px; background: var(--mat); }
.buoc > div:first-child { border-left: 0; }
.buoc > div strong { font-size: 12.5px; font-weight: 600; color: var(--phu); display: flex; align-items: center; gap: 6px; }
.buoc > div .ngay-buoc { font-family: var(--nhan-de); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.buoc > div span { font-size: 12px; color: var(--phu); }
.buoc > div.xong { background: var(--xanh-nhat); }
.buoc > div.xong strong, .buoc > div.xong span { color: var(--xanh); }
.buoc > div.tre { background: var(--vang-nhat); }
.buoc > div.tre strong, .buoc > div.tre span { color: var(--vang); }
.buoc > div.hom-nay { box-shadow: inset 0 0 0 2px var(--cham); }
.buoc .nut-buoc { display: none; }
.bang { width: 100%; border-collapse: collapse; }
.bang th { text-align: left; padding: 5px 10px; background: var(--dau-bang); font-size: 12px; font-weight: 600; color: var(--phu); border-bottom: 1px solid var(--ke); white-space: nowrap; }
.bang td { padding: 6px 10px; border-top: 1px solid var(--ke-nhat); vertical-align: middle; }
.bang tbody tr:hover td { background: var(--re); }
.bang th.phai, .bang td.phai { text-align: right; }
.bang tr.mo-dong td { color: var(--mo); text-decoration: line-through; text-decoration-color: #c3c8d1; }
.bang a.ca-hang { color: var(--muc); font-weight: 600; }
.cuon-ngang { overflow-x: auto; }
.tien-don { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.tien-don .gach { grid-column: 1 / -1; height: 1px; background: var(--ke); margin: 3px 0; }
.tien-don .tong { font-size: 15px; font-weight: 700; }

/* ---------- Biểu đồ */
.bd-cot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 180px; padding: 20px 0 0; }
.bd-cot .cot { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; color: var(--muc); min-width: 0; position: relative; }
.bd-cot a.cot:hover { text-decoration: none; }
.bd-cot .khung-cot { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--ke-dam); position: relative; background: repeating-linear-gradient(to top, transparent 0 24.6%, var(--ke-nhat) 24.6% 25%); }
.bd-cot .thanh-cot { width: min(30px, 68%); min-height: 2px; background: var(--bieu-do); }
.bd-cot .cot.nhat .thanh-cot { background: #bccdff; }
.bd-cot .cot.rong .thanh-cot { background: #d5d9e0; height: 2px !important; }
.bd-cot a.cot:hover .thanh-cot { background: var(--cham-dam); }
.bd-cot .gia-tri-cot { position: absolute; bottom: calc(var(--cao, 0%) + 4px); left: -12px; right: -12px; text-align: center; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }
.bd-cot .nhan-cot { font-size: 11.5px; color: var(--phu); text-align: center; line-height: 1.25; white-space: nowrap; }
.bd-cot .nhan-cot b { display: block; color: var(--muc); font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-cot .cot.hom-nay .nhan-cot, .bd-cot .cot.hom-nay .nhan-cot b { color: var(--cham); font-weight: 700; }
.bd-cot .vach-tong { position: absolute; left: 0; right: 0; border-top: 2px dashed #6b7384; pointer-events: none; }
.bd-cot .cot.thieu .thanh-cot { background: var(--do); }
.bd-ngang { display: flex; flex-direction: column; gap: 6px; }
.bd-ngang .dong-bd { display: grid; grid-template-columns: minmax(90px, 180px) minmax(0, 1fr) max-content; align-items: center; gap: 10px; color: var(--muc); }
.bd-ngang a.dong-bd:hover { text-decoration: none; }
.bd-ngang a.dong-bd:hover .ten-bd { color: var(--cham); text-decoration: underline; }
.bd-ngang .ten-bd { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bd-ngang .ten-bd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-ngang .ray { height: 12px; background: var(--xam-nhat); overflow: hidden; }
.bd-ngang .ray > i { display: block; height: 100%; min-width: 2px; background: var(--bieu-do); }
.bd-ngang .so-bd { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bd-ngang .so-bd small { font-weight: 400; color: var(--phu); }
.noi-goi-y { position: fixed; z-index: 80; max-width: 280px; padding: 6px 9px; background: var(--muc); color: #fff; font-size: 12.5px; line-height: 1.4; pointer-events: none; white-space: pre-line; }

/* ---------- Lịch tháng: các ô liền nhau như lịch treo tường */
.lich-thang { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--ke); border-top: 1px solid var(--ke); }
.lich-thang .ten-thu { padding: 4px 6px; font-size: 12px; font-weight: 600; color: var(--phu); text-align: center; background: var(--dau-bang); border-right: 1px solid var(--ke); border-bottom: 1px solid var(--ke); }
.o-lich { display: flex; flex-direction: column; gap: 2px; min-height: 82px; padding: 5px 7px 6px; background: var(--mat); color: var(--muc); position: relative; border-right: 1px solid var(--ke); border-bottom: 1px solid var(--ke); }
a.o-lich:hover { box-shadow: inset 0 0 0 2px var(--cham); text-decoration: none; }
.o-lich.ngoai { background: var(--dau-bang); color: var(--mo); }
.o-lich .so-ngay { font-weight: 600; font-variant-numeric: tabular-nums; align-self: flex-start; }
.o-lich.la-hom-nay .so-ngay { background: var(--cham); color: #fff; padding: 0 6px; }
.o-lich.dang-chon { box-shadow: inset 0 0 0 3px var(--cham); }
.o-lich .so-dien { font-family: var(--nhan-de); font-size: 21px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.o-lich .so-dien small { font-family: var(--chu); font-size: 12px; font-weight: 400; }
.o-lich .viec-ngay { margin-top: auto; font-size: 11.5px; color: var(--phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-lich.m1 { background: var(--m1); }
.o-lich.m2 { background: var(--m2); }
.o-lich.m3 { background: var(--m3); }
.o-lich.m4 { background: var(--m4); }
.o-lich.m3 .viec-ngay, .o-lich.m4 .viec-ngay { color: #0b1a4a; }
.chu-giai { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; color: var(--phu); }
.chu-giai i { display: inline-block; width: 13px; height: 13px; border: 1px solid var(--ke); vertical-align: -2px; margin-right: 4px; }

/* ---------- Kho: mỗi đơn một phiếu soạn */
.phieu { border: 1px solid var(--ke); border-radius: var(--r); background: var(--mat); }
.phieu.da-xong > .dau-phieu { background: var(--xanh-nhat); }
.phieu.da-xong .mon { color: var(--phu); }
.phieu > .dau-phieu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 12px; background: var(--dau-bang); border-bottom: 1px solid var(--ke); }
.phieu > .dau-phieu .khach { margin-right: auto; min-width: 0; }
.phieu > .dau-phieu .khach a { color: var(--muc); font-weight: 700; font-size: 14.5px; }
.phieu > .dau-phieu .khach div { font-size: 12.5px; color: var(--phu); }
.mon { display: grid; grid-template-columns: 54px minmax(0, 1fr) max-content max-content; align-items: center; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--ke-nhat); }
.mon:first-of-type { border-top: 0; }
.mon .ten-mon { min-width: 0; }
.mon .ten-mon a { font-family: var(--nhan-de); font-size: 18px; font-weight: 600; color: var(--muc); }
.mon .ten-mon div { font-size: 12.5px; color: var(--phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ke, .mon .ke { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--muc); background: #fff7c7; color: var(--muc); font-family: var(--nhan-de); font-size: 15px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.ke.chua { border-style: dashed; border-color: var(--mo); background: transparent; color: var(--phu); font-family: var(--chu); font-size: 12.5px; font-weight: 400; letter-spacing: 0; }
.mon .sl { min-width: 60px; text-align: right; font-family: var(--nhan-de); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mon .sl small { font-family: var(--chu); font-size: 12px; font-weight: 400; color: var(--phu); }

/* ---------- Nhập đơn: một tờ phiếu, gõ từ trên xuống, tổng tiền luôn nằm ở mép dưới */
.bieu-mau-don { display: flex; flex-direction: column; gap: 14px; }
.meo-phim { align-self: flex-end; padding-bottom: 3px; }
.luoi-o { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; }
.luoi-o .c2 { grid-column: span 2; }
.luoi-o .c4 { grid-column: span 4; }
.o-ngay { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.o-ngay .o.chinh > span:first-child { color: var(--cham-dam); }
.o-co-lich { position: relative; display: block; }
.o-co-lich input[type="text"] { padding-right: 30px; font-variant-numeric: tabular-nums; }
.o-co-lich .nut-lich { position: absolute; right: 1px; top: 1px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--phu); cursor: pointer; }
.o-co-lich .nut-lich:hover { color: var(--cham); background: var(--dau-bang); }
.o-co-lich .lich-an { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.o-ngay .o.chinh input { border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); font-weight: 600; }
.chan-the { padding: 7px 12px; border-top: 1px solid var(--ke-nhat); }
.chan-the.canh-bao { background: var(--vang-nhat); color: #4a3200; }
.loi ul { margin: 4px 0 0; padding-left: 20px; }
.o input.sai { border-color: var(--do); background: var(--do-nhat); }
.bang-nhap td { padding: 3px 6px; }
.bang-nhap tbody tr:hover td { background: transparent; }
.bang-nhap td.stt, .bang-nhap th.stt { width: 34px; text-align: right; color: var(--phu); }
.bang-nhap input { width: 100%; height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: var(--r); background: var(--xam-nhat); }
.bang-nhap input:hover { border-color: var(--ke); }
.bang-nhap input:focus { outline: 0; background: #fff; border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); }
.bang-nhap input[name="ma"] { font-family: var(--nhan-de); font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.bang-nhap input[name="ma"]::placeholder { font-family: var(--chu); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.bang-nhap input.sai { border-color: var(--do); background: var(--do-nhat); }
.bang-nhap .mo-ta { white-space: nowrap; }
.bang-nhap .mo-ta .anh { vertical-align: middle; }
.bang-nhap .mo-ta .chu { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; vertical-align: middle; }
.bang-nhap .mo-ta .ten { color: var(--phu); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.bang-nhap .mo-ta .ke { font-size: 13px; padding: 0 6px; }
.bang-nhap .tt-dong { font-weight: 600; }
.bang-nhap .con { font-size: 12.5px; white-space: nowrap; }
.bang-nhap tr.ngung input { color: var(--mo); text-decoration: line-through; }
.bang-nhap tfoot td { padding: 7px 6px; border-top: 1px solid var(--ke); background: var(--dau-bang); }
.bang-nhap .bo-dong { width: 26px; height: 26px; color: var(--mo); }
.bang-nhap .bo-dong:hover { color: var(--do); background: var(--do-nhat); }
.thanh-luu { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; padding: 10px 12px; background: var(--mat); border: 1px solid var(--ke); border-top: 2px solid var(--muc); }
.thanh-luu .o-tien-don { display: flex; gap: 10px; }
.thanh-luu .o-tien-don .o { width: 128px; }
.thanh-luu .o-tong { display: flex; margin-left: auto; border: 1px solid var(--ke); }
.thanh-luu .o-tong > div { display: flex; flex-direction: column; padding: 3px 14px 4px; border-left: 1px solid var(--ke-nhat); min-width: 124px; }
.thanh-luu .o-tong > div:first-child { border-left: 0; }
.thanh-luu .o-tong span { font-size: 12px; font-weight: 600; color: var(--phu); }
.thanh-luu .o-tong strong { font-family: var(--nhan-de); font-size: 22px; font-weight: 600; line-height: 1.1; text-align: right; }
.thanh-luu .o-tong .con-lai strong { color: var(--do); }
.thanh-luu .o-tong .con-lai.du strong { color: var(--cham); }
.thanh-luu .o-nut { display: flex; gap: 8px; align-items: center; }
.go-y-nhap { position: absolute; right: auto; z-index: 70; max-width: 460px; max-height: 340px; }
.go-y-nhap .muc { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-top: 1px solid var(--ke-nhat); cursor: pointer; }
.go-y-nhap .muc:first-child { border-top: 0; }
.go-y-nhap .muc:hover, .go-y-nhap .muc.dang-o { background: var(--cham-nhat); }
.go-y-nhap .chu { flex: 1; min-width: 0; }
.go-y-nhap .chu strong { display: block; font-weight: 600; }
.go-y-nhap .chu span { display: block; font-size: 12px; color: var(--phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go-y-nhap .so-con { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--phu); }
.go-y-nhap .so-con.kho { color: var(--xanh); font-weight: 600; }
.go-y-nhap .so-con.kho.het { color: var(--do); }
.nut-tao { margin-left: auto; }
.nut-tao + .nguoi { margin-left: 0; }

/* ---------- Việc trên một đơn (bản nhận nhập liệu) */
.viec-don .hang-viec { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 9px 12px; }
.viec-don .hang-viec.tien { border-top: 1px solid var(--ke-nhat); background: var(--dau-bang); }
.viec-don .hang-viec form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0; }
.viec-don .hang-viec > .phu { align-self: center; }
.viec-don .gian { flex: 1; }
.viec-don .chon-buoc { gap: 0 !important; flex-wrap: nowrap !important; }
.viec-don .chon-buoc select { height: 32px; padding: 0 6px; border: 1px solid var(--ke-dam); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: var(--mat); }
.viec-don .chon-buoc .nut { border-radius: 0 var(--r) var(--r) 0; }
.viec-don .ghi-tien .o { width: 132px; }
.viec-don .ghi-tien .o.rong { width: auto; flex: 1 1 160px; }
.viec-them { position: relative; }
.viec-them summary { list-style: none; }
.viec-them summary::-webkit-details-marker { display: none; }
.viec-them .hop-them { position: absolute; right: 0; top: 36px; z-index: 10; width: 264px; padding: 10px; background: var(--mat); border: 1px solid var(--ke-dam); box-shadow: 0 6px 18px rgba(22, 24, 29, .18); flex-direction: column; align-items: stretch !important; }
.phieu .viec-kho { display: flex; gap: 6px; margin: 0; }

/* ---------- Đăng nhập, báo vướng */
.dang-nhap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.dang-nhap .hop { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.dang-nhap form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.dang-nhap .o input { height: 38px; }
.loi { padding: 8px 10px; border: 1px solid #f0b4ae; border-radius: var(--r); background: var(--do-nhat); color: var(--do); }
.bao-vuong { align-self: flex-start; margin-top: 4px; }
.bao-vuong summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--phu); list-style: none; }
.bao-vuong summary::-webkit-details-marker { display: none; }
.bao-vuong summary:hover { color: var(--cham); text-decoration: underline; }
.bao-vuong form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; width: min(480px, 100%); padding: 12px; }
.thanh-duoi { display: none; }
.dai-dien { display: none; }

/* ---------- Màn hình hẹp */
@media (max-width: 1280px) {
  .luoi.hai, .luoi.ba { grid-template-columns: minmax(0, 1fr); }
  /* Bảy ô còn hiện (khách, trạng thái, ngày, hàng, tổng, tiền, mũi tên) thì phải đủ bảy cột. */
  .cot-don { grid-template-columns: minmax(0, 1.5fr) 100px 96px 176px 100px 124px 16px; }
  .cot-don .an-vua { display: none; }
  .hai-khung.mo { grid-template-columns: minmax(0, 1fr) minmax(340px, 50%); }
}
@media (max-width: 900px) {
  body { font-size: 14px; }
  .hang-ten { height: auto; flex-wrap: wrap; padding: 6px 10px; gap: 6px 8px; }
  .nhan-hieu { flex: 1 1 auto; min-width: 0; }
  .tim-chung { order: 5; flex: 1 1 100%; max-width: none; }
  .hang-ten .nguoi { margin-left: 0; }
  .nhan-hieu small, .hang-ten .nguoi .ten, .tim-chung kbd { display: none; }
  .nhan-hieu strong { font-size: 16px; }
  .nut-bt.nut-menu { display: grid; }
  .hang-muc { display: none; flex-direction: column; padding: 4px 8px 8px; }
  body.mo-ben .hang-muc { display: flex; }
  .hang-muc a { height: 40px; border-bottom: 0; border-left: 3px solid transparent; }
  .hang-muc a[aria-current="page"] { border-left-color: var(--cham); background: var(--dau-bang); }
  .hang-muc .ngan { width: auto; height: 1px; margin: 4px 0; }
  .hang-muc .tuoi { margin: 6px 0 0 12px; }
  .trang { padding: 12px 10px 84px; gap: 12px; }
  .luoi.deu { grid-template-columns: minmax(0, 1fr); }
  .ho-so { grid-template-columns: minmax(0, 1fr); }
  .ho-so .anh-lon { max-width: 240px; }
  .thanh-duoi { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--mat); border-top: 1px solid var(--ke); padding-bottom: env(safe-area-inset-bottom); }
  .thanh-duoi a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; color: var(--phu); font-size: 11.5px; font-weight: 600; border-top: 3px solid transparent; }
  .thanh-duoi a:hover { text-decoration: none; }
  .thanh-duoi a[aria-current="page"] { color: var(--muc); border-top-color: var(--cham); }
  .dai-so, .luoi-so { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dai-so > *, .luoi-so > .the-so { border-top: 1px solid var(--ke-nhat); margin-top: -1px; }
  .dai-so > :nth-child(odd), .luoi-so > .the-so:nth-child(odd) { border-left: 0; }
  .dai-so .gia-tri, .the-so .gia-tri { font-size: 26px; }
  .luoi-so.ba-o { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .luoi-so.ba-o > .the-so:nth-child(odd) { border-left: 1px solid var(--ke-nhat); }
  .luoi-so.ba-o > .the-so:first-child { border-left: 0; }
  .luoi-so.ba-o .gia-tri small { display: block; margin: 2px 0 0; }
  .hang.dau { display: none; }
  .hang { padding: 8px 10px; }
  .cot-viec { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "khach tt" "viec ngay"; gap: 4px 10px; }
  .cot-viec > .khach { grid-area: khach; } .cot-viec > .o-tt { grid-area: tt; justify-self: end; } .cot-viec > .ngay { grid-area: ngay; text-align: right; align-items: flex-end; } .cot-viec > .viec-gi { grid-area: viec; }
  .cot-viec > .mui, .cot-don > .mui, .cot-giu > .mui { display: none; }
  .cot-don, .hai-khung.mo .cot-don { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "khach tt" "hang ngay" "tien no"; gap: 4px 10px; }
  .cot-don > .khach { grid-area: khach; } .cot-don > .o-tt { grid-area: tt; justify-self: end; }
  .cot-don > .ngay { grid-area: ngay; text-align: right; align-items: flex-end; } .cot-don > .o-hang { grid-area: hang; display: block !important; }
  .cot-don > .o-tien { grid-area: tien; text-align: left; display: block !important; } .cot-don > .o-no { grid-area: no; justify-self: end; }
  .cot-don .an-vua { display: none; }
  .cot-giu { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "khach sl" "khoang tt"; gap: 4px 10px; }
  .cot-giu > .khach { grid-area: khach; } .cot-giu > .o-sl { grid-area: sl; } .cot-giu > .o-khoang { grid-area: khoang; } .cot-giu > .o-tt { grid-area: tt; justify-self: end; } .cot-giu > .an-hep { display: none; }
  .hai-khung.mo { grid-template-columns: minmax(0, 1fr); }
  .khung-xem { position: fixed; inset: 0; top: 0; max-height: none; z-index: 60; border: 0; }
  .luoi-sp { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  .o-lich { min-height: 56px; padding: 3px 4px; }
  .o-lich .viec-ngay, .o-lich .so-dien small { display: none; }
  .o-lich .so-dien { font-size: 17px; }
  .bd-cot { gap: 2px; height: 160px; }
  .bd-cot .nhan-cot { font-size: 10.5px; }
  .mon { grid-template-columns: 46px minmax(0, 1fr) max-content; }
  .mon .ke { grid-column: 2; justify-self: start; }
  .mon .sl { grid-row: 1; grid-column: 3; }
  .bd-ngang .dong-bd { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) max-content; }
  .ma-tran-cuon { overflow-x: auto; }
  .ma-tran { min-width: 720px; }
  .so-do .nut-sd { min-width: 96px; }
  .day-loc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .luoi-o { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .luoi-o .c2 { grid-column: span 1; }
  .luoi-o .c4 { grid-column: span 2; }
  .o-ngay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bang-nhap, .bang-nhap tbody, .bang-nhap tfoot { display: block; }
  .bang-nhap thead { display: none; }
  .bang-nhap tr.dong-nhap { display: grid; grid-template-columns: 22px minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr) 28px; grid-template-areas: "stt ma sl gia bo" ". mota mota mota mota" ". con con tt tt"; gap: 4px 6px; padding: 8px; border-top: 1px solid var(--ke-nhat); }
  .bang-nhap tr.dong-nhap:first-child { border-top: 0; }
  .bang-nhap tr.dong-nhap > td { padding: 0; border: 0; width: auto; }
  .bang-nhap td.stt { grid-area: stt; align-self: center; text-align: left; }
  .bang-nhap td.o-ma { grid-area: ma; }
  .bang-nhap td.o-sl { grid-area: sl; }
  .bang-nhap td.o-gia { grid-area: gia; }
  .bang-nhap td.o-bo { grid-area: bo; }
  .bang-nhap td.mo-ta { grid-area: mota; white-space: normal; }
  .bang-nhap td.mo-ta:empty, .bang-nhap td.con:empty, .bang-nhap td.tt-dong:empty { display: none; }
  .bang-nhap td.mo-ta .chu { flex-wrap: wrap; }
  .bang-nhap td.con { grid-area: con; }
  .bang-nhap td.tt-dong { grid-area: tt; }
  .bang-nhap tfoot tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px; border-top: 1px solid var(--ke); background: var(--dau-bang); }
  .bang-nhap tfoot td { padding: 0; border: 0; background: transparent; }
  .bang-nhap tfoot td:empty { display: none; }
  .bang-nhap tfoot td:nth-child(2) { margin-right: auto; }
  .meo-phim { display: none; }
  .thanh-luu { position: static; gap: 8px 10px; }
  .thanh-luu .o-tien-don { flex-wrap: wrap; width: 100%; }
  .thanh-luu .o-tien-don .o { flex: 1 1 96px; width: auto; }
  .thanh-luu .o-tong { margin-left: 0; width: 100%; }
  .thanh-luu .o-tong > div { flex: 1; min-width: 0; padding: 3px 8px 4px; }
  .thanh-luu .o-tong strong { font-size: 19px; }
  .thanh-luu .o-nut { width: 100%; }
  .thanh-luu .o-nut .nut { flex: 1; }
  .nut-tao kbd { display: none; }
  .viec-don .gian { display: none; }
}
@media print {
  .thanh-tren, .thanh-duoi, .bao-vuong, .thanh-loc, .day-loc, .viec-don { display: none !important; }
  body { background: #fff; }
  .trang { padding: 0; }
}

/* =====================================================================================================================
   Màu, chiều sâu và chuyển động
   Bố cục ở trên giữ nguyên; phần này quyết định bề mặt: bo góc, bóng, màu khi rê chuột, chuyển động. Mọi chuyển động đều
   ngắn (dưới nửa giây) và tắt hẳn khi máy đặt "giảm chuyển động". */
html { scrollbar-color: #c3cbdb transparent; }
body { background: radial-gradient(1100px 420px at 12% -8%, #e2e9ff 0%, rgba(226, 233, 255, 0) 62%), radial-gradient(900px 380px at 96% -12%, #ffe9d2 0%, rgba(255, 233, 210, 0) 58%), var(--nen); background-attachment: fixed; }
::selection { background: #cddcff; }
a { transition: color var(--nhanh); }
:focus-visible { outline: 2px solid var(--cham-sang); outline-offset: 2px; border-radius: 4px; }
kbd { border-radius: 4px !important; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 150ms; }

/* ---------- Thanh trên: nền đậm như cánh gà sân khấu, một vệt đèn màu ở mép dưới */
.thanh-tren { border-bottom-color: var(--ke); transition: box-shadow var(--vua); view-transition-name: thanh-tren; }
.thanh-tren.da-cuon { box-shadow: 0 10px 24px -14px rgba(11, 20, 55, .45); }
.hang-ten { position: relative; background: linear-gradient(100deg, #0a1233 0%, #13236a 56%, #1f3fb0 100%); color: #fff; }
.hang-ten::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--nhan-manh) 0%, #ff5d8f 34%, rgba(255, 93, 143, 0) 72%); pointer-events: none; }
.nhan-hieu, .nhan-hieu:hover { color: #fff; }
.nhan-hieu small { color: #b4c2f0; }
/* Ô vuông nhỏ mang đúng màu nền của ô tên khách trên sheet (ở từng dòng hàng của một đơn, và ở nhãn lọc theo màu). */
.o-mau { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .28); border-radius: 3px; vertical-align: -1px; }
/* Màn hình Hai miền: mỗi miền một cột, cột cuối là tổng; mỗi miền giữ một màu ở mọi bảng và mọi thanh. */
.cham-mien { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--ke-dam); }
.cham-mien.m0, .thanh-chong > i.m0 { background: var(--cham); }
.cham-mien.m1, .thanh-chong > i.m1 { background: #0f8a72; }
.cham-mien.m2, .thanh-chong > i.m2 { background: #c2410c; }
.bang-mien td.cot-cong, .bang-mien th.cot-cong { background: var(--re); font-weight: 600; border-left: 1px solid var(--ke); }
.bang-mien tr.hang-chinh td { font-size: 15px; font-weight: 600; }
.bang-mien tr.trong-ky td { background: var(--cham-nhat); }
.bang-mien tr.trong-ky td.cot-cong { background: #dfe8ff; }
.bang-mien td.so a { color: inherit; text-decoration: underline; text-decoration-color: var(--ke-dam); text-underline-offset: 3px; }
.bang-mien td.so a:hover { color: var(--cham-dam); text-decoration-color: currentColor; }
.bang-mien .cot-chong { width: 30%; min-width: 120px; }
.thanh-chong { display: flex; gap: 2px; height: 10px; }
.thanh-chong > i { display: block; height: 100%; min-width: 3px; border-radius: 3px; }
.chu-giai { display: inline-flex; gap: 14px; }
.o-mien { border: 1px solid var(--ke); border-radius: var(--r); padding: 8px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.o-mien legend { padding: 0 6px; font-size: 12px; color: var(--phu); }
.o-mien label { display: inline-flex; gap: 6px; align-items: center; }
.o-mien > div { flex-basis: 100%; }
/* Nhãn nhỏ cạnh một ngày mà sheet không ghi, phần mềm tính thay (ngày soạn = ngày gửi trừ N ngày). */
.tu-tinh { display: inline-block; padding: 0 6px; border: 1px dashed var(--ke-dam); border-radius: 999px; font-family: inherit; font-size: 11px; font-weight: 500; line-height: 16px; color: var(--phu); vertical-align: 1px; white-space: nowrap; cursor: help; }
/* Nút đổi miền: mỗi miền là một file sheet, mở ở một cổng riêng của cùng máy chủ. Miền đang xem là ô trắng. */
.doi-mien { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap; }
.doi-mien .nhan-mien { padding: 0 5px 0 9px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #a9b7e4; }
.doi-mien .mot-mien { display: inline-block; padding: 2px 12px; border-radius: 999px; font-family: var(--nhan-de); font-size: 14px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #dbe4ff; transition: background var(--nhanh), color var(--nhanh); }
.doi-mien a.mot-mien:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }
.doi-mien .mot-mien[aria-current="true"] { background: #fff; color: #13236a; box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .45); }
.doi-mien .mot-mien.tat { opacity: .5; }
/* Miền khai thêm đổi tông thanh trên sang xanh ngọc, để liếc qua là biết đang xem miền nào. */
body[data-mien] .hang-ten { background: linear-gradient(100deg, #062825 0%, #0b4f47 56%, #0f8a72 100%); }
body[data-mien] .hang-ten::after { background: linear-gradient(90deg, #ffd166 0%, var(--nhan-manh) 34%, rgba(255, 159, 28, 0) 72%); }
body[data-mien] .doi-mien .mot-mien[aria-current="true"] { color: #0b4f47; }
body[data-mien] .nhan-hieu small, body[data-mien] .hang-ten .nguoi .ten span, body[data-mien] .doi-mien .nhan-mien { color: #a8dccf; }
body[data-mien] .tim-chung input::placeholder { color: #a8dccf; }
@media (max-width: 900px) {
  .doi-mien .nhan-mien { display: none; }
  .doi-mien .mot-mien { padding: 2px 9px; font-size: 13px; }
  /* Hàng trên đã có nút đổi miền nên "Đăng xuất" xuống đứng cuối hàng ô tìm, khỏi chiếm riêng một hàng. */
  .doi-mien ~ .tim-chung { flex: 1 1 60%; }
  .doi-mien ~ .nguoi { order: 6; }
}
.tim-chung .o-tim { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); border-radius: 8px; color: #c5d1f6; transition: background var(--nhanh), border-color var(--nhanh), box-shadow var(--nhanh); }
.tim-chung .o-tim:hover { background: rgba(255, 255, 255, .16); }
.tim-chung input { color: #fff; }
.tim-chung input::placeholder { color: #a9b7e4; }
.tim-chung kbd { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #dbe4ff; }
.tim-chung .o-tim:focus-within { background: #fff; border-color: #fff; color: var(--phu); box-shadow: 0 0 0 3px rgba(122, 160, 255, .5); }
.tim-chung .o-tim:focus-within input { color: var(--muc); }
.tim-chung .o-tim:focus-within input::placeholder { color: var(--mo); }
.tim-chung .o-tim:focus-within kbd { background: var(--dau-bang); border-color: var(--ke); color: var(--phu); }
.hang-ten .nguoi { color: #eef2ff; }
.hang-ten .nguoi .ten span { color: #a9b7e4; }
.hang-ten .nut-chu { color: #c9dbff; }
.hang-ten .nut-chu:hover { color: #fff; }
.hang-ten .nut-bt { color: #dbe4ff; }
.hang-ten .nut-bt:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nut.nut-tao { background: linear-gradient(180deg, #ffb648, var(--nhan-manh)); border-color: #e88a05; color: #2a1600; box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 4px 12px -4px rgba(255, 159, 28, .7); }
.nut.nut-tao:hover { background: linear-gradient(180deg, #ffc266, #ffa82e); border-color: #e88a05; color: #2a1600; }
.hang-muc { gap: 2px; }
.hang-muc a { position: relative; border-radius: 6px 6px 0 0; transition: color var(--nhanh), background var(--nhanh); }
.hang-muc a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -3px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--cham), var(--cham-sang)); transform: scaleX(0); transition: transform var(--vua) var(--em); }
.hang-muc a:hover { background: var(--cham-nhat); color: var(--cham-dam); }
.hang-muc a:hover::after { transform: scaleX(.35); }
.hang-muc a[aria-current="page"] { color: var(--cham-dam); border-bottom-color: transparent; }
.hang-muc a[aria-current="page"]::after { transform: scaleX(1); }
.tuoi .cham { border-radius: 50%; animation: nhip 2.6s ease-out infinite; }
.tuoi.cu .cham { animation: none; }
@keyframes nhip { 0% { box-shadow: 0 0 0 0 rgba(47, 158, 94, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(47, 158, 94, 0); } }
.vach-chuyen { position: fixed; left: 0; top: 0; z-index: 100; height: 3px; width: 0; background: linear-gradient(90deg, var(--nhan-manh), #ff5d8f); opacity: 0; pointer-events: none; }
body.dang-chuyen .vach-chuyen { opacity: 1; width: 86%; transition: width 4s cubic-bezier(.05, .7, .1, 1), opacity 80ms; }

/* ---------- Nội dung trang hiện lên nhẹ từ dưới */
.trang > * { animation: hien-len 240ms var(--em) both; }
.trang > :nth-child(2) { animation-delay: 30ms; }
.trang > :nth-child(3) { animation-delay: 60ms; }
.trang > :nth-child(4) { animation-delay: 90ms; }
.trang > :nth-child(n + 5) { animation-delay: 120ms; }
@keyframes hien-len { from { opacity: 0; transform: translateY(7px); } }
.thanh-luu, .trang > .bieu-mau-don { animation: none; }
.canh-bao-cu, .thong-bao { border-radius: 8px; border-left-width: 4px; }
.thong-bao { animation: truot-xuong 320ms var(--em) both; box-shadow: var(--bong-1); }
@keyframes truot-xuong { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Nút, ô nhập */
.nut { border-radius: var(--r); background: linear-gradient(180deg, #3a69f2, var(--cham)); border-color: var(--cham-dam); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 1px 2px rgba(23, 59, 176, .35); transition: background var(--nhanh), border-color var(--nhanh), box-shadow var(--nhanh), transform 80ms, color var(--nhanh); }
.nut:hover { background: linear-gradient(180deg, #2f5fe8, var(--cham-dam)); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 5px 14px -4px rgba(34, 81, 224, .6); }
.nut:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(23, 59, 176, .3) inset; }
.nut.vien { background: var(--mat); border-color: var(--ke-dam); box-shadow: 0 1px 1px rgba(15, 23, 42, .05); }
.nut.vien:hover { background: var(--cham-nhat); border-color: var(--cham); color: var(--cham-dam); box-shadow: 0 3px 10px -4px rgba(34, 81, 224, .45); }
.nut.do { background: var(--mat); box-shadow: 0 1px 1px rgba(15, 23, 42, .05); }
.nut.do:hover { background: var(--do-nhat); box-shadow: 0 3px 10px -4px rgba(200, 30, 30, .45); }
.nut-bt { transition: background var(--nhanh), color var(--nhanh); }
.o input, .o select, .o textarea, .o-don, .o-tim-nho { transition: border-color var(--nhanh), box-shadow var(--nhanh), background var(--nhanh); }
.o input:hover, .o select:hover, .o textarea:hover { border-color: #8b97ad; }
.o input:focus, .o select:focus, .o textarea:focus, .o-tim-nho:focus-within, .bang-nhap input:focus { border-color: var(--cham); box-shadow: 0 0 0 3px var(--cham-mo); }
.o-ngay .o.chinh input { box-shadow: 0 0 0 3px var(--cham-mo); }
.thanh-loc { border-radius: var(--r-lon); box-shadow: var(--bong-1); }
.thanh-loc.tran { box-shadow: none; }
.buoc-thang { overflow: hidden; }
.buoc-thang a { transition: background var(--nhanh), color var(--nhanh); }
.buoc-thang a:hover { background: var(--cham-nhat); color: var(--cham-dam); }

/* ---------- Khung */
.the, .phieu { border-radius: var(--r-lon); box-shadow: var(--bong-1); }
.the > :first-child, .phieu > :first-child { border-top-left-radius: 9px; border-top-right-radius: 9px; }
.the > :last-child, .phieu > :last-child { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; }
.the > .ds:first-child > .hang:first-child { border-top-left-radius: 9px; border-top-right-radius: 9px; }
.the > .ds:last-child > .hang:last-child, .phieu > .mon:last-child { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; }
.the > .dau-the { background: var(--mat); border-bottom-color: var(--ke-nhat); }
.the > .dau-the h2 { display: flex; align-items: center; gap: 8px; }
.the > .dau-the h2::before { content: ""; flex: none; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, var(--cham-sang), var(--cham)); }
.chan-the { background: var(--dau-bang); }

/* ---------- Dải số */
.dai-so, .luoi-so { border-radius: var(--r-lon); box-shadow: var(--bong-1); overflow: hidden; }
.dai-so > *, .luoi-so > .the-so { position: relative; transition: background var(--nhanh); }
.dai-so > a::before, .luoi-so > a.the-so::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--cham), var(--cham-sang)); transform: scaleX(0); transform-origin: left; transition: transform var(--vua) var(--em); }
.dai-so > a:hover::before, .luoi-so > a.the-so:hover::before, .dai-so > .dang-chon::before, .luoi-so > .the-so.dang-chon::before { transform: scaleX(1); }
.dai-so > a:hover .ten { text-decoration: none; }
.dai-so > .t-do, .luoi-so > .the-so.t-do { background: linear-gradient(180deg, var(--do-nhat), rgba(253, 236, 235, 0) 78%); }
.dai-so > .t-vang, .luoi-so > .the-so.t-vang { background: linear-gradient(180deg, var(--vang-nhat), rgba(255, 243, 214, 0) 78%); }
.dai-so > .t-xanh { background: linear-gradient(180deg, var(--xanh-nhat), rgba(226, 246, 234, 0) 78%); }
.dai-so > a.t-do::before { background: var(--do); }
.dai-so > a.t-vang::before { background: #e59a12; }
.dai-so > a.t-xanh::before { background: var(--xanh); }
.dai-so > .dang-chon, .the-so.dang-chon { background: var(--cham-nhat); box-shadow: none; }
.dai-so > .dang-chon .ten { color: var(--cham-dam); }
.thanh-tien { border-radius: 999px; overflow: hidden; }
.thanh-tien > i { border-radius: 999px; background: linear-gradient(90deg, var(--cham), var(--cham-sang)); transform-origin: left; animation: dai-ra 620ms var(--em) both; }

/* ---------- Sơ đồ đường đi của đơn */
.so-do .nut-sd { border-radius: 8px; transition: transform var(--nhanh) var(--em), box-shadow var(--nhanh), border-color var(--nhanh), background var(--nhanh); }
.so-do a.nut-sd:hover { transform: translateY(-3px); box-shadow: var(--bong-2); }
.so-do .mui-sd { color: #9aa6bd; }
.de-y a { border-radius: 999px; padding: 3px 11px; transition: transform var(--nhanh) var(--em), box-shadow var(--nhanh), border-color var(--nhanh), background var(--nhanh); }
.de-y a:hover { transform: translateY(-1px); box-shadow: var(--bong-1); }

/* ---------- Bảng việc theo ngày, lịch tháng */
.ma-tran td a { transition: box-shadow var(--nhanh), filter var(--nhanh); }
.ma-tran td a:hover { box-shadow: inset 0 0 0 2px var(--cham); filter: saturate(1.25); }
.ma-tran thead th.hom-nay { background: linear-gradient(180deg, #3a69f2, var(--cham)); }
.lich-thang { border-radius: 8px; overflow: hidden; }
.o-lich { transition: box-shadow var(--nhanh), filter var(--nhanh); }
a.o-lich:hover { filter: saturate(1.2); }
.o-lich.la-hom-nay .so-ngay { border-radius: 999px; padding: 0 8px; background: linear-gradient(180deg, #3a69f2, var(--cham)); }
.chu-giai i { border-radius: 3px; }

/* ---------- Ô trạng thái, nhãn, nút lọc, tab, phân trang */
.tt { border-radius: 5px; }
.cham-tt { border-radius: 3px; }
.nhan { border-radius: 5px; }
.ke, .mon .ke { border-radius: 3px; box-shadow: 1px 1px 0 rgba(15, 23, 42, .18); }
.ke.chua { box-shadow: none; }
.day-loc { gap: 6px; }
.loc { margin: 0; border-radius: 999px; border-color: var(--ke); padding: 0 12px; box-shadow: 0 1px 1px rgba(15, 23, 42, .04); transition: background var(--nhanh), border-color var(--nhanh), color var(--nhanh), box-shadow var(--nhanh); }
.loc:hover { background: var(--cham-nhat); border-color: var(--cham); color: var(--cham-dam); }
.loc[aria-current="true"] { background: linear-gradient(180deg, #3a69f2, var(--cham)); border-color: var(--cham-dam); box-shadow: 0 4px 10px -4px rgba(34, 81, 224, .65); }
.loc[aria-current="true"]:hover { color: #fff; }
.tab a { position: relative; transition: color var(--nhanh), background var(--nhanh); }
.tab a::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--cham), var(--cham-sang)); transform: scaleX(0); transition: transform var(--vua) var(--em); }
.tab a:hover { background: var(--cham-nhat); color: var(--cham-dam); }
.tab a[aria-current="true"] { color: var(--cham-dam); border-bottom-color: transparent; }
.tab a[aria-current="true"]::after { transform: scaleX(1); }
.phan-trang { gap: 4px; }
.phan-trang a, .phan-trang span.so-trang { margin-left: 0; border-radius: 6px; border-color: var(--ke); transition: background var(--nhanh), border-color var(--nhanh), color var(--nhanh); }
.phan-trang a:hover { background: var(--cham-nhat); border-color: var(--cham); color: var(--cham-dam); }
.phan-trang span.so-trang { background: linear-gradient(180deg, #3a69f2, var(--cham)); border-color: var(--cham-dam); }

/* ---------- Hàng, bảng */
.hang { transition: background var(--nhanh), box-shadow var(--nhanh); }
a.hang:hover { box-shadow: inset 3px 0 0 var(--cham-sang); }
a.hang.dang-xem { box-shadow: inset 3px 0 0 var(--cham); }
.hang .mui { transition: transform var(--nhanh) var(--em), color var(--nhanh); }
a.hang:hover .mui { transform: translateX(3px); }
.bang td { transition: background var(--nhanh); }
.bang-nguoi td a:not(.ca-hang) { display: inline-block; min-width: 30px; padding: 1px 7px; border-radius: 5px; text-align: right; transition: background var(--nhanh), color var(--nhanh); }
.bang-nguoi td a:not(.ca-hang):hover { background: var(--cham); color: #fff; text-decoration: none; }
.bang-nguoi tr.dang-chon td { background: var(--cham-nhat); }
.bang-nguoi .cot-ray { width: 18%; min-width: 110px; }
.bang-nguoi .ray { height: 8px; border-radius: 999px; background: var(--xam-nhat); overflow: hidden; }
.bang-nguoi .ray > i { display: block; height: 100%; min-width: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--bieu-do), #7ea2ff); transform-origin: left; animation: dai-ra 620ms var(--em) both; }

/* ---------- Ảnh, lưới sản phẩm, hồ sơ */
.anh { border-radius: 6px; }
.phong-anh { backdrop-filter: blur(6px); animation: mo-dan 160ms ease-out both; }
.phong-anh img { border-radius: 10px; box-shadow: var(--bong-3); animation: phong-to 220ms var(--em) both; }
@keyframes mo-dan { from { opacity: 0; } }
@keyframes phong-to { from { opacity: 0; transform: scale(.94); } }
.sp { border-radius: var(--r-lon); box-shadow: var(--bong-1); transition: transform var(--vua) var(--em), box-shadow var(--vua), border-color var(--nhanh); }
a.sp:hover { transform: translateY(-4px); box-shadow: var(--bong-2); border-color: var(--cham-sang); }
.sp .hinh img { transition: transform 420ms var(--em); }
a.sp:hover .hinh img { transform: scale(1.05); }
.sp .hinh .goc .nhan { border-radius: 0 6px 0 0; }
.ho-so .anh-lon { border-radius: var(--r-lon); box-shadow: var(--bong-1); }
.o-so, .buoc { border-radius: 8px; overflow: hidden; box-shadow: var(--bong-1); }
.buoc > div.hom-nay { box-shadow: inset 0 0 0 2px var(--cham-sang); }

/* ---------- Biểu đồ */
.bd-cot .thanh-cot { border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #7ea2ff, var(--bieu-do)); transform-origin: bottom; animation: moc-len 560ms var(--em) both; transition: filter var(--nhanh); }
.bd-cot .cot.nhat .thanh-cot { background: linear-gradient(180deg, #dbe5ff, #bccdff); }
.bd-cot .cot.rong .thanh-cot { background: #d5d9e0; animation: none; }
.bd-cot .cot.thieu .thanh-cot { background: linear-gradient(180deg, #f2766d, var(--do)); }
.bd-cot a.cot:hover .thanh-cot { background: linear-gradient(180deg, var(--cham-sang), var(--cham-dam)); }
.bd-cot .gia-tri-cot { animation: mo-dan 400ms 380ms ease-out both; }
.bd-ngang .ray { height: 10px; border-radius: 999px; }
.bd-ngang .ray > i { border-radius: 999px; background: linear-gradient(90deg, var(--bieu-do), #7ea2ff); transform-origin: left; animation: dai-ra 620ms var(--em) both; }
.bd-ngang a.dong-bd:hover .ray > i { filter: saturate(1.3) brightness(.92); }
@keyframes moc-len { from { transform: scaleY(0); } }
@keyframes dai-ra { from { transform: scaleX(0); } }
@supports (animation-delay: calc(sibling-index() * 1ms)) {
  .bd-cot .cot .thanh-cot { animation-delay: calc(sibling-index() * 16ms); }
  .bd-ngang .dong-bd .ray > i, .bang-nguoi tr .ray > i { animation-delay: calc(sibling-index() * 28ms); }
}
.noi-goi-y { border-radius: 7px; box-shadow: var(--bong-2); animation: mo-dan 110ms ease-out both; }

/* ---------- Hộp nổi: gợi ý, khung xem đơn, hộp thêm */
.go-y, .go-y-nhap, .viec-them .hop-them { border: 1px solid var(--ke); border-radius: var(--r-lon); box-shadow: var(--bong-3); animation: tha-xuong 140ms var(--em) both; }
.go-y { top: 38px; }
.go-y .dau-nhom:first-child { border-top: 0; border-radius: 9px 9px 0 0; }
.go-y a, .go-y-nhap .muc { transition: background 90ms; }
.go-y a:last-child { border-radius: 0 0 9px 9px; }
@keyframes tha-xuong { from { opacity: 0; transform: translateY(-6px); } }
.khung-xem { box-shadow: var(--bong-2); animation: truot-vao 220ms var(--em) both; }
@keyframes truot-vao { from { opacity: 0; transform: translateX(18px); } }
.khung-xem .dau-khung { background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); }
.xuong { display: flex; flex-direction: column; gap: 12px; }
.xuong i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #e9edf5 25%, #f6f8fc 45%, #e9edf5 65%); background-size: 300% 100%; animation: lap-lanh 1.1s linear infinite; }
.xuong i:nth-child(1) { width: 52%; height: 22px; }
.xuong i:nth-child(2) { width: 34%; }
.xuong i:nth-child(3) { height: 64px; }
.xuong i:nth-child(4) { height: 120px; }
@keyframes lap-lanh { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Kho, nhập đơn */
.phieu { transition: box-shadow var(--vua); }
.phieu:hover { box-shadow: var(--bong-2); }
.phieu > .dau-phieu { background: var(--mat); border-bottom-color: var(--ke-nhat); }
.phieu.da-xong > .dau-phieu { background: var(--xanh-nhat); }
.bang-nhap input { transition: background var(--nhanh), border-color var(--nhanh), box-shadow var(--nhanh); }
.bang-nhap .bo-dong { border-radius: 6px; }
.thanh-luu { border-radius: var(--r-lon) var(--r-lon) 0 0; border-top: 0; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); box-shadow: 0 -10px 26px -14px rgba(11, 20, 55, .4); }
.thanh-luu::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--cham), var(--cham-sang) 45%, var(--nhan-manh)); }
.thanh-luu .o-tong { border-radius: 8px; overflow: hidden; background: var(--mat); }
.viec-don .chon-buoc select { border-radius: var(--r) 0 0 var(--r); }

/* ---------- Đăng nhập */
.dang-nhap { background: radial-gradient(900px 500px at 15% 0%, #23409e 0%, rgba(35, 64, 158, 0) 60%), radial-gradient(700px 420px at 100% 100%, rgba(255, 159, 28, .22) 0%, rgba(255, 159, 28, 0) 60%), #0a1233; }
.dang-nhap .nhan-hieu { flex-direction: column; align-items: flex-start; gap: 2px; }
.dang-nhap .nhan-hieu strong { font-size: 26px; }
.dang-nhap .the { border: 0; border-radius: 14px; box-shadow: var(--bong-3); animation: hien-len 320ms var(--em) both; }
.dang-nhap form { padding: 24px; }
.dang-nhap .the > :first-child, .dang-nhap .the > :last-child { border-radius: var(--r); }
.bao-vuong form { box-shadow: var(--bong-2); }

@media (max-width: 900px) {
  .hang-muc a::after { display: none; }
  .hang-muc a { border-radius: 6px; }
  .thanh-duoi { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); box-shadow: 0 -8px 20px -14px rgba(11, 20, 55, .4); }
  .thanh-duoi a { transition: color var(--nhanh); }
  .thanh-duoi a[aria-current="page"] { color: var(--cham-dam); }
  .khung-xem { animation: none; }
  .thanh-luu { border-radius: var(--r-lon); position: relative; }
  .dai-so.chon-duoc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
@media print {
  body { background: #fff; }
  .the, .dai-so, .phieu { box-shadow: none; }
  .trang > * { animation: none; }
}
