/* chung.css — biến màu + thành phần dùng chung. Ví dụ từng lớp: public/GIAO-DIEN.md và màn #/mau-thanh-phan.
   Tông: nền kem, chữ đen than, nhấn vàng đồng (dùng tiết chế), trạng thái xanh lá / cam / đỏ. Không có chế độ tối. */

/* ---------- 1. Biến ---------- */
:root {
  --nen: #faf7f2; --nen-2: #f3ede2; --the: #fff;
  --muc: #141414; --muc-2: #3b3833; --mo: #756f66; --mo-2: #a39c90;
  --vien: #e8e0d1; --vien-2: #d8cfbd;
  --vang: #b8935a; --vang-dam: #96743d; --vang-nhat: #f6eddc; --vang-chu: #7a5c2a;
  --tot: #2f7d4f; --tot-nen: #e4f2e9;
  --cam: #b45f06; --cam-nen: #fdf0dc;
  --do: #b3261e; --do-nen: #fbe8e6;
  --xanh: #2c5b8a; --xanh-nen: #e6eef7;
  --xam: #6f6a62; --xam-nen: #eeeae3;
  --bo: 10px; --bo-nho: 7px; --bo-to: 14px;
  --bong: 0 1px 2px rgba(20, 20, 20, .05), 0 6px 18px rgba(20, 20, 20, .06);
  --bong-to: 0 18px 50px rgba(20, 20, 20, .22);
  --vong: 0 0 0 3px rgba(184, 147, 90, .28);
  --chu: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ray: 84px;          /* bề rộng thanh điều hướng dọc (máy tính) */
  --day: 58px;          /* bề cao thanh điều hướng đáy (điện thoại) */
  --day-an-toan: env(safe-area-inset-bottom, 0px);
}

/* ---------- 2. Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body { background: var(--nen); color: var(--muc); font: 400 14.5px/1.5 var(--chu); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: not-allowed; }
a { color: var(--vang-chu); text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
svg.bt { flex: none; }
:focus-visible { outline: 2px solid var(--vang-dam); outline-offset: 2px; border-radius: 4px; }
::selection { background: #ecd9b6; }
* { scrollbar-width: thin; scrollbar-color: #d2c8b6 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d6ccba; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #bfb39d; }
.lien-ket { overflow-wrap: anywhere; }

/* tiện ích nhỏ */
.hang { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hang-sat { gap: 4px; }
.cot { display: flex; flex-direction: column; gap: 12px; }
.gian { flex: 1 1 0; min-width: 0; }
.mo { color: var(--mo); }
.nho { font-size: 12.5px; }
.dam { font-weight: 650; }
.cat-chu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.xuong-dong-chu { overflow-wrap: anywhere; white-space: pre-wrap; }
.an-ngoai-man { position: fixed !important; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.luoi-2, .luoi-3, .luoi-4 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.luoi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.luoi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chi-dt, .chi-man-hep { display: none !important; }
@media (max-width: 1180px) { .chi-man-hep { display: inline-flex !important; } .luoi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .luoi-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .chi-dt { display: inline-flex !important; } .an-dt { display: none !important; } .luoi-2, .luoi-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 3. Nút ---------- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--vien-2); border-radius: var(--bo); background: #fff; color: var(--muc); font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none; position: relative; flex: none; transition: background-color .12s, border-color .12s, box-shadow .12s, transform .06s; user-select: none; }
.nut:hover { background: var(--nen); border-color: #c9bea8; }
.nut:active { transform: translateY(1px); }
.nut:focus-visible { outline: none; box-shadow: var(--vong); border-color: var(--vang); border-radius: var(--bo); }
.nut:disabled { opacity: .5; transform: none; }
.nut-chinh { background: var(--vang); border-color: var(--vang); color: #17130b; }
.nut-chinh:hover { background: #ab8650; border-color: #ab8650; }
.nut-nguy { background: var(--do); border-color: var(--do); color: #fff; }
.nut-nguy:hover { background: #9c1f18; border-color: #9c1f18; }
.nut-mo { background: transparent; border-color: transparent; }
.nut-mo:hover { background: rgba(20, 20, 20, .06); border-color: transparent; }
.nut-bt { width: 38px; padding: 0; }
.nut-nho { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.nut-nho.nut-bt { width: 30px; padding: 0; }
.nut-to { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.nut-day { width: 100%; }
.nut.dang-chay { color: transparent !important; pointer-events: none; opacity: 1; }
.nut.dang-chay > * { visibility: hidden; }
.nut.dang-chay::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid rgba(20, 20, 20, .25); border-top-color: var(--muc); animation: cs-xoay .7s linear infinite; }
.nut-nguy.dang-chay::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes cs-xoay { to { transform: rotate(360deg); } }
.vong-xoay { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(20, 20, 20, .18); border-top-color: var(--vang-dam); animation: cs-xoay .7s linear infinite; flex: none; }

/* ---------- 4. Ô nhập, ô chọn, trường ---------- */
.o-nhap, .o-chon { display: block; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--vien-2); border-radius: var(--bo); background: #fff; color: var(--muc); font-size: 14.5px; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.o-nhap::placeholder { color: var(--mo-2); }
.o-nhap:hover, .o-chon:hover { border-color: #c9bea8; }
.o-nhap:focus, .o-chon:focus { outline: none; border-color: var(--vang); box-shadow: var(--vong); }
.o-nhap:disabled, .o-chon:disabled { background: var(--nen-2); color: var(--mo); }
textarea.o-nhap { height: auto; min-height: 84px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
.o-nhap[type=search]::-webkit-search-cancel-button { display: none; }
.o-chon { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23756f66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; text-overflow: ellipsis; }
.o-kem { position: relative; display: block; min-width: 0; }
.o-kem > .o-nhap { padding-right: 42px; }
.o-kem-nut { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--mo); }
.o-kem-nut:hover { background: var(--nen-2); color: var(--muc); }
.o-tim > .o-nhap { padding-left: 36px; }
.o-kem-bt { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mo); pointer-events: none; }
.truong { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.truong-nhan { font-size: 13.5px; font-weight: 600; color: var(--muc-2); display: flex; align-items: baseline; gap: 6px; }
.truong-sao { color: var(--do); }
.truong-phu { margin-left: auto; font-weight: 400; color: var(--mo); font-size: 12.5px; }
.truong-goi-y { font-size: 12.5px; color: var(--mo); line-height: 1.45; }
.truong-loi { font-size: 12.5px; color: var(--do); font-weight: 600; }
.truong.co-loi .o-nhap, .truong.co-loi .o-chon { border-color: var(--do); box-shadow: 0 0 0 3px rgba(179, 38, 30, .14); }
.bieu-mau { display: flex; flex-direction: column; gap: 14px; }

/* công tắc bật / tắt */
.cong-tac { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; position: relative; min-height: 24px; }
.cong-tac > input { position: absolute; opacity: 0; width: 40px; height: 24px; margin: 0; cursor: pointer; }
.cong-tac-ranh { flex: none; width: 40px; height: 24px; border-radius: 999px; background: #cfc6b5; position: relative; transition: background-color .15s; }
.cong-tac-ranh::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.cong-tac > input:checked + .cong-tac-ranh { background: var(--tot); }
.cong-tac > input:checked + .cong-tac-ranh::after { transform: translateX(16px); }
.cong-tac > input:focus-visible + .cong-tac-ranh { box-shadow: var(--vong); }
.cong-tac > input:disabled + .cong-tac-ranh { opacity: .55; }
.cong-tac.dang-chay .cong-tac-ranh::after { animation: cs-nhip .8s ease-in-out infinite; }
@keyframes cs-nhip { 50% { opacity: .45; } }
.cong-tac-chu { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; min-width: 0; }
.cong-tac-nhan { font-weight: 600; font-size: 14px; }
.cong-tac-mo-ta { font-size: 12.5px; color: var(--mo); line-height: 1.45; }

/* ---------- 5. Thẻ ---------- */
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo-to); min-width: 0; }
.the-dau { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--vien); }
.the-dau-chu { flex: 1; min-width: 0; }
.the-tieu-de { font-size: 15.5px; font-weight: 700; letter-spacing: -.005em; }
.the-mo-ta { font-size: 13px; color: var(--mo); margin-top: 2px; }
.the-dau-nut { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.the-than { padding: 16px 18px; }
.the-than-sat { padding: 0; }
.the-chan { padding: 12px 18px; border-top: 1px solid var(--vien); background: #fdfbf7; border-radius: 0 0 var(--bo-to) var(--bo-to); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.the-bam { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.the-bam:hover { border-color: var(--vien-2); box-shadow: var(--bong); }

/* ---------- 6. Huy hiệu, nhãn màu, số đếm ---------- */
.huy-hieu { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1; white-space: nowrap; background: var(--xam-nen); color: var(--xam); flex: none; }
.hh-cham { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hh-tot { background: var(--tot-nen); color: var(--tot); }
.hh-cam { background: var(--cam-nen); color: var(--cam); }
.hh-do { background: var(--do-nen); color: var(--do); }
.hh-xanh { background: var(--xanh-nen); color: var(--xanh); }
.hh-vang { background: var(--vang-nhat); color: var(--vang-chu); }
.hh-xam { background: var(--xam-nen); color: var(--xam); }
.hh-vai-chu { background: var(--muc); color: #e8cfa3; }
.hh-vai-quan_ly { background: var(--vang-nhat); color: var(--vang-chu); }
.hh-vai-nhan_vien { background: var(--xanh-nen); color: var(--xanh); }
.hh-vai-xem { background: var(--xam-nen); color: var(--xam); }
.nhan-mau { --mau: #756f66; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--xam-nen); background: color-mix(in srgb, var(--mau) 13%, #fff); color: var(--muc-2); color: color-mix(in srgb, var(--mau) 62%, #141414); max-width: 100%; min-width: 0; }
.nhan-mau-cham { width: 7px; height: 7px; border-radius: 50%; background: var(--mau); flex: none; }
.nhan-mau-ten { overflow: hidden; text-overflow: ellipsis; line-height: 20px; }
.nhan-mau-xoa { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: -4px; border-radius: 4px; color: inherit; opacity: .7; }
.nhan-mau-xoa:hover { opacity: 1; background: rgba(20, 20, 20, .1); }
.so-dem { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--do); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; flex: none; font-variant-numeric: tabular-nums; }
.so-dem-nhe { background: var(--xam-nen); color: var(--muc-2); }
.cham-mau { width: 9px; height: 9px; border-radius: 50%; background: var(--mau, var(--mo)); flex: none; }
.the-vai { display: flex; align-items: flex-start; gap: 10px; }
.the-vai-mo-ta { font-size: 13px; color: var(--mo); line-height: 1.45; }

/* chọn vai kèm giải thích */
.chon-vai { display: flex; flex-direction: column; gap: 8px; }
.chon-vai-muc { display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--vien-2); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .12s, background-color .12s; }
.chon-vai-muc:hover { border-color: #c9bea8; }
.chon-vai-muc > input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--vang-dam); flex: none; }
.chon-vai-muc:has(input:checked) { border-color: var(--vang); background: var(--vang-nhat); }
.chon-vai-chu { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chon-vai-ten { font-weight: 650; }
.chon-vai-mo-ta { font-size: 12.5px; color: var(--mo); line-height: 1.45; }

/* ---------- 7. Thanh tab, hàng chip ---------- */
.thanh-tab { display: flex; gap: 2px; border-bottom: 1px solid var(--vien); overflow-x: auto; scrollbar-width: none; }
.thanh-tab::-webkit-scrollbar, .day-chip::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mo); font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; }
.tab:hover { color: var(--muc); }
.tab.chon { color: var(--muc); border-bottom-color: var(--vang); }
.day-chip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--vien-2); border-radius: 999px; background: #fff; color: var(--muc-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; flex: none; transition: background-color .12s, border-color .12s; }
.chip:hover { border-color: #c9bea8; background: var(--nen); }
.chip.chon { background: var(--vang-nhat); border-color: var(--vang); color: #4a3716; }
.chip .so-dem, .tab .so-dem { min-width: 18px; height: 18px; font-size: 10.5px; }

/* ---------- 8. Bảng (điện thoại tự thành thẻ) ---------- */
.bang-khung { background: #fff; border: 1px solid var(--vien); border-radius: var(--bo-to); overflow: hidden; }
.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 650; color: var(--mo); text-transform: uppercase; letter-spacing: .04em; background: #fdfbf7; border-bottom: 1px solid var(--vien); white-space: nowrap; }
.bang td { padding: 12px 14px; border-bottom: 1px solid var(--vien); vertical-align: middle; }
.bang tbody tr:last-child td { border-bottom: 0; }
.bang tbody tr:hover { background: #fdfbf7; }
.bang .bang-so { text-align: right; font-variant-numeric: tabular-nums; }
.bang .bang-nut { text-align: right; white-space: nowrap; }
.bang .bang-chinh { font-weight: 600; }
@media (max-width: 760px) {
  .bang, .bang tbody { display: block; }
  .bang thead { display: none; }
  .bang tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--vien); }
  .bang tbody tr:last-child { border-bottom: 0; }
  .bang td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; border: 0; text-align: right; min-width: 0; }
  .bang td[data-nhan]::before { content: attr(data-nhan); color: var(--mo); font-size: 12.5px; flex: none; text-align: left; font-weight: 400; }
  .bang td.bang-chinh { font-size: 15px; font-weight: 650; text-align: left; justify-content: flex-start; padding-bottom: 6px; }
  .bang td.bang-chinh::before { display: none; }
  .bang td.bang-nut { justify-content: flex-end; padding-top: 8px; gap: 8px; }
  .bang td.bang-nut::before { display: none; }
}

/* ---------- 9. Thanh công cụ màn, đầu màn ---------- */
.man-dau { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.man-dau-chu { flex: 1; min-width: 0; }
.man-tieu-de { font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.man-mo-ta { color: var(--mo); margin-top: 3px; font-size: 14px; max-width: 70ch; }
.man-dau-nut { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.man-dau-ve { margin-left: -8px; }
.thanh-cong-cu { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.thanh-cong-cu > .o-kem, .thanh-cong-cu > .o-nhap { flex: 1 1 220px; max-width: 360px; }
.thanh-cong-cu > .o-chon { width: auto; flex: 0 1 200px; }
.muc-tieu-de { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mo); margin: 22px 0 10px; }
@media (max-width: 760px) {
  .man-dau { flex-wrap: wrap; margin-bottom: 14px; }
  .man-tieu-de { font-size: 19px; }
  .man-dau-nut { width: 100%; justify-content: flex-start; }
  .man-dau-nut > .nut:not(.nut-bt) { flex: 1 1 auto; }
  .thanh-cong-cu > .o-kem, .thanh-cong-cu > .o-nhap { max-width: none; flex-basis: 100%; }
  .thanh-cong-cu > .o-chon { flex: 1 1 140px; }
}

/* ---------- 10. Danh sách ---------- */
.ds { display: flex; flex-direction: column; }
.ds-dong { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--vien); width: 100%; text-align: left; position: relative; min-width: 0; background: #fff; color: inherit; text-decoration: none; }
button.ds-dong:hover, a.ds-dong:hover, .ds-dong.bam:hover { background: #fdfaf4; }
.ds-dong.chon { background: var(--vang-nhat); }
.ds-dong.chon::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--vang); }
.ds-dong:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--vang); border-radius: 0; }
.ds-chinh { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ds-ten { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-phu { font-size: 13px; color: var(--mo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-cuoi { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--mo); }
.ds-khung { background: #fff; border: 1px solid var(--vien); border-radius: var(--bo-to); overflow: hidden; }
.ds-khung .ds-dong:last-child { border-bottom: 0; }

/* ---------- 11. Khung xương, trạng thái trống / lỗi ---------- */
.xuong { display: block; height: 13px; border-radius: 6px; background: linear-gradient(90deg, #ece5d8 0%, #f6f1e8 45%, #ece5d8 90%); background-size: 220% 100%; animation: cs-luot 1.25s ease-in-out infinite; }
.xuong-mong { height: 10px; opacity: .8; }
.xuong-tron { width: 40px; height: 40px; border-radius: 50%; flex: none; }
@keyframes cs-luot { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.xuong-khoi { display: flex; flex-direction: column; }
.xuong-khoi-chu { gap: 10px; padding: 6px 0; }
.xuong-dong { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--vien); }
.xuong-cot { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xuong-khoi-the { gap: 12px; }
.xuong-the { padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.xuong-hang { display: flex; gap: 14px; padding: 15px 14px; border-bottom: 1px solid var(--vien); justify-content: space-between; }
.trong { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 44px 20px; color: var(--mo); min-height: 200px; }
.trong-hinh { width: 58px; height: 58px; border-radius: 50%; background: var(--nen-2); color: var(--vang-dam); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.trong-tieu-de { font-size: 16px; font-weight: 700; color: var(--muc); }
.trong-mo-ta { max-width: 380px; font-size: 14px; line-height: 1.5; }
.trong-nut { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.trong-loi .trong-hinh { background: var(--do-nen); color: var(--do); }

/* lưu ý trong trang */
.luu-y { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 14px; line-height: 1.5; }
.luu-y > svg { margin-top: 2px; }
.luu-y-than { flex: 1; min-width: 0; }
.luu-y-tieu-de { font-weight: 700; }
.luu-y-nut { flex: none; }
.luu-y-tin { background: var(--xanh-nen); border-color: #c9d9ea; color: #1f4468; }
.luu-y-canh_bao { background: var(--cam-nen); border-color: #f1d3a4; color: #7a3f00; }
.luu-y-loi { background: var(--do-nen); border-color: #f0c2bd; color: #8a1c15; }
.luu-y-tot { background: var(--tot-nen); border-color: #bfdfca; color: #1f5a37; }
@media (max-width: 760px) { .luu-y { flex-wrap: wrap; } .luu-y-nut { width: 100%; padding-left: 28px; } }

/* ---------- 12. Hộp thoại ---------- */
html.co-lop body { overflow: hidden; }
.hop-nen, .ngan-nen { position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 10, .46); display: flex; align-items: center; justify-content: center; padding: 20px; animation: cs-hien .14s ease-out; }
@keyframes cs-hien { from { opacity: 0; } }
.hop { background: #fff; border-radius: 16px; width: min(520px, 100%); max-height: min(88dvh, 760px); display: flex; flex-direction: column; box-shadow: var(--bong-to); animation: cs-noi .18s cubic-bezier(.2, .8, .3, 1); outline: none; }
@keyframes cs-noi { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.hop-nho { width: min(410px, 100%); }
.hop-to { width: min(780px, 100%); }
.hop-dau, .ngan-dau { display: flex; align-items: center; gap: 10px; padding: 14px 12px 10px 20px; flex: none; }
.hop-tieu-de, .ngan-tieu-de { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.hop-than, .ngan-than { padding: 4px 20px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.hop-cau { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.hop-chi-tiet { margin-top: 8px; font-size: 13.5px; color: var(--mo); line-height: 1.5; }
.hop-chan, .ngan-chan { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--vien); flex: none; flex-wrap: wrap; }
.hop-nguy .hop-tieu-de { color: var(--do); }
@media (max-width: 760px) {
  .hop-nen { align-items: flex-end; padding: 0; }
  .hop, .hop-nho, .hop-to { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; animation-name: cs-truot-len; }
  .hop-chan, .ngan-chan { padding-bottom: calc(12px + var(--day-an-toan)); }
  .hop-chan > .nut, .ngan-chan > .nut { flex: 1 1 0; }
}
@keyframes cs-truot-len { from { transform: translateY(40px); opacity: .4; } }

/* ---------- 13. Ngăn kéo bên cạnh ---------- */
.ngan-nen { padding: 0; justify-content: flex-end; align-items: stretch; }
.ngan { background: #fff; width: min(420px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: var(--bong-to); animation: cs-truot-phai .2s cubic-bezier(.2, .8, .3, 1); outline: none; }
.ngan-to { width: min(580px, 100%); }
.ngan-dau { padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--vien); padding-bottom: 12px; }
.ngan-than { padding-top: 16px; }
@keyframes cs-truot-phai { from { transform: translateX(40px); opacity: .4; } }
.ngan-nen:has(.ngan-trai) { justify-content: flex-start; }
.ngan-trai { animation-name: cs-truot-trai; }
@keyframes cs-truot-trai { from { transform: translateX(-40px); opacity: .4; } }
.ngan-nen:has(.ngan-duoi) { align-items: flex-end; justify-content: center; }
.ngan-duoi { width: min(560px, 100%); height: auto; max-height: 86dvh; border-radius: 18px 18px 0 0; animation-name: cs-truot-len; }
.ngan-duoi .ngan-dau { padding-top: 14px; }
.ngan-duoi .ngan-than { padding-bottom: calc(18px + var(--day-an-toan)); }

/* ---------- 14. Menu thả, gợi ý ---------- */
.menu { position: fixed; z-index: 120; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--vien); border-radius: 12px; box-shadow: var(--bong-to); padding: 6px; overflow-y: auto; animation: cs-noi .12s ease-out; outline: none; }
.menu-muc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left; color: var(--muc); min-height: 38px; }
.menu-muc:hover, .menu-muc:focus-visible { background: var(--nen-2); outline: none; }
.menu-muc:disabled { opacity: .45; }
.menu-muc > svg { color: var(--mo); }
.menu-nhan { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-nhan small { color: var(--mo); font-size: 12px; line-height: 1.35; }
.menu-nguy, .menu-nguy > svg { color: var(--do); }
.menu-muc.chon { font-weight: 650; }
.menu-tich { color: var(--vang-dam) !important; }
.menu-cho { width: 17px; flex: none; }
.menu-vach { height: 1px; background: var(--vien); margin: 5px 4px; }
.menu-tieu-de { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mo); }
.menu-khoi { padding: 8px 10px; }
.goi-y { position: fixed; z-index: 200; background: #1d1b18; color: #fff; font-size: 12.5px; line-height: 1.35; padding: 5px 8px; border-radius: 6px; max-width: 260px; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }

/* ---------- 15. Dải báo trên cùng ---------- */
.thanh-bao-khoi { display: flex; flex-direction: column; flex: none; }
.thanh-bao { display: flex; align-items: center; gap: 9px; padding: 7px 16px; font-size: 13.5px; line-height: 1.4; min-height: 36px; }
.thanh-bao > svg { flex: none; }
.thanh-bao-chu { flex: 1; min-width: 0; }
.thanh-bao-nut { flex: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; border-radius: 6px; color: inherit; }
.thanh-bao-dong { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; opacity: .75; color: inherit; }
.thanh-bao-dong:hover { opacity: 1; background: rgba(20, 20, 20, .1); }
.thanh-bao-do { background: var(--do); color: #fff; }
.thanh-bao-cam { background: var(--cam-nen); color: #7a3f00; border-bottom: 1px solid #f1d3a4; }
.thanh-bao-tin { background: var(--xanh-nen); color: #1f4468; border-bottom: 1px solid #c9d9ea; }
.thanh-bao-thu { background: repeating-linear-gradient(135deg, #1c1a16 0 14px, #24211b 14px 28px); color: #e8cfa3; font-size: 12.5px; letter-spacing: .02em; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.thanh-bao-thu b { letter-spacing: .08em; color: #f4dfb8; }

/* ---------- 16. Thông báo nổi ---------- */
.bao-khoi { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.bao { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; background: #1d1b18; color: #fff; border-radius: 12px; padding: 10px 10px 10px 13px; min-width: 220px; max-width: min(480px, calc(100vw - 24px)); box-shadow: var(--bong-to); font-size: 14px; line-height: 1.45; animation: cs-noi .18s cubic-bezier(.2, .8, .3, 1); }
.bao > svg { margin-top: 2px; }
.bao-chu { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bao-tot > svg { color: #86d6a2; } .bao-loi > svg { color: #ff9d94; } .bao-canh_bao > svg { color: #f4c46c; } .bao-tin > svg { color: #a9c8ea; }
.bao-nut { color: #e8cfa3; font-weight: 700; padding: 1px 6px; border-radius: 6px; flex: none; }
.bao-dong { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #b9b2a6; }
.bao-dong:hover { background: rgba(255, 255, 255, .12); color: #fff; }
@media (max-width: 760px) { .bao-khoi { bottom: calc(var(--day) + var(--day-an-toan) + 12px); width: calc(100vw - 24px); } .bao { width: 100%; max-width: none; } }

/* ---------- 17. Ảnh đại diện + huy hiệu nền tảng ---------- */
.anh-dd { --co: 40px; position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--co); height: var(--co); border-radius: 50%; background: var(--nen-dd, var(--nen-2)); color: var(--chu-dd, var(--muc-2)); font-weight: 700; font-size: calc(var(--co) * .37); line-height: 1; flex: none; user-select: none; letter-spacing: .01em; }
.anh-dd-vuong { border-radius: 26%; }
.anh-dd-anh { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: var(--nen-2); }
.anh-dd-goc { position: absolute; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px #fff; }
.anh-dd-cham { width: calc(var(--co) * .28); height: calc(var(--co) * .28); min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--mo-2); right: 0; bottom: 0; }
.cham-san_sang { background: #36a166; }
.cham-tam_nghi { background: #b7ae9e; }
.nt { --co: 18px; display: inline-flex; width: var(--co); height: var(--co); border-radius: 50%; flex: none; background: #756f66; overflow: hidden; }
.nt > svg { width: 100%; height: 100%; }
.nt-facebook { background: #1877f2; }
.nt-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 92%); }
.nt-zalo_oa { background: #0068ff; border-radius: 30%; overflow: visible; }
.nt-zalo_oa > svg { overflow: visible; }
.nt-zalo_ca_nhan { background: #0b8dff; }
.nt-tiktok { background: #111; }
.ten-kenh { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.ten-kenh > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 18. Bố cục 2 cột / 3 cột đáp ứng (xem GIAO-DIEN.md) ---------- */
.bc { display: grid; grid-template-columns: var(--bc-ds, 340px) minmax(0, 1fr); height: 100%; min-height: 0; position: relative; overflow: hidden; }
.bc-3 { grid-template-columns: var(--bc-ds, 340px) minmax(0, 1fr) var(--bc-phu, 320px); }
.bc > * { min-width: 0; min-height: 0; }
.bc-ds, .bc-chinh, .bc-phu { display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.bc-ds { border-right: 1px solid var(--vien); }
.bc-chinh { background: var(--nen); }
.bc-phu { border-left: 1px solid var(--vien); }
.bc-cuon { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1180px) {
  .bc-3 { grid-template-columns: var(--bc-ds-hep, 310px) minmax(0, 1fr); }
  .bc-3 > .bc-phu { position: absolute; top: 0; bottom: 0; right: 0; width: min(340px, 100%); z-index: 6; transform: translateX(104%); transition: transform .2s cubic-bezier(.2, .8, .3, 1); box-shadow: var(--bong-to); visibility: hidden; }
  .bc-3.mo-phu > .bc-phu { transform: none; visibility: visible; }
}
@media (max-width: 760px) {
  .bc, .bc-3 { grid-template-columns: minmax(0, 1fr); }
  .bc > .bc-ds { border-right: 0; }
  .bc > .bc-chinh { display: none; }
  .bc.mo-chinh > .bc-ds { display: none; }
  .bc.mo-chinh > .bc-chinh { display: flex; }
  .bc-3 > .bc-phu { width: 100%; }
}

/* ---------- 19. Điện thoại: nút và ô cao ≥ 44px ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .nut { height: 44px; padding: 0 16px; font-size: 15px; }
  .nut-bt { width: 44px; padding: 0; }
  .nut-nho { height: 44px; font-size: 14px; padding: 0 12px; }
  .nut-nho.nut-bt { width: 44px; }
  .nut-to { height: 50px; }
  .o-nhap, .o-chon { height: 46px; font-size: 16px; }
  textarea.o-nhap { font-size: 16px; }
  .o-kem-nut { width: 42px; height: 42px; right: 2px; }
  .chip { height: 44px; padding: 0 14px; font-size: 14px; }
  .tab { padding: 13px 12px; font-size: 14.5px; }
  .menu-muc { min-height: 46px; font-size: 15px; }
  .cong-tac { min-height: 44px; align-items: center; }
  .cong-tac > input { height: 44px; top: 0; }
  .chon-vai-muc { padding: 13px; }
  .hop-dau .nut-bt, .ngan-dau .nut-bt { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
