/* Giao diện CareZone bán hàng. Màu, chữ, kích thước theo design/tokens.json và các artboard trên canvas. */
:root {
  --xanh-dam: #113917; --xanh-rung: #2D6635; --xanh-lui: #B9D3BC; --bac-ha: #F0FBF2; --kem: #F4F3EC; --trang: #fff;
  --vien: #E6E2D6; --vien-dam: #DCD8CB; --chu: #22301F; --nau: #3A3026; --chu-phu: #7A7363; --canh-bao: #B23A2E; --cam: #E0663A;
  --ban-ghi: #FAFAF7; --avatar: #E6FBE0;
  /* Giao diện nhân viên: chữ Roboto, gọn như KiotViet (anh Ân chốt 29/10/2026). Be Vietnam Pro giữ cho ấn phẩm, điểm nhấn (trang Giới thiệu). */
  --font: 'Roboto', 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-an-pham: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --co-chu: 1;   /* hệ số cỡ chữ: điện thoại giữ nguyên (chữ từ 14px), iPad và máy tính nhỏ lại */
  --an-toan-duoi: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { :root { --co-chu: .93; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--chu); background: var(--kem); font-size: calc(14px * var(--co-chu)); line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.so { font-variant-numeric: tabular-nums; }
.an-thi-giac { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--xanh-rung); outline-offset: 2px; }

#app { height: 100%; }
.khung { display: flex; width: 100%; height: 100%; overflow: hidden; }

/* ===== Thanh trái iPad (rail 112px) ===== */
.rail { width: 112px; flex: none; background: var(--xanh-dam); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 3px; overflow-y: auto; }
.logo-hop { width: 100px; height: 44px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; padding: 0 6px; flex: none; }
.logo-hop img { max-width: 100%; max-height: 100%; display: block; }
.nv { position: relative; width: 98px; padding: 9px 4px 8px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--xanh-lui); font-size: 11px; font-weight: 500; text-align: center; line-height: 1.2; background: none; border: 0; }
.nv.on { background: var(--xanh-rung); color: #fff; }
.nv svg { flex: none; }
.huy-hieu { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cam); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ===== Thanh trái máy tính (236px, có chữ) ===== */
.side { width: 236px; flex: none; background: var(--xanh-dam); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow-y: auto; }
.side .logo-hop { width: 204px; height: 67px; align-self: center; border-radius: 16px; margin-bottom: 18px; padding: 0 12px; }
.si { position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px; color: var(--xanh-lui); font-size: calc(14.5px * var(--co-chu)); font-weight: 500; background: none; border: 0; text-align: left; width: 100%; }
.si.on { background: var(--xanh-rung); color: #fff; }
.si .huy-hieu { position: static; margin-left: auto; }
.side-chan { margin-top: auto; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); color: var(--xanh-lui); font-size: calc(12px * var(--co-chu)); line-height: 1.4; }
.side-chan b { color: #fff; }

/* ===== Khung chính ===== */
.khung-chinh { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thanh-tren { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--vien); }
.thanh-tren h1 { margin: 0; font-size: calc(21px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); white-space: nowrap; }
.thanh-tren .phai { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nut-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--kem); display: flex; align-items: center; justify-content: center; color: var(--nau); position: relative; flex: none; border: 0; }
.nut-icon .cham { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--cam); box-shadow: 0 0 0 2px var(--kem); }
.toi { display: flex; align-items: center; gap: 10px; font-size: calc(12.5px * var(--co-chu)); color: #6B6557; line-height: 1.25; white-space: nowrap; background: none; border: 0; padding: 0; text-align: left; }
.toi b { display: block; color: var(--chu); font-size: calc(13.5px * var(--co-chu)); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--avatar); color: var(--xanh-rung); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.menu-nguoi-dung { position: absolute; right: 24px; top: 58px; z-index: 30; min-width: 220px; background: #fff; border: 1px solid var(--vien); border-radius: 14px; box-shadow: 0 16px 40px rgba(17, 57, 23, .18); padding: 8px; }
.menu-nguoi-dung .gt { padding: 8px 10px 10px; border-bottom: 1px solid #EEEAE0; margin-bottom: 6px; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); }
.menu-nguoi-dung .gt b { display: block; color: var(--chu); font-size: calc(14px * var(--co-chu)); }
.menu-nguoi-dung button { width: 100%; height: 44px; border-radius: 10px; background: none; border: 0; text-align: left; padding: 0 10px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.menu-nguoi-dung button:hover { background: var(--kem); }
.noi-dung { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px; background: var(--kem); }

/* Khối giữ chỗ cho màn hình sẽ làm ở các việc sau */
.the { background: #fff; border: 1px solid var(--vien); border-radius: 16px; }
.cho-viec { max-width: 560px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.cho-viec h2 { margin: 0; font-size: calc(18px * var(--co-chu)); color: var(--xanh-dam); }
.cho-viec p { margin: 0; color: var(--chu-phu); font-size: calc(14.5px * var(--co-chu)); line-height: 1.5; }
.nhan { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: #E3F1E5; color: #1D4A27; font-size: calc(12px * var(--co-chu)); font-weight: 700; border: 1px solid #C3DEC8; width: fit-content; }

/* ===== Điện thoại ===== */
.tren-dt { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; padding-top: env(safe-area-inset-top, 0px); }
.tren-dt h1 { margin: 0; font-size: calc(20px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); white-space: nowrap; }
.tren-dt .nut-icon { background: #fff; margin-left: auto; }
.nut-avatar-dt { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--avatar); color: var(--xanh-dam); font-weight: 700; font-size: 15px; }
.tren-dt .nut-icon .cham { box-shadow: 0 0 0 2px #fff; }
.noi-dung-dt { flex: 1; min-height: 0; overflow: auto; padding: 8px 16px 16px; }
/* Thanh dưới: đủ các tab, vuốt ngang được; mỗi tab rộng khoảng 1/4,5 màn hình để thấy tab kế bên và biết còn vuốt tiếp */
.thanh-duoi { flex: none; min-height: 82px; background: #fff; border-top: 1px solid var(--vien); display: flex; padding: 8px 0 calc(var(--an-toan-duoi) + 8px); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; }
.thanh-duoi::-webkit-scrollbar { display: none; }
.thanh-duoi button:first-child { margin-left: auto; }
.thanh-duoi button:last-child { margin-right: auto; }
.thanh-duoi button { flex: 0 0 22%; min-width: 76px; scroll-snap-align: center; text-align: center; line-height: 1.2; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: #8A8372; position: relative; background: none; border: 0; padding: 0; }
.thanh-duoi button.on { color: var(--xanh-rung); }
.thanh-duoi .huy-hieu { top: -4px; right: 18px; }
.to-ben-duoi { position: fixed; inset: 0; z-index: 40; background: rgba(17, 32, 20, .48); display: flex; align-items: flex-end; }
.to-ben-duoi .tam { width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 16px 16px calc(var(--an-toan-duoi) + 16px); display: flex; flex-direction: column; gap: 4px; }
.to-ben-duoi .tam h2 { margin: 0 0 6px; font-size: calc(16px * var(--co-chu)); color: var(--xanh-dam); padding: 0 6px; }
.to-ben-duoi .tam button { height: 52px; border-radius: 12px; background: var(--kem); border: 0; display: flex; align-items: center; gap: 12px; padding: 0 14px; font-weight: 700; font-size: calc(15px * var(--co-chu)); color: var(--chu); position: relative; text-align: left; width: 100%; }
.to-ben-duoi .tam button .huy-hieu { position: static; margin-left: auto; }
.to-ben-duoi .tam .tai-khoan { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 14px 6px 8px; border-top: 1px solid #EEEAE0; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.25; }
.to-ben-duoi .tam .tai-khoan b { display: block; color: var(--chu); font-size: calc(14px * var(--co-chu)); }

/* ===== Đăng nhập ===== */
.dang-nhap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--xanh-dam); }
.dang-nhap-hop { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 28px 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.dang-nhap-hop .logo { height: 54px; align-self: center; }
.dang-nhap-hop h1 { margin: 0; text-align: center; font-size: calc(20px * var(--co-chu)); color: var(--xanh-dam); }
.o-nhap { display: flex; flex-direction: column; gap: 7px; }
.o-nhap label { font-size: 13px; font-weight: 700; color: var(--nau); }
.o-nhap input { height: 48px; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: var(--ban-ghi); padding: 0 12px; font-size: 16px; width: 100%; }
.o-nhap input:focus { border-color: var(--xanh-rung); outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(45, 102, 53, .18); }
.nut { height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: calc(15px * var(--co-chu)); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; white-space: nowrap; }
.nut.chinh-xanh { background: var(--xanh-rung); color: #fff; }
.nut:disabled { opacity: .55; cursor: default; }
.loi { background: #FFF5F4; border: 1px solid #E3B4AE; color: var(--canh-bao); padding: 10px 12px; border-radius: 10px; font-size: calc(13.5px * var(--co-chu)); font-weight: 500; }
.dang-tai { min-height: 100%; display: flex; align-items: center; justify-content: center; color: var(--chu-phu); }

/* ===== Thành phần dùng chung (web/ui.js) ===== */
.noi-dung.day { padding: 0; }
.noi-dung-dt.day { padding: 0; }
.nut-chung { height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: calc(15px * var(--co-chu)); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; white-space: nowrap; background: none; }
.nut-chung.nho { height: 36px; padding: 0 14px; font-size: calc(13.5px * var(--co-chu)); border-radius: 10px; }
.nut-chung.chinh { background: var(--xanh-rung); color: #fff; }
.nut-chung.phu { background: #fff; border-color: var(--vien-dam); color: var(--chu); }
.nut-chung.nhat { background: #E8F4EA; border-color: #BCD8C1; color: var(--xanh-dam); }
.nut-chung.canh-bao { background: #fff; border-color: #E3B4AE; color: var(--canh-bao); }
.nut-chung.chu { padding: 0 8px; color: var(--canh-bao); }
.nut-chung:disabled, .nut-chung[aria-disabled='true'] { opacity: .5; cursor: not-allowed; }
.nut-chung.rong { width: 100%; }
.nut-icon-nho { width: 36px; height: 36px; border-radius: 10px; background: var(--kem); border: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--nau); flex: none; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--vien-dam); font-weight: 500; font-size: calc(14.5px * var(--co-chu)); color: var(--chu); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; }
.chip.on { background: var(--xanh-rung); border-color: var(--xanh-rung); color: #fff; }
.chip .so-dem { font-size: calc(12.5px * var(--co-chu)); font-weight: 700; opacity: .75; }
.o-tim { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: #fff; border: 1px solid var(--vien-dam); border-radius: 12px; color: var(--chu-phu); min-width: 0; }
.o-tim input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--chu); }
.o-tim:focus-within { border-color: var(--xanh-rung); box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.o-quet-vong { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: #fff; border: 1.5px solid var(--xanh-rung); border-radius: 12px; color: var(--xanh-rung); min-width: 0; }
.o-quet-vong input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 700; color: var(--chu); letter-spacing: .02em; }
.o-quet-vong input::placeholder { font-weight: 500; color: var(--chu-phu); letter-spacing: 0; }
.nhan-tt { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: calc(12px * var(--co-chu)); font-weight: 700; white-space: nowrap; }
.nhan-tt.xam { background: #ECEAE3; color: #6B6557; }
.nhan-tt.vang { background: #FBEBC8; color: #7A4E05; }
.nhan-tt.xanh { background: #DCEFD9; color: #1F5A2B; }
.nhan-tt.do { background: #FDE6E3; color: var(--canh-bao); }
.nhan-tt.xanh-duong { background: #E2EBF5; color: #2B4C70; }
.nhan-tt.tim { background: #ECE6F6; color: #5B4A86; }
.nhan-tt.cam { background: #FBE3D6; color: #A9502E; }
.dang-tai-nho { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--chu-phu); font-size: calc(14px * var(--co-chu)); }
.xoay { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--vien-dam); border-top-color: var(--xanh-rung); animation: quay .8s linear infinite; }
@keyframes quay { to { transform: rotate(360deg); } }
.khung-trong, .khung-loi { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 32px 20px; color: var(--chu-phu); font-size: calc(14px * var(--co-chu)); }
.khung-trong b, .khung-loi b { color: var(--chu); font-size: calc(15px * var(--co-chu)); }
.khung-loi { color: var(--canh-bao); }
/* Logo hiện ngắn khi chuyển tab (web/app.js useLogoChuyenTab): nền xanh lá phủ vùng nội dung, logo trong hộp trắng như thanh bên, không chặn bấm */
.logo-chuyen { position: fixed; z-index: 35; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 42%, #3A7A43 0%, var(--xanh-rung) 52%, var(--xanh-dam) 135%); pointer-events: none; animation: logo-chuyen-nen .9s ease both; }
.logo-chuyen-the { background: #fff; border-radius: 20px; padding: 18px 28px; box-shadow: 0 12px 36px rgba(0, 0, 0, .22); animation: logo-chuyen-logo .9s cubic-bezier(.2, .8, .3, 1) both; }
.logo-chuyen-the img { display: block; width: min(200px, 46vw); height: auto; }
@keyframes logo-chuyen-nen { 0% { opacity: 0; } 16% { opacity: 1; } 74% { opacity: 1; } 100% { opacity: 0; } }
@keyframes logo-chuyen-logo { 0% { opacity: 0; transform: scale(.8); } 26% { opacity: 1; transform: scale(1); } 100% { opacity: 1; transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .logo-chuyen { display: none; } }
.khung-thong-bao { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.thong-bao { background: var(--xanh-dam); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; font-size: calc(14.5px * var(--co-chu)); box-shadow: 0 10px 28px rgba(17, 57, 23, .3); text-align: center; }
.thong-bao.loi { background: var(--canh-bao); }
@media (max-width: 767px) { .khung-thong-bao { bottom: 96px; } }

.lop-phu { position: fixed; inset: 0; z-index: 60; background: rgba(17, 32, 20, .48); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lop-phu.ben-phai { justify-content: flex-end; align-items: stretch; padding: 0; }
.hop-thoai { width: 100%; max-height: calc(100vh - 40px); background: #fff; border-radius: 18px; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.ngan-ben { width: var(--rong-ngan, 460px); max-width: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -16px 0 40px rgba(0, 0, 0, .2); animation: truot .18s ease-out; }
@keyframes truot { from { transform: translateX(40px); opacity: .4; } }
.hop-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #EEEAE0; }
.hop-dau h2 { margin: 0; font-size: calc(17px * var(--co-chu)); color: var(--xanh-dam); }
.hop-than { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; }
.hop-chan { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid #EEEAE0; }
.hop-chan > * { flex: 1; }
.noi-dung-xac-nhan { margin: 0; font-size: calc(15px * var(--co-chu)); line-height: 1.5; color: var(--chu); }
@media (max-width: 767px) {
  .lop-phu.ben-phai { align-items: flex-end; justify-content: stretch; }
  .ngan-ben { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: len-dt .2s ease-out; }
  @keyframes len-dt { from { transform: translateY(40px); opacity: .4; } }
  .hop-chan { padding-bottom: calc(16px + var(--an-toan-duoi)); }
}

.hang-chon { display: flex; flex-direction: column; gap: 8px; }
.hang-chon .nhan-o { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.hang-chon .nhan-o i { color: var(--canh-bao); font-style: normal; }
.luot-ngang { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.luot-ngang::-webkit-scrollbar { display: none; }
.hang-chon.co-loi .luot-ngang { outline: 1.5px solid #E3B4AE; outline-offset: 2px; border-radius: 12px; }
.loi-o { color: var(--canh-bao); font-size: calc(12.5px * var(--co-chu)); font-weight: 500; }
.o-nhap-nho { height: 42px; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: var(--ban-ghi); padding: 0 12px; font-size: 15px; width: 100%; }
.o-nhap-nho:focus { border-color: var(--xanh-rung); outline: none; background: #fff; }

/* Thanh trên: nút quay lại, nhãn trạng thái */
.thanh-tren .quay-lai { width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--chu); margin-left: -10px; flex: none; }
.thanh-tren .chip-tieu-de { margin-left: 4px; }
.tren-dt .quay-lai { width: 36px; height: 36px; border: 0; background: none; margin-left: -8px; display: inline-flex; align-items: center; justify-content: center; color: var(--chu); flex: none; }
.nut-icon .cham { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--cam); box-shadow: 0 0 0 2px var(--kem); }
.dai-mat-mang { position: fixed; top: 0; left: 0; right: 0; z-index: 95; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; background: var(--canh-bao); color: #fff; font-weight: 700; font-size: calc(14px * var(--co-chu)); text-align: center; }
.o-quet-vong .o-quet-ok { flex: none; height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--xanh-rung); color: #fff; font-weight: 700; font-size: 14px; }
.o-quet-vong .o-quet-ok:disabled { background: #D9D6CB; color: #fff; }
.o-quet-vong input::placeholder { font-size: 14px; }
