/* app.css — giao diện dùng chung: điện thoại nhân viên · máy quầy · chủ / quản lý.
 * Màu nhấn lấy theo công ty (js/common.js → applyBrand đặt --p, --p6, --p7, --p50, --p100, --p200, --on-p, --pt) — công ty đổi màu, cả giao diện đổi theo.
 * Không style nội tuyến (CSP style-src 'self'), không font / ảnh tải ngoài: dùng font hệ thống, biểu tượng SVG vẽ trong JS / data: URI. */

/* ================= 1. Biến thiết kế ================= */
:root {
  /* màu nhấn (mặc định khi chưa biết công ty) */
  --p: #0e7c86; --p6: #0b636b; --p7: #084a50; --p50: #e8f3f4; --p100: #cfe5e7; --p200: #9fcbcf; --on-p: #ffffff; --pt: #0b636b;
  /* nền + chữ */
  --bg: #f4f6f9; --card: #ffffff; --soft: #f8fafc; --hover: #f5f7fa;
  --t: #101828; --t2: #344054; --m: #5b6779; --m2: #98a2b3; --ink: #1d2939;
  --b: #e3e8ef; --b2: #eef1f5; --b3: #d0d7e2;
  /* trạng thái: chữ ≥ 4.5:1 trên nền tương ứng */
  --ok: #157347; --ok-bg: #e8f6ee; --ok-b: #bfe3cd;
  --warn: #8f5200; --warn-bg: #fff4e0; --warn-b: #f3d9a6;
  --bad: #b42318; --bad-bg: #fdeceb; --bad-b: #f4c7c2;
  --info: #1d5fbf; --info-bg: #eaf1fd; --info-b: #c9dbf7;
  /* hình khối */
  --r-xs: 6px; --r-sm: 9px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .03);
  --sh-3: 0 24px 48px -12px rgba(16, 24, 40, .22), 0 6px 14px -6px rgba(16, 24, 40, .1);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

/* ================= 2. Nền tảng ================= */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--t); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--t); letter-spacing: -.012em; }
h1 { font-size: 21px; line-height: 1.3; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 15.5px; line-height: 1.4; font-weight: 650; margin: 0 0 10px; }
p { margin: 10px 0; }
a { color: var(--pt); text-underline-offset: 2px; }
b, strong { font-weight: 650; }
code { font: 13px/1.5 var(--mono); background: var(--soft); border: 1px solid var(--b); border-radius: var(--r-xs); padding: 4px 8px; color: var(--t2); word-break: break-all; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--m); }
.muted.sm, .small { font-size: 13px; }
.small { color: var(--m); margin-top: 8px; line-height: 1.45; }
.small.bad { color: var(--bad); font-weight: 600; }
.mt { margin-top: 10px; }
.mono { font-family: var(--mono); font-size: 13.5px; color: var(--t2); }
.z { color: var(--m); }
b.ok { color: var(--ok); }
.nocode { color: var(--bad); font-weight: 600; }

/* ================= 3. Ô nhập ================= */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--t2); margin: 16px 0 7px; }
input, select, textarea { width: 100%; min-height: 44px; font: inherit; font-size: 15px; color: var(--t); background: #fff; border: 1px solid var(--b3); border-radius: var(--r-sm); padding: 10px 13px; box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b9c3d1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p100); }
input:disabled, select:disabled { background: var(--soft); color: var(--m); box-shadow: none; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: #6b7588; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer; background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6779' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; box-shadow: none; accent-color: var(--p); cursor: pointer; flex: none; }
input[type=color] { width: 64px; height: 44px; padding: 4px; cursor: pointer; }
input[type=file] { min-height: 0; padding: 7px; font-size: 13.5px; color: var(--m); border-style: dashed; box-shadow: none; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--t2); background: #fff; border: 1px solid var(--b3); border-radius: 7px; padding: 6px 12px; margin-right: 10px; cursor: pointer; }
input[type=date], input[type=time], input[type=month] { font-variant-numeric: tabular-nums; }
.chk { display: flex; gap: 11px; align-items: flex-start; margin: 12px 0 4px; font-size: 15px; font-weight: 500; color: var(--t); cursor: pointer; line-height: 1.45; }
.chk input { margin-top: 1px; }
.chk.big-chk { background: var(--soft); border: 1px solid var(--b); border-radius: var(--r); padding: 14px; margin-top: 14px; }
.chks { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 6px 0 4px; }

/* ================= 4. Nút ================= */
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--b3); border-radius: var(--r-sm); background: #fff; color: var(--t2); font-size: 14.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; box-shadow: var(--sh-1); transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--hover); border-color: #b9c3d1; color: var(--t); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.pri { background: var(--p); border-color: var(--p); color: var(--on-p); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.btn.pri:hover { background: var(--p6); border-color: var(--p6); color: var(--on-p); }
.btn.bad { color: var(--bad); border-color: var(--bad-b); }
.btn.bad:hover { background: var(--bad-bg); border-color: #eeaaa3; color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--m); }
.btn.ghost:hover { background: var(--hover); color: var(--t); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; gap: 6px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.xs { min-height: 28px; min-width: 34px; padding: 3px 8px; font-size: 12.5px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.full { display: flex; width: 100%; min-height: 52px; margin-top: 18px; border-radius: var(--r); font-size: 16px; }
.btn.full + .btn.full { margin-top: 10px; }
.btn.full:not(.pri) { background: transparent; box-shadow: none; }
.btn.full:not(.pri):hover { background: #fff; }
.link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 4px; background: none; border: 0; color: var(--pt); font-weight: 600; font-size: 14.5px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ic { width: 18px; height: 18px; }

/* ================= 5. Nhãn trạng thái + thông báo ================= */
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--b); background: var(--soft); color: var(--t2); font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.b-green { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-b); }
.b-amber { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-b); }
.b-red { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-b); }
.b-blue { background: var(--info-bg); color: var(--info); border-color: var(--info-b); }
.badge.lnk { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.badge.lnk:hover { filter: brightness(.97); text-decoration: underline; text-underline-offset: 2px; }
.err, .okmsg, .warnbox { display: flex; gap: 10px; align-items: flex-start; border: 1px solid; border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px; line-height: 1.45; font-weight: 500; }
.err::before, .okmsg::before, .warnbox::before { content: ""; width: 18px; height: 18px; flex: none; margin-top: 1px; background: currentColor; -webkit-mask: var(--mi) center / contain no-repeat; mask: var(--mi) center / contain no-repeat; }
.err { --mi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E"); background: var(--bad-bg); color: var(--bad); border-color: var(--bad-b); margin-top: 14px; }
.okmsg { --mi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.4l2.6 2.6L16 9.6'/%3E%3C/svg%3E"); background: var(--ok-bg); color: var(--ok); border-color: var(--ok-b); margin-top: 14px; }
.warnbox { --mi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l9.5 16.5h-19z'/%3E%3Cpath d='M12 10v4M12 17.2v.01'/%3E%3C/svg%3E"); background: var(--warn-bg); color: var(--warn); border-color: var(--warn-b); margin-bottom: 14px; }
.warnbox.sm { padding: 8px 11px; margin: 4px 0; font-size: 13.5px; }
.warnbox.sm::before { width: 16px; height: 16px; }

/* ================= 6. Khối dùng chung ================= */
.card { background: var(--card); border: 1px solid var(--b); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--sh-2); }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-hd h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; }
.card-hd h3 .ic { width: 20px; height: 20px; color: var(--pt); }
.card-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13.5px; color: var(--m); }
.card-sub .ic { width: 15px; height: 15px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; color: var(--m); text-align: center; font-size: 14.5px; }
.empty .ic { width: 36px; height: 36px; padding: 8px; box-sizing: content-box; border-radius: 50%; background: var(--soft); color: var(--m2); }
.loading { display: flex; align-items: center; gap: 10px; }
.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--b); border-top-color: var(--p); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img, .brand .ph { width: 44px; height: 44px; flex: none; border-radius: 12px; }
.brand img { object-fit: contain; background: #fff; border: 1px solid var(--b); box-shadow: var(--sh-1); }
.brand .ph { display: flex; align-items: center; justify-content: center; background: var(--p); color: var(--on-p); font-size: 19px; font-weight: 700; box-shadow: var(--sh-1); }
.brand .ph .ic { width: 24px; height: 24px; }
.brand-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-tx b { font-size: 16.5px; font-weight: 700; color: var(--t); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tx span { margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--p50); color: var(--pt); border: 1px solid var(--p100); font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.av.sm { width: 34px; height: 34px; font-size: 12.5px; }
.secret { font: 700 21px/1.35 var(--mono); background: var(--p50); color: var(--t); border: 1px dashed var(--p200); border-radius: var(--r); padding: 16px; text-align: center; word-break: break-all; letter-spacing: 1px; user-select: all; }
.pre { white-space: pre-wrap; font: 13px/1.45 var(--mono); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: var(--sh-3); animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Hộp thoại */
.mod-bg { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 7vh 16px 32px; background: rgba(16, 24, 40, .48); animation: fade .15s ease-out; }
.mod { width: 100%; max-width: 520px; background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-3); animation: pop .18s ease-out; }
.mod.lg { max-width: 820px; }
.mod h2 { font-size: 18px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--b2); }
.mod .mb > p:first-child { margin-top: 0; }
.mod .bt { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--b2); }
.mod .bt .btn { min-width: 96px; }
.mod img.shot { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--r); border: 1px solid var(--b); }
.mod ul { margin: 0; padding-left: 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* ================= 7. Điện thoại nhân viên ================= */
.wrap { max-width: 460px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.wrap .brand { margin: 2px 2px 18px; }
.wrap.auth { max-width: 440px; padding-top: max(40px, 9vh); }
.wrap.auth .brand { justify-content: center; margin-bottom: 22px; }
.wrap.auth .brand img, .wrap.auth .brand .ph { width: 52px; height: 52px; border-radius: 14px; }
.wrap.auth .brand-tx b { font-size: 19px; }
.card.form { padding: 24px 20px; }
.card.form > h1:first-child { margin-bottom: 2px; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.form-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--p50); color: var(--pt); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.form-ic .ic { width: 26px; height: 26px; }
/* người dùng */
.who { padding: 16px 18px; }
.who-row { display: flex; align-items: center; gap: 14px; }
.who-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who-tx b { font-size: 17.5px; font-weight: 700; letter-spacing: -.01em; }
.who-tx span { font-size: 14px; color: var(--m); margin-top: 2px; }
.who label { margin-top: 14px; }
/* đồng hồ + nút lớn */
.hero { padding: 26px 20px 22px; text-align: center; }
.clock { font-size: 62px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--t); }
.clock .sec { font-size: .46em; font-weight: 600; letter-spacing: 0; color: #7a8599; margin-left: 2px; }
.date { margin-top: 8px; color: var(--m); font-size: 15px; font-weight: 500; }
.wifi-w { display: flex; justify-content: center; margin-top: 16px; }
.wifi { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid; font-size: 14.5px; font-weight: 600; }
.wifi .ic { width: 18px; height: 18px; }
.wifi.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-b); }
.wifi.pending { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-b); }
.wifi.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-b); }
.hero .warnbox { margin: 14px 0 0; text-align: left; }
.big { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 108px; margin-top: 20px; padding: 18px 20px; border: 0; border-radius: var(--r-xl); background: var(--p); color: var(--on-p); font-size: 25px; font-weight: 700; letter-spacing: -.01em; box-shadow: 0 14px 28px -14px var(--p), 0 2px 4px rgba(16, 24, 40, .08); transition: transform .12s, box-shadow .15s, background .15s; }
.big:hover { background: var(--p6); }
.big:active { transform: scale(.985); }
.big-ic { width: 52px; height: 52px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .18); }
.big-ic .ic { width: 28px; height: 28px; stroke-width: 2; }
.big.out { background: var(--ink); color: #fff; box-shadow: 0 14px 28px -14px rgba(16, 24, 40, .7), 0 2px 4px rgba(16, 24, 40, .08); }
.big.out:hover { background: #101828; }
.big:disabled { opacity: .55; box-shadow: none; cursor: progress; }
.done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0 6px; color: var(--ok); font-size: 17px; font-weight: 700; text-align: center; }
.done .ic { width: 46px; height: 46px; padding: 6px; box-sizing: content-box; border-radius: 50%; background: var(--ok-bg); }
/* lượt bấm hôm nay */
.list { padding: 6px 18px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--b2); }
.row:last-child { border-bottom: 0; }
.row-l { display: flex; align-items: center; gap: 12px; color: var(--t2); font-weight: 500; }
.row-r, .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--t); }
.tl { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--p); box-shadow: 0 0 0 4px var(--p50); }
.tl.out { background: var(--ink); box-shadow: 0 0 0 4px var(--b2); }
.month { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; color: var(--m); font-size: 14px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--b); color: var(--t2); }
.pill b { color: var(--t); font-variant-numeric: tabular-nums; }
/* menu Xin bổ sung / Xin nghỉ */
.menu { padding: 4px 0; overflow: hidden; }
.menu-it { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 18px; border: 0; background: none; text-align: left; color: var(--t); font-size: 15.5px; font-weight: 600; transition: background .15s; }
.menu-it + .menu-it { border-top: 1px solid var(--b2); }
.menu-it:hover { background: var(--hover); }
.mi-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--p50); color: var(--pt); }
.mi-ic .ic { width: 22px; height: 22px; }
.mi-tx { flex: 1; min-width: 0; }
.menu-it .chev { width: 18px; height: 18px; color: var(--m2); }
.out-link { display: flex; justify-content: center; width: 100%; margin-top: 4px; color: var(--m); }
.out-link:hover { color: var(--bad); text-decoration: none; }
.links { display: flex; justify-content: space-between; flex-wrap: wrap; }
/* biểu mẫu xin nghỉ */
.hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hd h1 { margin: 0; }
.pill-link { min-height: 36px; padding: 6px 13px; border-radius: 999px; background: var(--p50); border: 1px solid var(--p100); font-size: 13.5px; white-space: nowrap; }
.pill-link:hover { text-decoration: none; background: var(--p100); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chip { min-height: 48px; padding: 8px 10px; border: 1px solid var(--b3); border-radius: var(--r-sm); background: #fff; color: var(--t2); font-size: 14.5px; font-weight: 600; line-height: 1.25; text-align: center; box-shadow: var(--sh-1); transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: #b9c3d1; background: var(--hover); }
.chip.on { background: var(--p50); border-color: var(--p); color: var(--pt); box-shadow: inset 0 0 0 1px var(--p); }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 6px 0; }
.pic { position: relative; display: block; aspect-ratio: 1 / 1; min-height: 92px; padding: 0; overflow: hidden; border: 1px solid var(--b); border-radius: var(--r); background: var(--soft); box-shadow: var(--sh-1); }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
button.pic:hover img, a.pic:hover img { transform: scale(1.04); }
.pic .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(16, 24, 40, .62); color: #fff; }
.pic .x .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.pic.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--p200); background: var(--p50); color: var(--pt); box-shadow: none; }
.pic.add .ic { width: 26px; height: 26px; }
.pic.add span { font-size: 12px; font-weight: 600; line-height: 1.25; padding: 0 6px; text-align: center; }
/* đơn nghỉ (điện thoại + quản trị) */
.lvi, .lvc { display: flex; flex-direction: column; gap: 5px; padding: 16px 0; border-top: 1px solid var(--b2); font-size: 14.5px; }
.card.form .lvi:first-of-type { margin-top: 10px; }
.mod .lvc { border-top: 0; padding-top: 0; }
.lvh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-day { color: var(--t2); }
.lvh .lv-day { color: var(--t); font-size: 15px; }
.lv-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 4px; }
.lv-name b { font-size: 15.5px; }
.lv-name span { color: var(--m); font-size: 13.5px; }
.lvt { font-size: 13.5px; font-weight: 600; }
.lvt.ok { color: var(--ok); }
.lvt.bad { color: var(--bad); }
.lvb { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.lvb .btn.on { outline: 2px solid var(--t); outline-offset: 2px; }

/* Màn chụp ảnh */
.cam { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); background: #0b1220; color: #fff; }
.cam-in { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cam-frame { position: relative; width: min(100%, 360px); height: min(64vh, 480px); overflow: hidden; border-radius: 28px; background: #111827; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 60px rgba(0, 0, 0, .5); }
@supports (aspect-ratio: 1 / 1) { .cam-frame { height: auto; max-height: 66vh; aspect-ratio: 3 / 4; } }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: #111827; }
.cam-oval { position: absolute; left: 15%; right: 15%; top: 11%; bottom: 15%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 999px rgba(11, 18, 32, .42); pointer-events: none; }
.cam .cnt { min-height: 30px; padding: 0 8px; font-size: 19px; font-weight: 600; text-align: center; letter-spacing: .01em; }
.cam #camx { min-width: 150px; min-height: 48px; padding: 10px 28px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; font-size: 16px; font-weight: 600; }
.cam #camx:hover { background: rgba(255, 255, 255, .16); }

/* ================= 8. Máy quầy ================= */
.wrap.wide { max-width: 760px; padding-top: 32px; }
.pg-counter .brand { justify-content: center; margin-bottom: 22px; }
.counter-box { padding: 56px 24px 46px; text-align: center; }
.counter-box .clock { font-size: clamp(76px, 13vw, 140px); }
.counter-box .date { font-size: 19px; margin-top: 10px; }
.state { display: inline-flex; align-items: center; gap: 11px; margin: 26px 0 12px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--ok-b); background: var(--ok-bg); color: var(--ok); font-size: 18px; font-weight: 700; }
.state.off { border-color: var(--bad-b); background: var(--bad-bg); color: var(--bad); }
.counter-box .last { font-size: 14.5px; }
.dot { position: relative; display: inline-block; width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--ok); }
.dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: ping 2s ease-out infinite; }
.dot.off { background: var(--bad); }
.dot.off::after { border-color: var(--bad); }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* ================= 9. Quản trị (chủ / quản lý) ================= */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--b); box-shadow: 0 1px 0 rgba(16, 24, 40, .02); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top .brand img, .top .brand .ph { width: 42px; height: 42px; border-radius: 11px; }
.who2 { display: flex; align-items: center; gap: 10px; flex: none; }
.user { display: flex; align-items: center; gap: 10px; padding-right: 12px; border-right: 1px solid var(--b); }
.user .av { width: 36px; height: 36px; font-size: 13px; }
.user-tx { display: flex; flex-direction: column; line-height: 1.25; }
.user-tx b { font-size: 14px; }
.user-tx span { font-size: 12.5px; color: var(--m); }
.nav { border-top: 1px solid var(--b2); }
.nav-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--m); font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: color .15s, border-color .15s; }
.tab .ic { width: 18px; height: 18px; }
.tab:hover { color: var(--t); }
.tab.on { color: var(--pt); border-bottom-color: var(--p); }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 64px; }
.ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ctl select, .ctl input { width: auto; }
.ctl select { min-width: 170px; }
.ctl .sp { flex: 1; }
.ctl.end { justify-content: flex-end; margin: 20px 0 0; }
.ctl.bar { margin-bottom: 20px; }
/* ô số liệu */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px; background: #fff; border: 1px solid var(--b); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.stat-ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--p50); color: var(--pt); }
.stat-ic .ic { width: 21px; height: 21px; }
.stat-tx { display: flex; flex-direction: column; min-width: 0; }
.stat-tx > span { font-size: 13px; font-weight: 600; color: var(--m); }
.stat-tx b { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--t); }
.stat-tx small { margin-top: 3px; font-size: 12.5px; color: var(--m); font-variant-numeric: tabular-nums; }
.stat.ok .stat-ic { background: var(--ok-bg); color: var(--ok); }
.stat.ok b { color: var(--ok); }
.stat.warn .stat-ic { background: var(--warn-bg); color: var(--warn); }
.stat.warn b { color: var(--warn); }
.stat.bad { border-color: var(--bad-b); }
.stat.bad .stat-ic { background: var(--bad-bg); color: var(--bad); }
.stat.bad b { color: var(--bad); }
/* bảng */
.card.tbl { padding: 0; overflow: hidden; }
.card.tbl > .card-hd { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--b); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tw.inset { border: 1px solid var(--b); border-radius: var(--r); margin-top: 4px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.t th { padding: 11px 16px; background: var(--soft); border-bottom: 1px solid var(--b); text-align: left; vertical-align: bottom; font-size: 12.5px; font-weight: 600; color: var(--m); white-space: nowrap; }
.t td { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--b2); vertical-align: middle; white-space: nowrap; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .lb { white-space: normal; min-width: 180px; }
.t .r { text-align: right; font-variant-numeric: tabular-nums; }
.t td.strong { font-weight: 700; }
.t td.code { font-family: var(--mono); font-size: 13.5px; color: var(--t2); }
.t th.chev, .t td.chev { width: 36px; padding-left: 0; padding-right: 14px; color: var(--m2); }
.t td.chev .ic { width: 18px; height: 18px; }
.t tr.red td { background: #fff7f6; }
.t tr.red td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.t tr.clk { cursor: pointer; }
.t tr.clk:hover td { background: var(--p50); }
.t tr.clk:hover td.chev { color: var(--pt); }
.t tr.off td { color: var(--m); }
.t.mon th.r { white-space: normal; min-width: 76px; line-height: 1.3; }
.t.day td.nm, .t.day th:first-child { position: sticky; left: 0; z-index: 1; }
.t.day td.nm { min-width: 210px; }
.t.users th, .t.users td { padding-left: 14px; padding-right: 14px; }
.t.users .lb { min-width: 0; }
.t td.acts { text-align: right; }
.row-acts { display: flex; justify-content: flex-end; gap: 6px; }
.bdg { display: flex; flex-wrap: wrap; gap: 5px; }
.shots { display: flex; gap: 5px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-tx b { font-weight: 650; color: var(--t); }
.person-tx span { font-size: 12.5px; color: var(--m); }
.tbtn { display: inline-flex; align-items: center; gap: 4px; min-width: 66px; min-height: 34px; padding: 4px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--t); transition: background .15s, border-color .15s; }
.tbtn:hover { background: var(--p50); border-color: var(--p100); }
.tbtn.none { color: var(--m); font-weight: 500; }
.w { color: var(--warn); font-size: 10px; }
.ed { color: var(--pt); font-size: 12px; }
/* Cần xử lý */
.todo { padding: 0; overflow: hidden; }
.todo > .card-hd { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--b); background: #fff; }
.count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--bad); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-bd { padding: 0 20px 4px; }
.lv-grid > .lvc:first-child, .it-list > .it:first-child { border-top: 0; }
.lv-grid + .it-list { border-top: 1px solid var(--b2); }
.todo .it { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--b2); }
.it-main { flex: 1 1 300px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--t2); }
.it-tx b { color: var(--t); }
.it-act { display: flex; flex-wrap: wrap; gap: 6px; }
/* lịch tháng từng người */
.grid { width: calc(100% + 12px); margin: -6px; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.grid th { padding: 2px 0 4px; font-size: 12px; font-weight: 600; color: var(--m); text-align: center; }
.g { position: relative; height: 66px; padding: 18px 2px 4px; border: 1px solid var(--b); border-radius: 11px; background: #fff; text-align: center; vertical-align: middle; transition: border-color .15s, box-shadow .15s; }
.g[data-cell] { cursor: pointer; }
.g[data-cell]:hover { border-color: var(--p); box-shadow: 0 0 0 3px var(--p50); }
.g small { position: absolute; top: 5px; left: 8px; font-size: 11.5px; font-weight: 600; color: var(--m); font-variant-numeric: tabular-nums; }
.g b { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 6px; border-radius: 8px; font-size: 17px; font-weight: 700; line-height: 1; }
.g b:empty { display: none; }
.g.sun { background: var(--soft); }
.g.today { border-color: var(--p); box-shadow: inset 0 0 0 1px var(--p); }
.g.today small { color: var(--pt); }
.g.edit { border-color: #e2a84a; box-shadow: inset 0 0 0 1px #e2a84a; }
.g.unc { background: var(--bad-bg); border-color: var(--bad-b); }
.s3, .sP { color: var(--ok); background: var(--ok-bg); }
.s2 { color: var(--pt); background: var(--p50); }
.s1, .sW { color: var(--warn); background: var(--warn-bg); }
.sK { color: var(--bad); background: var(--bad-bg); }
.lvx { font-style: normal; font-size: 10.5px; font-weight: 700; vertical-align: top; margin-left: 2px; }
.lvx.p { color: var(--ok); }
.lvx.k { color: var(--bad); }
.lvx.w { color: var(--warn); }
.gsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.gsum > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--b2); }
.gsum span { font-size: 12.5px; font-weight: 600; color: var(--m); }
.gsum b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gsum-w { margin-top: 10px; }
/* cài đặt */
.subtabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin-bottom: 20px; border-radius: var(--r); background: #e9edf2; }
.subtabs .tab { min-height: 36px; padding: 0 16px; margin: 0; border: 0; border-radius: 9px; font-size: 14px; }
.subtabs .tab.on { background: #fff; color: var(--t); box-shadow: var(--sh-2); }
.cfgcard { padding: 22px 24px; }
.cfgcard > .card-hd { padding-bottom: 14px; border-bottom: 1px solid var(--b2); margin-bottom: 4px; }
.fg { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
.fg .full { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--b2); }
.kv > span:first-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--t2); font-size: 14px; }
.kv > span:first-child .ic { width: 18px; height: 18px; color: var(--m); }
.kv code { justify-self: start; grid-column: 2 / -1; }
.kv-v { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.kv-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--t2); }
.kv-act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.logo-row { grid-template-columns: 140px minmax(0, 1fr); }
.logo-ed { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-act input[type=file] { width: auto; }
.logo-pv { width: 72px; height: 72px; flex: none; object-fit: contain; border: 1px solid var(--b); border-radius: 14px; background: #fff; box-shadow: var(--sh-1); }
.logo-pv.empty { display: inline-flex; align-items: center; justify-content: center; color: var(--m2); background: var(--soft); border-style: dashed; box-shadow: none; }
.logo-pv.empty .ic { width: 28px; height: 28px; }
.shifts { margin-top: 10px; }
.sh { display: grid; grid-template-columns: 120px 304px 304px; align-items: center; gap: 10px 28px; padding: 8px 0; }
.sh > b { font-weight: 600; color: var(--t2); font-size: 14px; }
.sh-hd { padding: 4px 0 0; }
.sh-hd span { font-size: 12.5px; font-weight: 600; color: var(--m); }
.rg { display: inline-flex; align-items: center; gap: 8px; }
.rg i { font-style: normal; color: var(--m2); }
.rg input[type=time] { width: 138px; }
.rg input[type=date] { width: 168px; }
.sh.apply { padding-top: 12px; }
.sh.apply .rg { grid-column: 2 / -1; }
.apply-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--b2); }
.apply-row b { font-weight: 600; color: var(--t2); font-size: 14px; }
.apply-row input { width: 170px; }
.roster .ctl { margin-bottom: 4px; }
.note { margin: -4px 4px 16px; font-size: 13.5px; }

/* ================= 10. Màn rộng / hẹp ================= */
@media (min-width: 1000px) {
  .todo-bd { padding: 18px 20px 6px; }
  .lv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .lv-grid > .lvc { border: 1px solid var(--b); border-radius: var(--r); padding: 14px 16px 16px; background: #fff; }
  .lv-grid + .it-list { margin-top: 16px; }
  .lv-grid .pics { grid-template-columns: repeat(auto-fill, 76px); }
  .lv-grid .pic { min-height: 76px; }
}
@media (max-width: 720px) {
  .kv, .logo-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kv code { grid-column: auto; }
  .kv-act { justify-content: flex-start; }
  .sh { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sh-hd { display: none; }
  .rg { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
  .top-in { padding: 10px 14px; gap: 10px; }
  .top .brand img, .top .brand .ph { width: 38px; height: 38px; }
  .top .brand-tx b { font-size: 15px; }
  .user { padding-right: 0; border-right: 0; }
  .user-tx, .hide-sm { display: none; }
  .nav-in { padding: 0 6px; }
  .tab { padding: 0 11px; font-size: 14px; }
  .tab .ic { display: none; }
  .page { padding: 16px 12px 48px; }
  .card { padding: 16px; border-radius: 14px; }
  .card.tbl > .card-hd, .todo > .card-hd { padding: 14px 16px; }
  .todo-bd { padding: 0 16px 4px; }
  .cfgcard { padding: 18px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat-ic { width: 34px; height: 34px; border-radius: 10px; }
  .stat-ic .ic { width: 18px; height: 18px; }
  .stat-tx b { font-size: 22px; }
  .ctl select, .ctl input { flex: 1 1 140px; min-width: 0; }
  .ctl .sp { display: none; }
  .t th, .t td { padding: 10px 12px; }
  .t.day td.nm { min-width: 168px; }
  .t.day .person .av { display: none; }
  .mod-bg { padding: 16px 10px 24px; }
  .mod { padding: 18px 16px; }
  .grid { border-spacing: 3px; margin: -3px; width: calc(100% + 6px); }
  .g { height: 56px; padding-top: 16px; border-radius: 8px; }
  .g small { top: 3px; left: 5px; font-size: 10.5px; }
  .g b { min-width: 26px; height: 26px; font-size: 15px; padding: 0 4px; }
  .gsum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter-box { padding: 40px 12px 34px; }
}
@media (max-width: 380px) {
  .clock { font-size: 54px; }
  .big { font-size: 22px; min-height: 100px; }
  .big-ic { width: 46px; height: 46px; }
  .chip { font-size: 14px; padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .top, .nav, .ctl, .btn, .mod .bt, .stats { display: none !important; }
  .card { box-shadow: none; }
}
