:root {
  --pri: #15a34a; --pri-d: #0f7a37; --pri-l: #e8f7ee; --pri-ll: #f3fbf6;
  --side: #0f5132; --side-2: #136c42; --side-t: #d8f3e3;
  --bg: #f3f5f7; --card: #fff; --line: #e5e8ec; --line-2: #eef1f4;
  --tx: #1d2530; --tx-2: #5b6574; --tx-3: #8b95a3;
  --red: #e5484d; --red-l: #fdecec; --orange: #f59e0b; --orange-l: #fff6e0;
  --blue: #2f7de1; --blue-l: #e9f2fd; --violet: #7c5ce0; --violet-l: #f1edfd;
  --r: 10px; --sh: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --sh-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --side-w: 248px; --top-h: 58px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--pri-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hide { display: none !important; }
.muted { color: var(--tx-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
svg { flex: none; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-s { gap: 6px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Khung ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; background: linear-gradient(180deg, var(--side), #0b3f27);
  color: var(--side-t); position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; height: var(--top-h); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: grid; place-items: center; color: var(--pri); font-weight: 800; overflow: hidden; flex: none; }
.side-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side-brand b { color: #fff; font-size: 15px; line-height: 1.2; display: block; }
.side-brand span { font-size: 11.5px; opacity: .7; }
.side-nav { overflow-y: auto; padding: 8px 8px 24px; flex: 1; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }
.nav-g > .nav-h, .nav-a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-t);
  cursor: pointer; user-select: none; font-weight: 500; text-decoration: none !important;
}
.nav-g > .nav-h:hover, .nav-a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-a.on { background: var(--pri); color: #fff; }
.nav-ic { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-h .chev { margin-left: auto; transition: transform .2s; opacity: .6; width: 14px; height: 14px; }
.nav-g.open > .nav-h .chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 4px 18px; }
.nav-g.open > .nav-sub { display: block; }
.nav-sub .nav-a { font-weight: 400; padding: 7px 12px; font-size: 13.5px; }
.nav-sub .nav-t { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .5; padding: 8px 12px 2px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.top {
  height: var(--top-h); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.top .burger { display: none; }
.top-title { font-weight: 600; font-size: 15px; }
.top-sp { flex: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; overflow: hidden; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.user-chip:hover { background: var(--bg); }
.user-chip .nm { font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 20px; max-width: 1480px; width: 100%; margin: 0 auto; }
.crumb { color: var(--tx-3); font-size: 13px; margin-bottom: 4px; }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 { font-size: 22px; font-weight: 700; }
.page-h .sp { flex: 1; }
.scrim { display: none; }
.demo-bar { background: #fff4d6; color: #7a5200; font-size: 12.5px; padding: 6px 20px; text-align: center; border-bottom: 1px solid #f3dd9c; }

/* ---------- Thẻ, nút, form ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-b { padding: 18px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h h3 { font-size: 15.5px; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s; text-decoration: none !important; color: var(--tx);
}
.btn:hover { border-color: var(--pri); color: var(--pri-d); }
.btn svg { width: 16px; height: 16px; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-d); border-color: var(--pri-d); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-l); }
.btn.pri.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.pri.danger:hover { background: #c22b30; border-color: #c22b30; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; }
.btn.icon { width: 34px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }

.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > label { font-size: 13px; font-weight: 500; color: var(--tx-2); }
.f > label .req { color: var(--red); }
.f .hint { font-size: 12px; color: var(--tx-3); }
.inp, select.inp, textarea.inp {
  height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea.inp { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.inp:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(21, 163, 74, .14); }
.inp.sm { height: 32px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; accent-color: var(--pri); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd5dc; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--pri); }
.switch input:checked + span::after { transform: translateX(16px); }
.multi { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; min-height: 38px; max-height: 160px; overflow: auto; }
.multi label { display: inline-flex; gap: 5px; align-items: center; background: var(--bg); border-radius: 6px; padding: 3px 8px; font-size: 13px; cursor: pointer; }
.multi input { accent-color: var(--pri); }

/* ---------- Bộ lọc, bảng ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.toolbar .inp { width: auto; min-width: 150px; height: 34px; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 340px; }
.toolbar .tb-f { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.toolbar .tb-f > span { white-space: nowrap; }
.tbl-wrap { overflow: auto; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--tx-2); background: #f8fafb; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; font-size: 13px;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl th.right, .tbl td.right, .ts th.right, .ts td.right { text-align: right; }
.tbl th.center, .tbl td.center { text-align: center; }
.tbl tbody tr:hover td { background: #fafcfb; }
.tbl tr.click { cursor: pointer; }
.tbl .acts { white-space: nowrap; text-align: right; width: 1%; }
.tbl .acts .btn { margin-left: 4px; }
.empty { padding: 40px 16px; text-align: center; color: var(--tx-3); }
.empty svg { width: 44px; height: 44px; opacity: .35; display: block; margin: 0 auto 8px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 10px 14px; color: var(--tx-2); font-size: 13px; flex-wrap: wrap; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--tx-2); white-space: nowrap; }
.tag.green { background: var(--pri-l); color: var(--pri-d); }
.tag.red { background: var(--red-l); color: #c22b30; }
.tag.orange { background: var(--orange-l); color: #a86a00; }
.tag.blue { background: var(--blue-l); color: #1e5fb4; }
.tag.violet { background: var(--violet-l); color: #5b3fc0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--tx-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; text-decoration: none !important; }
.tabs a:hover { color: var(--pri-d); }
.tabs a.on { color: var(--pri-d); border-bottom-color: var(--pri); }

/* ---------- Thống kê ---------- */
.stat { padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 22px; height: 22px; }
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--tx-2); font-size: 13px; }
.c-green { background: var(--pri-l); color: var(--pri-d); }
.c-red { background: var(--red-l); color: var(--red); }
.c-orange { background: var(--orange-l); color: #c27c00; }
.c-blue { background: var(--blue-l); color: var(--blue); }
.c-violet { background: var(--violet-l); color: var(--violet); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--pri); border-radius: 6px; }
.chart { width: 100%; height: 220px; }

/* ---------- Modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: var(--sh-lg); animation: pop .18s ease; }
.modal.lg { max-width: 900px; }
.modal.sm { max-width: 440px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* form dài: phần thân tự cuộn, tiêu đề và nút Lưu/Huỷ luôn nằm trong màn hình */
@media (min-width: 769px) {
  .modal { max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
  .modal-b { overflow-y: auto; min-height: 0; }
  .modal-h, .modal-f { flex: none; }
  .sheet-grip { display: none; }
  /* nút thao tác của bảng luôn trong tầm nhìn khi bảng phải cuộn ngang */
  .tbl td.acts, .tbl th.acts { position: sticky; right: 0; background: var(--card); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
  .tbl thead th.acts { background: #f8fafb; }
  /* hàng nút của thanh công cụ luôn dồn phải, kể cả khi xuống dòng */
  .toolbar > .grow + .btn, .toolbar > .grow + #selInfo + .btn { margin-left: auto; }
}
.sheet-grip { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: #1d2530; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--sh-lg); font-size: 13.5px; animation: pop .2s; max-width: 380px; }
.toast.ok { background: var(--pri-d); }
.toast.err { background: #b42318; }
.spin { width: 18px; height: 18px; border: 2px solid rgba(0, 0, 0, .12); border-top-color: var(--pri); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
.btn .spin { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.btn.pri .spin { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { padding: 60px; display: grid; place-items: center; }

/* ---------- Đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-l { background: linear-gradient(150deg, #15a34a, #0b5a30); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-l::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .06); right: -200px; bottom: -200px; }
.auth-l h1 { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.auth-l p { opacity: .85; font-size: 16px; max-width: 420px; }
.auth-l ul { padding-left: 18px; opacity: .9; line-height: 1.9; }
.auth-r { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }

/* ---------- Màn hình chấm công nhân viên ---------- */
.ck-hero { background: linear-gradient(140deg, #15a34a, #0e6e37); color: #fff; border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.ck-hero .clock { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ck-hero .date { opacity: .85; margin-top: 4px; }
.ck-btn {
  width: 168px; height: 168px; border-radius: 50%; border: 0; background: #fff; color: var(--pri-d); font-weight: 700;
  font-size: 17px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .18), 0 0 0 22px rgba(255, 255, 255, .08); margin: 26px auto 10px; transition: transform .15s;
}
.ck-btn:active { transform: scale(.96); }
.ck-btn svg { width: 40px; height: 40px; }
.ck-btn.out { color: #c2410c; }
.ck-meta { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 13px; opacity: .92; }
.ck-meta b { display: block; font-size: 16px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pri); margin-top: 6px; flex: none; }
.tl-dot.out { background: var(--orange); }
.greet { background: var(--pri-ll); border: 1px dashed #9edcb5; border-radius: 12px; padding: 12px 14px; color: var(--pri-d); }

/* ---------- Bảng công ---------- */
.ts td, .ts th { padding: 6px 6px; text-align: center; font-size: 12.5px; }
.ts th.nm, .ts td.nm { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 170px; border-right: 1px solid var(--line); }
.ts th.nm { background: #f8fafb; z-index: 3; }
.ts th.we { color: var(--red); }
.ts th.today { background: var(--pri-l); color: var(--pri-d); }
.cell { display: inline-flex; min-width: 30px; height: 24px; align-items: center; justify-content: center; border-radius: 5px; font-weight: 600; font-size: 11.5px; padding: 0 4px; cursor: default; }
.cell.X { background: var(--pri-l); color: var(--pri-d); }
.cell.M, .cell.S, .cell.MS { background: var(--orange-l); color: #a86a00; }
.cell.V, .cell.KR { background: var(--red-l); color: #c22b30; }
.cell.P, .cell.L, .cell.CT, .cell.WFH { background: var(--blue-l); color: #1e5fb4; }
.cell.KL { background: var(--violet-l); color: #5b3fc0; }
.cell.OFF { color: var(--tx-3); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx-2); }

/* ---------- Lịch tuần (phòng họp / lịch làm việc) ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; }
.day-col { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 160px; display: flex; flex-direction: column; }
.day-col .dh { padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; }
.day-col.today .dh { color: var(--pri-d); background: var(--pri-ll); border-radius: 10px 10px 0 0; }
.day-col .db { padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.ev { background: var(--blue-l); border-left: 3px solid var(--blue); border-radius: 6px; padding: 5px 7px; font-size: 12.5px; cursor: pointer; }
.ev b { display: block; font-size: 12.5px; }

/* ---------- Cây nhân sự ---------- */
.org { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.org > *, .grid > *, .col > * { min-width: 0; }
.tree { padding: 8px; }
.tree-n { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.tree-n:hover { background: var(--bg); }
.tree-n.on { background: var(--pri-l); color: var(--pri-d); font-weight: 600; }
.tree-n .cnt { margin-left: auto; font-size: 12px; color: var(--tx-3); }
.tree-c { padding-left: 16px; border-left: 1px dashed var(--line); margin-left: 12px; }

/* ---------- Bản tin ---------- */
.post { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.post:last-child { border-bottom: 0; }
.post-c { white-space: pre-wrap; margin-top: 10px; }
.post img.ph { border-radius: 10px; margin-top: 10px; max-height: 360px; object-fit: cover; }

/* ---------- Kiosk QR ---------- */
.kiosk { min-height: 100vh; background: linear-gradient(150deg, #15a34a, #0b5a30); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 14px; }
.kiosk .qr { background: #fff; padding: 18px; border-radius: 18px; box-shadow: var(--sh-lg); }
.kiosk .qr canvas, .kiosk .qr img { display: block; width: min(70vw, 340px) !important; height: auto !important; }
.kiosk .clock { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.kiosk .bar { width: min(70vw, 376px); height: 6px; background: rgba(255, 255, 255, .25); border-radius: 4px; overflow: hidden; }
.kiosk .bar i { display: block; height: 100%; background: #fff; transition: width 1s linear; }

/* ---------- Thao tác chạm ---------- */
a, button, .btn, .tile, .nav-a, .tabs a, label, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.top .back { display: none; }
.bn-badge { position: absolute; top: -5px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }

/* ---------- Trang "Thêm" (tất cả chức năng) ---------- */
.menu-me { padding: 16px; margin-bottom: 14px; }
.menu-name { font-size: 17px; display: block; }
.menu-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.menu-sec { margin-bottom: 16px; }
.menu-h { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--tx-2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 8px; }
.menu-h svg { width: 16px; height: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 14px 6px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--tx); text-align: center; text-decoration: none !important; min-height: 96px; }
.tile:hover { border-color: var(--pri); }
.tile:active { transform: scale(.97); background: var(--pri-ll); }
.tile-ic { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--pri-l); color: var(--pri-d); }
.tile-ic svg { width: 24px; height: 24px; }
.tile-t { font-size: 13px; font-weight: 500; line-height: 1.3; }
.menu-list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.menu-list a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--tx); border-bottom: 1px solid var(--line-2); text-decoration: none !important; font-weight: 500; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a svg { margin-left: auto; color: var(--tx-3); width: 18px; height: 18px; }
.menu-list a:active { background: var(--pri-ll); }

/* ---------- Thanh dưới cho nhân viên trên điện thoại ---------- */
.bottom-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .side { transform: translateX(-100%); box-shadow: var(--sh-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .main { margin-left: 0; }
  .top .burger { display: inline-flex; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
}

/* ===== Điện thoại & tablet nhỏ (≤ 768px): ưu tiên ngón tay ===== */
@media (max-width: 768px) {
  body { font-size: 15px; }
  /* chữ trong ô nhập ≥ 16px để iPhone không tự phóng to khi chạm */
  .inp, select.inp, textarea.inp, .toolbar .inp, .inp.sm { font-size: 16px; height: 46px; border-radius: 10px; }
  textarea.inp { height: auto; min-height: 96px; }
  .btn { height: 44px; padding: 0 16px; border-radius: 10px; font-size: 15px; }
  .btn.sm { height: 40px; padding: 0 12px; font-size: 14px; }
  .btn.xs { height: 40px; min-width: 40px; padding: 0 10px; font-size: 13.5px; border-radius: 8px; }
  .btn.icon { width: 44px; }
  .btn svg { width: 18px; height: 18px; }
  .chk { min-height: 40px; }
  .chk input { width: 20px; height: 20px; }
  .multi label { padding: 8px 12px; font-size: 14px; border-radius: 8px; min-height: 40px; }
  .f > label { font-size: 14px; }

  /* khung: thanh trên gọn, chừa tai thỏ; menu bên thay bằng thanh dưới + trang "Thêm" */
  .top { height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0; gap: 4px; }
  .top .burger { display: none; }
  body:not(.is-root) .top .back { display: inline-flex; }
  .top-title { font-size: 17px; font-weight: 700; padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  body:not(.is-root) .top-title { padding-left: 0; }
  .top-sp { display: none; }
  .user-chip { padding: 4px; }
  .user-chip .nm { display: none; }
  .demo-bar { padding: 5px 12px; font-size: 12px; }
  .content { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .crumb { display: none; }
  /* tiêu đề trang đã hiện ở thanh trên: chỉ giữ hàng nút thao tác */
  .page-h { margin-bottom: 12px; gap: 8px; }
  .page-h h1 { display: none; }
  .page-h .sp { display: none; }
  .page-h:not(:has(> :not(h1):not(.sp))) { display: none; }
  .page-h > .btn, .page-h > a.btn { flex: 1 1 auto; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--tx-3); padding: 4px 0 2px; text-decoration: none !important; min-height: 50px; }
  .bottom-nav .bn-ic { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; transition: background .15s; }
  .bottom-nav a svg { width: 23px; height: 23px; }
  .bottom-nav a.on { color: var(--pri-d); font-weight: 600; }
  .bottom-nav a.on .bn-ic { background: var(--pri-l); }

  /* thẻ, lưới */
  .card { border-radius: 14px; }
  .card-b { padding: 14px; }
  .card-h { padding: 12px 14px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .grid { gap: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .bar-row { grid-template-columns: 100px 1fr 40px; }

  /* tab: vuốt ngang, vùng chạm cao */
  .tabs a { padding: 13px 12px; font-size: 14.5px; }
  /* tab cấp trang: dính dưới thanh trên khi cuộn */
  #page > div > .tabs { margin: 0 -12px 12px; padding: 0 8px; background: var(--card); position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 20; }

  /* bộ lọc: ô tìm kiếm chiếm cả hàng, các bộ lọc 2 ô một hàng */
  .toolbar { padding: 10px; gap: 8px; }
  .toolbar .search { flex: 1 1 100%; max-width: none; min-width: 0; }
  .toolbar .inp { flex: 1 1 calc(50% - 8px); min-width: 0; max-width: none; height: 44px; }
  .toolbar .inp.search, .toolbar .search { flex: 1 1 100%; }
  .toolbar .tb-f { flex: 1 1 calc(50% - 8px); min-width: 0; flex-direction: column; align-items: stretch; gap: 2px; }
  .toolbar .tb-f .inp { width: 100%; flex: none; height: 44px; }
  .toolbar .grow { display: none; }
  .toolbar .btn { flex: 1 1 auto; }

  /* hộp thoại thành tấm trượt từ dưới lên, nút bấm cố định đáy */
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.lg { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; animation: sheet .22s ease; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: #d0d5dc; margin: 8px auto 0; flex: none; }
  .modal-h { padding: 8px 8px 8px 16px; }
  .modal-h h3 { font-size: 17px; }
  .modal-b { overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .modal-f { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-f .btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; align-items: center; }
  .toast { max-width: 100%; font-size: 14.5px; padding: 12px 16px; }

  /* đăng nhập */
  .auth { grid-template-columns: 1fr; }
  .auth-l { padding: calc(24px + env(safe-area-inset-top)) 22px 26px; min-height: auto; }
  .auth-l h1 { font-size: 26px; }
  .auth-l p { font-size: 14.5px; }
  .auth-l ul { display: none; }
  .auth-r { padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); align-items: flex-start; }

  /* lịch tuần: các ngày xếp dọc */
  .week { grid-template-columns: 1fr; overflow: visible; }
  .day-col { min-height: 0; }
  .day-col .db:empty { display: none; }

  .ck-hero { border-radius: 20px; padding: 20px 16px; }
  .ck-hero .clock { font-size: 40px; }
  .ck-btn { width: 176px; height: 176px; }
}

/* ===== Điện thoại (≤ 640px): bảng thành danh sách thẻ ===== */
@media (max-width: 640px) {
  .tbl-wrap.has-cards { overflow: visible; max-height: none !important; }
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: auto !important; }
  .tbl.cards tbody { padding: 4px 8px 8px; }
  .tbl.cards tr { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 10px 12px; background: var(--card); position: relative; }
  /* ô chọn nhiều dòng: đặt ở góc phải thẻ */
  .tbl.cards td:has(> input[data-sel]) { position: absolute; top: 2px; right: 2px; padding: 0; width: 44px !important; height: 44px; display: grid; place-items: center; cursor: pointer; }
  .tbl.cards td:has(> input[data-sel]) input { width: 22px; height: 22px; accent-color: var(--pri); }
  .tbl.cards tr:has(input[data-sel]) td.c-title { padding-right: 34px; }
  .tbl.cards tbody tr:hover td { background: transparent; }
  .tbl.cards tr.click:active { background: var(--pri-ll); }
  .tbl.cards td { border: 0; padding: 4px 0; display: block; text-align: right; min-height: 0; overflow-wrap: anywhere; }
  .tbl.cards td::before { content: attr(data-label); float: left; color: var(--tx-3); font-size: 13px; text-align: left; max-width: 45%; margin-right: 12px; padding-top: 1px; }
  .tbl.cards td::after { content: ''; display: table; clear: both; }
  .tbl.cards td[data-label=""]::before { display: none; }
  .tbl.cards td[data-label=""] { text-align: left; }
  .tbl.cards td:empty { display: none; }
  .tbl.cards td.c-title { text-align: left; font-size: 15.5px; font-weight: 600; padding-bottom: 6px; }
  .tbl.cards td.c-title .small, .tbl.cards td.c-title .muted { font-weight: 400; }
  .tbl.cards td.c-title::before { display: none; }
  .tbl.cards td.right, .tbl.cards td.center { text-align: right; }
  .tbl.cards td.acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; white-space: normal; }
  .tbl.cards td.acts::after { display: none; }
  .tbl.cards td.acts .btn { margin-left: 0; }
  .tbl.cards td > .row { justify-content: flex-end; }
  .tbl.cards td.c-title > .row { justify-content: flex-start; }
  .tbl.cards tfoot { display: block; }
  .tbl.cards tfoot tr { display: flex; flex-wrap: wrap; gap: 8px; }
  .pager { justify-content: center; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .v { font-size: 20px; }
  .stat .ic { width: 36px; height: 36px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 88px; padding: 10px 2px; border-radius: 12px; }
  .tile-ic { width: 40px; height: 40px; }
  .tile-t { font-size: 12px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }

/* ==== Khu vực: màn hình nhân viên (views-me) ==== */
/* Ưu tiên điện thoại (một tay). Phạm vi: .me-* / .mh-* / .ms-* / .rq-* / .ps-* / .po-* / .nt-* / .kq-* do views-me gắn. */

/* --- Trang chủ chấm công: 2 cột trên laptop/tablet --- */
.me-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.me-home .mh-col, .me-home .mh-extra { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.me-home .mh-extra:empty { display: none; }
.me-home .ck-top { display: flex; align-items: center; gap: 12px; }
.me-home .ck-hi { opacity: .85; }
.me-home .ck-name { font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.me-home .ck-hero .avatar.lg { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
/* ô "Ca hôm nay" chiếm cả hàng (tên ca + khung giờ dài), Giờ vào / Giờ ra chia đôi hàng dưới */
.me-home .ck-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; text-align: center; font-size: 12.5px; opacity: 1; }
.me-home .ck-meta > div { background: rgba(255, 255, 255, .13); border-radius: 12px; padding: 8px 6px; min-width: 0; }
.me-home .ck-meta .ck-shift { grid-column: 1 / -1; }
/* nút phụ "Quét mã QR" dưới nút tròn; nút QR trong lời báo lỗi GPS */
.me-home .mh-qrbtn { min-height: 44px; height: auto; margin: 4px 0 2px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; }
.me-home .mh-qrbtn:hover { border-color: #fff; background: rgba(255, 255, 255, .18); color: #fff; }
.me-home .mh-qrbtn svg { width: 20px; height: 20px; }
.me-home .mh-qrmsg { display: flex; width: 100%; max-width: 300px; min-height: 44px; margin: 10px auto 0; border-color: #fff; background: #fff; color: var(--pri-d); font-weight: 600; }
.me-home .mh-qrmsg:hover { color: var(--pri-d); background: var(--pri-ll); }
.me-home .ck-meta span { display: block; opacity: .85; }
.me-home .ck-meta b { display: block; font-size: 15.5px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.me-home .ck-msg { text-align: center; font-size: 13px; opacity: .92; margin-top: 12px; }
.me-home .ck-msg:empty { display: none; }
.me-home .mh-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.me-home .mh-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mh-q { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 66px; color: inherit; text-decoration: none !important; transition: border-color .15s; }
.mh-q:hover { border-color: var(--pri); }
.mh-q:active { background: var(--pri-ll); }
.mh-qi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--pri-l); color: var(--pri-d); }
.mh-qi svg { width: 22px; height: 22px; }
.mh-qt { display: flex; flex-direction: column; min-width: 0; }
.mh-qt small { color: var(--tx-3); font-size: 12.5px; }
.mh-appr { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; color: inherit; text-decoration: none !important; background: var(--orange-l); border-color: #f6d88f; }
.mh-appr-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--orange); color: #fff; }
.mh-appr .grow { display: flex; flex-direction: column; }
.mh-appr small { color: #8a5a00; font-size: 12.5px; }
.mh-appr > svg { color: #a86a00; }
.mh-more { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin: -8px -4px; padding: 0 4px; font-size: 13px; font-weight: 500; }
.mh-more svg { width: 16px; height: 16px; }
/* bản tin xem nhanh: 2 bài, tiêu đề + 2 dòng nội dung + ảnh nhỏ; bấm mở trang Bản tin */
.mh-feed { overflow: hidden; }
.mh-post { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.card-h + .mh-post { border-top: 0; }
.mh-post:hover { background: #fafcfb; }
.mh-post:active { background: var(--pri-ll); }
.mh-pt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mh-ptl { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-pc { font-size: 13.5px; line-height: 1.4; color: var(--tx-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mh-pm { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 12.5px; color: var(--tx-3); }
.mh-pa { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-pn { display: inline-flex; align-items: center; gap: 3px; flex: none; font-variant-numeric: tabular-nums; }
.mh-pn svg { width: 14px; height: 14px; }
.mh-pimg { width: 64px; height: 64px; flex: none; border-radius: 10px; object-fit: cover; background: var(--bg); }

/* --- Quét QR, kết quả chấm công --- */
.me-scan { display: flex; flex-direction: column; gap: 12px; }
.me-scan p { margin: 0; }
.me-cam { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: #000; }
.me-cam:empty { display: none; }
.me-cam video { display: block; width: 100% !important; height: 100%; object-fit: cover; border-radius: 0 !important; }
.me-cam::after { content: ''; position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.me-msg { max-width: 420px; margin: 24px auto; padding: 28px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.me-msg h3 { font-size: 18px; }
.me-msg p { margin: 0 0 4px; overflow-wrap: anywhere; }
.me-msg-spin { width: 40px; height: 40px; border-width: 3px; }
.me-msg-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 4px; background: var(--pri-l); color: var(--pri-d); }
.me-msg-ic svg { width: 32px; height: 32px; }
.me-msg-ic.err { background: var(--red-l); color: var(--red); }
.me-msg-ic.out { background: var(--orange-l); color: #c27c00; }
.me-done { text-align: center; }
.me-done h2 { margin: 6px 0; }
.me-done-t { font-size: 46px; font-weight: 800; line-height: 1.1; color: var(--pri-d); font-variant-numeric: tabular-nums; }
.me-done-t.out { color: #c2410c; }

/* --- Máy checkin (máy tính bảng): dọc = xếp chồng, ngang = 2 cột --- */
.me-kiosk { min-height: 100vh; min-height: 100dvh; gap: 0; padding: max(20px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)); }
.me-kiosk .kq-info { display: contents; }
.me-kiosk .kq-head { order: 1; justify-content: center; flex-wrap: nowrap; }
.me-kiosk .kq-logo { width: 52px; height: 52px; border-radius: 12px; background: #fff; object-fit: contain; flex: none; }
.me-kiosk .kq-co { text-align: left; min-width: 0; }
.me-kiosk .kq-co b { display: block; font-size: clamp(20px, 3.2vw, 30px); line-height: 1.2; }
.me-kiosk .kq-co div { opacity: .85; font-size: clamp(13px, 2vw, 18px); }
.me-kiosk .clock { order: 2; margin-top: 10px; font-size: clamp(56px, 10vw, 104px); }
.me-kiosk .kq-date { order: 3; opacity: .85; font-size: clamp(15px, 2.4vw, 22px); }
.me-kiosk .kq-code { order: 4; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 22px 0 16px; }
.me-kiosk .qr { padding: clamp(12px, 2vw, 22px); border-radius: 22px; }
.me-kiosk .qr canvas, .me-kiosk .qr img { width: min(78vw, 52vh, 560px) !important; height: auto !important; image-rendering: pixelated; }
.me-kiosk .bar { width: 100%; height: 8px; }
.me-kiosk .kq-msg { order: 5; max-width: 620px; min-height: 3.4em; padding: 10px 18px; border-radius: 14px; font-size: clamp(17px, 2.4vw, 24px); line-height: 1.35; overflow-wrap: anywhere; }
.me-kiosk .kq-msg:not(:empty) { background: rgba(255, 255, 255, .16); }
.me-kiosk .kq-hint { order: 6; margin-top: 10px; opacity: .75; font-size: clamp(13px, 1.8vw, 17px); }
@media (orientation: landscape) and (min-width: 820px) {
  .me-kiosk { display: grid; grid-template-columns: minmax(0, 520px) auto; align-items: center; justify-content: center; column-gap: clamp(32px, 6vw, 90px); padding: 24px clamp(24px, 5vw, 72px); text-align: left; }
  .me-kiosk .kq-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
  .me-kiosk .kq-head { justify-content: flex-start; }
  .me-kiosk .clock { margin-top: 18px; font-size: clamp(72px, 10vw, 128px); }
  .me-kiosk .kq-msg { align-self: stretch; margin-top: 20px; }
  .me-kiosk .kq-code { margin: 0; }
  .me-kiosk .qr canvas, .me-kiosk .qr img { width: min(44vw, 74vh, 600px) !important; }
}

/* --- Đăng ký qua link mời --- */
.me-join .auth-box .btn.ghost { color: var(--pri-d); }

/* --- Lịch làm việc: lưới tháng (laptop/tablet), danh sách ngày (điện thoại) --- */
.ms-nav { display: flex; align-items: center; gap: 6px; }
.ms-nav .inp { width: auto; min-width: 0; }
.me-sched .ms-grid { overflow-x: auto; }
.me-sched .ms-week { grid-template-columns: repeat(7, minmax(92px, 1fr)); min-width: 680px; }
.me-sched .ms-cell { min-height: 92px; cursor: pointer; transition: border-color .15s; }
.me-sched .ms-cell:hover { border-color: var(--pri); }
.me-sched .ms-list { display: none; overflow: hidden; }
.ms-day { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line-2); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ms-day:first-child { border-top: 0; }
.ms-day.wk { border-top: 6px solid var(--bg); }
.ms-day:active { background: var(--pri-ll); }
.ms-day.today { background: var(--pri-ll); box-shadow: inset 4px 0 0 var(--pri); }
.ms-dt { width: 38px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ms-dt small { font-size: 12px; font-weight: 600; color: var(--tx-3); }
.ms-dt b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ms-day.sun .ms-dt small, .ms-day.sun .ms-dt b { color: var(--red); }
.ms-day.today .ms-dt small, .ms-day.today .ms-dt b { color: var(--pri-d); }
.ms-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ms-info b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ms-info b .tag { margin-left: 4px; vertical-align: 1px; }
.ms-info small { font-size: 13px; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.ms-info em { font-style: normal; font-weight: 600; color: #b45309; }
.ms-seg { font-size: 13px; font-weight: 400; color: var(--tx-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ms-day.off .ms-info b { color: var(--tx-3); font-weight: 500; }
.ms-st { flex: none; max-width: 42%; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ms-st .tag { white-space: normal; text-align: right; }
.ms-st small { font-size: 12.5px; font-weight: 600; color: var(--tx-2); white-space: nowrap; }

/* --- Đơn từ: chọn loại đơn --- */
.me-rqnew .rq-gh { margin: 18px 2px 8px; font-size: 13px; font-weight: 600; color: var(--tx-2); text-transform: uppercase; letter-spacing: .04em; }
.me-rqnew .rq-gh:first-child { margin-top: 0; }
.rq-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rq-type { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 14px; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .1s; }
.rq-type:hover { border-color: var(--rq, var(--pri)); }
.rq-type:active { transform: scale(.98); }
.rq-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--rq, var(--pri)); background: var(--pri-l); background: color-mix(in srgb, var(--rq, var(--pri)) 14%, #fff); }
.rq-ic svg { width: 22px; height: 22px; }
.rq-tx { display: flex; flex-direction: column; min-width: 0; }
.rq-tx b { line-height: 1.3; }
.rq-tx small { color: var(--tx-3); font-size: 12.5px; line-height: 1.35; }
/* đơn đăng ký ca: các ngày đăng ký thêm (ô lịch + nút bỏ) */
.rq-more { display: flex; flex-direction: column; gap: 8px; }
.rq-more:empty { display: none; }
.rq-md { display: flex; align-items: center; gap: 6px; }
.rq-md .inp { flex: 1; }
.rq-md .btn { flex: none; color: var(--tx-3); }
.f > .rq-more-add { align-self: flex-start; }
/* đơn của tôi: trạng thái cạnh tên đơn (chỉ dạng thẻ trên điện thoại) */
.rq-ttl { display: flex; align-items: flex-start; gap: 8px; }
.rq-ttl > .rq-desc { flex: 1; }
.rq-stin { display: none; }
.me-rqmine .empty .btn { margin-top: 4px; }
/* tên đơn + ngày trong bảng/thẻ (App.reqDesc) */
.rq-desc { min-width: 0; }
.rq-desc .small, .tk-t .small { font-weight: 400; }
/* chi tiết đơn (App.requestDetail) */
.me-rqd .rq-who { flex-wrap: nowrap; }
.me-rqd .rq-sum { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); }
.me-rqd .rq-sum .rq-desc b { font-size: 16px; }
.rq-reason { margin: 8px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-photo { display: block; max-height: 220px; margin-top: 12px; border-radius: 10px; }
.rq-steps, .rq-hist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rq-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; overflow-wrap: anywhere; }
.rq-sn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--tx-2); font-size: 12px; font-weight: 700; }
.rq-steps li.done .rq-sn { background: var(--pri); color: #fff; }
.rq-steps li.cur .rq-sn { background: var(--orange); color: #fff; }
.rq-hist li { font-size: 13px; overflow-wrap: anywhere; }
/* số dư ngày nghỉ */
.me-bal .bal-card { display: flex; flex-direction: column; gap: 12px; }
.bal-h { display: flex; flex-direction: column; gap: 2px; }
.bal-h b { font-size: 15px; }
.bal-body { display: flex; align-items: center; gap: 16px; }
.bal-big { display: flex; flex-direction: column; min-width: 88px; }
.bal-big .mono { font-size: 34px; font-weight: 800; line-height: 1; color: var(--pri-d); }
.bal-big small { margin-top: 4px; color: var(--tx-3); font-size: 12.5px; }
.bal-kv { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 1px solid var(--line-2); font-size: 13px; }
.bal-kv div { display: flex; justify-content: space-between; gap: 8px; }
.bal-kv span { color: var(--tx-3); }
/* duyệt đơn */
.me-appr .ap-emp { flex-wrap: nowrap; }
.me-appr td.ap-reason { max-width: 320px; overflow-wrap: anywhere; }
/* hộp "Lý do từ chối": nút Từ chối màu đỏ */
.modal.me-rej .btn.pri.danger { background: var(--red); border-color: var(--red); color: #fff; }
.modal.me-rej .btn.pri.danger:hover { background: #c22b30; border-color: #c22b30; color: #fff; }

/* --- Bảng nhãn – giá trị (hồ sơ, chi tiết công) --- */
.tbl.me-kv td { padding: 9px 10px; }
.tbl.me-kv td:first-child { width: 40%; color: var(--tx-3); }
.tbl.me-kv td:last-child { overflow-wrap: anywhere; }
.tbl.me-kv tr:last-child td { border-bottom: 0; }
.me-prof { align-items: start; }
.me-prof .pf-head { flex-wrap: nowrap; }
.me-prof .pf-head h3 { font-size: 18px; overflow-wrap: anywhere; }

/* --- Phiếu lương --- */
.ps-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.ps-card:hover { border-color: var(--pri); }
.ps-top { display: flex; flex-direction: column; gap: 2px; }
.ps-top b { font-size: 15px; }
.ps-net { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--pri-ll); }
.ps-net small { color: var(--tx-3); font-size: 12.5px; }
.ps-net .mono { font-size: 24px; font-weight: 800; line-height: 1.2; color: var(--pri-d); }
.ps-go { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 13px; font-weight: 500; color: var(--pri-d); }
.ps-go svg { width: 16px; height: 16px; }
.ps-total { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; padding: 14px; border-radius: 14px; background: linear-gradient(140deg, #15a34a, #0e6e37); color: #fff; text-align: center; }
.ps-total span, .ps-total small { opacity: .85; font-size: 12.5px; }
.ps-total b { font-size: 30px; font-weight: 800; line-height: 1.2; }
.ps-tbl td { padding: 9px 10px; }
.ps-tbl td:first-child { overflow-wrap: anywhere; }
.ps-tbl td:last-child { white-space: nowrap; font-weight: 500; }
.ps-tbl tr.b td { font-weight: 700; background: var(--pri-ll); }

/* --- Bản tin --- */
.me-feed { max-width: 720px; }
.me-post .po-head { flex-wrap: nowrap; align-items: flex-start; }
.me-post .po-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.me-post .po-title { margin-top: 12px; font-size: 16px; }
.me-post .post-c { overflow-wrap: anywhere; }
.me-post img.ph { display: block; width: 100%; max-height: 420px; background: var(--bg); }
.po-file { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-top: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; }
.po-acts { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.po-acts .small { display: inline-flex; align-items: center; gap: 5px; }
.po-acts .small svg { width: 15px; height: 15px; }
.po-like { min-width: 64px; }
.po-like.pri, .po-like.pri:hover { background: #fdecef; border-color: #f7c4cf; color: #e11d48; }
.po-like.pri svg { fill: currentColor; }
.po-cmts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.po-cmt { align-self: flex-start; max-width: 100%; padding: 7px 11px; border-radius: 12px; background: var(--bg); font-size: 13.5px; overflow-wrap: anywhere; }
.po-new { display: flex; gap: 8px; margin-top: 4px; }
.po-new .inp { flex: 1; min-width: 0; }
.po-new .btn { height: auto; min-height: 40px; align-self: stretch; }
.po-topl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.po-topl .tag { white-space: normal; }

/* --- Thông báo --- */
.me-noti { overflow: hidden; }
.nt-item { display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.nt-item:last-child { border-bottom: 0; }
.nt-item:hover { background: #fafcfb; }
.nt-item:active { background: var(--pri-ll); }
.nt-item.unread { background: var(--pri-ll); }
.nt-item .grow { display: flex; flex-direction: column; gap: 2px; }
.nt-body { font-size: 13.5px; color: var(--tx-2); overflow-wrap: anywhere; }
.nt-ic { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--tx-2); }
.nt-item.unread .nt-ic { background: var(--pri-l); color: var(--pri-d); }
.nt-item.unread .nt-ic::after { content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.nt-item > svg { width: 16px; height: 16px; margin-top: 10px; color: var(--tx-3); }
.page-h > #readAll { flex: none; margin-left: auto; }

@media (max-width: 1200px) {
  .rq-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rq-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* lối tắt trang chủ (tablet, điện thoại): 4 ô dọc một hàng */
  .me-home .mh-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .mh-q { flex-direction: column; justify-content: flex-start; gap: 6px; min-height: 84px; padding: 10px 4px; border-radius: 14px; text-align: center; }
  .mh-qi { width: 40px; height: 40px; }
  .mh-qt b { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
  .mh-qt small { display: none; }
}
/* duyệt đơn dạng bảng: tên nhân viên không xuống dòng */
@media (min-width: 641px) { .me-appr .ap-emp b { white-space: nowrap; } }
/* duyệt đơn trên tablet (641–900px): bỏ cột Gửi lúc / Trạng thái, lý do đủ rộng, nút duyệt thành nút biểu tượng 40px */
@media (min-width: 641px) and (max-width: 900px) {
  .me-appr .tbl th.ap-time, .me-appr .tbl td.ap-time, .me-appr .tbl th.ap-st, .me-appr .tbl td.ap-st { display: none; }
  .me-appr .tbl th, .me-appr .tbl td { padding-left: 8px; padding-right: 8px; }
  .me-appr .tbl td.ap-reason { min-width: 180px; }
  .me-appr .tbl td.ap-full:not(.ap-reason) { min-width: 110px; }
  .me-appr .ap-emp { gap: 8px; }
  .me-appr .tbl td.acts .btn { width: 40px; min-width: 40px; height: 40px; padding: 0; gap: 0; font-size: 0; }
  .me-appr .tbl td.acts .btn svg { width: 20px; height: 20px; }
}
@media (max-width: 768px) {
  /* link nhỏ trong thẻ (bản đồ, ảnh): vùng chạm cao 40px mà không làm dòng cao thêm */
  .me-lnk { display: inline-flex; align-items: center; min-height: 40px; margin: -10px -6px; padding: 0 6px; }
  .me-appr td.acts .btn, .me-rqmine td.acts .btn, .me-tk td.acts .btn { height: 40px; min-width: 40px; }
  /* hộp thoại có nhiều nút (chi tiết công): nút xuống dòng, mỗi hàng 2 nút */
  .modal.me-wrapf .modal-f { flex-wrap: wrap; }
  .modal.me-wrapf .modal-f .btn { flex: 1 1 calc(50% - 8px); }
  .modal.me-pair .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; align-items: end; }
  .mh-post { padding: 12px 14px; }
}
@media (max-width: 640px) {
  /* trang chủ: 1 cột theo thứ tự ưu tiên – nút chấm công, đơn chờ duyệt, lối tắt, lượt chấm, bản tin, hướng dẫn */
  .me-home { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .me-home .mh-col { display: contents; }
  .me-home .mh-hero { order: 1; padding: 16px 16px 18px; }
  .me-home .mh-appr { order: 2; }
  .me-home .mh-quick { order: 3; }
  .me-home .mh-logs { order: 4; }
  .me-home .mh-extra { order: 5; gap: 12px; }
  .me-home .mh-how { order: 6; }
  .me-home .ck-hero .avatar.lg { width: 48px; height: 48px; font-size: 19px; }
  .me-home .ck-name { font-size: 18px; }
  .me-home .ck-hero .clock { margin-top: 12px; }
  .me-home .ck-btn { margin: 24px auto 8px; }
  .me-msg { margin: 8px auto; padding: 24px 16px; }

  /* lịch làm việc: danh sách ngày */
  .page-h > .ms-nav { flex: 1; }
  .ms-nav .inp { flex: 1; }
  .me-sched .ms-grid, .me-sched .ms-legend { display: none; }
  .me-sched .ms-list { display: block; }

  /* đơn từ */
  /* loại đơn: ô ngang gọn (biểu tượng + tên), 2 ô một hàng */
  .rq-types { gap: 8px; }
  .rq-type { gap: 10px; min-height: 60px; padding: 10px; border-radius: 12px; }
  .rq-ic { width: 36px; height: 36px; border-radius: 10px; }
  .rq-ic svg { width: 20px; height: 20px; }
  .rq-tx b { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
  .rq-tx small { display: none; }
  .me-rqnew .rq-gh { margin-top: 16px; }
  /* đơn của tôi: trạng thái cạnh tên đơn */
  .me-rqmine .tbl.cards td.rq-stc { display: none; }
  .me-rqmine .rq-stin { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
  .me-rqmine .rq-stin small { font-size: 12px; font-weight: 400; color: var(--tx-3); }
  .me-rqmine .tbl.cards td.acts .btn, .me-tk .tbl.cards td.acts .btn { height: 42px; min-width: 64px; }
  .me-appr .toolbar .search { flex-basis: 100%; }
  .me-appr .toolbar .btn { flex: 1 1 calc(50% - 8px); }
  .me-appr .toolbar #selInfo { flex: 1 1 100%; }
  .me-appr .toolbar #selInfo:empty { display: none; }
  .me-appr .tbl.cards td.ap-full { display: block; text-align: left; }
  .me-appr .tbl.cards td.ap-full::before { display: none; }
  .me-appr .tbl.cards td.ap-reason { max-width: none; margin: 4px 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
  .me-appr .tbl.cards td.acts { flex-wrap: nowrap; gap: 8px; }
  .me-appr .tbl.cards td.acts .btn { flex: 1 1 0; height: 46px; font-size: 15px; font-weight: 600; }

  /* hồ sơ, phiếu lương */
  .tbl.me-kv td { padding: 10px 4px; }
  .tbl.me-kv td:first-child { width: 42%; }
  .me-prof .avatar.lg { width: 60px; height: 60px; font-size: 22px; }
  .ps-tbl td { padding: 9px 6px; font-size: 14px; }

  /* bản tin: nút "Viết bài" nổi trên thanh dưới (gần ngón cái), mỗi bài một thẻ, ảnh tràn viền */
  .page-h > #newPost { position: fixed; right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 25; flex: none; height: 50px; padding: 0 20px; border-radius: 25px; box-shadow: 0 6px 20px rgba(15, 122, 55, .35); }
  .page-h:has(> #newPost) { margin: 0; }
  .me-feed { max-width: none; padding-bottom: 56px; }
  .me-feed > .me-feed-card { display: flex; flex-direction: column; gap: 12px; background: none; border: 0; box-shadow: none; }
  .me-feed > .me-feed-card > .post { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--sh); }
  .me-feed .me-post img.ph { width: calc(100% + 28px); max-width: none; margin-left: -14px; margin-right: -14px; border-radius: 0; }
}
@media print {
  .ps-total { background: none; color: var(--tx); border: 1px solid var(--line); }
}
/* ==== hết: views-me ==== */
/* ==== Khu vực: chấm công & đơn từ (views-tk) ==== */
/* Phạm vi: .tkv = trang chấm công (khung trang do views-tk gắn), .tkm = hộp thoại của views-tk. Ưu tiên laptop, vẫn dùng được trên điện thoại. */
.tk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.tk-code { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--line-2); color: var(--tx-2); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.tk-off-l + .tk-off-l { margin-top: 2px; }
.tk-kv { display: flex; flex-wrap: wrap; gap: 0 10px; }
.tk-kv > span { white-space: nowrap; }
.tkv .tbl th.center { text-align: center; }
/* ký hiệu công chưa có màu riêng */
.tkv .cell.NB { background: var(--blue-l); color: #1e5fb4; }
.tkv .cell.BC { background: var(--pri-ll); color: var(--pri-d); box-shadow: inset 0 0 0 1px #bfe6cd; }
.tkv .cell.KH { background: var(--red-l); color: #c22b30; text-decoration: line-through; }

/* ---- Lưới ngày: xếp ca, tổng hợp lịch, bảng công (cuộn trong khung, cột tên dính trái) ---- */
.tk-gwrap { max-height: 72vh; max-height: max(320px, calc(100dvh - 170px)); }
.tk-grid th, .tk-grid td { padding: 4px 3px; }
.tk-grid thead th { line-height: 1.25; font-size: 12px; vertical-align: bottom; }
.tk-grid th.nm, .tk-grid td.nm { min-width: 0; padding: 6px 10px; }
.tk-grid th.nm { vertical-align: middle; }
.tk-nm { min-width: 150px; max-width: 220px; }
.tk-nm b { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.tk-nm .tk-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-cnt { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: var(--line-2); color: var(--tx-2); font-size: 11px; font-weight: 600; }
.tk-grid th.d { min-width: 34px; }
.tk-grid th.d .tk-mo { color: var(--tx-3); font-weight: 400; }
.tk-grid td.d { border-left: 1px solid var(--line-2); }
.tk-grid td.d.we { background: #fcf7f7; }
.tk-grid td.d.today { background: var(--pri-ll); }
.tk-grid th.d.today { background: var(--pri-l); color: var(--pri-d); box-shadow: inset 0 -2px 0 var(--pri); }
.tk-grid tbody tr:hover td.d { background: #f4f8f6; }
.tk-grid tbody tr:hover td.d.today { background: var(--pri-l); }
.tk-grid td.tap { cursor: pointer; }
.tk-grid td.tap:hover { box-shadow: inset 0 0 0 2px var(--pri); }
.tk-grid .cell { min-width: 28px; height: 22px; font-size: 11.5px; }
.tk-sh { font-size: 11px; color: var(--tx-3); white-space: nowrap; }
.tk-otv { font-size: 10.5px; line-height: 1.15; font-weight: 600; color: var(--violet); white-space: nowrap; }
/* bảng công: cột tổng hợp, cột "Công" dính phải khi cuộn ngang (laptop/tablet) */
.tk-tsg .sm1 { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.tk-tsg th.tot, .tk-tsg td.tot { box-shadow: inset 1px 0 0 var(--line); }
.tk-tsg td.tot b { font-size: 13.5px; color: var(--pri-d); }
.tk-warn { color: #b45309; font-weight: 600; }
.tk-zero { color: var(--tx-3); }
/* chú thích ký hiệu */
.tk-legend { border-bottom: 1px solid var(--line-2); }
.tk-legend > summary { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--tx-2); cursor: pointer; list-style: none; user-select: none; }
.tk-legend > summary::-webkit-details-marker { display: none; }
.tk-legend > summary::before { content: ''; width: 0; height: 0; border: 4px solid transparent; border-left: 6px solid currentColor; margin-right: 2px; transition: transform .15s; }
.tk-legend[open] > summary::before { transform: rotate(90deg) translateX(2px); }
.tk-legend .legend { padding: 0 14px 10px; gap: 5px 14px; font-size: 12px; }
.tk-lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tk-lg .cell { min-width: 24px; height: 19px; font-size: 10.5px; padding: 0 3px; }
.tk-sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); }
.tk-sw.today { background: var(--pri-l); border-color: #b9e6c9; }
.tk-sw.we { background: #fcf7f7; }
/* xếp ca */
.tk-month { width: auto; }
.tk-chg { color: #a86a00; font-weight: 600; white-space: nowrap; }
.tk-chg:empty { display: none; }
.tk-rgrid td.d { padding: 3px 2px; }
/* ô chọn ca gọn: bỏ mũi tên mặc định (chiếm chỗ, cắt chữ), thay bằng mũi tên nhỏ */
.tk-rgrid .tk-rsel { -webkit-appearance: none; appearance: none; width: 70px; height: 28px; padding: 0 14px 0 6px; font-size: 12.5px; font-weight: 500; border-radius: 6px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--tx-3) 50%), linear-gradient(135deg, var(--tx-3) 50%, transparent 50%);
  background-position: calc(100% - 9px) 52%, calc(100% - 5px) 52%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.tk-rgrid .tk-rsel.off { color: var(--tx-3); background-color: #f6f7f9; }
.tk-rgrid .tk-rsel.chg { border-color: var(--pri); background-color: var(--pri-ll); color: var(--pri-d); font-weight: 600; }
.tk-sgrid .cell { min-width: 34px; margin: 1px 0; }

/* ---- Form ca: khung giờ dạng thẻ có nhãn ---- */
.tk-segs { display: flex; flex-direction: column; gap: 10px; }
.tk-seg { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; padding: 10px 12px 12px; }
.tk-seg-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tk-seg-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.tk-seg-grp { min-width: 0; }
.tk-seg-t, .tk-flow-t { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tx-3); margin-bottom: 4px; }
.tk-seg-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; align-items: end; }
.tk-sf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-sf > span { font-size: 12px; color: var(--tx-2); line-height: 1.3; }
.tk-segs:has(.tk-seg + .tk-seg) .tk-seg-brk { display: none; }
.tk-seg-main { order: -2; }
.tk-seg-brk { order: -1; }
.tk-segs:has(.tk-seg + .tk-seg) .tk-seg-main { grid-column: 1 / -1; }
.tk-seg-note { display: none; margin: 8px 0 0; }
.tk-segs:has(.tk-seg + .tk-seg) + .tk-seg-note { display: block; }
.tk-shiftf #addSeg { margin-top: 10px; }

/* ---- Form nhóm lịch làm việc ---- */
.tk-week td { vertical-align: top; }
.tk-week .wk-day { width: 1%; white-space: nowrap; padding-top: 12px; }
.tk-week .multi { border: 0; padding: 0; max-height: none; min-height: 0; }
.tk-schedf[data-mode="free"] .tk-week .wk-shifts { display: none; }
.tk-week .multi label:has(input:checked) { background: var(--pri-l); color: var(--pri-d); }
.tk-week tr:has([data-wd]:not(:checked)) .wk-shifts { opacity: .55; }
.tk-off { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.tk-off-m { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 14px; margin-top: 4px; }

/* ---- Lịch nghỉ (chi tiết), số dư ngày nghỉ ---- */
@media (min-width: 641px) { .tk-cald .tbl-wrap { border: 1px solid var(--line); border-radius: 10px; } }
.tk-adj { display: inline-block; padding: 1px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tk-adj:hover { background: var(--pri-l); text-decoration: none; }
.tk-lnk { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.tk-lnk svg { width: 14px; height: 14px; }
.tk-bal th.center { white-space: normal; min-width: 84px; max-width: 150px; vertical-align: bottom; line-height: 1.3; }
.tk-bal td.center { font-variant-numeric: tabular-nums; }
.tk-calbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tk-yr { display: flex; align-items: center; gap: 8px; }
.tk-yr b { min-width: 76px; text-align: center; font-size: 15px; }
.tk-calacts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.tk-h4 { font-size: 14px; font-weight: 600; color: var(--tx-2); margin: 16px 0 8px; }

/* ---- Cấu hình đơn báo & luồng duyệt ---- */
.tk-cfgbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tk-cfgbar .tk-hint { flex: 1 1 280px; min-width: 0; }
.tk-cfgacts { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-flow { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fff; }
.tk-flow-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 26px; }
.tk-flow-t { margin: 10px 0 6px; }
.tk-cond { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; padding: 10px; background: var(--bg); border-radius: 8px; }
.tk-cond select[multiple], .tk-st-ids select[multiple] { height: 96px; padding: 4px; }
.tk-dur { display: flex; align-items: center; gap: 6px; }
.tk-dur select { width: 72px; flex: none; }
.tk-dur input { width: 96px; flex: none; }
.tk-steps { counter-reset: tkst; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tk-step { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: #fbfcfd; }
.tk-step-n { counter-increment: tkst; flex: none; margin-top: 22px; width: 26px; height: 26px; border-radius: 50%; background: var(--pri-l); color: var(--pri-d); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; }
.tk-step-n::before { content: counter(tkst); }
.tk-st-type { flex: 1 1 200px; }
.tk-st-ids { flex: 2 1 240px; }
.tk-st-lv { flex: 0 0 90px; }
.tk-st-mode { flex: 1 1 170px; }
.tk-st-rm { margin-top: 22px; }
.tk-step:not([data-type="emp"]):not([data-type="role"]) .tk-st-ids { display: none; }
.tk-step:not([data-type="upper"]) .tk-st-lv { display: none; }

/* ---- Bảng công 1 nhân viên (trang chi tiết nhân viên) ---- */
.tk-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.tk-kpi { display: flex; flex-direction: column; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.tk-kpi b { font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-kpi b small { font-size: 12.5px; font-weight: 500; }
.tk-kpi span { font-size: 12px; color: var(--tx-2); }
.tk-kpi.pri { background: var(--pri-l); }
.tk-kpi.pri b { color: var(--pri-d); }
.tk-kpi.warn b { color: #b45309; }
.tk-kpi.bad b { color: var(--red); }

/* laptop / tablet ngang: bộ lọc gọn trên 1 hàng */
@media (min-width: 769px) {
  .tkv .toolbar select.inp { max-width: 180px; }
  .tkv .toolbar .search { min-width: 160px; }
  .tkv .tbl td.c-title { min-width: 160px; }
  /* các bảng loại đơn theo nhóm: cùng độ rộng cột để thẳng hàng giữa các nhóm */
  .tk-types { table-layout: fixed; }
  .tk-types th:nth-child(2) { width: 20%; }
  .tk-types th:nth-child(3) { width: 14%; }
  .tk-types th:nth-child(4) { width: 12%; }
  .tk-types th.acts { width: 128px; }
}
/* từ tablet trở lên: cột "Công" dính phải – luôn thấy tổng công khi cuộn ngang bảng công */
@media (min-width: 600px) {
  .tk-tsg th.tot, .tk-tsg td.tot { position: sticky; right: 0; z-index: 2; background: #fff; }
  .tk-tsg th.tot { z-index: 3; background: #f8fafb; }
  .tk-tsg tbody tr:hover td.tot { background: #fafcfb; }
}
/* tablet / laptop nhỏ: tiêu đề cột danh sách được xuống dòng để bảng vừa khung, ít phải cuộn ngang */
@media (max-width: 1100px) {
  .tkv .tbl.cards th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
  .tkv .tbl.cards td.c-title { min-width: 130px; }
  .tkv .tbl.cards .tk-off-l { min-width: 150px; }
  .tkv .tbl.cards .tk-scope { min-width: 110px; }
}
/* laptop vừa (1101–1440px): tiêu đề cột dài ("Tổng thời lượng làm thêm", "Cập nhật lần cuối"...) được xuống dòng khi thiếu chỗ,
   ô bớt đệm ngang – bảng danh sách vừa khung, cột thao tác dính phải không còn che cột cuối */
@media (min-width: 1101px) and (max-width: 1440px) {
  .tkv .tbl.cards th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
  .tkv .tbl.cards th, .tkv .tbl.cards td { padding-left: 9px; padding-right: 9px; }
}
/* tablet (641–1100px): cột thao tác dính phải, luôn bấm được khi bảng phải cuộn ngang */
@media (min-width: 641px) and (max-width: 1100px) {
  .tkv .tbl.cards th.acts, .tkv .tbl.cards td.acts { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
  .tkv .tbl.cards th.acts { z-index: 2; background: #f8fafb; }
  .tkv .tbl.cards tbody tr:hover td.acts { background: #fafcfb; }
}
/* điện thoại: danh sách thẻ – chấm màu + tên + nhãn xuống dòng gọn */
@media (max-width: 640px) {
  .tkv .tbl.cards td.c-title { flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .tkv .tbl.cards td.c-title .tk-dot { margin-right: 0; }
  .tkv .tbl.cards .tk-kv { justify-content: flex-end; }
}
/* điện thoại & tablet nhỏ */
@media (max-width: 768px) {
  .tkv .btn.xs, .tkm .btn.xs { height: 40px; min-width: 40px; }
  .tkm .multi label { min-height: 40px; }
  .tk-adj { min-width: 56px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--pri-ll); border: 1px solid #cfe9d8; }
  .tk-lnk { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
  .tk-gwrap { max-height: max(300px, calc(100dvh - 200px)); }
  .tk-grid th.d, .tk-grid td.d { min-width: 42px; }
  .tk-grid td.d { height: 44px; }
  .tk-grid th.nm, .tk-grid td.nm { padding: 6px 8px; }
  .tk-nm { width: 112px; min-width: 0; max-width: none; }
  .tk-nm b { font-size: 13px; }
  .tk-grid .tk-sub { font-size: 11.5px; }
  .tk-grid td.tap:hover { box-shadow: none; }
  .tk-grid td.tap:active { box-shadow: inset 0 0 0 2px var(--pri); }
  /* bảng công: tháng + Xem cùng hàng đầu */
  .tk-tscard .toolbar #tm { order: -2; flex: 1 1 calc(60% - 8px); }
  .tk-tscard .toolbar #tgo { order: -1; flex: 1 1 calc(40% - 8px); }
  .tk-legend > summary { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .tk-legend .legend { padding: 0 12px 12px; gap: 8px 14px; }
  /* xếp ca: tháng + nút danh sách cùng hàng; nút thao tác 2 cột, Lưu cả hàng */
  .tk-roster .page-h .tk-month { flex: 1 1 140px; width: auto; }
  .tk-rbar .tk-hint { flex: 1 1 100%; }
  .tk-rbar .btn { flex: 1 1 calc(50% - 8px); }
  .tk-rbar .btn.pri { flex-basis: 100%; }
  .tk-rbar .tk-chg { flex: 1 1 100%; text-align: center; }
  .tk-rgrid .tk-rsel { width: 76px; height: 40px; font-size: 16px; border-radius: 8px; padding: 0 14px 0 6px; }
  .tk-rgrid .tk-nm { width: 100px; }
  /* form ca */
  .tk-seg { padding: 10px; }
  .tk-seg-g { grid-template-columns: 1fr; gap: 10px; }
  .tk-seg-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-sf > span { font-size: 13px; }
  .tk-shiftf #addSeg { width: 100%; }
  /* tuần làm việc: mỗi ngày 1 khối, ca bên dưới */
  .tk-week { overflow: visible; }
  .tk-week thead { display: none; }
  .tk-week table, .tk-week tbody, .tk-week tr, .tk-week td { display: block; width: auto; }
  .tk-week tr { border-bottom: 1px solid var(--line-2); padding: 4px 0 8px; }
  .tk-week td { border: 0; padding: 2px 0; }
  .tk-week .wk-day { width: auto; padding-top: 2px; }
  .tk-off-m { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* lịch nghỉ */
  .tk-yr { flex: 1 1 100%; justify-content: space-between; }
  .tk-calacts { margin-left: 0; flex: 1 1 100%; }
  .tk-calacts .btn { flex: 1 1 calc(50% - 8px); }
  .tk-calacts .btn.pri { flex-basis: 100%; }
  /* đơn báo */
  .tk-cfgacts { flex: 1 1 100%; }
  .tk-cfgacts .btn { flex: 1 1 0; }
  .tk-cond { grid-template-columns: 1fr; }
  .tk-cond select[multiple], .tk-st-ids select[multiple] { height: 120px; }
  .tk-dur select { width: 84px; }
  .tk-dur input { flex: 1 1 auto; width: auto; min-width: 0; }
  .tk-step { align-items: center; }
  .tk-step-n, .tk-st-rm { margin-top: 0; }
  .tk-step .tk-sf { flex: 1 1 100%; order: 2; }
  .tk-step .tk-st-rm { order: 1; margin-left: auto; }
  .tk-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px; }
  .tk-kpi { padding: 8px; }
  .tk-kpi b { font-size: 17px; }
}
/* ==== hết: views-tk ==== */
/* ==== Khu vực: nhân sự & dashboard (views-hr) ==== */
/* --- Dashboard: laptop trước, điện thoại xem nhanh --- */
.db-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.db-tools .inp { width: auto; }
.db-kpi, .db-mid, .db-links { display: grid; gap: 16px; margin-bottom: 16px; }
.db-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-mid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.db-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.db-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.db-st { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic v" "l l"; align-items: center; gap: 8px 10px; padding: 12px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fbfcfd; min-width: 0; }
.db-kpi .card-b { padding: 14px; }
.db-st .ic, .db-link .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.db-st .ic { grid-area: ic; }
.db-st .ic svg, .db-link .ic svg { width: 19px; height: 19px; }
.db-st .v { grid-area: v; font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.db-st .l { grid-area: l; color: var(--tx-2); font-size: 13px; line-height: 1.3; }
/* biểu đồ cột HTML (chiều cao vùng vẽ = PLOT_H trong views-hr.js) */
.db-plot { height: 150px; display: flex; gap: 6px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.db-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.db-avg { font-size: 11.5px; color: var(--tx-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-stk { width: min(44px, 78%); display: flex; flex-direction: column; border-radius: 5px 5px 0 0; overflow: hidden; }
.db-stk > span { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.db-stk .ok { background: var(--pri); color: #fff; }
.db-stk .late { background: var(--orange); color: #4a2f00; }
.db-col.on .db-stk { box-shadow: 0 0 0 2px var(--pri-l); }
.db-days { display: flex; gap: 6px; padding: 6px 2px 0; }
.db-days span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 12px; color: var(--tx-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-days span.on { color: var(--pri-d); font-weight: 700; }
.db-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx-2); margin-top: 12px; }
.db-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.db-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.db-dot.ok { background: var(--pri); }
.db-dot.late { background: var(--orange); }
.db-more { margin: -4px -6px -4px 0; }
.db-top { list-style: none; margin: -4px 0; padding: 0; }
.db-top li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.db-top li:last-child { border-bottom: 0; }
.db-rk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; color: var(--tx-2); background: var(--line-2); }
.db-rk.r1 { background: #fde68a; color: #7a5200; }
.db-rk.r2 { background: #e5e7eb; color: #374151; }
.db-rk.r3 { background: #fed7aa; color: #9a3412; }
.db-nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 8px; color: var(--tx-3); text-align: center; }
.db-empty svg { width: 34px; height: 34px; opacity: .45; }
.db-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none !important; min-width: 0; }
a.db-link:hover { border-color: var(--pri); }
.db-link > .grow { display: flex; flex-direction: column; }
.db-link .v { font-size: 22px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.db-link .l { color: var(--tx-2); font-size: 13px; }
.db-link .db-chev { color: var(--tx-3); width: 18px; height: 18px; }
.db-sub { display: inline-flex; align-items: center; min-height: 28px; font-size: 12.5px; font-weight: 500; }
.db-bd { gap: 8px; }
@media (min-width: 1280px) {
  .db-kpi .card-h { min-height: 59px; }
  .db-kpi .db-stats { gap: 8px; padding: 12px; }
  .db-kpi .db-st .l { font-size: 12.5px; }
}
@media (max-width: 1279px) { .db-kpi { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) { .db-mid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
  .db-tools { flex: 1 1 100%; flex-wrap: nowrap; }
  .db-tools .inp { flex: 1 1 0; min-width: 0; width: 100%; }
  .db-kpi, .db-mid, .db-links { gap: 12px; margin-bottom: 12px; }
  .hr-db .card-h { gap: 8px; }
  .db-acts { flex: 1 1 100%; }
  .db-acts .btn { flex: 1 1 0; min-width: 0; }
  .db-more { margin: -8px -8px -8px 0; }
  .db-sub { min-height: 40px; font-size: 13.5px; }
}
@media (max-width: 640px) {
  .db-links { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .db-link { padding: 10px 14px; min-height: 60px; }
  .db-link .v { font-size: 20px; }
}
@media (max-width: 560px) {
  .db-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .db-st { padding: 10px; gap: 6px 8px; }
  .db-st .v { font-size: 22px; }
  .db-plot, .db-days { gap: 4px; }
  .db-avg { font-size: 10.5px; }
  .db-days span { font-size: 11px; }
}

/* --- Cây nhân sự: cây dính bên trái trên laptop, gập thành một dòng trên điện thoại --- */
.hr-org { grid-template-columns: 260px minmax(0, 1fr); }
.hr-orgc > summary { list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.hr-orgc > summary::-webkit-details-marker { display: none; }
.hr-orgc:not([open]) > summary { border-bottom: 0; }
.hr-orgchev { color: var(--tx-3); transition: transform .2s; }
.hr-orgc[open] .hr-orgchev { transform: rotate(180deg); }
.hr-orgsel { color: var(--pri-d); font-weight: 600; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-orgc .tree-t { min-width: 0; overflow-wrap: anywhere; }
.hr-orgc .tree-n .cnt { flex: none; }
.hr-orgc .tree-n:focus-visible { outline: 2px solid var(--pri); outline-offset: -2px; }
.hr-who { flex-wrap: nowrap; }
@media (min-width: 1025px) {
  .hr-orgc { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; }
  .hr-orgc > summary { cursor: default; }
  .hr-orgchev, .hr-orgsel { display: none; }
}
@media (min-width: 1440px) { .hr-org { grid-template-columns: 280px minmax(0, 1fr); } }
/* laptop vừa (1025–1439px): cây hẹp lại để bảng nhân viên rộng hơn */
@media (min-width: 1025px) and (max-width: 1439px) {
  .hr-org { grid-template-columns: 220px minmax(0, 1fr); }
  /* cây hẹp: thụt lề cấp con ít hơn để tên bộ phận cấp 3 không bị bẻ từng chữ */
  .hr-orgc .tree { padding: 6px; }
  .hr-orgc .tree-c { padding-left: 8px; margin-left: 9px; }
  .hr-orgc .tree-n { padding: 7px 6px; gap: 5px; }
}
/* bảng nhân viên (tablet → laptop < 1680px): ô gọn hơn, bỏ cột ít dùng (Email, Giới tính); dưới 1366px bỏ thêm
   Ngày bắt đầu — để SĐT và nút thao tác luôn thấy không phải cuộn ngang. Các cột này vẫn có trong hồ sơ nhân viên,
   ô tìm kiếm và file Excel xuất ra; trên điện thoại (dạng thẻ) vẫn hiện đủ. */
@media (min-width: 641px) and (max-width: 1679px) {
  #empList .tbl th, #empList .tbl td { padding-left: 8px; padding-right: 8px; }
  #empList .tbl td.hr-w { min-width: 130px; }
  #empList .tbl .hr-x { display: none; }
}
@media (min-width: 641px) and (max-width: 1365px) { #empList .tbl .hr-x2 { display: none; } }
@media (max-width: 1024px) {
  .hr-org { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hr-orgc > summary { min-height: 52px; }
  .hr-orgc .tree-n { min-height: 44px; }
}

/* --- Danh sách quản trị (hr-list): bảng gọn, không bẻ chữ từng từ trên laptop --- */
@media (min-width: 641px) {
  .hr-list .tbl th, .hr-list .tbl td { padding: 9px 10px; }
  .hr-list .tbl th { z-index: 2; }
  .hr-list .tbl th.right { text-align: right; }
  .hr-list .tbl td { white-space: nowrap; }
  .hr-list .tbl td.hr-w { white-space: normal; min-width: 160px; max-width: 280px; }
  .hr-list .tbl td.hr-nm { white-space: normal; min-width: 190px; }
  .hr-list .tbl td.hr-nm b { white-space: nowrap; }
  /* cột nhân viên dính trái khi bảng rộng cuộn ngang */
  .hr-list .tbl .hr-stk { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--line-2); }
  .hr-list .tbl th.hr-stk { z-index: 3; background: #f8fafb; }
  .hr-list .tbl tbody tr:hover td.hr-stk { background: #fafcfb; }
  /* danh sách nhân viên: cột tên (và ô chọn nếu có quyền sửa) dính trái */
  #empList .tbl .hr-nm { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--line-2); }
  #empList .tbl th.hr-nm { z-index: 3; background: #f8fafb; }
  #empList .tbl:has(td > input[data-sel]) th:first-child, #empList .tbl:has(td > input[data-sel]) td:first-child { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; max-width: 40px; background: var(--card); }
  #empList .tbl:has(td > input[data-sel]) th:first-child { z-index: 3; background: #f8fafb; }
  #empList .tbl:has(td > input[data-sel]) .hr-nm { left: 40px; }
  #empList .tbl tbody tr:hover td:first-child, #empList .tbl tbody tr:hover td.hr-nm { background: #fafcfb; }
}
/* tablet dọc 641–768px: cột thao tác dính phải như trên laptop (quy tắc chung chỉ áp từ 769px) */
@media (min-width: 641px) and (max-width: 768px) {
  .hr-list .tbl.cards td.acts, .hr-list .tbl.cards th.acts { position: sticky; right: 0; z-index: 1; background: var(--card); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
  .hr-list .tbl.cards th.acts { z-index: 3; background: #f8fafb; }
  .hr-list .tbl.cards tbody tr:hover td.acts { background: #fafcfb; }
}
.hr-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
/* laptop: bảng cuộn trong khung, tiêu đề cột và cột tên luôn thấy, thanh cuộn ngang ở trong tầm mắt */
@media (min-width: 1025px) {
  .hr-list:not(.hr-adv) > .card > .tbl-wrap { max-height: max(360px, calc(100vh - 250px)); }
}
/* nhiều bộ lọc: bộ lọc một hàng, nút thao tác một hàng riêng căn phải */
@media (min-width: 769px) {
  .hr-tb2 .toolbar > .grow { flex: 1 0 100%; height: 0; margin-bottom: -8px; }
  .hr-tb2 .toolbar > .grow + .btn { margin-left: auto; }
  .hr-tb2 .toolbar > #selInfo { margin-right: auto; }
}
@media (max-width: 768px) {
  .hr-list .toolbar .search { flex-basis: 100%; }
  /* nút "Thêm" lên ngay dưới bộ lọc, các nút phụ (Excel, nghỉ việc...) xuống sau */
  .hr-list .toolbar > .btn { order: 1; }
  .hr-list .toolbar > [data-act=add] { order: 0; flex-basis: 100%; }
  /* nút nhỏ trong thẻ (sửa, duyệt...) và trên cây: vùng chạm ≥ 40px */
  .hr-list .btn.xs, .hr-orgc .btn.xs { height: 40px; min-width: 40px; }
  /* tên nhân viên là link: vùng chạm cao ≥ 40px mà không đẩy dòng chức danh xuống */
  .hr-nml { position: relative; display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* --- Mời nhân viên: QR cạnh mã/link trên laptop, xếp dọc trên điện thoại --- */
.hr-inv { align-items: flex-start; flex-wrap: nowrap; }
.hr-inv-qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 10px; flex: none; }
@media (max-width: 640px) {
  .hr-inv { flex-direction: column; align-items: stretch; }
  .hr-inv-qr { align-self: center; }
  .hr-inv .col > .btn { align-self: stretch; }
}

/* --- Hồ sơ nhân viên: thẻ tóm tắt dính bên trái + các nhóm thông tin --- */
.hr-prof { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.hr-prof-side { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.hr-prof-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.hr-prof-id { min-width: 0; }
.hr-prof-id h2 { font-size: 19px; overflow-wrap: anywhere; }
.hr-prof-st { margin-top: 8px; font-size: 13px; color: var(--tx-2); }
.hr-prof-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hr-dl { margin: 0; padding: 2px 18px 8px; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; }
.hr-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); align-items: baseline; min-width: 0; }
.hr-kv:last-child { border-bottom: 0; }
.hr-kv dt { color: var(--tx-3); font-size: 13px; }
.hr-kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
@media (min-width: 1280px), (min-width: 641px) and (max-width: 1024px) {
  .hr-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-kv.full { grid-column: 1 / -1; }
}
@media (min-width: 1025px) { .hr-prof-side { position: sticky; top: calc(var(--top-h) + 16px); } }
@media (max-width: 1024px) {
  .hr-prof { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hr-prof-side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 16px; gap: 12px; }
  .hr-prof-hero { flex-direction: row; text-align: left; flex: 1 1 260px; min-width: 0; }
  .hr-prof-side > .btn { flex: 0 1 auto; width: auto; }
  .hr-prof-main { gap: 12px; }
}
@media (max-width: 640px) {
  .hr-prof-side { padding: 14px; }
  .hr-prof-side > .btn { flex: 1 1 100%; }
  .hr-prof-hero .avatar.lg { width: 60px; height: 60px; font-size: 22px; }
  .hr-prof-id h2 { font-size: 18px; }
  .hr-dl { padding: 0 14px 4px; }
  .hr-kv { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 10px; padding: 11px 0; }
  .hr-kv dt { font-size: 13.5px; }
  .hr-kv dd a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* --- Thông tin nâng cao: 2 cột trên laptop --- */
.hr-adv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hr-adv > .wide { grid-column: 1 / -1; }
.hr-adv .empty { padding: 18px 12px; font-size: 13.5px; }
.hr-adv .empty svg { width: 28px; height: 28px; margin-bottom: 4px; }
@media (max-width: 1279px) { .hr-adv { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) { .hr-adv { gap: 12px; } }

/* --- Danh mục hệ thống --- */
.hr-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.hr-cat { display: flex; flex-direction: column; gap: 6px; padding: 16px; color: inherit; text-decoration: none !important; min-width: 0; }
.hr-cat:hover { border-color: var(--pri); }
.hr-cat-h { display: flex; align-items: center; gap: 8px; }
.hr-cat-chev { color: var(--tx-3); width: 16px; height: 16px; }
.hr-cat-desc { margin: -6px 0 12px; font-size: 13px; }
@media (max-width: 1279px) { .hr-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .hr-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 640px) {
  .hr-cats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hr-cat { padding: 12px 14px; gap: 4px; }
  .hr-cat-desc { margin: 0 2px 10px; }
}

/* --- Báo cáo nhân sự: bộ lọc có nhãn, bảng chéo có cột đầu dính --- */
.hr-fbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; }
.hr-fbar .f { flex: 1 1 150px; }
.hr-fbar .f > label { font-size: 12.5px; }
.hr-fbtns { display: flex; gap: 8px; margin-left: auto; }
.hr-rep .tbl th { z-index: 2; }
.hr-rep .tbl .hr-stk { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--line-2); }
.hr-rep .tbl th.hr-stk { z-index: 3; background: #f8fafb; }
.hr-rep .tbl tfoot td { background: #f8fafb; border-top: 1px solid var(--line); }
.hr-rep .tbl td.center, .hr-rep .tbl th.center { text-align: center; }
@media (max-width: 768px) {
  .hr-fbar { padding: 12px; gap: 10px; }
  .hr-fbar .f { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .hr-fbtns { flex: 1 1 100%; margin-left: 0; }
  .hr-fbtns .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
  .hr-rep .tbl th, .hr-rep .tbl td { padding: 9px 8px; }
  /* cột đầu dính: hẹp lại, tên dài xuống dòng để còn chỗ cho các cột số */
  .hr-rep .tbl .hr-stk { white-space: normal; min-width: 96px; max-width: 128px; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  /* ô chọn tháng cần cả hàng mới hiện đủ "tháng 10 năm 2026" */
  .hr-fbar .f:has(input[type=month]) { flex-basis: 100%; order: 1; }
  .hr-fbtns { order: 2; }
}
/* ==== hết: views-hr ==== */
/* ==== Khu vực: lương (views-pay) ==== */
/* chung các trang lương (.pay-pg gắn trên khung trang): tiêu đề cột số căn phải theo số */
.pay-pg .tbl th.right { text-align: right; }
.pay-pg .tbl th.center { text-align: center; }
.pay-pg code { overflow-wrap: anywhere; }

/* --- Bảng lương chi tiết (#/pay/payroll/<id>) --- */
.pay-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pay-meta { gap: 8px; }
.pay-sum { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.pay-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 120px; padding: 8px 14px; border-radius: 10px; background: var(--bg); }
.pay-kpi span { font-size: 12.5px; color: var(--tx-2); line-height: 1.3; }
.pay-kpi b { font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-kpi.hi { background: var(--pri-l); }
.pay-kpi.hi span, .pay-kpi.hi b { color: var(--pri-d); }
.pay-gw { max-height: 70vh; }
.pay-grid th, .pay-grid td { padding: 8px 10px; font-size: 13px; }
.pay-grid thead th { white-space: normal; min-width: 120px; max-width: 160px; text-align: right; vertical-align: bottom; line-height: 1.3; }
.pay-grid thead th.nm { text-align: left; vertical-align: bottom; }
.pay-grid th.b { color: var(--pri-d); background: #eaf6ef; }
.pay-grid td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-grid td.z { color: var(--tx-3); }
.pay-grid td.b { font-weight: 700; background: var(--pri-ll); }
.pay-grid tbody tr:hover td.b { background: #eaf6ef; }
.pay-grid td.nm { min-width: 220px; max-width: 280px; padding: 5px 8px 5px 12px; }
.pay-grid tfoot td { position: sticky; bottom: 0; z-index: 1; background: #f8fafb; border-top: 1px solid var(--line); border-bottom: 0; }
.pay-grid tfoot td.nm { z-index: 3; padding: 10px 12px; background: #f8fafb; }
.pay-grid tfoot td.b { background: #eaf6ef; }
.pay-nm-c { display: flex; align-items: center; gap: 6px; }
.pay-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--tx); font: inherit; }
.pay-nm b { line-height: 1.3; overflow-wrap: anywhere; }
.pay-nm:hover b { color: var(--pri-d); text-decoration: underline; }
.pay-nm:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 4px; }
.pay-ra { display: flex; gap: 4px; flex: none; }

/* phiếu lương (hộp thoại) */
.pay-slip-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pay-slip-h b { overflow-wrap: anywhere; }
.pay-slip-net { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: 12px; background: var(--pri-l); color: var(--pri-d); }
.pay-slip-net span { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pay-slip-net b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pay-slip-t td { padding: 9px 12px; }
.pay-slip-t td:first-child { overflow-wrap: anywhere; }
.pay-slip-t td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-slip-t td.z { color: var(--tx-3); }
.pay-slip-t tr.b td { font-weight: 700; background: var(--pri-ll); }
.pay-slip-t tbody tr:hover td { background: transparent; }
.pay-slip-t tbody tr.b:hover td { background: var(--pri-ll); }

/* --- Sửa chế độ lương: bảng phần tử / công thức --- */
.pay-el-w { max-height: 52vh; border: 1px solid var(--line); border-radius: 10px; }
.pay-el th, .pay-el td { padding: 6px; }
.pay-el th:first-child, .pay-el td:first-child { padding-left: 10px; }
.pay-el .inp { min-width: 0; }
.pay-el select.inp { width: auto; }
.pay-el [data-k="order"] { width: 56px; text-align: center; padding: 0 4px; }
.pay-el [data-k="name"] { min-width: 170px; }
.pay-el [data-k="code"] { width: 170px; }
.pay-el [data-k="code"], .pay-el [data-k="formula"] { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; }
.pay-el td.c-fx { min-width: 320px; width: 40%; }
.pay-el.no-multi .c-multi { display: none; }
.pay-el .c-chk { width: 1%; white-space: nowrap; }
.pay-el td.c-del { width: 1%; }
.pay-el input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--pri); cursor: pointer; }
.pay-el-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
/* khi bảng phải cuộn ngang (màn hẹp): cột tên phần tử dính trái để biết đang sửa dòng nào */
.pay-el th.c-nm, .pay-el td.c-nm { position: sticky; left: 0; background: #fff; box-shadow: 1px 0 0 var(--line); }
.pay-el td.c-nm { z-index: 1; }
.pay-el th.c-nm { z-index: 2; background: #f8fafb; }

/* --- Thay đổi dữ liệu lương (nhập theo kỳ) --- */
.pay-chg-w { max-height: 60vh; }
.pay-chg-t th.c-v, .pay-chg-t td.c-v { width: 200px; }
.pay-chg-t td.c-v .inp { text-align: right; font-variant-numeric: tabular-nums; }
.pay-chg-t td.c-nm b { overflow-wrap: anywhere; }
.pay-save { gap: 12px; }

/* --- Thống kê lương --- */
.pay-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pay-kpis .stat { padding: 14px 16px; }
.pay-kpis .stat > div { min-width: 0; }
.pay-kpis .stat .v { font-size: 21px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-kpis .stat.hi { background: var(--pri-l); border-color: #bfe6cd; }
.pay-kpis .stat.hi .v, .pay-kpis .stat.hi .l { color: var(--pri-d); }
.pay-pg .tbl td.pay-net { font-weight: 700; color: var(--pri-d); }

/* laptop: hộp thoại lớn có thân cuộn, nút Lưu luôn thấy */
@media (min-width: 769px) {
  .modal.pay-mode-ed, .modal.pay-slip-m { max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
  .modal.pay-mode-ed .modal-b, .modal.pay-slip-m .modal-b { overflow-y: auto; min-height: 0; }
  .modal.pay-mode-ed { max-width: 1200px; }
  .modal.pay-slip-m { max-width: 560px; }
  .pay-slip-t td { padding: 8px 12px; }
}

/* tablet & laptop nhỏ < 1280px (bảng còn dạng bảng): tiêu đề cột dài được xuống dòng để bảng bớt rộng */
@media (min-width: 641px) and (max-width: 1279px) {
  .pay-pg .tbl.cards th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
}
/* tablet dọc 641–768px: cột thao tác dính phải như trên laptop (quy tắc chung chỉ áp từ 769px) */
@media (min-width: 641px) and (max-width: 768px) {
  .pay-pg .tbl.cards td.acts, .pay-pg .tbl.cards th.acts { position: sticky; right: 0; background: var(--card); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
  .pay-pg .tbl.cards th.acts { z-index: 2; background: #f8fafb; }
  .pay-pg .tbl.cards tbody tr:hover td.acts { background: #fafcfb; }
}
/* tablet dọc & điện thoại (≤ 768px) */
@media (max-width: 768px) {
  .pay-pr .page-h { display: block; }
  .pay-back { display: none !important; } /* đã có nút quay lại trên thanh trên */
  .pay-acts { justify-content: stretch; }
  .pay-acts .btn { flex: 1 1 auto; }
  .pay-ra .btn.xs, .pay-pg .tbl td.acts .btn.xs { height: 40px; min-width: 40px; }
  .pay-el-w { max-height: 56vh; }
  .pay-el [data-k="order"] { width: 60px; }
  .pay-el [data-k="name"] { min-width: 150px; }
  .pay-el [data-k="code"] { width: 180px; }
  .pay-el td.c-fx { min-width: 300px; }
  .pay-el input[type="checkbox"] { width: 22px; height: 22px; }
  .pay-el .btn.xs { height: 40px; min-width: 40px; }
  .pay-el-acts .btn { flex: 1 1 auto; }
  .pay-chg-tb select.inp { flex: 1 1 100%; }
  .pay-chg-tb .btn { flex: 1 1 calc(50% - 8px); }
  .pay-save { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; justify-content: space-between; }
  .pay-save .btn { min-width: 150px; }
}

/* điện thoại (≤ 640px) */
@media (max-width: 640px) {
  .pay-pg .tbl.cards td.acts .btn.xs { height: 40px; min-width: 44px; }
  .pay-acts .btn { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 0 8px; font-size: 14px; }
  .pay-meta { font-size: 13px; }
  /* tóm tắt: 2 ô một hàng, Thực lĩnh cả hàng */
  .pay-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .pay-kpi { min-width: 0; padding: 8px 12px; }
  .pay-kpi.hi { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
  .pay-kpi.hi b { font-size: 20px; }
  /* bảng lương: cột tên hẹp lại, bấm tên để xem phiếu (nút thao tác chuyển vào phiếu) */
  .pay-gw { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
  .pay-grid th, .pay-grid td { padding: 8px; font-size: 13.5px; }
  .pay-grid thead th { min-width: 112px; font-size: 12.5px; }
  .pay-grid thead th.nm, .pay-grid td.nm { min-width: 132px; width: 132px; max-width: 132px; }
  .pay-grid td.nm { padding: 4px 8px; }
  .pay-grid tfoot td.nm { padding: 10px 8px; }
  .pay-ra { display: none; }
  .pay-nm { min-height: 44px; justify-content: center; }
  .pay-nm b { font-size: 14px; }
  /* phiếu lương */
  .pay-slip-net b { font-size: 24px; }
  .pay-slip-t td { padding: 10px 4px; font-size: 14.5px; }
  .pay-slip-m.has-rc .modal-f .pay-close { display: none; } /* đóng bằng nút X / vuốt xuống */
  /* nhập theo kỳ: mỗi nhân viên một thẻ */
  .pay-chg-w { max-height: none; overflow: visible; }
  .pay-chg-t thead { display: none; }
  .pay-chg-t, .pay-chg-t tbody { display: block; width: auto; }
  .pay-chg-t tbody { padding: 2px 8px 8px; }
  .pay-chg-t tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 10px; margin: 8px 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .pay-chg-t td { display: block; padding: 0; border: 0; width: auto !important; }
  .pay-chg-t tbody tr:hover td { background: transparent; }
  .pay-chg-t td.c-nm, .pay-chg-t td.c-dp { grid-column: 1 / -1; }
  .pay-chg-t td.c-nm { font-size: 15px; }
  .pay-chg-t td.c-dp { font-size: 13px; color: var(--tx-3); margin-bottom: 6px; }
  .pay-chg-t td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 13px; color: var(--tx-2); }
  /* thống kê */
  .pay-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pay-kpis .stat { padding: 12px; }
  .pay-kpis .stat.hi { grid-column: 1 / -1; }
  .pay-kpis .stat .v { font-size: 18px; }
  .pay-kpis .stat.hi .v { font-size: 24px; }
}
/* ==== hết: views-pay ==== */
/* ==== Khu vực: tài nguyên, văn hoá, hệ thống (views-misc) ==== */
/* các lớp vm-* chỉ dùng trong views-misc.js; trang gắn lớp .vm lên khung trang, hộp thoại gắn qua size ('vm-form', 'vm-ticket'…) */
.vm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.vm-lines { display: flex; flex-direction: column; gap: 2px; }
.vm-lines svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--tx-3); }
.vm-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vm-break { word-break: break-all; }
.vm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.vm-mono:not(input) { font-size: 12px; }
.vm-url { display: inline-block; max-width: 100%; word-break: break-all; overflow-wrap: anywhere; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.vm-p0 { margin-top: 0; }
.vm-h4 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.vm .tbl th.vm-wide, .vm .tbl td.vm-wide { min-width: 240px; }
.vm .tbl td.vm-wide .vm-url { max-width: 460px; }
/* hộp ghi chú / giải thích đầu trang */
.vm-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--blue-l); border: 1px solid #d3e4fa; border-radius: var(--r); color: #1f3b63; font-size: 13.5px; line-height: 1.55; }
.vm-note > svg { width: 22px; height: 22px; color: var(--blue); flex: none; margin-top: 1px; }
.vm-note code { background: rgba(255, 255, 255, .7); padding: 0 4px; border-radius: 4px; }
/* tiêu đề nhóm trong form */
.vm-sec { display: flex; gap: 10px; align-items: flex-start; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--line-2); }
.form-grid > .f:first-child .vm-sec { border-top: 0; padding-top: 0; margin-top: 0; }
.vm-sec > svg { width: 18px; height: 18px; color: var(--pri-d); margin-top: 2px; }
.vm-sec b { display: block; font-size: 14.5px; color: var(--tx); }
.vm-sec span { display: block; font-size: 12.5px; color: var(--tx-3); font-weight: 400; margin-top: 1px; }
.vm-qrbox { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; line-height: 0; }
.vm-qrbox img, .vm-qrbox canvas { max-width: 100%; height: auto; }

/* --- Cấu hình yêu cầu: lưới mẫu đơn --- */
.vm-grp .card-h .btn { width: 32px; padding: 0; }
.vm-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vm-type { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.vm-type:hover { border-color: #b9e4c9; box-shadow: var(--sh); }
.vm-type.off { background: #fafbfc; }
.vm-type.off .vm-ico { filter: grayscale(1); opacity: .7; }
.vm-type-h { display: flex; gap: 10px; align-items: center; }
.vm-type-h b { overflow-wrap: anywhere; }
.vm-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--pri-ll); display: grid; place-items: center; font-size: 20px; flex: none; }
.vm-who { display: flex; gap: 6px; align-items: flex-start; color: var(--tx-2); }
.vm-who svg { width: 14px; height: 14px; margin-top: 2px; flex: none; color: var(--tx-3); }
.vm-type-f { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.vm-none { grid-column: 1 / -1; padding: 18px; text-align: center; color: var(--tx-3); border: 1px dashed var(--line); border-radius: 10px; }
/* laptop: các nhóm xếp 2 cột (nhóm thường chỉ có 1–3 mẫu, một cột cả trang để trống rất nhiều) */
@media (min-width: 1025px) {
  .vm-grps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .vm-grps > .card { margin-bottom: 0; }
  .vm-grps > :not(.vm-grp) { grid-column: 1 / -1; }
  .vm-grps .vm-types { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* --- Chi tiết yêu cầu (hộp thoại, dùng cả cho nhân viên) --- */
.vm-tk-meta { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.vm-tk-desc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.vm-cmts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.vm-cmt { align-self: flex-start; max-width: 88%; background: var(--bg); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.vm-cmt.me { align-self: flex-end; background: var(--pri-l); border-radius: 12px 12px 4px 12px; }
.vm-cmt-t { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.vm-cmt-in { display: flex; gap: 8px; }
.vm-cmt-in .inp { flex: 1; min-width: 0; }

/* --- Máy checkin --- */
.vm-kq { display: flex; gap: 14px; align-items: center; }
.vm-kq p { margin: 0; flex: 1; min-width: 0; }

/* --- Lịch họp dạng tuần (quản trị + nhân viên) --- */
.vm-wkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vm-wknav { display: flex; align-items: center; gap: 4px; }
.vm-wknav .btn.icon { width: 34px; }
.vm-wkr { display: flex; flex-direction: column; align-items: center; min-width: 170px; font-size: 15px; line-height: 1.25; text-align: center; }
.vm-wkr .small { font-weight: 500; }
.vm-mcal .dh .vm-cnt, .vm-mcal .vm-today { display: none; }
.vm-mcal .day-col.past .dh { color: var(--tx-3); }
.vm-mcal .ev { transition: background .15s; }
.vm-mcal .ev:hover { background: #dcebfc; }
.vm-mcal .ev.own { border-left-color: var(--pri); background: var(--pri-l); }
.vm-mcal .ev.own:hover { background: #d6f1e0; }
.vm-mcal .ev:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }
.vm-mcal .ev .vm-evt { display: block; overflow-wrap: anywhere; }
.vm-mcal .ev .vm-evt .small { display: block; }
/* chi tiết cuộc họp */
.vm-people { display: flex; flex-direction: column; gap: 6px; }
.vm-person { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.vm-person .grow { overflow-wrap: anywhere; }
.vm-person .vm-tags { justify-content: flex-end; }
/* thống kê phòng họp */
.vm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-bottom: 1px solid var(--line-2); }

/* --- Sinh nhật --- */
.vm-emp .tag { margin-left: 2px; }
.vm-card-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vm-card-t img, .vm-card-ph { width: 84px; height: 56px; border-radius: 8px; flex: none; object-fit: cover; background: var(--bg); }
.vm-card-ph { display: grid; place-items: center; color: var(--tx-3); }

/* --- Thẻ cài đặt dạng công tắc (lời chào, sinh nhật, kiểm duyệt) --- */
.vm-set { max-width: 680px; overflow: hidden; }
.vm-opt { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.vm-opt:hover { background: var(--pri-ll); }
.vm-opt:has(input:disabled) { cursor: default; background: none; }
.vm-opt b { display: block; font-weight: 600; }
.vm-opt .grow > .small { display: block; margin-top: 2px; line-height: 1.45; }
.vm-opt .switch input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
.vm-set-note { padding: 12px 18px; background: #fafbfc; border-bottom: 1px solid var(--line-2); line-height: 1.55; }
.vm-set-note code { background: var(--line-2); padding: 0 4px; border-radius: 4px; }
.vm-set-f { padding: 12px 18px; display: flex; justify-content: flex-end; }
.vm-set > :last-child { border-bottom: 0; }

/* --- Cài đặt Workspace: nhóm + xem trước --- */
.vm-ws { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; max-width: 1120px; }
.vm-ws-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vm-ws-h { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.vm-ws-h > svg { width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 10px; background: var(--pri-l); color: var(--pri-d); flex: none; }
.vm-ws-h h3 { font-size: 15.5px; font-weight: 600; }
.vm-ws-h p { margin: 2px 0 0; }
.vm-ws input[type=color] { width: 72px; padding: 3px; cursor: pointer; }
.vm-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 24px rgba(16, 24, 40, .1); }
.vm-ws-side { position: sticky; top: calc(var(--top-h) + 16px); }
.vm-prev-t { font-size: 12px; font-weight: 600; color: var(--tx-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.vm-brand { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: linear-gradient(180deg, var(--side), #0b3f27); color: var(--side-t); }
.vm-brand b { display: block; color: #fff; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.vm-brand span { font-size: 11.5px; opacity: .7; }
.vm-logo { width: 38px; height: 38px; border-radius: 9px; background: #fff; display: grid; place-items: center; color: var(--pri); font-weight: 800; overflow: hidden; flex: none; }
.vm-logo img { width: 100%; height: 100%; object-fit: cover; }
.vm-prev-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.vm-prev-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; color: #fff; font-weight: 600; }
.vm-prev-btn svg { width: 16px; height: 16px; }
.vm-prev-tag { display: inline-flex; padding: 2px 10px; border: 1px solid; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* --- Quyền quản trị: bảng chọn mức quyền --- */
.vm-pm { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.vm-pm-q { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; background: #f8fafb; border-bottom: 1px solid var(--line); }
.vm-pm-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.vm-pm-r:last-child { border-bottom: 0; }
.vm-pm-r:hover { background: #fafcfb; }
.vm-pm-n b { display: block; font-weight: 600; }
.vm-pm-n .small { display: block; line-height: 1.4; }
.vm-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.vm-seg label { position: relative; cursor: pointer; }
.vm-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.vm-seg span { display: flex; align-items: center; justify-content: center; height: 30px; min-width: 84px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--tx-2); white-space: nowrap; transition: background .15s, color .15s; }
.vm-seg label:hover span { color: var(--tx); }
.vm-seg input:checked + span { background: #fff; color: var(--tx); box-shadow: var(--sh); }
.vm-seg .lv-view input:checked + span { background: var(--blue-l); color: #1e5fb4; }
.vm-seg .lv-edit input:checked + span { background: var(--pri); color: #fff; }
.vm-seg input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 1px; }
/* bảng tổng hợp quyền */
.vm-pmx .legend > span { display: inline-flex; align-items: center; gap: 6px; }
.vm-pv { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.vm-pv svg { width: 14px; height: 14px; }
.vm-pv.e { background: var(--pri-l); color: var(--pri-d); }
.vm-pv.v { background: var(--blue-l); color: var(--blue); }
.vm-pv.n { color: var(--tx-3); }
.vm-pmx .tbl th.center { white-space: normal; min-width: 96px; text-align: center; }
.vm-pmx .tbl .vm-pmx-n { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 150px; border-right: 1px solid var(--line-2); }
.vm-pmx .tbl th.vm-pmx-n { background: #f8fafb; z-index: 3; }

/* --- Thiết bị --- */
.vm-elink { display: inline-flex; align-items: center; gap: 4px; color: var(--tx); }
.vm-elink svg { width: 14px; height: 14px; color: var(--tx-3); }

/* --- Kết nối máy chủ --- */
.vm-api-g { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1200px; }
.vm-api-g > .col { gap: 16px; }
.vm-status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.vm-status.demo { background: var(--orange-l); }
.vm-status.on { background: var(--pri-ll); }
.vm-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.vm-danger .vm-ws-h > svg { background: var(--red-l); color: var(--red); }
.vm-steps { margin: 0; padding: 0; list-style: none; counter-reset: vms; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.vm-steps li { counter-increment: vms; position: relative; padding-left: 38px; min-height: 26px; line-height: 1.6; }
.vm-steps li::before { content: counter(vms); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--pri-l); color: var(--pri-d); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.vm-steps code, .vm-api code { background: var(--line-2); padding: 0 4px; border-radius: 4px; }

/* tablet & laptop nhỏ */
@media (max-width: 1024px) {
  .vm-api-g { grid-template-columns: 1fr; }
}
/* tablet & laptop nhỏ < 1280px (bảng còn dạng bảng): tiêu đề cột được xuống dòng, ô bớt đệm để bảng vừa khung */
@media (min-width: 641px) and (max-width: 1279px) {
  .vm .tbl:not(.ts) th { white-space: normal; min-width: 64px; vertical-align: bottom; }
  .vm .tbl:not(.ts) td, .vm .tbl:not(.ts) th { padding-left: 8px; padding-right: 8px; }
  .vm .tbl th.vm-wide, .vm .tbl td.vm-wide { min-width: 180px; }
}
/* cột phụ (vm-lap: Loại máy, Thời gian tạo...) chỉ hiện trên màn rộng > 1366px; laptop 1280–1366 bảng vừa khung */
@media (min-width: 641px) and (max-width: 1366px) {
  .vm .tbl .vm-lap { display: none; }
}
@media (max-width: 900px) {
  .vm-ws { grid-template-columns: 1fr; }
  .vm-ws-side { position: static; order: -1; }
}

/* điện thoại & tablet nhỏ: vùng chạm ≥ 40px, xếp dọc */
@media (max-width: 768px) {
  .vm .btn.xs, .vm-form .btn.xs, .vm-meet .btn.xs, .vm-ticket .btn.xs { height: 40px; min-width: 40px; }
  .vm-form .multi label { min-height: 40px; }
  .vm-grp .card-h .btn { width: 40px; }
  .vm-note { padding: 12px 14px; gap: 10px; font-size: 14px; }
  .vm-tk-meta { flex-wrap: wrap; }
  .vm-kq { align-items: flex-start; }

  /* lịch tuần: dải chọn tuần chiếm cả hàng, ngày xếp dọc gọn */
  .vm-wknav { flex: 1 1 100%; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
  .vm-wknav .btn.icon { width: 44px; border-color: transparent; }
  .vm-wkr { flex: 1; min-width: 0; }
  .vm-wkbar > .btn { flex: 1 1 0; }
  .vm-wkbar > .grow { display: none; }
  .vm-mcal .day-col .dh { justify-content: flex-start; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; }
  .vm-mcal .day-col:has(.db:empty) .dh { border-bottom: 0; }
  .vm-mcal .day-col.today .dh { border-radius: 10px; }
  .vm-mcal .day-col.today:has(.db:not(:empty)) .dh { border-radius: 10px 10px 0 0; }
  .vm-mcal .dh .vm-cnt { display: inline; margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--tx-3); }
  .vm-mcal .vm-today { display: inline-flex; margin-left: 4px; padding: 1px 8px; border-radius: 10px; background: var(--pri); color: #fff; font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
  .vm-mcal .db { padding: 8px; }
  .vm-mcal .ev { display: grid; grid-template-columns: minmax(94px, auto) minmax(0, 1fr); gap: 10px; align-items: start; min-height: 48px; padding: 10px 12px; font-size: 14px; }
  .vm-mcal .ev b { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .vm-meet .modal-f { flex-wrap: wrap; }
  .vm-meet .modal-f .btn { flex: 1 1 auto; min-width: calc(33.33% - 6px); }

  .vm-set { max-width: none; }
  .vm-opt { padding: 14px; min-height: 64px; }
  .vm-set-note { padding: 12px 14px; }
  .vm-set-f { padding: 12px 14px; }
  .vm-set-f .btn { flex: 1; }

  .vm-ws-h { padding: 12px 14px; }
  .vm-savebar { bottom: calc(78px + env(safe-area-inset-bottom)); padding: 10px 12px; }
  .vm-savebar .small { display: none; }
  .vm-savebar .btn { flex: 1; }
  .vm-ws input[type=color] { width: 88px; }

  .vm-pm-r { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .vm-seg { display: flex; }
  .vm-seg label { flex: 1 1 0; min-width: 0; }
  .vm-seg span { height: 40px; min-width: 0; padding: 0 6px; font-size: 14px; }
  .vm-pm-q .grow { flex-basis: 100%; }
  .vm-pm-q .btn { flex: 1 1 0; }
}

/* điện thoại: bảng thành thẻ — ô nhiều dòng giữ một khối, ô dài hiện nhãn phía trên */
@media (max-width: 640px) {
  .vm .tbl.cards td > * { min-width: 0; overflow-wrap: anywhere; }
  .vm .tbl.cards td > .vm-tags { justify-content: flex-end; }
  .vm .tbl.cards td.vm-wide { min-width: 0; }
  .vm .tbl.cards td.vm-block { display: block; text-align: left; }
  .vm .tbl.cards td.vm-block::before { display: block; max-width: none; margin-bottom: 3px; }
  .vm .tbl.cards td.vm-block .vm-tags { justify-content: flex-start; }
  .vm .tbl.cards td.vm-block .vm-url { max-width: 100%; }
  .vm .tbl.cards .vm-elink { min-height: 40px; }
  .vm-card-t img, .vm-card-ph { width: 64px; height: 44px; }
  .vm-types { grid-template-columns: 1fr; }
  .vm-grp > .card-b { padding: 10px; }
  .vm-ws-prev .vm-prev-row, .vm-ws-prev #pvHex { display: none; }
  .vm-ws-prev .vm-prev-t { margin-bottom: 8px; }
  .vm-stats { gap: 8px; padding: 10px; }
  .vm-stats .stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .vm-stats .stat .ic { width: 30px; height: 30px; border-radius: 8px; }
  .vm-stats .stat .ic svg { width: 16px; height: 16px; }
  .vm-stats .stat .v { font-size: 18px; }
  .vm-stats .stat .l { font-size: 12px; line-height: 1.3; }
  .vm-btns .btn { flex: 1 1 100%; white-space: normal; height: auto; min-height: 44px; padding: 8px 14px; }
  .vm-pmx .card-h .legend { width: 100%; }
}
/* ==== hết: views-misc ==== */

/* ==== Khu vực: Gói dịch vụ & menu tài khoản (app.js, views-plan) ==== */
.plan-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; color: #fff !important; text-decoration: none !important; background: linear-gradient(135deg, #15a34a, #0e7a39); }
.plan-card b { display: block; font-size: 15px; letter-spacing: .03em; }
.plan-card span { display: block; font-size: 12.5px; opacity: .92; }
.plan-card svg { opacity: .9; }
.plan-card.s-trialing { background: linear-gradient(135deg, #f59e0b, #ea7a0c); }
.plan-card.s-grace, .plan-card.s-expired, .plan-card.s-readonly, .plan-card.s-locked { background: linear-gradient(135deg, #e5484d, #b42318); }
.user-pop { position: fixed; top: calc(var(--top-h) - 4px); right: 16px; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 60; padding: 14px; animation: pop .15s ease; }
.user-pop-h { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px 0 14px; }
.user-pop-h b { font-size: 16px; margin-top: 6px; }
.user-pop-l { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.user-pop-l a, .user-pop-l button { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border: 0; background: none; border-radius: 8px; color: var(--tx); cursor: pointer; text-align: left; font-weight: 500; text-decoration: none !important; }
.user-pop-l a:hover, .user-pop-l button:hover { background: var(--bg); }
.user-pop-l .danger { color: var(--red); }
.plan-bar { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 13.5px; background: var(--orange-l); color: #8a5300; border-bottom: 1px solid #f3dd9c; }
.plan-bar.s-grace, .plan-bar.s-expired, .plan-bar.s-readonly, .plan-bar.s-locked { background: var(--red-l); color: #a1161b; border-bottom-color: #f6c5c7; }
.plan-bar a { font-weight: 600; color: inherit; text-decoration: underline; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-now-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* nhãn trạng thái dài (quá hạn, ân hạn): không đủ chỗ thì xuống dòng dưới tên gói, không tràn ngang trên điện thoại */
.plan-now-h > .grow { flex: 1 1 110px; min-width: min-content; }
.plan-now-h > .tag { white-space: normal; }
.plan-name { font-size: 22px; font-weight: 800; }
.plan-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.plan-facts b { font-size: 18px; }
.plan-over { color: var(--red); }
.plan-meter { height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; margin: 6px 0; }
.plan-meter i { display: block; height: 100%; background: var(--pri); border-radius: 6px; }
.plan-meter i.over { background: var(--red); }
.plan-warn { margin-top: 16px; background: var(--orange-l); border-color: #f0c674; color: #8a5300; }
.plan-now.s-grace .plan-warn, .plan-now.s-expired .plan-warn, .plan-now.s-readonly .plan-warn, .plan-now.s-locked .plan-warn { background: var(--red-l); border-color: #f2b8ba; color: #a1161b; }
.plan-warn svg { vertical-align: -3px; }
.plan-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-item.cur { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri-l); }
.plan-price { font-size: 20px; font-weight: 800; margin-top: 10px; }
.plan-desc { color: var(--pri-d); font-weight: 500; margin-top: 2px; }
.plan-price span { font-size: 13px; font-weight: 500; color: var(--tx-3); }
@media (max-width: 1024px) { .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .plan-bar { padding: 8px 12px; font-size: 13px; }
  .plan-facts { grid-template-columns: 1fr; }
  .plan-list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .plan-price { font-size: 17px; }
}
.plan-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-calc .f:last-child { grid-column: 1 / -1; }
.plan-q { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--pri-ll); }
.plan-q-h { font-size: 15px; margin-bottom: 8px; }
.plan-q-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13.5px; }
.plan-q-rows > div span { color: var(--tx-2); }
.plan-q-total { border-top: 1px dashed #b9dfc6; margin-top: 4px; padding-top: 8px !important; font-size: 16px !important; }
.plan-q-total b { color: var(--pri-d); font-size: 18px; }
.plan-save { color: var(--pri-d); }
.plan-tip { margin-top: 8px; color: #8a5300; }
.tbl th.plan-hl, .tbl td.plan-hl { background: var(--pri-ll); }
.plan-rules ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; font-size: 13.5px; }
.plan-rules li { margin-bottom: 6px; }
@media (max-width: 768px) { .plan-calc { grid-template-columns: 1fr; } }
/* mã kích hoạt: laptop 2 cột (gói hiện tại + lịch sử | nhập mã + tính giá); ≤1024px 1 cột, ô nhập mã lên đầu khi dùng thử / sắp hết hạn / quá hạn */
.plan-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-key-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--pri-l); color: var(--pri-d); }
.plan-key.urgent { border-color: #f0c674; box-shadow: 0 0 0 3px var(--orange-l), var(--sh); }
.plan-key.urgent .plan-key-ic { background: var(--orange-l); color: #a86a00; }
.plan-key-f > label { display: block; font-size: 13px; font-weight: 500; color: var(--tx-2); margin-bottom: 6px; }
.plan-key-row { display: flex; gap: 8px; }
.plan-key-row .btn { height: 44px; flex: none; }
.inp.plan-key-in { flex: 1; height: 44px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .05em; text-transform: uppercase; }
.inp.plan-key-in::placeholder { color: var(--tx-3); opacity: .7; }
.inp.plan-key-in.bad { border-color: var(--red); }
.plan-key-err { margin-top: 8px; color: #c22b30; font-size: 13px; }
.plan-buy { margin: 14px 0 0; padding-left: 18px; color: var(--tx-2); line-height: 1.6; }
.plan-buy li { margin-bottom: 2px; }
.plan-mask { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.plan-demo .inp { flex: 1 1 140px; width: auto; }
.plan-demo #dpCode { flex-basis: 180px; }
.plan-cf-lic { padding: 12px 14px; border-radius: 12px; background: var(--pri-ll); border: 1px solid #cfeedd; }
.plan-cf-lic b { display: block; font-size: 16px; margin-top: 2px; }
.plan-cf-cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; margin-top: 14px; }
.plan-cf-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; }
.plan-cf-col > b { font-size: 15px; }
.plan-cf-col.new { border-color: var(--pri); background: var(--pri-ll); }
.plan-cf-arr { align-self: center; color: var(--tx-3); }
.plan-cf-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; color: var(--tx-2); }
.plan-cf-note svg { width: 16px; height: 16px; color: var(--pri-d); margin-top: 1px; }
.plan-cf .plan-warn { margin-top: 12px; }
@media (max-width: 1024px) {
  .plan-col { display: contents; }
  .plan-now { order: 1; }
  .plan-key { order: 2; }
  .plan-key.urgent { order: 0; }
  .plan-calc-card { order: 3; }
  .plan-hist { order: 4; }
}
@media (max-width: 768px) { .plan-key-row .btn, .inp.plan-key-in { height: 46px; } }
@media (max-width: 480px) {
  .plan-key-row { flex-direction: column; }
  .inp.plan-key-in { flex: none; }
  .plan-cf-cmp { grid-template-columns: minmax(0, 1fr); }
  .plan-cf-arr { justify-self: center; transform: rotate(90deg); }
}
.plan-bar a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; }
body.on-menu #planBar { display: none; }
details.menu-sec > summary { list-style: none; cursor: pointer; }
details.menu-sec > summary::-webkit-details-marker { display: none; }
details.menu-sec > summary .menu-h { margin: 0; padding: 12px 4px; }
details.menu-sec > summary .menu-h::after { content: '›'; margin-left: auto; font-size: 18px; transition: transform .2s; }
details.menu-sec[open] > summary .menu-h::after { transform: rotate(90deg); }
.menu-t { font-size: 13px; font-weight: 600; color: var(--tx-2); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 4px; }
/* màn hình cảm ứng (tablet) ở dạng bảng: ô chọn và nút trên dòng to hơn */
@media (pointer: coarse) { .tbl input[data-sel] { width: 22px; height: 22px; } .tbl td.acts .btn { min-height: 38px; min-width: 38px; } }
/* ==== hết: gói dịch vụ ==== */

/* ==== Khu vực: Thông báo Telegram (views-notify) ==== */
.tele-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.tele-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tele-row > .inp { flex: 1 1 260px; }
.tele-m .multi { max-height: none; }
.tele-chat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tele-chat-h { display: flex; gap: 12px; align-items: center; }
.tele-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tele-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: flex-end; }
.tele-help h3 { font-size: 15.5px; }
.tele-help ol { padding-left: 18px; line-height: 1.65; margin: 10px 0 0; font-size: 13.5px; }
.tele-help li { margin-bottom: 8px; }
.tele-sample { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tele-bubble { background: #eef6ff; border: 1px solid #d3e6fb; border-radius: 14px 14px 14px 4px; padding: 10px 12px; margin-top: 8px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.tele-prev { margin-bottom: 16px; }
.tele .greet svg { vertical-align: -3px; }
@media (max-width: 1024px) { .tele-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .tele-acts .btn { flex: 1 1 0; } .tele-row .btn { flex: 1 1 100%; } .tele .card-b > .row .btn { flex: 1 1 100%; } .tele-row .f { max-width: none !important; flex: 1 1 100%; } }
/* ==== hết: views-notify ==== */

@media print {
  .side, .top, .bottom-nav, .toolbar, .no-print, .demo-bar { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  /* đang mở hộp thoại (phiếu lương, QR): chỉ in nội dung hộp thoại */
  body:has(.modal-bg) #app, body:has(.modal-bg) .toasts { display: none !important; }
  .modal-bg { position: static; overflow: visible; padding: 0; background: none; animation: none; }
  .modal { max-width: none !important; max-height: none !important; box-shadow: none; border-radius: 0; }
  .modal-b { overflow: visible !important; }
  .modal-f, .modal-h button { display: none !important; }
}
