/* ═══════════════════════════════════════════════════════════════════
   Thái Ninh · Bán Hàng — giao diện
   Màu thương hiệu: xanh búp trà, vàng nắng, mực. Không tải font / thư viện ngoài.
   Co giãn: điện thoại (≤ 860px, menu trượt + thanh dưới), máy tính bảng / laptop nhỏ
   (861–1199px, menu thu thành cột biểu tượng), máy tính (≥ 1200px), màn rộng (≥ 1600px).
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --xanh-tra: #58832a;
  --xanh-dam: #3f611d;
  --xanh-rat-dam: #233a10;
  --xanh-nhat: #eef4e6;
  --xanh-hover: #f5f9f0;
  --vang-nang: #f5b300;
  --vang-nhat: #fff8e6;
  --muc: #22281c;
  --nen: #f6f7f3;
  --giay: #ffffff;
  --chu: var(--muc);
  --mo: #5f6957;
  --mo-nhat: #6b7563;   /* 18/11/2026: #8a9381 cũ chỉ đạt 3.2:1 trên nền trắng; nay 4.8:1 */
  --vien: #e3e8dc;
  --vien-dam: #ccd6c3;
  --chinh: var(--xanh-dam);
  --chinh-dam: #2e4714;
  --do: #b42318;
  --do-nhat: #fdecea;
  --vang: #fef3c7;
  --xanh-duong: #0b6bcb;

  --bo: 12px;          /* bo góc thẻ */
  --bo-nho: 8px;       /* bo góc nút, ô nhập */
  --bong-1: 0 1px 2px rgba(34, 40, 28, .05), 0 1px 3px rgba(34, 40, 28, .04);
  --bong-2: 0 4px 16px rgba(34, 40, 28, .08), 0 1px 3px rgba(34, 40, 28, .05);
  --bong-3: 0 12px 32px rgba(34, 40, 28, .16);
  --vong: 0 0 0 3px rgba(88, 131, 42, .22);

  --rong-menu: 248px;
  --le: clamp(14px, 1.2vw + 6px, 32px);       /* lề nội dung, tự co theo màn hình */
  --cao-thanh-duoi: 0px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-so: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Thang cỡ chữ (18/11/2026). Mọi font-size mới dùng một trong các bậc này, không viết số lẻ.
     Theo rem nên "Cỡ chữ nhỏ / lớn" trong Cài đặt hiển thị vẫn co giãn cả hệ thống. */
  --co-rat-nho: .75rem;     /* 12px: nhãn nhóm viết hoa, số trên huy hiệu */
  --co-phu: .8125rem;       /* 13px: thông tin phụ, thẻ nhỏ */
  --co-nho: .875rem;        /* 14px: chữ phụ trong bảng, nút nhỏ */
  --co-bang: .9375rem;      /* 15px: chữ trong bảng, nút, ô nhập */
  --co-than: 1rem;          /* 16px: chữ thường */
  --co-muc: 1.125rem;       /* 18px: tiêu đề khối */
  --co-lon: 1.25rem;        /* 20px */
  --co-tieu-de: 1.5rem;     /* 24px: tiêu đề trang, số liệu lớn */
  --co-so-lon: 1.75rem;     /* 28px: số trên thẻ tổng quan */

  /* Màu theo nghĩa: màu chỉ để báo việc / trạng thái; thông tin tham khảo dùng màu trung tính. */
  --tt-tin: #1d4f8f;     --tt-tin-nen: #e3edfb;      /* mới, thông tin cần biết */
  --tt-cho: #0b5f63;     --tt-cho-nen: #dcf1ef;      /* đã xác nhận, chờ gửi */
  --tt-duong: #3730a3;   --tt-duong-nen: #e7e8fd;    /* đang trên đường */
  --tt-tot: #1e5229;     --tt-tot-nen: #dff2e3;      /* xong, đã thu */
  --tt-canh: #8a4b00;    --tt-canh-nen: #fff1cc;     /* cần để ý, đang chờ */
  --tt-gap: #a2271b;     --tt-gap-nen: #fde4e1;      /* gấp, lỗi, hoàn */
  --tt-trung: #4b5346;   --tt-trung-nen: #eceee8;    /* tham khảo: kênh, tỉnh, huỷ */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(15px, .16vw + 13.2px, 16px); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--nen); color: var(--chu);
  line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--chinh); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--xanh-tra); outline-offset: 2px; border-radius: 4px; }
::selection { background: #d9e8c4; }
h1 { font-size: var(--co-tieu-de); font-weight: 700; margin: 0; color: var(--xanh-rat-dam); letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: var(--co-muc); font-weight: 600; margin: 24px 0 12px; color: var(--xanh-rat-dam); letter-spacing: -.005em; }
code { background: var(--xanh-nhat); padding: 1px 6px; border-radius: 5px; font-size: .86em; font-family: var(--font-so); }
.bo-qua { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: var(--bo-nho); box-shadow: var(--bong-2); }
.bo-qua:focus { left: 8px; }

/* ── Khung trang ── */
body.co-menu { padding-left: var(--rong-menu); padding-bottom: var(--cao-thanh-duoi); }
main { max-width: none; margin: 0; padding: 0 var(--le) 56px; }
body.khong-menu main { max-width: 460px; margin: 0 auto; padding-top: clamp(24px, 6vh, 72px); }

.dau-la { display: inline-block; width: 12px; height: 12px; margin-right: 8px; background: var(--vang-nang); border-radius: 0 70% 0 70%; }
.dau-dang-nhap { text-align: center; margin-bottom: 20px; }
.anh-logo-dn { display: block; width: 88px; height: 88px; margin: 0 auto; }
.ten-dang-nhap { text-align: center; font-weight: 700; font-size: var(--co-lon); color: var(--xanh-rat-dam); margin: 16px 0 4px; }
.mo-ta-dn { text-align: center; color: var(--mo); margin: 0; font-size: var(--co-bang); }

.khung-tieu-de { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 20px; }
.cac-nut-tieu-de { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Cột menu trái ── */
.cot-menu {
  position: fixed; inset: 0 auto 0 0; width: var(--rong-menu); z-index: 40;
  background: linear-gradient(180deg, #27410f 0%, var(--xanh-rat-dam) 60%, #1d300d 100%);
  color: #eef3e6; display: flex; flex-direction: column; overflow: hidden auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.cot-menu a { color: inherit; text-decoration: none; }
.dau-menu { padding: 18px 16px 14px; }
.ten-he-thong { display: flex; align-items: center; gap: 11px; min-width: 0; }
.anh-logo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.khoi-ten { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.khoi-ten strong { font-size: var(--co-muc); letter-spacing: .01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-ta-he-thong { font-size: var(--co-phu); color: #b5c59f; letter-spacing: .01em; }

.cot-menu nav { flex: 1; padding: 4px 10px 16px; }
.cot-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ten-nhom { margin: 18px 12px 6px; font-size: var(--co-rat-nho); letter-spacing: .09em; text-transform: uppercase; color: #a7b993; font-weight: 700; white-space: nowrap; }
.cot-menu nav a {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 12px;
  border-radius: 9px; font-size: var(--co-bang); font-weight: 500; color: #e3ebd8; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.cot-menu nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.cot-menu nav a.dang-o { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.cot-menu nav a.dang-o::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--vang-nang); }
.cot-menu nav a .icon { width: 19px; height: 19px; opacity: .8; }
.cot-menu nav a.dang-o .icon { opacity: 1; color: var(--vang-nang); }
.chu-muc { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.huy-hieu-menu { background: var(--vang-nang); color: #1a2512; font-size: var(--co-rat-nho); font-weight: 700; border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; line-height: 1.5; }

.cot-menu .nguoi { padding: 12px 12px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.khoi-nguoi { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; }
.avatar-chu { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--vang-nang); color: #2a2a12; font-weight: 700; display: grid; place-items: center; font-size: var(--co-bang); }
.thong-tin-nguoi { line-height: 1.25; min-width: 0; }
.ten-nguoi-dung { display: block; font-weight: 600; font-size: var(--co-nho); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vai-tro-the { display: block; font-size: var(--co-phu); color: #b5c59f; }
.nut-chu { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 36px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #eef3e6; border-radius: var(--bo-nho); padding: 6px 10px; cursor: pointer; font: inherit; font-size: var(--co-nho); transition: background .15s; }
.nut-chu:hover { background: rgba(255,255,255,.14); }
.cot-menu :focus-visible, .nut-chu:focus-visible { outline-color: var(--vang-nang); }

/* ── Thanh trên cùng (dính khi cuộn) ── */
.thanh-tren {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 calc(-1 * var(--le)) 8px; padding: 12px var(--le);
  background: rgba(246, 247, 243, .86); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.thanh-tim-nhanh { position: relative; flex: 1 1 260px; max-width: 520px; }
.thanh-tim-nhanh .icon-tim-kiem { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mo-nhat); pointer-events: none; display: flex; }
.thanh-tim-nhanh .icon-tim-kiem .icon { width: 17px; height: 17px; }
.thanh-tim-nhanh input[type="search"] { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--vien); background: #fff; font-size: var(--co-bang); margin: 0; box-shadow: var(--bong-1); }
.thanh-tim-nhanh input[type="search"]:focus { border-color: var(--xanh-tra); box-shadow: var(--vong); }
/* Gợi ý ô tìm nhanh khi đang gõ (19/11/2026) */
.goi-y-tim { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--giay); border: 1px solid var(--vien-dam); border-radius: var(--bo); box-shadow: var(--bong-3); padding: 6px; max-height: min(70vh, 480px); overflow-y: auto; }
.gyt-nhom { padding: 8px 10px 4px; font-size: var(--co-rat-nho); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mo-nhat); }
.gyt-dong { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 8px 10px; border-radius: var(--bo-nho); color: var(--chu); text-decoration: none; }
.gyt-dong:hover, .gyt-dong.dang-chon { background: var(--xanh-hover); }
.gyt-dong.dang-chon { box-shadow: inset 3px 0 0 var(--xanh-tra); }
.gyt-chinh { font-weight: 600; font-size: var(--co-bang); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gyt-nhan { font-size: var(--co-phu); color: var(--mo); white-space: nowrap; }
.gyt-phu { grid-column: 1 / -1; font-size: var(--co-phu); color: var(--mo); font-variant-numeric: tabular-nums; }
.gyt-trong { padding: 10px; color: var(--mo); font-size: var(--co-nho); }
.gyt-tat-ca { display: block; margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--vien); font-size: var(--co-nho); font-weight: 500; color: var(--chinh); text-decoration: none; }
.gyt-tat-ca:hover { text-decoration: underline; }
.nhom-nut-tren { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nut-them-nhanh { display: inline-flex; align-items: center; gap: 6px; }
.nut-tro-ly .icon { color: #c48a00; }

/* ── Đầu trang & thanh dưới trên điện thoại ── */
.thanh-di-dong, .thanh-duoi { display: none; }
.man-mo { position: fixed; inset: 0; background: rgba(20, 28, 14, .45); z-index: 35; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.chu-logo-di-dong { display: grid; line-height: 1.15; color: #fff; min-width: 0; }
.chu-logo-di-dong strong { font-size: var(--co-than); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chu-logo-di-dong small { font-size: var(--co-rat-nho); color: #b5c59f; }

/* Laptop nhỏ, máy tính bảng ngang: menu thu thành cột biểu tượng, rê chuột thì mở rộng đè lên nội dung. */
@media (min-width: 861px) and (max-width: 1199px) {
  :root { --rong-menu: 72px; }
  .cot-menu { transition: width .18s ease, box-shadow .18s ease; }
  .cot-menu:not(:hover):not(:focus-within) .khoi-ten,
  .cot-menu:not(:hover):not(:focus-within) .chu-muc,
  .cot-menu:not(:hover):not(:focus-within) .thong-tin-nguoi,
  .cot-menu:not(:hover):not(:focus-within) .nut-chu span { display: none; }
  .cot-menu:not(:hover):not(:focus-within) .ten-nhom { font-size: 0; margin: 12px 14px 8px; height: 1px; background: rgba(255,255,255,.14); }
  .cot-menu:not(:hover):not(:focus-within) nav a { justify-content: center; padding: 8px 0; }
  .cot-menu:not(:hover):not(:focus-within) .huy-hieu-menu { position: absolute; top: 4px; right: 8px; padding: 0 5px; min-width: 16px; font-size: var(--co-rat-nho); }
  .cot-menu:not(:hover):not(:focus-within) .ten-he-thong, .cot-menu:not(:hover):not(:focus-within) .khoi-nguoi { justify-content: center; }
  .cot-menu:hover, .cot-menu:focus-within { width: 248px; box-shadow: var(--bong-3); }
}
@media (min-width: 1600px) { :root { --rong-menu: 264px; } }

@media (max-width: 860px) {
  :root { --cao-thanh-duoi: calc(62px + env(safe-area-inset-bottom)); }
  body.co-menu { padding-left: 0; }
  .thanh-di-dong {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: var(--xanh-rat-dam); color: #fff; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
  }
  .logo-di-dong { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
  .anh-logo-di-dong { width: 30px; height: 30px; object-fit: contain; flex: none; }
  .nut-menu, .nut-tao-di-dong { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; cursor: pointer; }
  .nut-menu { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); padding: 0; }
  .nut-tao-di-dong { background: var(--xanh-tra); text-decoration: none; }
  .nut-menu .icon, .nut-tao-di-dong .icon { width: 20px; height: 20px; }
  .cot-menu { width: min(86vw, 300px); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: var(--bong-3); }
  body.menu-mo .cot-menu { transform: none; }
  body.menu-mo { overflow: hidden; }
  .thanh-tren { position: static; margin: 0 0 4px; padding: 12px 0 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .thanh-tim-nhanh { max-width: none; flex-basis: 100%; }
  .nhom-nut-tren { display: none; }
  .khung-tieu-de { margin: 12px 0 16px; }

  .thanh-duoi {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    height: var(--cao-thanh-duoi); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--vien); box-shadow: 0 -4px 16px rgba(34,40,28,.06);
  }
  .thanh-duoi a, .thanh-duoi button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; font: inherit; font-size: var(--co-rat-nho); font-weight: 600; color: var(--mo); text-decoration: none; cursor: pointer;
  }
  .thanh-duoi .icon { width: 22px; height: 22px; }
  .thanh-duoi a.dang-o { color: var(--xanh-dam); }
  .thanh-duoi a.dang-o .icon { stroke-width: 2.2; }
  .thanh-duoi a.td-chinh .icon { width: 44px; height: 44px; padding: 10px; margin-top: -18px; border-radius: 50%; background: var(--xanh-tra); color: #fff; box-shadow: 0 4px 12px rgba(63,97,29,.35); border: 3px solid #fff; }
  .thanh-duoi b { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--do); color: #fff; font-size: var(--co-rat-nho); line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 999px; }
  .thong-bao-nhanh { top: auto !important; bottom: calc(var(--cao-thanh-duoi) + 12px); left: 12px; right: 12px !important; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ── Hộp nội dung (Cards & Containers) ── */
.hop { background: var(--giay); border: 1px solid var(--vien); border-radius: 10px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.hop h2 { margin-top: 0; }
.hop-hep { max-width: 440px; margin: 30px auto; }
.luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.ca-hang, .ca-cot { grid-column: 1 / -1; }
.hai-cot { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 18px; }
.cot-doc-phai { display: flex; flex-direction: column; gap: 18px; }

/* ── Thẻ thống kê tổng quan (Dashboard Metric Cards) ── */
.cac-the { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.the-so { display: block; background: var(--giay); border: 1px solid var(--vien); border-radius: 10px; padding: 16px; text-decoration: none; color: var(--chu); border-top: 3.5px solid var(--xanh-tra); box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: transform .12s ease, box-shadow .12s ease, border-top-color .12s ease; }
.the-so:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,.08); border-top-color: var(--vang-nang); text-decoration: none; }
.the-so span { display: flex; align-items: center; gap: 8px; font-size: var(--co-nho); color: var(--mo); font-weight: 500; }
.the-so strong { display: block; font-size: var(--co-so-lon); font-weight: 700; margin-top: 6px; color: var(--chu); font-variant-numeric: tabular-nums; line-height: 1.2; }
.the-so em { display: block; font-style: normal; font-size: var(--co-phu); color: var(--mo); margin-top: 4px; }
.the-so em.do, .the-so strong.do { color: var(--do); }
.the-so .icon { width: 20px; height: 20px; color: var(--xanh-tra); flex-shrink: 0; }

/* ── Lưới chỉ số KPI Báo Cáo ── */
.hop-dieu-khien-bao-cao { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; background: #fff; border: 1px solid var(--vien); border-radius: 10px; padding: 12px 16px; }
.hop-dieu-khien-bao-cao .the-loc { margin-bottom: 0; }
.form-tuy-chon-ngay { margin-bottom: 0; padding: 0; border: none; background: transparent; }
.text-khoang-ngay { margin: -6px 0 16px; color: var(--mo); }
.luoi-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.the-kpi { background: #fff; border: 1px solid var(--vien); border-radius: 10px; padding: 16px; display: flex; align-items: flex-start; gap: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.03); border-top: 3px solid var(--vien-dam); }
.the-kpi-chinh { border-top-color: var(--xanh-tra); background: linear-gradient(180deg, #fafdf6 0%, #fff 100%); }
.icon-kpi { width: 42px; height: 42px; border-radius: 10px; background: var(--xanh-nhat); color: var(--xanh-dam); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-kpi .icon { width: 22px; height: 22px; }
.chi-tiet-kpi { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nhan-kpi { font-size: var(--co-nho); color: var(--mo); font-weight: 500; }
.so-kpi { font-size: var(--co-tieu-de); font-weight: 700; color: var(--chu); font-variant-numeric: tabular-nums; line-height: 1.2; }
.phu-kpi { font-size: var(--co-phu); color: var(--mo); margin-top: 2px; }

/* ── Biểu đồ SVG Doanh Thu ── */
.khung-bieu-do { padding: 18px 20px; margin-bottom: 20px; }
.hop-tieu-de-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.hop-tieu-de-flex h2 { margin: 0; }
.vung-cuon-bieu-do { overflow-x: auto; padding: 10px 0; }
.bieu-do-svg { width: 100%; min-height: 200px; display: block; }
.cot-bieu-do { transition: opacity .15s ease; cursor: pointer; }
.cot-bieu-do:hover { opacity: .78; }

/* ── 4 Thẻ số liệu Khách Hàng (Customer Metrics) ── */
.thanh-tieu-de-khach { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 12px 18px; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.thong-tin-khach-dau { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nhom-lien-lac-khach { display: flex; align-items: center; gap: 8px; }
.cac-nut-thao-tac-khach { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bon-the-so-lieu { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.the-so-lieu { background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 16px 18px; border-top: 3.5px solid var(--xanh-tra); display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.the-so-lieu .nhan-so-lieu { font-size: var(--co-nho); color: var(--mo); display: flex; align-items: center; gap: 6px; }
.the-so-lieu .nhan-so-lieu .icon { width: 16px; height: 16px; }
.the-so-lieu .gia-tri-so-lieu { font-size: var(--co-tieu-de); font-weight: 700; color: var(--chu); font-variant-numeric: tabular-nums; }
.the-so-lieu .chu-thich-so-lieu { font-size: var(--co-phu); color: var(--mo); }
.the-doanh-so { border-top-color: #10b981; }
.the-don-hang { border-top-color: #3b82f6; }
.the-don-hoan { border-top-color: #ef4444; }
.the-trung-binh { border-top-color: var(--vang-nang); }
.danh-sach-tra-quen { list-style: none; padding: 0; margin: 4px 0 0; }
.danh-sach-tra-quen li { padding: 3px 0; font-size: var(--co-bang); border-bottom: 1px dashed var(--vien); }
.danh-sach-tra-quen li:last-child { border-bottom: 0; }
.ghi-chu-crm { background: #fdfae7; border: 1px solid #f6e59e; border-radius: 7px; padding: 10px 14px; margin-top: 14px; color: #7a5a00; }

/* ── Biểu mẫu (Forms & Controls) ── */
label { display: block; font-size: var(--co-nho); color: var(--mo); font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; color: var(--chu); background: #fff; border: 1px solid #c8d3c2; border-radius: 7px; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox] { display: inline-block; width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--xanh-tra); box-shadow: 0 0 0 3px rgba(88,131,42,.15); }
.hop-hep label { margin-bottom: 14px; }
.o-ngay { display: inline-flex; align-items: center; gap: 6px; font-size: var(--co-nho); color: var(--mo); }
.o-ngay input { width: auto; margin: 0; padding: 6px 8px; font-size: var(--co-nho); }
.day-phai { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }

/* ── Nút bấm (Buttons) ── */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; font: inherit; font-size: var(--co-bang); font-weight: 500; color: var(--chu); background: #fff; border: 1px solid #c2cec0; border-radius: 7px; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, transform .08s; line-height: 1.35; }
.nut:hover { background: var(--xanh-nhat); border-color: #abbfa6; text-decoration: none; }
.nut:active { transform: scale(.98); }
.nut-chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
.nut-chinh:hover { background: var(--chinh-dam); border-color: var(--chinh-dam); color: #fff; }
.nut-nguy { color: var(--do); border-color: #f1b8b3; }
.nut-nguy:hover { background: var(--do-nhat); border-color: var(--do); }
.nut-nho { padding: 5px 10px; font-size: var(--co-nho); border-radius: 6px; }
.nut-lon { padding: 11px 18px; font-size: var(--co-than); font-weight: 600; }
.nut-kich-thuoc-day { width: 100%; text-align: center; justify-content: center; }

/* ── Thông báo hệ thống (Alerts & Toasts) ── */
.bao { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; font-size: var(--co-bang); }
.bao-ok { background: #e3f3e6; border: 1px solid #b5d9bd; color: #1e5229; }
.bao-loi { background: #fde8e6; border: 1px solid #f1b8b3; color: #7a1a14; }
.hop-canh-bao { background: #fffaeb; border: 1px solid #f0d38a; border-radius: 8px; padding: 12px 16px; color: var(--tt-canh); margin-bottom: 16px; font-size: var(--co-bang); }
.hop-canh-bao ul { margin: 6px 0 10px 18px; padding: 0; }
.thong-bao-nhanh { position: fixed; top: 22px; right: 24px; z-index: 1000; background: var(--xanh-dam); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: var(--co-bang); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.2); animation: truyenXuong .22s cubic-bezier(.16,1,.3,1); }
.thong-bao-nhanh.thong-bao-loi { background: var(--do); }
@keyframes truyenXuong { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Bộ lọc & Thẻ lọc (Filters & Tabs) ── */
.thanh-loc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; background: #fff; border: 1px solid var(--vien); border-radius: 10px; padding: 12px 14px; }
.thanh-loc input, .thanh-loc select { width: auto; margin: 0; flex: 1 1 150px; max-width: 260px; font-size: var(--co-bang); }
.the-loc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.the-loc a { padding: 7px 14px; border: 1px solid var(--vien); border-radius: 999px; background: #fff; text-decoration: none; font-size: var(--co-nho); font-weight: 500; color: var(--chu); transition: background .12s, border-color .12s; }
.the-loc a:hover { background: var(--xanh-nhat); }
.the-loc a.dang-o { background: var(--chinh); border-color: var(--chinh); color: #fff; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,.1); }

.nhom-loc-ngay { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--vien); }
.nhom-loc-ngay .nho-nhan { font-size: var(--co-nho); color: var(--mo); margin-right: 4px; }
.nut-the { border-radius: 999px; padding: 3px 10px; font-size: var(--co-phu); }
.nut-the.dang-chon { background: var(--chinh); color: #fff; border-color: var(--chinh); font-weight: 600; }

.thanh-thong-ke-don { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--vien); border-radius: 8px; padding: 10px 16px; margin-bottom: 12px; font-size: var(--co-bang); }
.thong-ke-muc { display: flex; gap: 6px; align-items: baseline; }
.thong-ke-muc span { color: var(--mo); }
.so-tien-noi { color: var(--chinh-dam); font-size: var(--co-muc); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Thanh thao tác hàng loạt (Bulk Actions Bar) ── */
.thanh-hang-loat { position: sticky; top: 12px; z-index: 25; background: var(--xanh-rat-dam); color: #fff; border-radius: 9px; padding: 10px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.thanh-hang-loat strong { color: var(--vang-nang); }
.thanh-hang-loat .nut { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.thanh-hang-loat .nut:hover { background: rgba(255,255,255,.24); }
.thanh-hang-loat .nut-nguy { background: var(--do); border-color: var(--do); color: #fff; }
.thanh-hang-loat input { width: 140px; margin: 0; padding: 5px 8px; font-size: var(--co-nho); }

/* ── Bảng dữ liệu (Tables) ── */
.bang-cuon { overflow-x: auto; background: var(--giay); border: 1px solid var(--vien); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.03); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: var(--co-bang); }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
th { background: var(--xanh-nhat); font-weight: 600; color: var(--xanh-rat-dam); white-space: nowrap; }
tbody tr:hover { background: var(--xanh-hover); }
tbody tr:last-child td { border-bottom: 0; }
.so { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.font-dam { font-weight: 600; }
tr.mo td { color: var(--mo); }
tr.canh-bao td { background: var(--vang); }
tr.tr-bi-chan td { background: #fff5f5; }
td.rong, li.rong { color: var(--mo); text-align: center; padding: 24px; font-style: italic; }
td input, td select { margin: 0; }
.o-tien { width: 125px; text-align: right; margin-left: auto; }
.hang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.hang form { margin: 0; }
td .hang { margin: 0; flex-wrap: nowrap; }

/* ── Các cột trong bảng Đơn Hàng ── */
.ma-don-link { font-weight: 700; font-size: var(--co-than); color: var(--chinh-dam); text-decoration: none; }
.ma-don-link:hover { text-decoration: underline; color: var(--xanh-tra); }
.the-kenh-nho { display: inline-block; font-size: var(--co-phu); font-weight: 600; padding: 1px 7px; border-radius: 4px; background: #f0f4ea; color: var(--xanh-dam); margin-top: 3px; }
.cot-ngay { white-space: nowrap; font-size: var(--co-nho); }
.ngay-chinh { display: block; font-weight: 600; color: var(--chu); }
.ten-khach-dong { font-size: var(--co-bang); font-weight: 600; color: var(--chu); margin-bottom: 2px; }
.sdt-khach-dong { display: flex; align-items: center; gap: 4px; font-size: var(--co-nho); }
.link-sdt { color: var(--chinh); font-weight: 600; }
.link-sdt:hover { text-decoration: underline; }
.dia-chi-rut-gon { font-size: var(--co-phu); color: var(--mo); margin-top: 2px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cot-hang { font-size: var(--co-nho); max-width: 260px; line-height: 1.35; }
.dong-san-pham-chu { color: #334155; }
.the-trang-thai-khoi, .the-thanh-toan-khoi { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; margin-bottom: 3px; }
.cot-van-chuyen { font-size: var(--co-nho); line-height: 1.3; }
.ten-hang-vc { font-weight: 600; color: #475569; font-size: var(--co-phu); text-transform: uppercase; letter-spacing: .03em; }
.dong-ma-van-don { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.ma-van-don-chu { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: var(--co-nho); font-weight: 600; color: var(--chu); background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.cot-tien { white-space: nowrap; }
.tong-tien-lon { font-size: var(--co-than); font-weight: 700; color: var(--xanh-dam); font-variant-numeric: tabular-nums; }
.kieu-thanh-toan { font-size: var(--co-phu); color: var(--mo); margin-top: 2px; }

/* ── Thao tác nhanh & Sao chép ── */
.thao-tac { text-align: right; white-space: nowrap; }
.nhom-thao-tac-dong { display: inline-flex; gap: 4px; align-items: center; }
.nut-chep-mini { background: none; border: none; padding: 2px 4px; cursor: pointer; color: var(--mo); border-radius: 4px; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; transition: color .12s, background .12s; }
.nut-chep-mini:hover { color: var(--chinh); background: var(--xanh-nhat); }
.nut-chep-mini .icon { width: 14px; height: 14px; }
.link-tra-cuu { display: inline-flex; align-items: center; gap: 4px; font-size: var(--co-phu); color: var(--chinh); text-decoration: none; margin-top: 3px; font-weight: 500; }
.link-tra-cuu:hover { text-decoration: underline; color: var(--chinh-dam); }
.link-tra-cuu .icon { width: 13px; height: 13px; }

/* ── Thẻ Trạng Thái & Hạng Khách Hàng (Pills & Badges) ── */
.nho { font-size: var(--co-nho); color: var(--mo); }
.nho-phu { font-size: var(--co-phu); color: var(--mo); display: block; }
.the { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; font-size: var(--co-phu); font-weight: 500; background: #e6e9e3; white-space: nowrap; }
.the .icon { width: 12px; height: 12px; }
.the-nho { font-size: var(--co-phu); padding: 1px 7px; }

.tt-moi { background: #dbeafe; color: #1e40af; }
.tt-xac_nhan { background: #fef3c7; color: #92400e; }
.tt-da_gui { background: #e0e7ff; color: #3730a3; }
.tt-da_giao { background: #d1fae5; color: #065f46; font-weight: 600; }
.tt-hoan { background: #fde8e6; color: #991b1b; }
.tt-huy { background: #f3f4f6; color: #4b5563; }

.the-da-thanh-toan { background: #d1fae5; color: #065f46; font-weight: 600; }
.the-chua-thu { background: #fef3c7; color: #92400e; }
.the-coc { background: #e0f2fe; color: #0369a1; }
.the-da-dong { background: #f3f4f6; color: #6b7280; }

.hang-vip { background: #fff0c2; color: #7a5a00; font-weight: 600; }
.hang-than_thiet { background: #dcebc9; color: #2f4718; font-weight: 500; }
.hang-quay_lai { background: #e3eefc; color: #1f4b80; }
.hang-moi { background: #eef0ea; color: #555; }
.hang-chua_mua { background: #f1f1ef; color: #6a6a62; }
.the-chan { background: #fde8e6; color: #7a1a14; font-weight: 600; }

.the-kho-an-toan { background: #ecfdf5; color: #065f46; }
.the-kho-canh-bao { background: #fef3c7; color: #92400e; font-weight: 600; }
.the-kho-het { background: #fee2e2; color: #b91c1c; font-weight: 700; }

/* ── Bảng Kết Quả Đối Soát & Nhập Kho ── */
tr.kq-ok td { background: #f0fdf4; }
tr.kq-loi td { background: #fef2f2; color: #991b1b; }
tr.kq-lech td { background: #fffbeb; }
tr.kq-bo td { background: #f8fafc; color: #64748b; }

/* ── Trang Chi Tiết Đơn Hàng (don-xem) ── */
.thanh-tieu-de-don { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 12px 18px; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.thong-tin-tieu-de { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cac-nut-thao-tac-don { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ba-cot-thong-tin { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; margin-bottom: 18px; }
.the-thong-tin { background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 18px; display: flex; flex-direction: column; }
.the-vietqr { background: #fafcf7; border-color: #d2dec6; }
.hop-tieu-de { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; border-bottom: 1px solid var(--vien); padding-bottom: 8px; }
.hop-tieu-de h2 { margin: 0; font-size: var(--co-muc); display: flex; align-items: center; gap: 6px; color: var(--xanh-rat-dam); }
.hop-tieu-de h2 .icon { width: 19px; height: 19px; color: var(--xanh-tra); }

.danh-sach-chi-tiet { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: var(--co-bang); }
.danh-sach-chi-tiet dt { color: var(--mo); font-size: var(--co-nho); }
.danh-sach-chi-tiet dd { margin: 0; word-break: break-word; }

.dong-tuong-tac-sdt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.link-sdt-to { font-size: var(--co-than); color: var(--chu); font-weight: 700; }
.dia-chi-to { font-size: var(--co-bang); font-weight: 500; }
.nut-zalo { background: #0068ff; color: #fff; border-color: #0068ff; }
.nut-zalo:hover { background: #0054cc; color: #fff; }
.nut-zalo-mini { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; background: #0068ff; color: #fff; text-decoration: none; vertical-align: middle; }
.nut-zalo-mini .icon { width: 14px; height: 14px; }

.khung-qr-noi-dung { display: flex; gap: 14px; align-items: center; }
.anh-qr-khoi { flex-shrink: 0; }
.anh-vietqr-don { width: 125px; height: 125px; object-fit: contain; border: 1px solid var(--vien); border-radius: 8px; background: #fff; padding: 4px; display: block; }
.thong-tin-ck { flex: 1; font-size: var(--co-nho); display: flex; flex-direction: column; gap: 6px; }
.dong-tk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nhan-tk { color: var(--mo); min-width: 82px; }
.chu-noi-dung-ck { color: var(--do); font-weight: 700; }
.chu-tien-ck { color: var(--xanh-dam); font-size: var(--co-than); font-weight: 700; }
.chu-tien-thu-ho { color: var(--do); font-size: var(--co-lon); font-weight: 700; font-variant-numeric: tabular-nums; }
.chu-xanh { color: var(--xanh-dam); font-weight: 600; }
.chu-cam { color: #d97706; font-weight: 600; }
.dong-van-don-chi-tiet { display: flex; align-items: center; gap: 6px; }
.ma-van-don-to { font-size: var(--co-than); font-weight: 700; font-family: ui-monospace, SFMono-Regular, monospace; }
.link-tra-cuu-hop { margin-top: 4px; }
.link-tra-cuu-to { font-size: var(--co-nho); color: var(--chinh); font-weight: 600; }

.bang-chi-tiet-hang tfoot tr td { padding: 9px 13px; }
.dong-tong-cong td { border-top: 2px solid var(--vien-dam); background: var(--xanh-nhat); font-size: var(--co-than); }
.dong-thu-cod td { background: #fff9ed; font-size: var(--co-muc); border-top: 1px dashed #e2c07d; }

/* ── Khối Mẫu Tin Nhắn CRM (Zalo/SMS) ── */
.hop-mau-tin-nhan { background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 18px; margin: 18px 0; }
.hang-nut-tab { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--vien); padding-bottom: 10px; flex-wrap: wrap; }
.nut-tab { background: none; border: 1px solid var(--vien); border-radius: 6px; padding: 7px 14px; font-size: var(--co-bang); cursor: pointer; color: var(--chu); font-weight: 500; transition: background .12s; }
.nut-tab:hover { background: var(--xanh-nhat); }
.nut-tab.dang-o { background: var(--xanh-dam); color: #fff; border-color: var(--xanh-dam); font-weight: 600; }
.o-tin-nhan-mau { width: 100%; font-family: inherit; font-size: var(--co-bang); line-height: 1.5; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--vien); background: #fdfdfc; resize: vertical; margin-bottom: 10px; }
.hang-thao-tac-tin-nhan { display: flex; gap: 8px; align-items: center; }

/* ── Màn hình Tạo / Sửa Đơn Hàng (don-tao) ── */
.khung-tao-don { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 960px) { .khung-tao-don { grid-template-columns: 1fr; } }
.cot-chinh-don { display: flex; flex-direction: column; gap: 18px; }
.cot-phu-don { display: flex; flex-direction: column; }
.the-thanh-toan-sticky { position: sticky; top: 16px; background: #fff; border: 1px solid var(--vien); border-radius: 10px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); border-top: 3.5px solid var(--xanh-tra); }
.the-thanh-toan-sticky h2 { margin-top: 0; border-bottom: 1px solid var(--vien); padding-bottom: 10px; margin-bottom: 14px; }
.dong-hang { display: grid; grid-template-columns: minmax(0, 1fr) 85px 125px auto; gap: 8px; align-items: center; margin-bottom: 10px; background: #fafbf8; border: 1px solid var(--vien); border-radius: 8px; padding: 8px 10px; }
.dong-hang select, .dong-hang input { margin: 0; }
.thanh-tien { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cac-nut-nhanh-gia, .cac-nut-nhanh-ship { display: flex; gap: 4px; margin-top: 6px; }
.nut-nhanh-tien, .nut-nhanh-ship { background: #fff; border: 1px solid var(--vien); border-radius: 4px; padding: 3px 8px; font-size: var(--co-phu); cursor: pointer; color: var(--mo); }
.nut-nhanh-tien:hover, .nut-nhanh-ship:hover { background: var(--xanh-nhat); color: var(--chinh); border-color: var(--xanh-tra); }
.dong-tinh-toan { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: var(--co-bang); }
.khung-nhap-phu { margin-bottom: 12px; }
.duong-ke-phu { border: 0; border-top: 1px dashed var(--vien); margin: 12px 0; }
.dong-tong-tien { border-top: 2px solid var(--vien); padding-top: 10px; font-weight: 700; font-size: var(--co-than); }
.dong-thu-ho-cod { background: #fff9ed; padding: 10px 12px; border-radius: 7px; margin-top: 8px; border: 1px dashed #e5c378; }
.chu-tong-tien { font-size: var(--co-lon); color: var(--chinh-dam); }
.chu-thu-ho { font-size: var(--co-lon); color: var(--do); }
.cac-nut-luu-don { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.goi-y-khach { background: #f0f7ea; border: 1px solid #c9dec0; border-radius: 7px; padding: 8px 12px; font-size: var(--co-nho); color: var(--xanh-rat-dam); }
.goi-y-khach.co-canh-bao { background: #fffbeb; border-color: #fef08a; color: #92400e; }

/* ── Quản lý Tồn kho & Nhập xuất (ton-kho) ── */
.tieu-de-nhap-xuat { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none; }
.tieu-de-nhap-xuat::-webkit-details-marker { display: none; }
.form-nhap-xuat { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--vien); }
.so-ton-lon { font-size: var(--co-muc); font-weight: 700; font-variant-numeric: tabular-nums; }
.form-canh-bao-kho { display: flex; gap: 6px; align-items: center; }

/* ── Tìm kiếm & Tra cứu (tra-cuu) ── */
.hop-tra-cuu { margin-bottom: 18px; }
.form-tra-cuu { display: flex; gap: 8px; align-items: center; padding: 6px; border: 2px solid var(--xanh-tra); border-radius: 10px; }
.o-tra-cuu-rong { flex: 1; border: none; padding: 10px 14px; font-size: var(--co-than); }
.o-tra-cuu-rong:focus { box-shadow: none; }
.hop-trong-tra-cuu { text-align: center; padding: 40px 20px; color: var(--mo); }
.hop-trong-tra-cuu .icon { width: 44px; height: 44px; margin-bottom: 12px; color: #cbd5e1; }

/* ── Phiếu Gói Hàng In (don-in) ── */
.thanh-in-dieu-khien { background: #fff; border: 1px solid var(--vien); border-radius: 9px; padding: 14px 18px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.danh-sach-phieu-in { display: flex; flex-direction: column; gap: 24px; }
.phieu-dong-goi { background: #fff; border: 2px solid #333; border-radius: 10px; padding: 20px; max-width: 680px; margin: 0 auto; box-shadow: 0 4px 14px rgba(0,0,0,.06); font-family: -apple-system, system-ui, "Segoe UI", Arial, sans-serif; color: #111; }
.phieu-dau-moi { display: flex; justify-content: space-between; gap: 14px; border-bottom: 2px solid #222; padding-bottom: 12px; margin-bottom: 14px; }
.phieu-thuong-hieu { display: flex; align-items: center; gap: 12px; }
.phieu-logo-anh { width: 50px; height: 50px; object-fit: contain; }
.ten-htx { font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; }
.phieu-slogan { font-size: .84rem; color: #444; font-style: italic; }
.phieu-lien-he { font-size: .82rem; color: #333; margin-top: 2px; }
.phieu-ma-khoi { text-align: right; }
.phieu-ma-don { font-size: 1.45rem; font-weight: 800; }
.phieu-ngay-tao { font-size: .82rem; color: #555; }
.phieu-ma-vd-hop { margin-top: 4px; border: 1px dashed #333; padding: 3px 8px; border-radius: 4px; display: inline-block; }
.ma-vd-in { font-size: 1rem; letter-spacing: .05em; }

.phieu-dia-chi-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-bottom: 1px solid #333; padding-bottom: 12px; margin-bottom: 14px; font-size: .88rem; }
.phieu-nguoi-gui { border-right: 1px dashed #bbb; padding-right: 12px; }
.nhan-vai-tro { font-size: .74rem; font-weight: 800; color: #666; letter-spacing: .05em; display: block; margin-bottom: 4px; }
.nhan-den { color: #000; }
.phieu-ten-khach { font-size: 1.15rem; font-weight: 800; }
.phieu-sdt-khach { font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; margin: 2px 0; }
.phieu-dia-chi-khach { font-size: .9rem; line-height: 1.35; }

.phieu-bang-hang { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: .92rem; }
.phieu-bang-hang th, .phieu-bang-hang td { border: 1px solid #444; padding: 6px 10px; }
.phieu-bang-hang th { background: #f0f0f0; font-weight: 700; color: #000; }
.cot-stt { width: 50px; text-align: center; }
.cot-sl { width: 90px; }
.phieu-sl-to { font-size: 1.1rem; }

.phieu-chan-moi { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; border-top: 2px solid #222; padding-top: 12px; }
.phieu-thong-tin-phu { font-size: .86rem; line-height: 1.4; }
.phieu-chi-dan-shipper { font-size: .8rem; color: #444; margin-top: 4px; }

.phieu-khung-cod-moi { border: 3px double #000; padding: 10px 16px; border-radius: 6px; text-align: center; min-width: 190px; }
.phieu-khung-cod-moi.co-cod { background: #fff; }
.nhan-cod-to { font-size: .88rem; font-weight: 800; letter-spacing: .05em; }
.so-tien-cod-to { font-size: 1.65rem; font-weight: 900; letter-spacing: .02em; margin: 2px 0; }
.chu-y-cod { font-size: .75rem; color: #444; font-weight: 600; }
.chu-da-tt { color: #000; }

.phieu-qr-thanh-toan { text-align: center; width: 90px; }
.phieu-qr-anh { width: 80px; height: 80px; object-fit: contain; }
.phieu-qr-chu { font-size: .68rem; color: #555; display: block; line-height: 1.2; margin-top: 2px; }

/* ── Phân trang & Dòng thời gian nhật ký ── */
.phan-trang { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0; }
.dong-thoi-gian { list-style: none; padding: 0; margin: 0; }
.dong-thoi-gian li { background: var(--giay); border: 1px solid var(--vien); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }

/* ── Định dạng In (Print) ── */
@media print {
  @page { size: A5 landscape; margin: 8mm; }
  .cot-menu, .thanh-di-dong, .thanh-tren, .man-mo, .khong-in, .bao, .thong-bao-nhanh { display: none !important; }
  body.co-menu main, body.khong-menu main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .danh-sach-phieu-in { gap: 0 !important; }
  .phieu-dong-goi { border: 2px solid #000 !important; border-radius: 0 !important; box-shadow: none !important; max-width: none !important; width: 100% !important; margin: 0 0 10mm 0 !important; padding: 12px !important; page-break-after: always; break-after: page; }
  .phieu-dong-goi:last-of-type { page-break-after: auto; break-after: auto; }
}

/* ── Icon nét mảnh SVG ── */
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.cot-menu nav a .icon { opacity: .88; }
.cot-menu nav a.dang-o .icon { opacity: 1; color: var(--vang-nang); }
.nut-chu .icon { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .dong-hang { grid-template-columns: minmax(0, 1fr) 58px auto; padding: 8px; }
  .dong-hang .o-sl { width: 100%; padding-left: 4px; padding-right: 4px; }
  .dong-hang .thanh-tien { display: none; }
  .thanh-tren { flex-direction: column; align-items: stretch; }
  .thanh-tim-nhanh { max-width: 100%; }
  .nhom-nut-tren { justify-content: flex-end; }
  .thanh-tieu-de-don, .thanh-tieu-de-khach { flex-direction: column; align-items: stretch; }
  .ba-cot-thong-tin { grid-template-columns: 1fr; }
  .bon-the-so-lieu { grid-template-columns: 1fr; }
  .khung-qr-noi-dung { flex-direction: column; align-items: flex-start; }
  .form-tuy-chon-ngay, .form-tuy-chon-ngay .o-ngay { flex-wrap: wrap; max-width: 100%; }
  .o-ngay input { flex: 1 1 130px; min-width: 0; }
}
/* Cột lưới/flex không được nở theo nội dung rồi đẩy tràn ngang trên điện thoại. */
.khung-tao-don > *, .cot-chinh-don > *, .dong-hang > * { min-width: 0; }
.dong-hang select { width: 100%; text-overflow: ellipsis; }

/* ── Các lớp bổ trợ và thành phần chi tiết ── */
.bang-don, .bang-khach, .bang-san-pham { width: 100%; }
.chon-don { cursor: pointer; width: 17px; height: 17px; accent-color: var(--xanh-tra); }
.dong-mvd-bang { display: inline-flex; align-items: center; gap: 4px; }
.form-ghi-chu-don { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.hop-bang-hang { padding: 18px; margin-top: 18px; }
.hop-ghi-chu, .hop-ghi-chu-nho { background: #fafaf7; border-left: 3.5px solid var(--xanh-tra); padding: 12px 16px; border-radius: 6px; margin: 12px 0; }
.hop-ghi-chu-nho { padding: 8px 12px; font-size: var(--co-nho); }
.huong-dan-in { font-size: var(--co-nho); color: var(--mo); margin-top: 4px; }
.khoi-thao-tac-tt { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.khung-tabs-tin-nhan { margin-top: 14px; }
.nhan-checkbox-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--co-bang); }
.nhan-hang-vc { display: inline-block; font-size: var(--co-phu); font-weight: 700; color: #475569; background: #e2e8f0; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; }
.nhan-kieu-tt { font-weight: 600; color: var(--chu); }
.nhom-nut-in { display: flex; gap: 8px; align-items: center; }
.noi-dung-cs-dong { font-size: var(--co-nho); line-height: 1.45; }
.noi-dung-tab { display: block; }
.noi-dung-tab[hidden] { display: none !important; }
.nut-sao-chep { cursor: pointer; }
.nut-them-dong { margin-top: 10px; }
.o-canh-bao-nho { font-size: var(--co-phu); color: #92400e; }
.o-ly-do-chan { margin-top: 6px; }
.o-sl { width: 75px; text-align: center; }
.o-sp { flex: 1; min-width: 220px; }
.phieu-can-nang { font-size: .86rem; color: #333; margin-bottom: 4px; }
.phieu-ghi-chu-hop { background: #f5f5f5; border: 1px dashed #666; padding: 6px 10px; border-radius: 4px; font-size: .84rem; margin: 4px 0; }
.phieu-nguoi-nhan { padding-left: 14px; }
.phieu-thuong-hieu-chu { display: flex; flex-direction: column; }
.ten-khach-link { font-weight: 700; color: var(--chinh-dam); text-decoration: none; }
.ten-khach-link:hover { text-decoration: underline; color: var(--xanh-tra); }
.the-canh-bao-giao { background: #fee2e2; color: #b91c1c; font-weight: 600; }
.the-kenh-don { display: inline-block; padding: 3px 10px; border-radius: 6px; background: #f0f4ea; color: var(--xanh-dam); font-size: var(--co-nho); font-weight: 600; }
.the-trang-thai-chinh { font-size: var(--co-than); }
.thoi-gian-tao { font-size: var(--co-nho); color: var(--mo); }
tr.tr-giao-cham td { background: #fff5f3; }
.xoa-dong { color: var(--do); border-color: #f1b8b3; }
.xoa-dong:hover { background: var(--do-nhat); }

/* ═══════════════════ Tinh chỉnh chung (ghi đè các khối phía trên) ═══════════════════ */

/* Thẻ, hộp */
.hop, .the-thong-tin, .hop-mau-tin-nhan, .thanh-tieu-de-don, .thanh-tieu-de-khach, .thanh-loc, .hop-dieu-khien-bao-cao,
.thanh-thong-ke-don, .thanh-in-dieu-khien { border-radius: var(--bo); border-color: var(--vien); box-shadow: var(--bong-1); }
.hop { padding: clamp(14px, 1.2vw + 8px, 22px); }
.hop > :first-child { margin-top: 0; }
.hop > :last-child { margin-bottom: 0; }
.hop-tieu-de { gap: 10px; flex-wrap: wrap; }
.hop-tieu-de h2 { font-size: var(--co-muc); }

/* Thẻ số liệu */
.cac-the { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: clamp(10px, 1vw, 16px); }
.the-so { border-radius: var(--bo); border-top-width: 1px; border-color: var(--vien); box-shadow: var(--bong-1); padding: 16px 18px; position: relative; overflow: hidden; }
a.the-so:hover { transform: translateY(-1px); box-shadow: var(--bong-2); border-color: var(--vien-dam); }
.the-so:hover { border-top-color: var(--vien-dam); }
.the-so span { font-size: var(--co-nho); }
.the-so strong { font-size: clamp(1.35rem, 1rem + 1vw, 1.7rem); letter-spacing: -.01em; }
.the-so .icon { width: 18px; height: 18px; }

/* Lưới */
.luoi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px 18px; }
.hai-cot { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.ba-cot-thong-tin { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.luoi-2-1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 18px; align-items: start; }
.luoi-2-1 > aside { position: sticky; top: 76px; }
@media (max-width: 1100px) { .luoi-2-1 { grid-template-columns: 1fr; } .luoi-2-1 > aside { position: static; } }

/* Ô nhập */
label { font-size: var(--co-nho); color: var(--mo); font-weight: 600; }
input, select, textarea { min-height: 40px; padding: 8px 12px; border-radius: var(--bo-nho); border-color: var(--vien-dam); font-size: var(--co-bang); }
textarea { min-height: 0; line-height: 1.5; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b4c2a8; }
input:focus, select:focus, textarea:focus { border-color: var(--xanh-tra); box-shadow: var(--vong); }
input::placeholder, textarea::placeholder { color: #9aa290; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 17px; height: 17px; accent-color: var(--xanh-tra); }
input[readonly] { background: #f7f8f4; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6957' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center; }
.thanh-loc { padding: 10px 12px; gap: 8px; }
.thanh-loc input, .thanh-loc select { min-height: 38px; font-size: var(--co-bang); }

/* Nút */
.nut { min-height: 38px; padding: 7px 14px; border-radius: var(--bo-nho); border-color: var(--vien-dam); font-weight: 600; box-shadow: var(--bong-1); white-space: nowrap; }
.nut:hover { background: var(--xanh-hover); border-color: #b4c2a8; }
.nut-chinh { background: var(--xanh-dam); border-color: var(--xanh-dam); color: #fff; box-shadow: 0 1px 2px rgba(35,58,16,.25), inset 0 1px 0 rgba(255,255,255,.08); }
.nut-chinh:hover { background: var(--chinh-dam); border-color: var(--chinh-dam); color: #fff; }
.nut-nho { min-height: 32px; padding: 4px 11px; font-size: var(--co-nho); }
.nut-lon { min-height: 46px; }
.nut .icon { width: 17px; height: 17px; }
.nut-nho .icon { width: 15px; height: 15px; }
.nut:disabled { opacity: .55; cursor: not-allowed; }
.nut-chu-nho { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: var(--co-phu); color: var(--mo); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.nut-chu-nho:hover { color: var(--do); }

/* Thông báo */
.bao { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; border-radius: var(--bo-nho); font-size: var(--co-bang); line-height: 1.45; }
.bao .icon { flex: none; margin-top: 1px; }
.bao-thong-tin { background: #eef5fc; border: 1px solid #c9ddf2; color: #1d4a74; }
.bao-thong-tin a { color: inherit; font-weight: 600; text-decoration: underline; }
.thong-bao-nhanh { border-radius: 10px; }

/* Thẻ lọc dạng tab */
.the-loc { gap: 6px; }
.the-loc a { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: var(--co-nho); border-color: var(--vien-dam); }
.the-loc a.dang-o { background: var(--xanh-dam); border-color: var(--xanh-dam); box-shadow: none; }
.dem { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.07); font-size: var(--co-phu); font-weight: 700; text-align: center; line-height: 1.6; }
.dang-o > .dem { background: rgba(255,255,255,.22); }

/* Bảng */
.bang-cuon {
  border-radius: var(--bo); box-shadow: var(--bong-1); -webkit-overflow-scrolling: touch;
  /* Bóng mờ hai mép báo còn cột khi cuộn ngang */
  background:
    linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)) left / 28px 100% no-repeat local,
    linear-gradient(270deg, #fff 30%, rgba(255,255,255,0)) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(34,40,28,.14), transparent) left / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(34,40,28,.14), transparent) right / 10px 100% no-repeat scroll,
    #fff;
}
table { font-size: var(--co-bang); }
th, td { padding: 11px 14px; border-bottom-color: #edf0e8; }
th { background: #f6f8f2; color: var(--mo); font-size: var(--co-phu); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #fafcf7; }
td.rong { padding: 36px 16px; font-style: normal; }

/* Nhãn trạng thái */
.the { padding: 2px 9px; font-size: var(--co-phu); font-weight: 600; line-height: 1.5; }
.the-nho { font-size: var(--co-rat-nho); padding: 0 7px; }

/* Trạng thái trống */
.trong { text-align: center; padding: clamp(28px, 6vh, 64px) 20px; color: var(--mo); }
.trong .icon { width: 44px; height: 44px; color: #c2ccb6; margin-bottom: 10px; stroke-width: 1.4; }
.trong p { margin: 4px 0; }
.trong-nho { color: var(--mo); text-align: center; padding: 28px 12px; font-size: var(--co-bang); list-style: none; }

/* Mục mở rộng (details) */
details.gap > summary, details.hop > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; list-style: none; color: var(--xanh-rat-dam); }
details.gap > summary::-webkit-details-marker { display: none; }
details.gap > summary::after { content: "+"; margin-left: auto; font-size: var(--co-lon); color: var(--mo); }
details.gap[open] > summary::after { content: "−"; }
details.gap[open] > summary { margin-bottom: 14px; }

/* Chip, công tắc */
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--vien-dam); background: #fff; font: inherit; font-size: var(--co-phu); font-weight: 600; color: var(--xanh-rat-dam); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.chip:hover { background: var(--xanh-nhat); border-color: #b4c2a8; }
.chip-tinh { cursor: default; background: #f4f6f0; border-color: transparent; color: var(--mo); min-height: 24px; padding: 1px 9px; font-size: var(--co-phu); }
.chip-tinh:hover { background: #f4f6f0; }
.cong-tac { position: relative; width: 38px; height: 22px; border-radius: 999px; border: 0; background: #cfd6c7; cursor: pointer; padding: 0; transition: background .15s; flex: none; }
.cong-tac span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.cong-tac.bat { background: var(--xanh-tra); }
.cong-tac.bat span { transform: translateX(16px); }

/* Ảnh đại diện theo kênh */
.anh-dai-dien { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: #7b8a6c; font-size: var(--co-bang); }
.kenh-facebook.anh-dai-dien { background: #1877f2; }
.kenh-zalo.anh-dai-dien { background: #0068ff; }
.kenh-website.anh-dai-dien { background: var(--xanh-tra); }
.kenh-tiktok_shop.anh-dai-dien { background: #161823; }
.the-kenh.kenh-facebook { background: #e7f0fe; color: #1456b8; }
.the-kenh.kenh-zalo { background: #e5f0ff; color: #0050c8; }
.the-kenh.kenh-website { background: var(--xanh-nhat); color: var(--xanh-dam); }
.the-kenh.kenh-tiktok_shop { background: #ececee; color: #161823; }
.the-can-nguoi { background: #fff1e0; color: #a14b00; }
.huy-hieu { background: var(--xanh-tra); color: #fff; font-size: var(--co-rat-nho); font-weight: 700; border-radius: 999px; min-width: 20px; padding: 0 6px; text-align: center; line-height: 1.6; }

/* ═══════════════════ Hộp thư ═══════════════════ */
.hop-thu {
  display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  height: calc(100dvh - 150px); min-height: 520px; background: #fff;
  border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong-1); overflow: hidden; margin-bottom: 16px;
}
.hop-thu > * { min-width: 0; }
.ht-danh-sach { display: flex; flex-direction: column; border-right: 1px solid var(--vien); min-height: 0; }
.ht-tim select { flex: 0 1 auto; max-width: 42%; }
.ht-tim { display: flex; gap: 6px; padding: 12px 12px 8px; }
.ht-tim input { flex: 1; min-width: 0; margin: 0; min-height: 36px; font-size: var(--co-nho); }
.ht-tim select { width: auto; margin: 0; min-height: 36px; font-size: var(--co-nho); }
.ht-loc { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--vien); }
.ht-loc::-webkit-scrollbar { display: none; }
.ht-loc a { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: var(--co-phu); font-weight: 600; color: var(--mo); text-decoration: none; }
.ht-loc a:hover { background: var(--xanh-hover); }
.ht-loc a.dang-o { background: var(--xanh-nhat); color: var(--xanh-dam); }
.ht-ds { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; }
.ht-muc { display: flex; gap: 11px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.ht-muc:hover { background: #f7f9f4; text-decoration: none; }
.ht-muc.dang-o { background: var(--xanh-nhat); }
.ht-than { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ht-dong-1, .ht-dong-2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ht-dong-1 strong { flex: 1; min-width: 0; font-size: var(--co-bang); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-dong-1 time { flex: none; font-size: var(--co-phu); color: var(--mo-nhat); }
.ht-tin { flex: 1; min-width: 0; font-size: var(--co-nho); color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-muc.chua-doc strong, .ht-muc.chua-doc .ht-tin { color: var(--chu); font-weight: 700; }
.ht-dong-3 { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

.ht-khung { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fbfcf9; }
.ht-khung > .trong { margin: auto; }
.ht-dau { display: flex; align-items: center; gap: 11px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--vien); }
.ht-ten { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.ht-ten strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-nut { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ht-nut form { margin: 0; }
.nut-quay-lai { display: none; }
.ht-khach { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--vien); font-size: var(--co-nho); }
.ht-khach > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.ht-khach .icon { width: 16px; height: 16px; color: var(--mo); }
.ht-gan { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; width: 100%; }
.ht-gan input { width: 160px; margin: 0; min-height: 32px; font-size: var(--co-nho); }
.ht-tin-nhan { flex: 1; overflow-y: auto; padding: 16px clamp(12px, 2vw, 24px); display: flex; flex-direction: column; gap: 6px; }
.ht-moc-ngay { text-align: center; margin: 10px 0 4px; }
.ht-moc-ngay span { font-size: var(--co-rat-nho); color: var(--mo); background: #eef1ea; padding: 2px 10px; border-radius: 999px; }

.bong { max-width: min(78%, 560px); display: flex; flex-direction: column; }
.bong-noi-dung { padding: 9px 13px; border-radius: 16px; font-size: var(--co-bang); line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.bong-vao { align-self: flex-start; }
.bong-vao .bong-noi-dung { background: #fff; border: 1px solid var(--vien); border-bottom-left-radius: 5px; }
.bong-ra { align-self: flex-end; align-items: flex-end; }
.bong-ra .bong-noi-dung { background: var(--xanh-dam); color: #fff; border-bottom-right-radius: 5px; }
.bong-bot .bong-noi-dung { background: #fff6dc; color: var(--chu); border: 1px solid #f3dc9b; }
.bong-chan { display: flex; align-items: center; gap: 6px; padding: 2px 6px; font-size: var(--co-rat-nho); color: var(--mo-nhat); }
.bong-chan span { display: inline-flex; align-items: center; gap: 3px; }
.bong-chan .icon { width: 12px; height: 12px; }
.cho-gui { color: #a14b00; font-weight: 600; }

.ht-goi-y { margin: 0 14px 8px; padding: 10px 12px; background: #fffbea; border: 1px solid #f3dc9b; border-radius: 10px; font-size: var(--co-nho); }
.ht-goi-y p { margin: 6px 0 8px; white-space: pre-line; }
.ht-goi-y .hang { margin: 0; }
.ht-goi-y-dau { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ht-goi-y-dau .icon { width: 16px; height: 16px; color: #c48a00; }
.ht-goi-y-dau .nho { margin-left: auto; font-size: var(--co-phu); }
.ht-goi-y-trong { display: flex; align-items: center; gap: 8px; color: var(--mo); background: #f7f8f4; border-color: var(--vien); }
.ht-soan { padding: 10px 14px 12px; background: #fff; border-top: 1px solid var(--vien); }
.ht-mau-nhanh { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.ht-o-soan { display: flex; gap: 8px; align-items: flex-end; }
.ht-o-soan textarea { margin: 0; flex: 1; min-height: 42px; max-height: 220px; resize: none; }
.ht-o-soan .nut { min-height: 42px; }

@media (max-width: 860px) {
  .hop-thu { grid-template-columns: 1fr; height: calc(100dvh - var(--cao-thanh-duoi) - 140px); min-height: 440px; }
  .hop-thu.dang-doc .ht-danh-sach { display: none; }
  .hop-thu:not(.dang-doc) .ht-khung { display: none; }
  .ht-danh-sach { border-right: 0; }
  .nut-quay-lai { display: inline-flex; padding: 4px 8px; }
  .ht-nut .nut span { display: none; }
  .ht-gan { flex-wrap: nowrap; }
  .ht-gan label { display: none; }
  .ht-gan input { flex: 1; width: auto; min-width: 0; }
  .bong { max-width: 88%; }
}

/* ═══════════════════ Bot ═══════════════════ */
.hang-nhap { display: flex; gap: 8px; }
.hang-nhap input { margin: 0; flex: 1; min-width: 0; }
.ket-qua-thu { margin-top: 14px; padding: 14px; background: #fbfcf9; border: 1px dashed var(--vien-dam); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; }
.ket-qua-thu .bong { max-width: 92%; }
.ket-qua-thu > p { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; }
.ket-qua-thu > p .icon { width: 15px; height: 15px; }
.ds-kich-ban { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.ds-kich-ban > li { border: 1px solid var(--vien); border-radius: 10px; padding: 12px 14px; background: #fff; }
.ds-kich-ban > li.tat { background: #f8f9f6; }
.ds-kich-ban > li.tat .kb-tra-loi, .ds-kich-ban > li.tat strong { color: var(--mo-nhat); }
.kb-dau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-nut { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.kb-nut form { margin: 0; display: flex; }
.kb-tu-khoa { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.kb-tra-loi { margin: 0; font-size: var(--co-nho); color: var(--mo); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chon-the { display: grid; gap: 8px; margin-bottom: 10px; }
.the-chon { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--vien-dam); border-radius: 10px; cursor: pointer; transition: border-color .12s, background .12s; }
.the-chon input { grid-row: span 2; margin: 0; }
.the-chon strong { color: var(--chu); font-size: var(--co-bang); }
.the-chon span { grid-column: 2; font-size: var(--co-phu); font-weight: 400; color: var(--mo); }
.the-chon.dang-chon { border-color: var(--xanh-tra); background: var(--xanh-hover); box-shadow: 0 0 0 1px var(--xanh-tra); }
aside .hop label { margin-bottom: 12px; }

/* ═══════════════════ Trợ lý ═══════════════════ */
.tro-ly { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.tl-trang-thai { display: flex; align-items: center; gap: 8px; font-size: var(--co-nho); color: var(--mo); background: #fff; border: 1px solid var(--vien); border-radius: 999px; padding: 6px 14px; align-self: center; text-align: center; }
.cham-tt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cham-tt.xanh { background: #2f9e44; box-shadow: 0 0 0 3px rgba(47,158,68,.18); }
.cham-tt.vang { background: var(--vang-nang); box-shadow: 0 0 0 3px rgba(245,179,0,.2); }
.cham-tt.xam { background: #a8b0a0; }
.tl-khung { display: flex; flex-direction: column; gap: 8px; padding: 18px; min-height: 320px; max-height: calc(100dvh - 330px); overflow-y: auto; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong-1); }
.tl-chao { margin: auto; text-align: center; padding: 20px; max-width: 460px; }
.tl-chao h2 { margin: 12px 0 6px; font-size: var(--co-muc); }
.tl-bieu-tuong { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #fff3c4, #fde68a); color: #9a6a00; }
.tl-bieu-tuong .icon { width: 28px; height: 28px; }
.bong-tro-ly .bong-noi-dung { background: #f7f9f4; border-color: var(--vien); white-space: normal; }
.bong-tro-ly.khong-hieu .bong-noi-dung { background: #fffbea; border-color: #f3dc9b; }
.bong-lien-ket { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bong-lien-ket .icon { width: 14px; height: 14px; }
.tl-hoi { background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); padding: 10px 12px 12px; box-shadow: var(--bong-1); }
.tl-xoa { text-align: center; margin: 0; }
@media (max-width: 860px) { .tl-khung { max-height: none; min-height: 240px; padding: 12px; } }

/* ═══════════════════ Kết nối nguồn ═══════════════════ */
.luong-du-lieu ol { list-style: none; counter-reset: buoc; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.luong-du-lieu li { counter-increment: buoc; position: relative; padding: 12px 14px 12px 48px; background: #f8faf5; border-radius: 10px; display: grid; gap: 2px; }
.luong-du-lieu li::before { content: counter(buoc); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--xanh-dam); color: #fff; font-size: var(--co-phu); font-weight: 700; display: grid; place-items: center; }
.luong-du-lieu li span { font-size: var(--co-nho); color: var(--mo); }
.dia-chi-nhan { border-top: 1px solid var(--vien); padding-top: 12px; }
.dia-chi-nhan p { margin: 6px 0 0; }
.o-chep input { font-family: var(--font-so); font-size: var(--co-nho); }
.luoi-nguon { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-bottom: 18px; }
.the-nguon { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); padding: 16px; box-shadow: var(--bong-1); margin: 0; }
.the-nguon.dang-bat { border-color: #bcd3a2; }
.the-nguon > p { margin: 0; }
.tn-dau { display: flex; align-items: center; gap: 10px; }
.tn-dau > div { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.tn-dau code { background: none; padding: 0; }
.tn-bieu-tuong { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--xanh-nhat); color: var(--xanh-dam); flex: none; }
.tt-nguon { flex: none; font-size: var(--co-rat-nho); font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.tt-nguon.xanh { background: #dcf3e2; color: #1d6b33; }
.tt-nguon.vang { background: #fff1c7; color: #8a5a00; }
.tt-nguon.xam { background: #eef0ea; color: var(--mo); }
.tn-mang-ve { display: flex; flex-wrap: wrap; gap: 4px; }
.tn-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 10px 0 0; border-top: 1px solid #eef1ea; }
.tn-so div { display: grid; gap: 1px; }
.tn-so dt { font-size: var(--co-rat-nho); color: var(--mo-nhat); text-transform: uppercase; letter-spacing: .04em; }
.tn-so dd { margin: 0; font-size: var(--co-nho); font-weight: 600; }
.the-nguon details summary { cursor: pointer; font-size: var(--co-nho); font-weight: 600; color: var(--chinh); }
.the-nguon details[open] { display: grid; gap: 10px; }
.the-nguon details[open] summary { margin-bottom: 2px; }
.tt-dl-cho { background: #fff1c7; color: #8a5a00; }
.tt-dl-da_xu_ly { background: #dcf3e2; color: #1d6b33; }
.tt-dl-bo_qua { background: #eef0ea; color: var(--mo); }
.tt-dl-loi { background: var(--do-nhat); color: var(--do); }
.xem-json summary { cursor: pointer; color: var(--chinh); font-size: var(--co-nho); }
.xem-json pre { max-width: 420px; max-height: 260px; overflow: auto; margin: 6px 0 0; padding: 8px 10px; background: #f6f8f2; border-radius: 8px; font-size: var(--co-phu); white-space: pre-wrap; word-break: break-word; }
.o-ma { font-family: var(--font-so); font-size: var(--co-nho); }

/* ═══════════════════ Màn hình cảm ứng: vùng bấm đủ lớn, chữ ô nhập ≥ 16px (iPhone không tự phóng to) ═══════════════════ */
@media (pointer: coarse) {
  .nut, .the-loc a, .chip { min-height: 44px; }
  .nut-nho { min-height: 40px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  textarea { min-height: 0; }
  .thanh-tim-nhanh input[type="search"] { height: 44px; font-size: 16px; }
  .cot-menu nav a { min-height: 46px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}

/* Điện thoại nhỏ */
@media (max-width: 480px) {
  .khung-tieu-de { flex-direction: column; align-items: stretch; }
  .cac-nut-tieu-de .nut { flex: 1; }
  .the-so { padding: 14px; }
  .hang-nhap { flex-direction: column; }
  .tn-so { grid-template-columns: repeat(2, 1fr); }
  th, td { padding: 9px 10px; }
}

/* Màn rất rộng */
/* (bỏ giới hạn 1640px: main giãn theo màn hình) */

@media print {
  .thanh-duoi, .bo-qua { display: none !important; }
  body.co-menu { padding: 0 !important; }
}

.the-so-tro-ly { background: linear-gradient(135deg, #fffdf3, #fff8de); }
.the-so-tro-ly::after { background: var(--vang-nang); }
.the-so .chu-nho-the { font-size: var(--co-bang); font-weight: 600; color: var(--mo); margin-top: 10px; }

/* Phân quyền trong trang Tài khoản */
.phan-quyen summary { cursor: pointer; color: var(--chinh); font-size: var(--co-nho); font-weight: 600; white-space: nowrap; }
.phan-quyen[open] { min-width: 280px; }
.phan-quyen form { display: grid; gap: 6px; margin-top: 8px; padding: 10px; background: #f8faf5; border-radius: 10px; }
.pq-dong { display: flex; align-items: flex-start; gap: 8px; color: var(--chu); font-weight: 400; cursor: pointer; }
.pq-dong input { margin-top: 3px; }
.pq-dong span { display: grid; line-height: 1.3; }
.pq-dong strong { font-size: var(--co-nho); font-weight: 600; }
.pq-dong small { font-size: var(--co-phu); color: var(--mo); }

/* ═══════════════════ Tổng quan & biểu đồ ═══════════════════ */
.loi-chao { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: -6px 0 18px; }
.loi-chao p { margin: 0; }
.loi-chao h2 { margin: 2px 0 0; font-size: clamp(1.05rem, .9rem + .5vw, 1.3rem); }
.vai-tro-nhan { background: var(--xanh-nhat); color: var(--xanh-dam); }

.kpi-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: clamp(10px, 1vw, 14px); margin-bottom: 18px; }
.kpi-luoi-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong-1); color: var(--chu); text-decoration: none; min-width: 0; }
a.kpi:hover { text-decoration: none; border-color: var(--vien-dam); box-shadow: var(--bong-2); }
.kpi-chinh { background: linear-gradient(160deg, #f4f9ec 0%, #fff 70%); border-color: #d3e3bf; }
.kpi-nhan { display: flex; align-items: center; gap: 7px; font-size: var(--co-phu); font-weight: 600; color: var(--mo); }
.kpi-nhan .icon { width: 17px; height: 17px; color: var(--xanh-tra); }
.kpi strong { font-size: clamp(1.3rem, 1rem + .9vw, 1.65rem); font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-phu { font-size: var(--co-phu); color: var(--mo); }
.bien-dong b { font-weight: 700; }
.bien-dong.tang b { color: #1d6b33; }
.bien-dong.giam b { color: var(--do); }
.bien-dong.ngang b { color: var(--mo); }
.chu-canh-bao { color: var(--do); font-weight: 700; }

.luoi-tq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.2vw, 18px); margin-bottom: 18px; }
.luoi-tq > .hop { margin: 0; min-width: 0; }
.luoi-tq > .o-rong { grid-column: 1 / -1; }
@media (max-width: 1000px) { .luoi-tq { grid-template-columns: 1fr; } }
@media (min-width: 1700px) { .luoi-tq { grid-template-columns: repeat(3, minmax(0, 1fr)); } .luoi-tq > .o-rong { grid-column: span 2; } }

/* Biểu đồ cột */
.bd { margin: 0; }
.bd-khung { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; height: clamp(170px, 22vw, 230px); }
.bd-truc-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: var(--co-rat-nho); color: var(--mo-nhat); text-align: right; font-variant-numeric: tabular-nums; }
.bd-truc-y span { line-height: 0; }
.bd-vung { position: relative; min-width: 0; }
.bd-luoi { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; border-bottom: 1px solid #cfd8c4; pointer-events: none; }
.bd-luoi i { display: block; border-top: 1px dashed #e8ece2; }
.bd-cac-cot { position: absolute; inset: 0; display: flex; align-items: stretch; gap: clamp(1px, .35vw, 6px); }
.bd-cot { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 22px; cursor: default; outline: none; border-radius: 4px; }
.bd-cot i { position: relative; display: block; width: 100%; max-width: 34px; margin: 0 auto; background: #9cbd72; border-radius: 4px 4px 0 0; transition: background .12s; }
.bd-cot.bd-cot-cuoi i { background: var(--xanh-dam); }
.bd-cot:hover i, .bd-cot:focus-visible i { background: var(--xanh-tra); }
.bd-cot.bd-cot-cuoi:hover i { background: var(--xanh-rat-dam); }
.bd-cot i b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-size: var(--co-rat-nho); font-weight: 600; color: var(--mo); white-space: nowrap; }
.bd-nhan { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: var(--co-rat-nho); color: var(--mo); white-space: nowrap; line-height: 20px; }
.bd-nhan.an { visibility: hidden; }
.bd-cot:hover, .bd-cot:focus-visible { background: rgba(88, 131, 42, .06); }
.bd-cot::after {
  content: none; position: absolute; bottom: calc(100% - 18px); left: 50%; transform: translate(-50%, -4px);
  background: var(--muc); color: #fff; font-size: var(--co-phu); font-weight: 600; padding: 5px 9px; border-radius: 7px; white-space: nowrap;
  box-shadow: var(--bong-2); opacity: 0; pointer-events: none; transition: opacity .1s; z-index: 5;
}
/* Chú thích chỉ tạo khi trỏ / chạm vào cột: lúc ẩn mà vẫn có thì chú thích dài ở cột sát mép làm cả trang tràn ngang trên điện thoại. */
.bd-cot:hover::after, .bd-cot:focus-visible::after { content: attr(data-tip); opacity: 1; max-width: min(260px, 80vw); overflow: hidden; text-overflow: ellipsis; }
.bd-cot:first-child::after, .bd-cot:nth-child(2)::after { left: 0; transform: translate(0, -4px); }
.bd-cot:last-child::after, .bd-cot:nth-last-child(2)::after { left: auto; right: 0; transform: translate(0, -4px); }
.bd-bang { margin-top: 8px; font-size: var(--co-phu); }
.bd-bang summary { cursor: pointer; color: var(--mo); display: inline-block; }
.bd-bang table { margin-top: 6px; font-size: var(--co-phu); }
.bd-bang td { padding: 4px 8px; }

/* Biểu đồ thanh ngang */
.bd-ngang ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bd-ngang li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; outline: none; }
.bdn-ten { display: grid; line-height: 1.25; font-size: var(--co-nho); font-weight: 600; min-width: 0; }
.bdn-ten a { color: var(--chu); }
.bdn-ten small { font-size: var(--co-phu); font-weight: 400; color: var(--mo); }
.bdn-ten, .bdn-ten a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdn-ray { display: block; height: 10px; background: #f0f3eb; border-radius: 999px; overflow: hidden; }
.bdn-ray i { display: block; height: 100%; background: var(--xanh-tra); border-radius: 999px; }
.bd-ngang li:hover .bdn-ray i, .bd-ngang li:focus-within .bdn-ray i { background: var(--xanh-dam); }
.bdn-so { display: grid; text-align: right; font-size: var(--co-nho); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; min-width: 58px; }
.bdn-so small { font-size: var(--co-rat-nho); font-weight: 500; color: var(--mo); }

/* Bảng hiệu suất nhân viên */
.bang-trong-hop { box-shadow: none; margin: 0; }
.cot-thanh { width: 22%; min-width: 110px; vertical-align: middle; }
.nv-ten { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.nv-ten small { font-weight: 400; color: var(--mo); font-size: var(--co-phu); margin-left: 2px; }
.avatar-nho { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--xanh-nhat); color: var(--xanh-dam); font-size: var(--co-phu); font-weight: 700; flex: none; }

/* Thẻ việc cần làm */
.luoi-viec { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: clamp(10px, 1vw, 14px); margin-bottom: 18px; }
.the-viec { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong-1); color: var(--chu); text-decoration: none; min-width: 0; }
a.the-viec:hover { text-decoration: none; border-color: var(--vien-dam); box-shadow: var(--bong-2); transform: translateY(-1px); }
.tv-bieu-tuong { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--xanh-nhat); color: var(--xanh-dam); flex: none; }
.tv-than { display: grid; min-width: 0; line-height: 1.25; }
.tv-than span { font-size: var(--co-phu); color: var(--mo); font-weight: 600; }
.tv-than strong { font-size: var(--co-tieu-de); font-variant-numeric: tabular-nums; }
.tv-than em { font-style: normal; font-size: var(--co-phu); color: var(--mo); }
.the-viec.gap { border-color: #f0d38a; background: linear-gradient(160deg, #fffaeb, #fff 70%); }
.the-viec.gap .tv-bieu-tuong { background: #fff0c4; color: #8a5a00; }
.the-viec.xong strong { color: var(--mo-nhat); }

/* Danh sách gọn */
.ds-gon { list-style: none; margin: 0; padding: 0; }
.ds-gon li { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 9px 2px; border-bottom: 1px solid #eef1ea; font-size: var(--co-nho); }
.ds-gon li:last-child { border-bottom: 0; }
.ds-gon li > :first-child { min-width: 72px; }
.ds-gon .so { margin-left: auto; font-weight: 600; }
.ds-gon .icon { width: 14px; height: 14px; margin-right: 3px; }
.rut-gon { flex: 1 1 160px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nut-nhanh-tq { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chu-thich-tq { margin-top: 4px; }
@media (max-width: 480px) {
  .nut-nhanh-tq .nut { flex: 1 1 140px; }
  .bd-ngang li { grid-template-columns: minmax(0, 1fr) auto; }
  .bd-ngang .bdn-ray { grid-column: 1 / -1; grid-row: 2; }
  .loi-chao { align-items: flex-start; flex-direction: column-reverse; gap: 6px; }
}

/* Lớp chiều cao / chiều rộng cho biểu đồ (CSP chặn style nội tuyến nên dùng lớp có sẵn) */
.h-0 { height: 0%; }
.h-1 { height: 1%; }
.h-2 { height: 2%; }
.h-3 { height: 3%; }
.h-4 { height: 4%; }
.h-5 { height: 5%; }
.h-6 { height: 6%; }
.h-7 { height: 7%; }
.h-8 { height: 8%; }
.h-9 { height: 9%; }
.h-10 { height: 10%; }
.h-11 { height: 11%; }
.h-12 { height: 12%; }
.h-13 { height: 13%; }
.h-14 { height: 14%; }
.h-15 { height: 15%; }
.h-16 { height: 16%; }
.h-17 { height: 17%; }
.h-18 { height: 18%; }
.h-19 { height: 19%; }
.h-20 { height: 20%; }
.h-21 { height: 21%; }
.h-22 { height: 22%; }
.h-23 { height: 23%; }
.h-24 { height: 24%; }
.h-25 { height: 25%; }
.h-26 { height: 26%; }
.h-27 { height: 27%; }
.h-28 { height: 28%; }
.h-29 { height: 29%; }
.h-30 { height: 30%; }
.h-31 { height: 31%; }
.h-32 { height: 32%; }
.h-33 { height: 33%; }
.h-34 { height: 34%; }
.h-35 { height: 35%; }
.h-36 { height: 36%; }
.h-37 { height: 37%; }
.h-38 { height: 38%; }
.h-39 { height: 39%; }
.h-40 { height: 40%; }
.h-41 { height: 41%; }
.h-42 { height: 42%; }
.h-43 { height: 43%; }
.h-44 { height: 44%; }
.h-45 { height: 45%; }
.h-46 { height: 46%; }
.h-47 { height: 47%; }
.h-48 { height: 48%; }
.h-49 { height: 49%; }
.h-50 { height: 50%; }
.h-51 { height: 51%; }
.h-52 { height: 52%; }
.h-53 { height: 53%; }
.h-54 { height: 54%; }
.h-55 { height: 55%; }
.h-56 { height: 56%; }
.h-57 { height: 57%; }
.h-58 { height: 58%; }
.h-59 { height: 59%; }
.h-60 { height: 60%; }
.h-61 { height: 61%; }
.h-62 { height: 62%; }
.h-63 { height: 63%; }
.h-64 { height: 64%; }
.h-65 { height: 65%; }
.h-66 { height: 66%; }
.h-67 { height: 67%; }
.h-68 { height: 68%; }
.h-69 { height: 69%; }
.h-70 { height: 70%; }
.h-71 { height: 71%; }
.h-72 { height: 72%; }
.h-73 { height: 73%; }
.h-74 { height: 74%; }
.h-75 { height: 75%; }
.h-76 { height: 76%; }
.h-77 { height: 77%; }
.h-78 { height: 78%; }
.h-79 { height: 79%; }
.h-80 { height: 80%; }
.h-81 { height: 81%; }
.h-82 { height: 82%; }
.h-83 { height: 83%; }
.h-84 { height: 84%; }
.h-85 { height: 85%; }
.h-86 { height: 86%; }
.h-87 { height: 87%; }
.h-88 { height: 88%; }
.h-89 { height: 89%; }
.h-90 { height: 90%; }
.h-91 { height: 91%; }
.h-92 { height: 92%; }
.h-93 { height: 93%; }
.h-94 { height: 94%; }
.h-95 { height: 95%; }
.h-96 { height: 96%; }
.h-97 { height: 97%; }
.h-98 { height: 98%; }
.h-99 { height: 99%; }
.h-100 { height: 100%; }
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }

/* Điện thoại: thẻ việc 2 cột, gọn hơn */
@media (max-width: 560px) {
  .luoi-viec { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .the-viec { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .tv-bieu-tuong { width: 32px; height: 32px; border-radius: 9px; }
  .tv-bieu-tuong .icon { width: 17px; height: 17px; }
  .tv-than strong { font-size: var(--co-lon); }
}

/* Logo TN: menu thu gọn (máy tính bảng) giữ logo giữa cột */
@media (min-width: 861px) and (max-width: 1199px) {
  .cot-menu:not(:hover):not(:focus-within) .anh-logo { width: 36px; height: 36px; }
}
.phieu-logo-anh { width: 46px; height: 46px; }

/* ═══════════════════ Thông minh: rủi ro, tỉnh, nhãn đơn, nhóm khách ═══════════════════ */
.rui-ro { gap: 4px; }
.rui-ro .icon { width: 12px; height: 12px; }
.rui-ro-cao { background: var(--do-nhat); color: var(--do); }
.rui-ro-vua { background: #fff1d6; color: #8a5a00; }
.rui-ro-thap { background: #e5f4ea; color: #1d6b33; }
.hop-rui-ro { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--bo); border: 1px solid; font-size: var(--co-bang); }
.hop-rui-ro.rui-ro-cao { background: #fff6f5; border-color: #f3c3bd; color: #6b1a12; }
.hop-rui-ro.rui-ro-vua { background: #fffaee; border-color: #f0d38a; color: #5c3d00; }
.hop-rui-ro ul { margin: 4px 0 6px 18px; padding: 0; }
.rr-diem { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: #fff; border: 3px solid currentColor; line-height: 1; }
.rr-diem strong { font-size: var(--co-tieu-de); }
.rr-diem span { font-size: var(--co-rat-nho); color: var(--mo); }
.the-tinh { background: #eef3fb; color: #24497a; margin-top: 3px; }
.cac-nhan-don { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.nhan-don { font-size: var(--co-rat-nho); font-weight: 600; padding: 0 7px; border-radius: 4px; background: #fff3d1; color: #7a5200; text-decoration: none; line-height: 1.6; }
.nhan-don:hover { background: #ffe7a6; text-decoration: none; }
.thanh-nhan-don { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; padding: 8px 12px; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); }
.thanh-nhan-don input { width: auto; flex: 1 1 200px; margin: 0; min-height: 34px; }
.goi-y-mon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; background: #f6faf0; border: 1px dashed #c6d9ae; border-radius: 9px; }
.goi-y-mon a.chip { text-decoration: none; }
.goi-y-tinh { display: block; margin-top: 4px; font-weight: 500; }
.goi-y-tinh.ok { color: #1d6b33; }
.goi-y-tinh.chua { color: #8a5a00; }
.the-loc-phu { align-items: center; }
.the-loc-phu > .nho { margin-right: 2px; }
.nhom-trung_thanh { background: #dcf3e2; color: #1d6b33; }
.nhom-tiem_nang { background: #e4f0d4; color: #3f611d; }
.nhom-moi { background: #e6effb; color: #24497a; }
.nhom-can_giu { background: #fff1d6; color: #8a5a00; }
.nhom-sap_mat { background: #fde8dd; color: #9a3b12; }
.nhom-da_mat { background: #eceeea; color: #5f6957; }
.nhom-chua_mua { background: #f3f4f1; color: #6d7566; }

/* ═══════════════════ Dự báo & gợi ý thông minh ═══════════════════ */
.goi-y-hom-nay { border-color: #e6dcb8; background: linear-gradient(170deg, #fffdf5 0%, #fff 60%); }
.goi-y-hom-nay h2 .icon { color: #c48a00; }
.goi-y-hom-nay ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.goi-y-hom-nay li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--vien); border-radius: 10px; }
.gy-bieu-tuong { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--xanh-nhat); color: var(--xanh-dam); }
.gy-gap .gy-bieu-tuong { background: var(--do-nhat); color: var(--do); }
.gy-nen .gy-bieu-tuong { background: #fff0c4; color: #8a5a00; }
.goi-y-hom-nay li.gy-gap { border-color: #f3c3bd; background: #fffaf9; }
.goi-y-hom-nay li.gy-nen { border-color: #f0d38a; background: #fffdf5; }
.goi-y-hom-nay li.gy-tin { border-color: var(--vien-dam); }
.gy-than { min-width: 0; }
.gy-than strong { display: block; font-size: var(--co-bang); }
.gy-than p { margin: 2px 0 0; font-size: var(--co-phu); color: var(--mo); }
.gy-muc { font-size: var(--co-rat-nho); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mo-nhat); }
.gy-gap .gy-muc { color: var(--do); }
.gy-nen .gy-muc { color: #8a5a00; }
.goi-y-hom-nay li .nut .icon { width: 14px; height: 14px; }
@media (max-width: 560px) { .goi-y-hom-nay li { grid-template-columns: auto minmax(0, 1fr); } .goi-y-hom-nay li .nut { grid-column: 2; justify-self: start; } }
.kpi-du-bao { background: linear-gradient(160deg, #fffaeb 0%, #fff 70%); border-color: #efe0b0; }
.kpi-du-bao .kpi-nhan .icon { color: #c48a00; }

.du-bao-dau { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.du-bao-dau > div:first-child { flex: 1 1 320px; }
.du-bao-dau h2 .icon { color: #c48a00; }
.du-bao-dau p { margin: 4px 0 0; }
.du-bao-tong { display: flex; gap: 18px; flex-wrap: wrap; }
.du-bao-tong span { display: grid; font-size: var(--co-phu); color: var(--mo); }
.du-bao-tong strong { font-size: var(--co-tieu-de); color: var(--chu); font-variant-numeric: tabular-nums; }
.du-bao-thong-so { flex-basis: 100%; gap: 12px; margin: 0; padding-top: 10px; border-top: 1px dashed var(--vien); }
.du-bao-thong-so label { display: flex; align-items: center; gap: 6px; }
.du-bao-thong-so input { width: 70px; margin: 0; min-height: 34px; }
.muc-ton-het { background: var(--do-nhat); color: var(--do); }
.muc-ton-gap { background: #fde3d6; color: #9a3b12; }
.muc-ton-som { background: #fff1c7; color: #8a5a00; }
.muc-ton-on { background: #dcf3e2; color: #1d6b33; }
.muc-ton-cham { background: #eceeea; color: #5f6957; }
tr.db-het td, tr.db-gap td { background: #fff8f6; }
.so-nhap { color: var(--xanh-dam); font-size: var(--co-than); }
#ds-dat-xuong { font-family: var(--font-so); font-size: var(--co-nho); margin-bottom: 8px; }

.goi-y-hang { margin-bottom: 12px; padding: 10px 12px; background: #f6faf0; border: 1px solid #d3e3bf; border-radius: 10px; font-size: var(--co-nho); }
.goi-y-hang strong { display: flex; align-items: center; gap: 6px; }
.goi-y-hang strong .icon { width: 16px; height: 16px; color: #c48a00; }
.goi-y-hang ul { margin: 6px 0 0; padding-left: 18px; }
.goi-y-hang li.tot { font-weight: 600; color: var(--xanh-dam); }

.cs-thong-ke { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: var(--co-bang); color: var(--mo); }
.cs-thong-ke strong { color: var(--chu); font-size: var(--co-muc); }
.cs-thong-ke .nut { margin-left: auto; }
.ds-cs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ds-cs > li { margin: 0; }
.cs-dau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-ten { flex: 1 1 200px; display: grid; line-height: 1.3; min-width: 0; }
.cs-tin textarea { margin: 0 0 8px; font-size: var(--co-bang); background: #fbfcf9; }
.cs-tin .hang { margin: 0; }
.mau-cs { padding: 10px 12px; background: #f7f9f4; border-radius: 8px; font-size: var(--co-nho); }

/* Nút mở form nhập kho (summary dạng nút chính): chữ trắng rõ trên nền xanh */
details > summary.nut-chinh, details > summary.nut-chinh span, details > summary.nut-chinh .icon { color: #fff; }
details > summary.nut-chinh { justify-content: center; }
details > summary.nut-chinh::after { content: none !important; }

/* Điện thoại: gợi ý hôm nay gọn — bỏ ô biểu tượng, nút nằm cùng dòng mô tả */
@media (max-width: 560px) {
  .goi-y-hom-nay { padding: 12px; }
  .goi-y-hom-nay .hop-tieu-de .nho { display: none; }
  .goi-y-hom-nay li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; }
  .goi-y-hom-nay .gy-bieu-tuong { display: none; }
  .goi-y-hom-nay li .nut { grid-column: auto; align-self: center; }
  .goi-y-hom-nay li .nut .icon { display: none; }
  .gy-than strong { font-size: var(--co-nho); }
  .gy-than p { font-size: var(--co-phu); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ═══════════════════ Đổi trả & sổ quỹ ═══════════════════ */
.buoc-tra { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-bottom: 18px; }
.buoc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 14px 16px; background: #fff; border: 1px solid var(--vien); border-radius: var(--bo); }
.buoc > span { grid-row: span 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef0ea; color: var(--mo); }
.buoc.xong > span { background: #dcf3e2; color: #1d6b33; }
.buoc.dang { border-color: #f0d38a; background: #fffcf2; }
.buoc.dang > span { background: #fff0c4; color: #8a5a00; }
.buoc em { font-style: normal; font-size: var(--co-phu); color: var(--mo); }
.buoc form, .buoc > a { margin-top: 6px; justify-self: start; }
.tong-tra { margin: 12px 0; font-size: var(--co-than); }
.tong-tra strong { font-size: var(--co-lon); color: var(--xanh-dam); }
.o-tim-don { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.o-tim-don input { width: 130px; min-height: 32px; margin: 0; }
.phieu-tra-don { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chu-thu { color: #1d6b33; }
.chu-chi { color: var(--do); }
.the-tu-dong { background: #eef3fb; color: #24497a; margin-left: 4px; }
.chon-the-ngang { grid-template-columns: 1fr 1fr; }
.chon-the-ngang .the-chon { grid-template-columns: auto 1fr; }
.chon-the-ngang .the-chon input { grid-row: auto; }
.o-ky { margin: 0 0 0 auto; gap: 6px; }
.o-ky input { min-height: 34px; margin: 0; }

/* Giá vốn & lãi */
.bien-thap { background: var(--do-nhat); color: var(--do); }
.bien-vua { background: #fff1c7; color: #8a5a00; }
.bien-tot { background: #dcf3e2; color: #1d6b33; }
input.o-thieu { border-color: #f0c36b; background: #fffbef; }
.lai-don { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 9px 14px; background: #f6faf0; border: 1px dashed #c6d9ae; border-radius: 10px; font-size: var(--co-bang); }
.lai-don .icon { width: 16px; height: 16px; color: var(--xanh-dam); }
.nhap-quy { display: grid; gap: 6px; align-content: start; }
.nhap-quy select { margin: 0; }

/* ── Cài đặt hiển thị riêng từng người (lớp trên <html>) ── */
html.co-chu-nho { font-size: 14px; }
html.co-chu-lon { font-size: 17.5px; }
html.mat-do-gon th, html.mat-do-gon td { padding-top: 6px; padding-bottom: 6px; }
.ht-nhom { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; padding: 12px 0; border-top: 1px solid var(--vien); }
.ht-nhom:first-of-type { border-top: 0; }
.ht-nhan { font-weight: 600; color: var(--chu); padding-top: 8px; }
.ht-chon { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.ht-chon .the-chon { min-width: 190px; }
.o-tick { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--vien); border-radius: var(--bo-nho); background: #fff; cursor: pointer; font-weight: 500; }
.o-tick:has(input:checked) { border-color: var(--xanh-tra); background: var(--xanh-hover); }
.o-tick input { margin: 0; width: auto; min-height: 0; }
.ht-phu { margin-top: 12px; }
@media (max-width: 640px) { .ht-nhom { grid-template-columns: 1fr; } .ht-nhan { padding-top: 0; } .ht-chon .the-chon { min-width: 0; flex: 1 1 100%; } }

/* Nút "Tuỳ chỉnh hiển thị" trên danh sách đơn */
.tuy-chinh-ds { position: relative; margin-left: auto; }
.tuy-chinh-ds > summary { list-style: none; cursor: pointer; }
.tuy-chinh-ds > summary::-webkit-details-marker { display: none; }
.tcd-hop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(440px, calc(100vw - 2 * var(--le))); background: var(--giay); border: 1px solid var(--vien-dam); border-radius: var(--bo); box-shadow: var(--bong-3); padding: 14px 16px; display: grid; gap: 12px; }
.tcd-hop fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tcd-hop legend { font-weight: 600; font-size: var(--co-phu); margin-bottom: 6px; color: var(--mo); text-transform: uppercase; letter-spacing: .03em; }
.tcd-hop .o-tick { font-size: var(--co-nho); padding: 5px 9px; }
.tcd-hop fieldset > .nho { flex-basis: 100%; margin: 2px 0 0; }
.tcd-chan { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }

/* Danh sách đơn: dòng đang xem, cột ghi chú */
.bang-don tr.dang-xem > td { background: var(--vang-nhat); }
.bang-don tr.dang-xem > td:first-child { box-shadow: inset 3px 0 0 var(--vang-nang); }
.cot-ghi-chu { min-width: 170px; max-width: 240px; font-size: var(--co-nho); }
.gcd { display: flex; gap: 5px; align-items: flex-start; line-height: 1.35; margin-bottom: 4px; }
.gcd svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.gcd-giao { color: var(--xanh-rat-dam); }
.gcd-noi-bo { color: #7a5a00; }
.co-ghi-chu { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-size: var(--co-phu); color: var(--mo); }
.co-ghi-chu svg { width: 12px; height: 12px; }
.nut.nut-nguy-nhat { color: #fff; background: var(--do); border-color: var(--do); }
.nut.nut-nguy-nhat:hover { background: #8f1c13; border-color: #8f1c13; }
.form-xoa-don { display: inline; }

/* ── Khung chi tiết nhanh (bấm mã đơn) ── */
.khung-nhanh { position: fixed; inset: 0; z-index: 80; }
.khung-nhanh[hidden] { display: none; }
.kn-nen { position: absolute; inset: 0; background: rgba(23, 33, 14, .32); animation: kn-hien .15s ease-out; }
.kn-hop { position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: var(--nen); box-shadow: var(--bong-3); display: flex; flex-direction: column; outline: none; animation: kn-truot .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes kn-truot { from { transform: translateX(32px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes kn-hien { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kn-hop, .kn-nen { animation: none; } }
body.kn-dang-mo { overflow: hidden; }
.kn-thanh { display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: var(--giay); border-bottom: 1px solid var(--vien); }
.nut-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--bo-nho); background: none; color: var(--mo); cursor: pointer; }
.nut-icon:hover { background: var(--xanh-hover); border-color: var(--vien); color: var(--chu); }
.nut-icon:focus-visible { box-shadow: var(--vong); outline: none; }
.nut-icon svg { width: 18px; height: 18px; }
.kn-vi-tri { margin-left: 4px; }
.kn-dong { margin-left: auto; }
.kn-noi-dung { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 40px; display: grid; gap: 12px; align-content: start; transition: opacity .12s; }
.kn-noi-dung.dang-tai { opacity: .45; pointer-events: none; }
.kn-noi-dung > .bao, .kn-noi-dung > .hop-canh-bao { margin: 0; }
.kn-trong { padding: 40px 10px; text-align: center; color: var(--mo); }
.kn-dau { display: grid; gap: 6px; }
.kn-tieu-de { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kn-tieu-de h2 { margin: 0; font-size: var(--co-lon); letter-spacing: -.01em; }
.kn-phu { margin: 0; color: var(--mo); font-size: var(--co-nho); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kn-nut { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.kn-form-gon { display: inline; }
.kn-khoi { background: var(--giay); border: 1px solid var(--vien); border-radius: var(--bo); padding: 12px 14px; }
.kn-khoi h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: var(--co-phu); text-transform: uppercase; letter-spacing: .04em; color: var(--mo); }
.kn-khoi h3 svg { width: 15px; height: 15px; }
.kn-khoi p { margin: 4px 0; }
.kn-khach { display: grid; gap: 5px; }
.kn-ten { font-size: var(--co-than); font-weight: 600; margin-right: 6px; }
.kn-sdt, .kn-dia-chi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kn-so-lieu { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--co-nho); color: var(--mo); padding-top: 6px; border-top: 1px dashed var(--vien); margin-top: 4px; }
.kn-so-lieu strong { color: var(--chu); }
.kn-ghi-khach { font-size: var(--co-nho); background: var(--xanh-hover); border-radius: var(--bo-nho); padding: 6px 9px; }
.kn-bang { font-size: var(--co-nho); }
.kn-bang td { padding: 5px 0; border-bottom: 1px solid #eef1ea; }
.kn-bang td + td { padding-left: 10px; white-space: nowrap; }
.kn-bang tfoot td { border-bottom: 0; padding: 3px 0; color: var(--mo); }
.kn-bang tfoot td + td { padding-left: 10px; }
.kn-bang tfoot .kn-tong td { color: var(--chu); font-weight: 700; font-size: var(--co-than); padding-top: 7px; border-top: 1px solid var(--vien-dam); }
.kn-rui-ro { display: flex; gap: 8px; align-items: center; font-size: var(--co-nho); padding: 8px 12px; border-radius: var(--bo-nho); background: var(--vang-nhat); border: 1px solid #f3dc9b; }
.kn-lich-su { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: var(--co-nho); }
.kn-lich-su .nho { display: block; font-size: var(--co-phu); }
.kn-nguy { border-color: #f1d0cc; background: #fffafa; display: grid; gap: 8px; }
.kn-huy { display: flex; gap: 6px; flex-wrap: wrap; }
.kn-huy input { flex: 1; min-width: 160px; }
.kn-nguy .nho { margin: 0; }
@media (max-width: 860px) {
  .kn-hop { width: 100%; }
  .kn-noi-dung { padding: 12px 12px calc(40px + env(safe-area-inset-bottom)); }
}

/* ── Ba loại ghi chú đơn ── */
.khoi-ghi-chu { display: grid; gap: 10px; }
.trang-don-gc .khoi-ghi-chu { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 14px 0; }
.gc { background: var(--giay); border: 1px solid var(--vien); border-radius: var(--bo); padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
.gc-giao { border-color: #c6d9ae; }
.gc-noi-bo { border-color: #f0d38a; background: #fffdf6; }
.gc-cskh { border-color: #c9ddf2; }
.gc-dau { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.gc-ten { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.gc-ten svg { width: 16px; height: 16px; }
.gc-pham-vi { font-size: var(--co-phu); color: var(--mo); }
.gc-form { display: grid; gap: 6px; }
.gc-form textarea { width: 100%; resize: vertical; min-height: 58px; }
.gc-chan { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.gc-chip { display: flex; flex-wrap: wrap; gap: 4px; }
.gc-chip .chip { min-height: 26px; padding: 2px 9px; font-size: var(--co-phu); }
.gc-phu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gc-phu select { width: auto; }
.gc-hen { display: inline-flex; align-items: center; gap: 5px; font-size: var(--co-phu); color: var(--mo); margin: 0; }
.gc-hen input { width: auto; }
.gc-noi-dung { margin: 0; }
.gc-ds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.gc-ds li { font-size: var(--co-nho); padding: 6px 9px; background: #f4f8fd; border-radius: var(--bo-nho); }
.gc-meta { display: block; font-size: var(--co-phu); color: var(--mo); margin-bottom: 1px; }

.thanh-hang-loat[hidden] { display: none; }
.thanh-hang-loat > .hang { margin: 0; }
.gc-chan > .nut { margin-left: auto; }
.nut-icon:disabled { opacity: .35; cursor: default; background: none; border-color: transparent; }

/* ── Tiến trình & thao tác trạng thái đơn ── */
.khoi-thao-tac { background: var(--giay); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px 16px; display: grid; gap: 12px; margin-bottom: 14px; }
.kn-noi-dung .khoi-thao-tac { margin: 0; padding: 12px 14px; }
.tien-trinh { list-style: none; margin: 0; padding: 0; display: flex; counter-reset: b; }
.tien-trinh li { flex: 1 1 0; position: relative; display: grid; justify-items: center; text-align: center; gap: 2px; min-width: 0; padding-top: 2px; }
.tien-trinh li::before { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 3px; background: var(--vien); z-index: 0; }
.tien-trinh li:first-child::before { display: none; }
.tien-trinh li.xong::before, .tien-trinh li.dang::before { background: var(--xanh-tra); }
.tien-trinh li.xau::before { background: linear-gradient(90deg, var(--xanh-tra), var(--do)); }
.tt-cham { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--vien-dam); box-sizing: border-box; }
.tien-trinh li.xong .tt-cham { background: var(--xanh-tra); border-color: var(--xanh-tra); }
.tien-trinh li.dang .tt-cham { border-color: var(--xanh-tra); box-shadow: 0 0 0 4px rgba(88, 131, 42, .18); }
.tien-trinh li.xau .tt-cham { border-color: var(--do); background: var(--do); box-shadow: 0 0 0 4px rgba(180, 35, 24, .15); }
.tt-ten { font-size: var(--co-phu); font-weight: 600; color: var(--mo); }
.tien-trinh li.xong .tt-ten, .tien-trinh li.dang .tt-ten { color: var(--chu); }
.tien-trinh li.xau .tt-ten { color: var(--do); }
.tt-gio { font-size: var(--co-rat-nho); color: var(--mo-nhat); font-variant-numeric: tabular-nums; }
.tt-phu { font-size: var(--co-rat-nho); color: var(--do); font-weight: 600; }
.ktt-buoc { display: grid; gap: 8px; }
.ktt-buoc form { margin: 0; }
.ktt-mot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ktt-mot .nho { flex: 1 1 220px; }
.ktt-gui { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: end; padding: 10px 12px; background: var(--xanh-hover); border-radius: var(--bo-nho); }
.ktt-gui label { margin: 0; font-size: var(--co-phu); }
.ktt-tieu-de, .ktt-gui .nut, .ktt-goi-y { grid-column: 1 / -1; }
.ktt-tieu-de { display: inline-flex; align-items: center; gap: 6px; }
.ktt-tieu-de svg, .ktt-goi-y svg { width: 16px; height: 16px; }
.ktt-goi-y { display: inline-flex; align-items: center; gap: 5px; }
.ktt-hoan { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--vien); }
.ktt-hoan input[name=ly_do] { flex: 1 1 180px; min-width: 0; }
.ktt-xong { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--xanh-dam); font-weight: 600; }
.ktt-xong svg { width: 16px; height: 16px; }
.ktt-xong.nho { color: var(--mo); font-weight: 400; }
.ktt-huy, .ktt-khac { border-top: 1px solid var(--vien); padding-top: 8px; }
.ktt-huy > summary, .ktt-khac > summary { cursor: pointer; font-size: var(--co-nho); font-weight: 600; color: var(--mo); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.ktt-huy > summary { color: var(--do); }
.ktt-huy > summary::before, .ktt-khac > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1.1em; }
.ktt-huy[open] > summary::before, .ktt-khac[open] > summary::before { transform: rotate(90deg); }
.ktt-huy > summary::-webkit-details-marker, .ktt-khac > summary::-webkit-details-marker { display: none; }
.ktt-huy-form { display: grid; gap: 8px; margin-top: 8px; padding: 10px 12px; background: #fffafa; border: 1px solid #f1d0cc; border-radius: var(--bo-nho); }
.ktt-huy-form > .nut { justify-self: start; }
.ktt-tien { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ktt-tien legend { font-size: var(--co-nho); margin-bottom: 4px; }
.ktt-tien .nho { flex-basis: 100%; }
.ktt-lui, .ktt-sua-nhan { display: grid; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--vien); }
.ktt-lui:first-of-type { border-top: 0; padding-top: 0; }
.ktt-lui-hang { display: flex; gap: 6px; flex-wrap: wrap; }
.ktt-lui-hang input { flex: 1 1 200px; min-width: 0; }
.ktt-sua-luoi { display: grid; grid-template-columns: 1fr 140px; gap: 6px; }
.ktt-sua-luoi .ktt-dc { grid-column: 1 / -1; }
.ktt-sua-luoi .nut { grid-column: 1 / -1; justify-self: start; }
.the-loc a.the-hoan-cho { border-style: dashed; color: var(--do); }
@media (max-width: 640px) {
  .ktt-gui { grid-template-columns: 1fr; }
  .tt-gio { font-size: var(--co-rat-nho); }
  .ktt-sua-luoi { grid-template-columns: 1fr; }
}
.ktt-huy-form > label { justify-self: start; }
.ktt-gui .nut { justify-self: start; grid-column: 1 / -1; }

/* ── Chi tiết đơn mở ngay dưới dòng ── */
.bang-don tbody tr[data-id] { cursor: pointer; }
.bang-don tbody tr[data-id]:hover > td { background: var(--xanh-hover); }
.bang-don tbody tr.dang-xem > td { background: var(--vang-nhat); border-bottom-color: transparent; }
.bang-don tr.dong-chi-tiet > td { padding: 0 12px 14px; background: var(--vang-nhat); border-bottom: 2px solid var(--vang-nang); cursor: default; }
.bang-don tr.dong-chi-tiet > td:first-child { box-shadow: inset 3px 0 0 var(--vang-nang); }
.kn-duoi-dong { overflow: visible; padding: 0; animation: kn-hien .18s ease-out; }
.kn-duoi-dong .kn-trong { padding: 18px; }
.kn-thu-gon { margin-top: 10px; }
.kn-luoi { display: grid; gap: 12px; }
.kn-cot { display: grid; gap: 12px; align-content: start; min-width: 0; }
.kn-duoi-dong .kn-luoi { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.kn-duoi-dong .kn-dau { background: var(--giay); border: 1px solid var(--vien); border-radius: var(--bo); padding: 12px 14px; }
.kn-duoi-dong .khoi-ghi-chu .gc-chip .chip { font-size: var(--co-rat-nho); }
@media (max-width: 1280px) { .kn-duoi-dong .kn-luoi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kn-duoi-dong .kn-cot:last-child { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 860px) { .kn-duoi-dong .kn-luoi { grid-template-columns: minmax(0, 1fr); } .kn-duoi-dong .kn-cot:last-child { grid-template-columns: minmax(0, 1fr); } .bang-don tr.dong-chi-tiet > td { padding: 0 6px 12px; } }
.kn-dong-boc { position: sticky; left: 12px; max-width: 100%; }
@media (max-width: 860px) { .kn-dong-boc { left: 6px; } }
.gc-mac-dinh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 0; }

/* ── Địa chỉ lên đơn: tỉnh → xã / phường mới ── */
.khoi-dia-chi { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--vien); border-radius: var(--bo); background: var(--xanh-hover); }
.dc-tieu-de { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dc-tim-hang { display: flex; gap: 8px; }
.dc-tim-hang input { flex: 1; min-width: 0; margin: 0; }
.dc-tim-hang .nut { white-space: nowrap; }
.dc-bao:empty { display: none; }
.dc-bao.dc-ok { color: var(--xanh-dam); font-weight: 600; }
.dc-bao.dc-canh-bao { color: #8a5a00; }
.dc-goi-y { display: grid; gap: 4px; max-height: 280px; overflow-y: auto; padding: 6px; background: var(--giay); border: 1px solid var(--vien-dam); border-radius: var(--bo-nho); box-shadow: var(--bong-2); }
.dc-gy-tieu-de { margin: 2px 4px 4px; font-size: var(--co-nho); font-weight: 600; color: #8a5a00; }
.dc-gy { display: grid; gap: 1px; text-align: left; padding: 7px 10px; border: 0; border-radius: var(--bo-nho); background: none; font: inherit; cursor: pointer; color: var(--chu); }
.dc-gy:hover, .dc-gy:focus-visible { background: var(--xanh-nhat); outline: none; }
.dc-gy strong { font-size: var(--co-bang); }
.dc-gy-cu { font-size: var(--co-phu); color: var(--mo); }
.dc-luoi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
.dc-luoi label { margin: 0; }
.dc-luoi .dc-so { grid-column: 1 / -1; }
.dc-xem { display: grid; gap: 4px; }
.dc-xem:empty { display: none; }
.dc-dong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: var(--co-nho); padding: 6px 10px; border-radius: var(--bo-nho); background: var(--giay); border: 1px solid var(--vien); }
.dc-nhan { font-size: var(--co-rat-nho); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--mo); min-width: 150px; }
.dc-moi strong { color: var(--xanh-rat-dam); }
.dc-cu { border-style: dashed; }
.dc-gom { color: var(--mo); font-size: var(--co-phu); }
.dc-bo { margin-left: auto; min-height: 0; padding: 1px 10px; }
.dc-tay > summary { cursor: pointer; font-size: var(--co-nho); color: var(--mo); }
.dc-tay[open] { display: grid; gap: 6px; }
@media (max-width: 640px) { .dc-luoi { grid-template-columns: 1fr; } .dc-tim-hang { flex-wrap: wrap; } .dc-tim-hang .nut { flex: 1; } .dc-nhan { min-width: 0; flex-basis: 100%; } }
.dc-cu-dong { display: block; font-size: var(--co-phu); color: var(--mo); margin-top: 3px; font-weight: 400; }
.phieu-dia-chi-cu { font-size: .85em; margin-top: 2px; }
.dc-goi-y[hidden] { display: none; }
@media (max-width: 640px) { .dc-tim-hang input { flex-basis: 100%; } }

/* Cột ghi chú tách riêng, hiện đủ nội dung */
.cot-ghi-chu { min-width: 180px; max-width: 280px; font-size: var(--co-nho); line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.gcd-chu { white-space: pre-line; }
.cot-ghi-chu.gcd-giao .gcd-chu { color: var(--xanh-rat-dam); }
.cot-ghi-chu.gcd-noi-bo .gcd-chu { color: #7a5a00; }
.gcd-cs-muc + .gcd-cs-muc { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--vien); }
.ly-do-dong { margin-top: 4px; font-size: var(--co-phu); color: var(--mo); max-width: 200px; }

/* Thanh cuộn ngang nổi dính đáy màn hình (thay thanh cuộn gốc ở cuối bảng) */
.bang-cuon.co-cuon-noi { margin-bottom: 0; scrollbar-width: none; }
.bang-cuon.co-cuon-noi::-webkit-scrollbar { display: none; }
.cuon-noi { position: sticky; bottom: 0; z-index: 6; overflow-x: auto; overflow-y: hidden; margin-bottom: 16px;
  background: rgba(255,255,255,.96); border: 1px solid var(--vien); border-top-color: var(--vien-dam); border-radius: 0 0 10px 10px;
  box-shadow: 0 -2px 8px rgba(34,40,28,.08); }
.cuon-noi[hidden] { display: none; }
.cuon-noi-ruot { height: 1px; }
@media print { .cuon-noi { display: none !important; } }
.cuon-noi { scrollbar-width: auto; scrollbar-color: #9aa58e rgba(0,0,0,.04); }
.cuon-noi::-webkit-scrollbar { height: 14px; }
.cuon-noi::-webkit-scrollbar-track { background: rgba(0,0,0,.04); }
.cuon-noi::-webkit-scrollbar-thumb { background: #9aa58e; border-radius: 7px; border: 3px solid rgba(255,255,255,.96); }
.cuon-noi::-webkit-scrollbar-thumb:hover { background: #6f7c62; }

/* Ghi chú gọn trong bảng đơn */
.bang-don .gcd-chu { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.bang-don .gcd-chu.mo { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.gcd-them { border: 0; background: none; padding: 0; margin-top: 2px; font: inherit; font-size: var(--co-phu); font-weight: 600; color: var(--xanh-dam); cursor: pointer; }
.gcd-them:hover { text-decoration: underline; }
.gcd-md { margin-bottom: 4px; font-size: var(--co-phu); line-height: 1.45; color: var(--mo); cursor: help; }
.the-gcd-md { display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: 999px; background: var(--xanh-nhat); color: var(--xanh-rat-dam);
  font-size: var(--co-rat-nho); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.6; vertical-align: 1px; }
.gcd-y { color: var(--mo); }

/* ── Ô Theo dõi đơn (nhóm đơn cần để mắt, không phải trạng thái) ── */
.the-theo-doi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; }
.ttd-nhan { font-size: var(--co-phu); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mo); margin-right: 4px; }
.the-theo-doi a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 6px 3px 12px; border-radius: 999px; border: 1px solid var(--vien); background: #fff; color: var(--chu); text-decoration: none; font-size: var(--co-phu); font-weight: 500; transition: background .12s, border-color .12s; }
.the-theo-doi a b { min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; font-size: var(--co-phu); font-weight: 700; background: var(--xanh-nhat); color: var(--xanh-rat-dam); }
.the-theo-doi a:hover { border-color: var(--vien-dam); background: #fafbf7; }
.the-theo-doi a.ttd-gap b { background: #fde4e1; color: #a2271b; }
.the-theo-doi a.ttd-viec b { background: #fff1c9; color: #7a5300; }
.the-theo-doi a.ttd-tien b { background: #e0ecfb; color: #1d4f8f; }
.the-theo-doi a.ttd-gap:not(.ttd-rong) { border-color: #f1b8b1; }
.the-theo-doi a.ttd-rong { color: var(--mo); }
.the-theo-doi a.ttd-rong b { background: #f1f2ee; color: var(--mo); }
.the-theo-doi a.dang-o { background: var(--xanh-dam); border-color: var(--xanh-dam); color: #fff; font-weight: 600; }
.the-theo-doi a.dang-o b { background: rgba(255,255,255,.22); color: #fff; }
@media (max-width: 560px) { .the-theo-doi { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .the-theo-doi a { flex: 0 0 auto; } }
@media print { .the-theo-doi { display: none; } }

/* ── Giao chậm / delay ── */
.ktt-giao-cham { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--vien); }
.ktt-giao-cham .kgc-form { display: flex; flex: 1 1 320px; gap: 6px; align-items: center; min-width: 0; }
.ktt-giao-cham .kgc-form input[name=ly_do] { flex: 1 1 180px; min-width: 0; }
.kgc-tinh-trang { flex: 1 1 100%; margin: 0; display: flex; gap: 6px; align-items: center; font-size: var(--co-nho); color: #8a4a00; }
.kgc-tinh-trang svg { width: 16px; height: 16px; flex: none; }
.ktt-giao-cham.dang-cham { background: #fff6e6; border: 1px solid #f3d28f; border-radius: var(--bo-nho, 8px); padding: 8px 10px; }
.ktt-giao-cham.dang-cham .kgc-tinh-trang { color: #7a3d00; }
.the-giao-cham { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #fde4e1; color: #a2271b; font-size: var(--co-phu); font-weight: 600; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ══ Trang Đơn hàng: bộ lọc gọn, cột ghim, tiêu đề nổi, bước kế tiếp, thẻ điện thoại (16/11/2026) ══ */
.thanh-loc-gon { display: block; padding: 8px 10px; }
.thanh-loc-gon .bl-hang + .bl-hang { margin-top: 8px; }
.thanh-loc-gon .bl-hang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.thanh-loc-gon .bl-hang[hidden] { display: none; }
.thanh-loc-gon input, .thanh-loc-gon select { flex: 0 1 150px; max-width: 200px; min-height: 36px; }
.thanh-loc-gon input[type=search] { flex: 1 1 240px; max-width: 360px; }
.thanh-loc-gon .bl-them { padding-top: 8px; border-top: 1px dashed var(--vien); }
.thanh-loc-gon .o-ngay { display: inline-flex; align-items: center; gap: 6px; font-size: var(--co-nho); color: var(--mo); white-space: nowrap; }
.thanh-loc-gon .o-ngay input { flex: none; width: auto; }
.bl-nut-them { display: inline-flex; align-items: center; gap: 6px; }
.bl-nut-them b { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--xanh-dam); color: #fff; font-size: var(--co-rat-nho); line-height: 1.6; text-align: center; }
.bl-nut-them[aria-expanded=true] { background: var(--xanh-nhat); }
.js .bl-nut-loc { display: none; }
.thanh-thong-ke-don { gap: 6px 20px; padding: 8px 14px; }
.thanh-thong-ke-don .day-phai { gap: 6px; }

/* Tiêu đề cột bấm để sắp xếp */
.th-sx { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.th-sx:hover { color: var(--xanh-rat-dam); }
.th-sx .th-mui { font-size: var(--co-rat-nho); opacity: .45; }
.th-sx.dang { color: var(--xanh-rat-dam); }
.th-sx.dang .th-mui { opacity: 1; }

/* Dấu khách quen / từng hoàn cạnh tên */
.the-kq { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--xanh-nhat); color: var(--xanh-rat-dam); font-size: var(--co-rat-nho); font-weight: 600; line-height: 1.7; white-space: nowrap; vertical-align: 1px; }
.the-kq-xau { background: #fde4e1; color: #a2271b; }

/* Thao tác trên dòng: nút bước kế tiếp nằm trên, các nút phụ nằm dưới */
.bang-don td.c-thao { white-space: nowrap; }
.nut-buoc { display: flex; width: 100%; justify-content: center; margin-bottom: 5px; }
.bang-don .nhom-thao-tac-dong { display: flex; justify-content: flex-end; }

/* Ghi chăm sóc ngay trên dòng */
.gcd-ghi-cs { display: inline-block; margin-top: 3px; padding: 1px 8px; border: 1px dashed var(--vien-dam); border-radius: 999px; background: none; color: var(--mo); font-size: var(--co-phu); cursor: pointer; }
.gcd-ghi-cs:hover { border-style: solid; color: var(--xanh-rat-dam); background: var(--xanh-nhat); }
.gcd-o-cs { display: grid; gap: 5px; margin-top: 4px; min-width: 200px; }
.gcd-o-cs textarea { width: 100%; min-height: 58px; margin: 0; padding: 6px 8px; font-size: var(--co-nho); resize: vertical; }
.gcd-o-cs div { display: flex; gap: 5px; }

/* Thanh thao tác hàng loạt: chia nhóm */
.thanh-hang-loat { gap: 8px 14px; }
.thl-nhom { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.22); }
.thanh-hang-loat .thl-tat-ca { background: var(--vang-nang); border-color: var(--vang-nang); color: #2b2400; font-weight: 600; }
.thanh-hang-loat .thl-tat-ca:hover { background: #ffd95e; }
.thanh-hang-loat input[name=nhan_them] { width: 110px; }
.thanh-hang-loat input[name=ly_do] { width: 190px; }

/* Tiêu đề bảng nổi khi lăn xuống */
.dau-noi { position: sticky; top: 0; z-index: 8; height: 0; }
.dau-noi[hidden] { display: none; }
.dau-noi-cuon { overflow: hidden; border: 1px solid var(--vien); border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 0 6px 14px rgba(34,40,28,.12); background: #f6f8f2; }
.dau-noi table { width: auto; table-layout: fixed; margin: 0; }
.dau-noi th { box-sizing: border-box; border-bottom: 0; }

@media (min-width: 761px) {
  /* Ghim cột: ô chọn + mã đơn bên trái, thao tác bên phải */
  .bang-don .c-ghim { position: sticky; z-index: 2; background: #fff; }
  .bang-don th.c-ghim { background: #f6f8f2; z-index: 3; }
  .bang-don .c-chon { left: 0; width: 44px; min-width: 44px; max-width: 44px; padding-right: 0; }
  .bang-don .c-ma { left: 44px; box-shadow: 6px 0 8px -6px rgba(34,40,28,.18); }
  .bang-don .c-thao { right: 0; box-shadow: -6px 0 8px -6px rgba(34,40,28,.18); }
}

@media (max-width: 760px) {
  /* Điện thoại: mỗi đơn một thẻ, không kéo ngang */
  .bang-cuon:has(> table.bang-the) { overflow: visible; background: none; border: 0; box-shadow: none; }
  table.bang-the, table.bang-the tbody { display: block; width: 100%; }
  table.bang-the thead { display: none; }
  table.bang-the tbody tr[data-id] {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: start;
    background: #fff; border: 1px solid var(--vien); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: var(--bong-1);
  }
  table.bang-the tbody tr[data-id] > td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; grid-column: 1 / -1; }
  table.bang-the tbody tr[data-id] > td.c-chon { grid-column: 1; grid-row: 1; padding-top: 2px; }
  table.bang-the tbody tr[data-id] > td.c-ma { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
  table.bang-the tbody tr[data-id] > td.c-tien { grid-column: 3; grid-row: 1; text-align: right; }
  table.bang-the td.c-ngay { font-size: var(--co-phu); color: var(--mo); display: flex; gap: 8px; }
  table.bang-the td.c-ngay .ngay-chinh, table.bang-the td.c-ngay .nho-phu { display: inline; }
  table.bang-the td.c-khach .dia-chi-rut-gon { max-width: none; white-space: normal; }
  table.bang-the td.c-khach .link-sdt { font-size: var(--co-than); font-weight: 600; padding: 4px 0; display: inline-block; }
  table.bang-the td.c-hang { max-width: none; }
  table.bang-the td.c-tt { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
  table.bang-the td.c-tt > div { display: contents; }
  table.bang-the td.c-vc { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: var(--co-nho); }
  table.bang-the td.c-gc { font-size: var(--co-phu); padding-left: 10px; border-left: 3px solid var(--vien); }
  table.bang-the td.c-gc::before { content: attr(data-nhan); display: block; font-size: var(--co-rat-nho); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mo); }
  table.bang-the td.c-gc:has(> .nho:only-child) { display: none; }
  table.bang-the tbody tr[data-id] > td.c-thao { display: flex; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--vien); text-align: left; }
  table.bang-the td.c-thao .nut-buoc { flex: 1 1 auto; width: auto; margin: 0; min-height: 42px; }
  table.bang-the td.c-thao .nhom-thao-tac-dong { flex: none; gap: 6px; }
  table.bang-the td.c-thao .nut { min-height: 42px; }
  table.bang-the tbody tr.dang-xem { border-color: var(--vang-nang); margin-bottom: 0; border-radius: 12px 12px 0 0; }
  table.bang-the tr.dong-chi-tiet { display: block; margin-bottom: 10px; }
  table.bang-the tr.dong-chi-tiet > td { display: block; border: 1px solid var(--vang-nang); border-top: 0; border-radius: 0 0 12px 12px; }
  table.bang-the td.rong { display: block; }
  .thanh-loc-gon input, .thanh-loc-gon select { flex: 1 1 42%; max-width: none; }
  .thanh-loc-gon input[type=search] { flex-basis: 100%; max-width: none; }
  .thl-nhom { padding-left: 0; border-left: 0; }
  .thanh-hang-loat { top: 56px; }
}
.thanh-hang-loat [hidden] { display: none !important; }

@media (max-width: 760px) {
  /* Điện thoại: phần đầu trang Đơn hàng gọn lại để thẻ đơn hiện sớm */
  .the-loc:has(+ .the-theo-doi), .the-loc + .the-theo-doi { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .the-loc:has(+ .the-theo-doi) a { flex: none; }
  .the-loc:has(+ .the-theo-doi) { margin-bottom: 8px; }
  .thanh-loc-gon .bl-hang:first-of-type input[type=search] { order: 0; flex: 1 1 55%; }
  .thanh-loc-gon .bl-nut-them { order: 1; }
  .thanh-loc-gon .bl-hang:first-of-type select { order: 2; flex: 1 1 42%; }
  .thanh-loc-gon .bl-hang:first-of-type a.nut { order: 3; }
  .thanh-thong-ke-don { gap: 4px 14px; padding: 8px 10px; font-size: var(--co-nho); }
  .thanh-thong-ke-don .day-phai { margin-left: 0; }
  .thanh-thong-ke-don .so-tien-noi { font-size: var(--co-than); }
}

/* ══ Trang Đơn hàng: chi tiết nhỏ (nhóm 3) ══ */
.ttd-on { font-size: var(--co-phu); color: var(--mo); }
/* Dòng cần để mắt: nền nhạt + vạch đỏ đầu dòng */
.bang-don tbody tr.dong-gap > td { background: #fff7f5; }
.bang-don tbody tr.dong-gap > td:first-child { box-shadow: inset 3px 0 0 #d9534a; }
.bang-don tbody tr.dong-gap:hover > td { background: #ffefec; }
.bang-don tbody tr.dong-gap.dang-xem > td { background: var(--vang-nhat); }
/* Ô ngày kiểu ngày/tháng/năm, kèm nút mở lịch */
.o-ngay-vn { position: relative; display: inline-flex; align-items: center; }
.thanh-loc-gon .o-ngay-vn input[type=text] { width: 136px; flex: none; padding-right: 34px; }
.o-ngay-vn input.loi { border-color: var(--do); box-shadow: 0 0 0 2px rgba(200,60,50,.15); }
.o-ngay-vn .lich-an { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.nut-lich { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--mo); cursor: pointer; }
.nut-lich:hover { background: var(--xanh-nhat); color: var(--xanh-rat-dam); }
.nut-lich .icon { width: 16px; height: 16px; }
/* Báo có đơn mới */
.bao-don-moi { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid #f3d28f; border-radius: var(--bo-nho, 8px); background: #fff6e6; color: #7a3d00; font-size: var(--co-bang); }
.bao-don-moi[hidden] { display: none; }
.bao-don-moi strong { font-weight: 700; }
@media (max-width: 760px) {
  table.bang-the tbody tr.dong-gap { border-color: #efb2ab; background: #fff7f5; box-shadow: inset 3px 0 0 #d9534a, var(--bong-1); }
  table.bang-the tbody tr.dong-gap > td:first-child { box-shadow: none; }
}

/* ══ Trang Vận chuyển (16/11/2026) ══ */
.vc-the { margin-bottom: 12px; }
.vc-the .the-loc { margin-bottom: 8px; align-items: center; }
.vc-so { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #eef1ea; color: var(--chu); font-size: var(--co-phu); font-weight: 700; text-align: center; line-height: 1.6; }
.the-loc a.dang-o .vc-so { background: rgba(255,255,255,.22); color: #fff; }
.the-loc a.vc-gap .vc-so { background: #fde4e1; color: #a2271b; }
.vc-cc a { min-height: 30px; padding: 3px 12px; font-size: var(--co-phu); background: transparent; border-style: dashed; }
.vc-nhan { font-size: var(--co-rat-nho); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mo); margin-right: 2px; }
.vc-loc input[type=search] { flex: 2 1 240px; max-width: 380px; }
.vc-loc select { flex: 0 1 180px; }
.js .vc-loc .vc-nut-tim { display: none; }
.vc-tong .do { font-weight: 600; }
.nut-an { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thl-ly-do { width: 210px; max-width: 100%; margin: 0; min-height: 32px; padding: 4px 8px; font-size: var(--co-nho); color: var(--chu); }
.bang-vc td { vertical-align: top; }
.bang-vc .c-khach .link-sdt { display: block; width: fit-content; }
.bang-vc .c-hang { max-width: 260px; font-size: var(--co-nho); }
.bang-vc .c-ma .the-giao-cham, .bang-vc .c-ma .the { display: block; width: fit-content; margin-top: 4px; }
.bang-vc .c-ngay .the, .bang-vc .c-ngay .nho { display: block; width: fit-content; margin-top: 3px; }
.bang-vc .c-vc .nho { display: block; }
.bang-vc tbody tr.dong-gap > td { background: #fff7f5; }
.bang-vc tbody tr.dong-gap > td:first-child { box-shadow: inset 3px 0 0 #d9534a; }
.vd-nhap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 300px; }
.vd-nhap select, .vd-nhap input { margin: 0; min-height: 34px; padding: 4px 8px; font-size: var(--co-nho); }
.vd-nhap select { flex: 0 1 130px; width: auto; }
.vd-nhap .o-vd { flex: 1 1 150px; width: auto; min-width: 130px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.vd-nhap .o-phi { flex: 0 0 82px; width: 82px; }
.vd-nhap .o-vd::placeholder { text-transform: none; font-family: inherit; }
@media (min-width: 761px) {
  .vd-nhap { flex-wrap: nowrap; min-width: 400px; }
  .vd-nhap select { flex: 0 0 122px; }
  .vd-nhap .o-vd { flex: 1 1 140px; min-width: 120px; }
  .vd-nhap .o-phi { flex: 0 0 70px; width: 70px; }
}
.vc-nhan { white-space: nowrap; }
.bang-tk-hang tfoot th { text-transform: none; letter-spacing: 0; font-size: var(--co-bang); color: var(--chu); }
.vc-luu-het { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.vc-goi-y { margin-top: 10px; }
.bang-tk-hang tfoot th { background: #f6f8f2; font-weight: 700; border-top: 2px solid var(--vien-dam); }
@media (max-width: 760px) {
  .vc-the .the-loc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .vc-the .the-loc a { flex: none; }
  .vc-loc input[type=search] { flex: 1 1 100%; max-width: none; }
  .vc-loc select { flex: 1 1 40%; max-width: none; }
  table.bang-vc td.c-khach strong { display: block; }
  table.bang-vc td.c-hang { font-size: var(--co-nho); color: var(--mo); }
  table.bang-vc td.c-vc { display: block; }
  table.bang-vc td.c-vc > .nho { display: inline; margin-right: 6px; }
  table.bang-vc td.c-kl { text-align: left; font-size: var(--co-phu); color: var(--mo); }
  table.bang-vc .vd-nhap { min-width: 0; }
  table.bang-vc .vd-nhap .o-vd { flex-basis: 100%; min-height: 42px; font-size: var(--co-than); }
  table.bang-vc .vd-nhap select { flex: 1 1 auto; min-height: 40px; }
  table.bang-vc .vd-nhap .nut { min-height: 40px; }
  table.bang-vc td.c-ngay { flex-wrap: wrap; align-items: center; }
  table.bang-vc td.c-ngay .the, table.bang-vc td.c-ngay .nho { display: inline; margin: 0; }
  table.bang-vc tbody tr[data-id] > td.c-ma .the-giao-cham { max-width: 100%; }
  .thl-ly-do { width: 100%; }
}

/* ══ Trang Đổi trả (16/11/2026) ══ */
@media (max-width: 1100px) { .luoi-2-1 { grid-template-columns: minmax(0, 1fr); } }
.ds-tra { display: grid; gap: 8px; margin-bottom: 12px; }
.dong-tra { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--vien); border-radius: 10px; background: #fff; }
.dong-tra.mo { opacity: .55; }
.dong-tra .dt-ten { min-width: 0; }
.dong-tra .dt-sl { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin: 0; font-size: var(--co-phu); color: var(--mo); flex: none; }
.dong-tra .dt-sl input { width: 84px; margin: 0; text-align: center; min-height: 40px; font-size: var(--co-than); }
.form-tra #ghi-doi { background: var(--xanh-nhat); border-radius: 8px; padding: 8px 10px; }
.the-doi-tra { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #eef2fb; color: #2d4a8a; font-size: var(--co-phu); font-weight: 600; text-decoration: none; }
.the-doi-tra:hover { background: #dfe7f8; }
.th-tong .do strong { color: var(--do); }
.th-loc input[type=search] { flex: 2 1 260px; max-width: 400px; }
.bang-tra td { vertical-align: top; }
.bang-tra .c-ma .the, .bang-tra .c-ma .nho-phu { display: block; width: fit-content; margin-top: 3px; }
.bang-tra .c-hang { max-width: 280px; font-size: var(--co-nho); }
.bang-tra .c-hoan .the { display: block; width: fit-content; margin-bottom: 3px; }
.bang-tra tbody tr.th-xong > td { color: var(--mo); }
.bang-tra tbody tr.th-xong .ma-don-link { color: var(--mo); }
.sua-phieu { margin-top: 12px; border-top: 1px dashed var(--vien); padding-top: 10px; }
.sua-phieu summary { cursor: pointer; font-weight: 600; font-size: var(--co-bang); color: var(--xanh-dam); }
.sua-phieu form { margin-top: 10px; }
.nhat-ky-phieu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--co-bang); }
.nhat-ky-phieu li { padding-left: 12px; border-left: 2px solid var(--vien); }
@media (max-width: 760px) {
  .dong-tra { padding: 10px; }
  table.bang-tra td.c-khach .link-sdt { display: inline-block; }
  table.bang-tra td.c-ve, table.bang-tra td.c-hoan { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
  table.bang-tra td.c-hoan .the { display: inline-block; margin: 0; }
  table.bang-tra td.c-ma .the, table.bang-tra td.c-ma .nho-phu { display: inline-block; margin: 0 0 0 6px; }
  table.bang-tra td.c-tien .nho { display: block; }
  .th-tong { flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media print {
  .buoc-tra .buoc { break-inside: avoid; }
  .sua-phieu, .the-loc, .thanh-loc { display: none !important; }
}


tfoot th { text-transform: none; letter-spacing: 0; font-size: var(--co-bang); color: var(--chu); }

/* ── Mục Bán hàng (audit 17/11/2026) ── */
/* Tạo đơn: dòng đặt quá số còn bán được */
.dong-hang.vuot-ton { border-color: #e0a19a; background: #fdf3f1; }
.dong-hang .bao-ton { grid-column: 1 / -1; font-size: var(--co-phu); color: var(--do); font-weight: 600; }
/* Tạo đơn: thanh tổng + nút lưu dính đáy (chỉ điện thoại) */
.thanh-luu-di-dong { display: none; }
@media (max-width: 760px) {
  .thanh-luu-di-dong {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; bottom: var(--cao-thanh-duoi); z-index: 20; grid-column: 1 / -1;
    margin: 0 -12px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--vien); box-shadow: 0 -4px 12px rgba(0,0,0,.06);
  }
  .thanh-luu-di-dong strong { font-size: var(--co-muc); color: var(--chinh-dam); }
  .thanh-luu-di-dong .nut { min-height: 44px; padding: 0 22px; }
}
.nut-luu-don:disabled { opacity: .6; cursor: progress; }
/* Chi tiết đơn: mẫu tin nhắn thu gọn, bảng hàng gọn, mã vận đơn không gãy */
details.hop-mau-tin-nhan > summary { cursor: pointer; list-style: none; margin-bottom: 0; border-bottom: 0; padding-bottom: 0; gap: 10px; flex-wrap: wrap; }
details.hop-mau-tin-nhan > summary::-webkit-details-marker { display: none; }
details.hop-mau-tin-nhan > summary h2 { margin: 0; }
details.hop-mau-tin-nhan > summary h2::after { content: ' ▾'; color: var(--mo); font-size: .8em; }
details.hop-mau-tin-nhan[open] > summary { margin-bottom: 14px; border-bottom: 1px solid var(--vien); padding-bottom: 8px; }
details.hop-mau-tin-nhan[open] > summary h2::after { content: ' ▴'; }
.dong-van-don-chi-tiet { flex-wrap: wrap; }
.ma-van-don-to { white-space: nowrap; }
@media (max-width: 760px) {
  .bang-hang-gon th, .bang-hang-gon td, .bang-chi-tiet-hang.bang-hang-gon tfoot tr td { padding: 7px 6px; font-size: var(--co-nho); }
  .bang-hang-gon td:first-child { white-space: normal; }
  .bang-hang-gon td .nho { display: block; }
  .ma-van-don-to { font-size: var(--co-bang); }
}
.ls-cu > summary { cursor: pointer; margin: 4px 0 10px; color: var(--chinh-dam); }

/* ── Mục Khách hàng & CRM (audit 17/11/2026) ── */
.ds-phieu-tra-khach { margin: 0 0 18px; padding-left: 18px; }
.ds-phieu-tra-khach li { margin: 4px 0; }
.o-gop { max-width: 200px; }
.o-kenh-cs { width: auto; min-height: 32px; margin: 0; padding: 4px 8px; font-size: var(--co-nho); }
.cs-tin textarea { field-sizing: content; min-height: 4.5em; max-height: 14em; }
@media (max-width: 760px) {
  .loc-khach .day-phai { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .loc-khach .day-phai .nut { flex: 1 1 auto; justify-content: center; }
  /* Danh sách khách thành thẻ: tên + liên hệ ở trên, số liệu chia 2 cột có nhãn. */
  .bang-cuon:has(> table.bang-the-kh) { overflow: visible; background: none; border: 0; box-shadow: none; }
  table.bang-the-kh, table.bang-the-kh tbody { display: block; width: 100%; }
  table.bang-the-kh thead { display: none; }
  table.bang-the-kh tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px;
    background: #fff; border: 1px solid var(--vien); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
  table.bang-the-kh tbody tr.tr-bi-chan { background: #fff5f5; }
  table.bang-the-kh tbody tr > td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; text-align: left; }
  table.bang-the-kh tbody tr > td:first-child { grid-column: 1 / -1; }
  table.bang-the-kh tbody tr > td[data-nhan]::before { content: attr(data-nhan); display: block; font-size: var(--co-phu); color: var(--mo); font-weight: 400; }
  table.bang-the-kh tbody tr > td.thao-tac { grid-column: 1 / -1; }
  table.bang-the-kh tbody tr > td.rong { grid-column: 1 / -1; text-align: center; }
}

/* Kênh & Tự động (audit 17/11/2026) */
.the-chon .nhan-checkbox-inline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--co-phu); font-weight: 600; color: var(--chu); }
.ht-nut .nut-nguy .icon { color: inherit; }
@media (max-width: 860px) {
  .ht-goi-y p { max-height: 7.5em; overflow-y: auto; }
}

/* Sản phẩm, kho, báo cáo, quản trị (audit 17/11/2026) */
#sua-chi-tiet { margin-bottom: 16px; }
@media (max-width: 760px) {
  table.bang-tai-khoan tbody tr > td form.hang { flex-wrap: wrap; }
  table.bang-tai-khoan tbody tr > td select { min-width: 120px; }
  table.bang-tai-khoan tbody tr > td input[type=password] { min-width: 0; flex: 1 1 140px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Lớp đồng bộ màu & chữ (18/11/2026) — đặt cuối file để thắng các luật cũ cùng độ ưu tiên.
   Nguyên tắc: màu = việc / trạng thái; thông tin tham khảo = trung tính.
   Độ đậm chỉ 4 bậc: 400 chữ thường · 500 nhãn, nút · 600 tên, trạng thái · 700 tiêu đề, số tiền chính.
   ═══════════════════════════════════════════════════════════════════ */

/* Số luôn thẳng cột để so tiền / số lượng nhanh */
table, .the, .so-tien-noi, .tong-tien-lon, .the-so strong, .so-kpi, .gia-tri-so-lieu, .huy-hieu-menu, .link-sdt { font-variant-numeric: tabular-nums; }
::selection { background: #d9e8c4; color: var(--muc); }
/* Chữ mẫu trong ô phải nhạt hẳn so với chữ đã nhập, không thì nhân viên tưởng ô đã có dữ liệu (anh Ninh 19/11: "0xxxxxxxxx" trông như số thật). */
input::placeholder, textarea::placeholder { color: #8f9886; opacity: 1; }

/* Tiêu đề: một bậc rõ ràng giữa trang → khối → chữ thường */
h2 { font-size: var(--co-muc); font-weight: 700; }

/* Trạng thái đơn: mỗi bước một màu riêng, không trùng màu cảnh báo */
.the.tt-moi      { background: var(--tt-tin-nen);   color: var(--tt-tin);   font-weight: 600; }
.the.tt-xac_nhan { background: var(--tt-cho-nen);   color: var(--tt-cho);   font-weight: 600; }
.the.tt-da_gui   { background: var(--tt-duong-nen); color: var(--tt-duong); font-weight: 600; }
.the.tt-da_giao  { background: var(--tt-tot-nen);   color: var(--tt-tot);   font-weight: 600; }
.the.tt-hoan     { background: var(--tt-gap-nen);   color: var(--tt-gap);   font-weight: 600; }
.the.tt-huy      { background: var(--tt-gap-nen);   color: var(--tt-gap);   font-weight: 600; }   /* Huỷ / Hoàn: đỏ (anh Ninh 18/11) */

/* Tiền: đã xong = xanh; còn phải theo dõi = vàng; chỉ là thông tin = trung tính */
.the-da-thanh-toan { background: var(--tt-tot-nen);   color: var(--tt-tot); }
.the-chua-thu      { background: var(--tt-canh-nen);  color: var(--tt-canh); }
.the-coc, .the.the-cod { background: var(--tt-trung-nen); color: var(--tt-trung); font-weight: 500; }

/* Việc gấp / cần để ý */
.the-giao-cham, .rui-ro-cao { background: var(--tt-gap-nen); color: var(--tt-gap); font-weight: 600; }
.rui-ro-vua, .the-kq.the-kq-xau { background: var(--tt-canh-nen); color: var(--tt-canh); }
.rui-ro-thap                 { background: var(--tt-tot-nen); color: var(--tt-tot); }
.the-doi-tra { background: var(--tt-tin-nen); color: var(--tt-tin); }

/* Thông tin tham khảo: bỏ nền màu, chữ xám — để mắt dồn vào trạng thái và việc gấp */
.the-kenh-nho { background: none; padding: 0; color: var(--mo); font-weight: 500; font-size: var(--co-phu); }
.the.the-tinh { background: none; padding: 0; color: var(--mo); font-weight: 500; }
.the-kq { background: var(--tt-trung-nen); color: var(--tt-trung); font-weight: 500; }

/* Dòng đơn: tên khách và mã đơn là điểm neo, phần còn lại nhẹ hơn */
/* Mã đơn, tên khách, số tiền: đậm vừa (anh Ninh 18/11: bản 600/700 đậm quá). Màu xanh của mã đơn đủ làm điểm neo. */
.ma-don-link, .ten-khach-link { font-weight: 500; }
.ten-khach-dong { font-weight: 500; font-size: var(--co-bang); }
.tong-tien-lon, .so-tien-noi, .chu-tien-ck, .chu-tien-thu-ho, .so-ton-lon, .dong-tong-tien, .link-sdt-to,
.kn-bang tfoot .kn-tong td, .the-so strong, .so-kpi, .the-so-lieu .gia-tri-so-lieu, .kpi strong { font-weight: 600; }
/* <strong> / <b> mặc định "bolder" = đậm hơn chỗ bao ngoài một bậc (500 → 700, 600 → 900): đó là lý do mã đơn, tên khách, số tiền vẫn rất đậm.
   Chữ nhấn mạnh trong câu dùng 600; trong các ô trên thì theo đúng độ đậm của ô. */
b, strong { font-weight: 600; }
.phieu-dong-goi b, .phieu-dong-goi strong { font-weight: 700; }   /* phiếu in giữ như cũ: chữ đậm rõ trên giấy */
.ma-don-link strong, .ten-khach-dong strong, .ten-khach-link strong, .tong-tien-lon strong, .so-tien-noi strong,
.chu-tien-ck strong, .chu-tien-thu-ho strong, .so-ton-lon strong, .dong-tong-tien strong, .link-sdt-to strong { font-weight: inherit; }

/* Nút hành động cần chú ý (Huỷ, Hoàn, bước lùi): đỏ rõ ràng; rê chuột thì đỏ đặc. Nút xoá vẫn đỏ đặc (.nut-nguy-nhat). */
.nut-nguy { color: var(--tt-gap); background: var(--tt-gap-nen); border-color: #e8a59d; font-weight: 600; }
.nut-nguy:hover { color: #fff; background: var(--do); border-color: var(--do); }
.link-sdt { font-weight: 500; }
.ngay-chinh { font-weight: 500; }
.ma-van-don-chu { font-weight: 500; }
.dong-san-pham-chu { color: var(--chu); }
.ten-hang-vc { color: var(--mo); }

/* Dòng gấp: giữ vạch đỏ bên trái, nền nhạt hơn để cả danh sách không đỏ hồng */
.bang-don tbody tr.dong-gap > td, .bang-vc tbody tr.dong-gap > td { background: #fffaf9; }
.bang-don tbody tr.dong-gap:hover > td { background: #fff1ee; }
@media (max-width: 760px) {
  table.bang-the tbody tr.dong-gap { background: #fffaf9; }
}

/* Thanh tổng đơn: nhãn và số không bị chẻ cột trên điện thoại; ghi chú tự xuống dòng */
.thong-ke-muc { flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
.thong-ke-muc > span, .thong-ke-muc > strong { white-space: nowrap; }

/* ═══ Trang Tạo đơn (anh Ninh 19/11/2026): mỗi phần đọc rõ ═══
   Nhãn ô: sẫm, đậm vừa · chữ đã nhập: đen · chữ mẫu: nhạt hẳn · lời giải thích sau nhãn: xám, chữ thường.
   Mỗi khối có số thứ tự 1 → 4 theo đúng thứ tự lên đơn. */
.khung-tao-don { counter-reset: buoc-don; }
.khung-tao-don .hop > h2, .khung-tao-don .hop-tieu-de-flex > h2 { counter-increment: buoc-don; display: flex; align-items: center; gap: 10px; }
.khung-tao-don .hop > h2::before, .khung-tao-don .hop-tieu-de-flex > h2::before {
  content: counter(buoc-don); flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--xanh-nhat); color: var(--xanh-dam); font-size: var(--co-phu); font-weight: 700; }
.khung-tao-don label { color: #39432f; font-weight: 500; }
.khung-tao-don label > .nho, .khung-tao-don .dc-tieu-de .nho { color: var(--mo); font-weight: 400; }
.khung-tao-don input, .khung-tao-don select, .khung-tao-don textarea { color: var(--muc); }
.khung-tao-don .dong-tinh-toan > span { color: #39432f; }
.goi-y-mon[hidden], .goi-y-khach[hidden] { display: none; }   /* khung trống viền gạch hiện dù chưa có gợi ý */

/* Địa chỉ: dòng địa chỉ mới (in phiếu, gửi hãng) nổi nhất; địa chỉ cũ là các nút chọn */
.dc-tieu-de > strong { font-size: var(--co-bang); color: var(--xanh-rat-dam); }
.dc-moi { border-color: #c6d9ae; }
.dc-moi .dc-nhan { color: var(--xanh-dam); }
.dc-moi strong { font-weight: 600; font-size: var(--co-bang); }
.dc-dong.dc-cu { border-style: solid; align-items: center; }
.dc-cu-chon { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.dc-chip { font: inherit; font-size: var(--co-phu); line-height: 1.3; padding: 4px 10px; border: 1px solid var(--vien-dam); border-radius: 999px;
  background: var(--giay); color: var(--chu); cursor: pointer; }
.dc-chip:hover { border-color: var(--xanh-tra); background: var(--xanh-hover); }
.dc-chip.dang-chon { background: var(--xanh-dam); border-color: var(--xanh-dam); color: #fff; font-weight: 500; }
.dc-cu-ghi { flex-basis: 100%; padding-left: 158px; font-size: var(--co-phu); color: var(--mo); }
.dc-cu-ghi.dc-cu-xong { color: var(--tt-tot); }
@media (max-width: 640px) { .dc-cu-ghi { padding-left: 0; } }

/* Chỉ tiêu đánh giá khách hàng — trang Khách hàng, chỉ Chủ (anh Ninh 19/11/2026) */
.chi-tieu-khach { margin-bottom: 14px; }
.chi-tieu-luoi { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 12px; }
.chi-tieu-luoi > div { min-width: 0; }
.chi-tieu-luoi td:nth-child(2) { min-width: 220px; }
.chi-tieu-luoi td.so { white-space: nowrap; }
.chi-tieu-luoi h3 { font-size: var(--co-than); font-weight: 600; margin: 0 0 8px; color: var(--muc); }
.chi-tieu-luoi h3 .nho { font-weight: 400; }
.chi-tieu-luoi td .the { white-space: nowrap; }

/* Hồ sơ khách: địa chỉ đã giao, hội thoại, bảng gọn (anh Ninh 19/11/2026) */
.ds-dia-chi-khach { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ds-dia-chi-khach li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--vien); }
.ds-dia-chi-khach li:last-child { border-bottom: 0; padding-bottom: 0; }
table.bang-gon td, table.bang-gon th { padding-top: 6px; padding-bottom: 6px; }
.nut-mo-them { margin-top: 8px; }

/* Quà tặng kèm đơn (19/11/2026): thông tin, không phải trạng thái → màu trung tính, chỉ tách bằng vạch và chữ "Tặng". */
.khoi-qua-tang { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--vien-dam); }
.qua-tieu-de { margin-bottom: 10px; }
.qua-tieu-de strong { font-size: var(--co-than); }
.qua-tieu-de .nho { display: block; margin-top: 2px; }
.dong-hang.dong-qua { background: var(--giay); border-style: dashed; }
.dong-qua .thanh-tien { color: var(--mo); font-size: var(--co-nho); }
.nhan-qua { display: inline-block; padding: 0 6px; border: 1px solid var(--vien-dam); border-radius: 4px; color: var(--mo); font-size: var(--co-rat-nho); font-weight: 600; vertical-align: 1px; }
tr.dong-qua-tang td { color: var(--mo); }
.phieu-qua-tang th { text-align: left; }

/* Nút xoá ghi chú nội bộ / chăm sóc (19/11/2026): chỉ hiện với người viết hoặc Chủ. Thao tác phá huỷ → chữ đỏ, nhỏ, không nổi bật. */
.gc-xoa { display: inline; margin: 0 0 0 6px; }
.nut-xoa-ghi { background: none; border: 0; padding: 0 2px; color: var(--do); font-size: var(--co-phu); text-decoration: underline; cursor: pointer; }
.nut-xoa-ghi:hover, .nut-xoa-ghi:focus-visible { color: #8a1a12; }
