/* HRM › Chấm công: bảng công dạng lịch (hrm-attendance-calendar.js). Mỗi trạng thái một màu riêng, ô vuông phẳng; Chủ nhật nền kẻ,
   hôm nay viền màu chính. Bảng tháng cuộn ngang, cột tên và cột tổng dính hai bên. */
.hrm-attcal, .hrm-attcal-dialog { --ac-ok: #15803D; --ac-late: #C2410C; --ac-ot: #1D4ED8; --ac-open: #0E7490; --ac-miss: #B45309; --ac-leave: #7C3AED; --ac-unpaid: #64748B; --ac-absent: #DC2626; --ac-trip: #0F766E; --ac-cell: 31px; --ac-sum: 48px; }
.hrm-attcal-head { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px 20px; }
.hrm-attcal-head h3 { margin: 0; white-space: nowrap; }
/* Máy tính (anh Hiệp 02/11/2026): nút Theo tháng / Theo người nằm bên trái, cạnh tiêu đề. */
.hrm-attcal-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hrm-attcal-month { display: flex; align-items: center; gap: 6px; }
.hrm-attcal-month strong { min-width: 118px; text-align: center; font-size: 1rem; color: var(--ink, var(--bms-text)); }
.hrm-attcal-month .btn { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.hrm-attcal-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.hrm-attcal-search { flex: 0 1 360px; min-width: 200px; }
/* Máy tính: ô tìm chuẩn (có nút Lọc) nằm góc phải hàng. */
/* Độ dài chuẩn của ô tìm (420px như các trang khác), không kéo dài hết chỗ trống (anh Hiệp 02/11/2026). */
html:not(.bms-phone-v2) .hrm-attcal-tools .hrm-attcal-search:not(#\#) { --bms-search-width: 420px; flex: 0 1 420px; width: 420px; min-width: 300px; }
html:not(.bms-phone-v2) .hrm-attcal-fgroup { display: grid; gap: 8px; min-width: 240px; }
html:not(.bms-phone-v2) .hrm-attcal-fgroup > span { color: var(--muted); font-size: 12px; font-weight: 600; }
html:not(.bms-phone-v2) .hrm-attcal-fchips { display: flex; gap: 6px; }
html:not(.bms-phone-v2) .hrm-attcal-fchips button { flex: 1; height: 36px; padding: 0 14px; border: 1px solid var(--bms-border, #DCE3EF); border-radius: 8px; background: var(--bms-surface, #fff); color: var(--bms-text, #1F2937); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
html:not(.bms-phone-v2) .hrm-attcal-fchips button.active { border-color: var(--bms-primary, #1A73E8); background: #EFF6FF; color: var(--bms-primary, #1A73E8); }
.hrm-attcal-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bms-surface-subtle, #EEF2F7); }
.hrm-attcal-seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; }
.hrm-attcal-seg button.active { background: var(--bms-surface, #fff); color: var(--bms-primary, #0757b8); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.hrm-attcal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 12px; color: var(--muted); font-size: .8rem; }
.hrm-attcal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hrm-attcal-legend .hrm-attcal-swatch { width: 22px; height: 18px; font-size: 10px; }

/* Ô trạng thái dùng chung cho bảng, chú thích, hộp chi tiết */
.hrm-attcal-swatch { position: relative; display: inline-grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 4px; color: #fff; font: 700 12px/1 var(--bms-font-ui, inherit); font-variant-numeric: tabular-nums; cursor: pointer; }
.hrm-attcal-swatch.inline { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.hrm-attcal-swatch.ok { background: var(--ac-ok); }
.hrm-attcal-swatch.late { background: var(--ac-late); }
.hrm-attcal-swatch.ot { background: var(--ac-ot); }
.hrm-attcal-swatch.open { background: color-mix(in srgb, var(--ac-open) 14%, var(--bms-surface, #fff)); color: var(--ac-open); box-shadow: inset 0 0 0 1.5px var(--ac-open); font-size: 10px; }
.hrm-attcal-swatch.miss { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ac-miss) 18%, var(--bms-surface, #fff)) 0 4px, var(--bms-surface, #fff) 4px 8px); color: var(--ac-miss); box-shadow: inset 0 0 0 1.5px var(--ac-miss); }
.hrm-attcal-swatch.leave { background: var(--ac-leave); }
.hrm-attcal-swatch.unpaid { background: var(--ac-unpaid); }
.hrm-attcal-swatch.absent { background: var(--ac-absent); }
.hrm-attcal-swatch.trip { background: var(--ac-trip); }
.hrm-attcal-swatch.has-flag::after { position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #FACC15; box-shadow: 0 0 0 1.5px #fff; content: ""; }
.hrm-attcal-swatch.has-flag.pending::after { background: #F97316; }

/* Bảng tháng */
.hrm-attcal-wrap { overflow-x: auto; border: 1px solid var(--line, #c8d8ef); border-radius: 10px; }
/* Cột tên / ô dính (sticky) không được nổi đè lên thanh tiêu đề trang khi cuộn (anh Hiệp 02/11/2026). */
html:not(.bms-phone-v2) .hrm-attcal-wrap { isolation: isolate; }
.hrm-attcal-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.hrm-attcal-grid :where(th):is(th, td), .hrm-attcal-grid :where(td):is(th, td) { padding: 0; vertical-align: middle; border-bottom: 1px solid var(--line, #E2E8F0); background: var(--bms-surface, #fff); text-align: center; }
.hrm-attcal-grid thead th { position: sticky; top: 0; z-index: 2; height: 44px; background: var(--bms-surface-subtle, #F8FAFC); color: var(--muted); font-weight: 600; }
.hrm-attcal-grid thead th b { display: block; color: var(--ink, var(--bms-text)); font-size: 13px; }
.hrm-attcal-grid thead th small { display: block; font-size: 10px; }
.hrm-attcal-grid :where(th):is(thead th, tfoot td).sun, .hrm-attcal-grid :where(td):is(thead th, tfoot td).sun, .hrm-attcal-cell.sun { background: repeating-linear-gradient(135deg, var(--bms-surface-subtle, #F1F5F9) 0 5px, var(--bms-surface, #fff) 5px 10px); }
.hrm-attcal-grid thead th.today { box-shadow: inset 0 -3px 0 var(--bms-primary, #0757b8); }
.hrm-attcal-grid thead th.today b { color: var(--bms-primary, #0757b8); }
.hrm-attcal-cell { width: var(--ac-cell); min-width: var(--ac-cell); height: var(--ac-cell); padding: 3px 1.5px !important; }
.hrm-attcal-cell > button { display: block; width: calc(var(--ac-cell) - 3px); height: 28px; margin: 0 auto; }
.hrm-attcal-cell > button:not(.hrm-attcal-swatch) { border: 0; border-radius: 4px; background: var(--bms-surface-subtle, #F1F5F9); cursor: pointer; }
.hrm-attcal-cell.sun > button:not(.hrm-attcal-swatch), .hrm-attcal-cell.future > button:not(.hrm-attcal-swatch) { background: transparent; cursor: default; }
.hrm-attcal-cell.today { background: color-mix(in srgb, var(--bms-primary, #0757b8) 6%, var(--bms-surface, #fff)); }
.hrm-attcal-cell > button:hover:not(:disabled) { outline: 2px solid var(--bms-primary, #0757b8); outline-offset: 1px; }
.hrm-attcal-who { position: sticky; left: 0; z-index: 1; min-width: 190px; max-width: 190px; padding: 0 10px !important; text-align: left !important; box-shadow: 1px 0 0 var(--line, #E2E8F0); }
thead .hrm-attcal-who { z-index: 3; font-size: 13px; }
.hrm-attcal-who span:not(.hrm-attcal-pic):not(.avatar-role-portrait) { color: var(--muted); font-weight: 600; }
.hrm-attcal-who > button { display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.hrm-attcal-who > button > span:last-child { display: grid; min-width: 0; }
.hrm-attcal-who b { overflow: hidden; color: var(--ink, var(--bms-text)); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.hrm-attcal-who small { color: var(--muted); font-size: 11px; }
.hrm-attcal-who > button:hover b { color: var(--bms-primary, #0757b8); text-decoration: underline; }
.hrm-attcal-pic:not(#\#) { flex: 0 0 30px; width: 30px; height: 30px; min-width: 30px; min-height: 30px; border-radius: 50%; box-shadow: none; }
.hrm-attcal-pic.big:not(#\#) { flex-basis: 48px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
.hrm-attcal-group th { position: sticky; left: 0; height: 30px; padding: 0 10px !important; background: var(--bms-surface-subtle, #F8FAFC) !important; color: var(--ink, var(--bms-text)); font-size: 12px; font-weight: 800; text-align: left !important; text-transform: uppercase; letter-spacing: .04em; }
.hrm-attcal-group th span { margin-left: 6px; color: var(--muted); font-weight: 600; }
/* Tên tổ dính trái khi cuộn ngang (ô gộp cả hàng không tự dính được). */
.hrm-attcal-group th > b { position: sticky; left: 10px; font-weight: inherit; }
.hrm-attcal-sum { position: sticky; z-index: 1; width: var(--ac-sum); min-width: var(--ac-sum); max-width: var(--ac-sum); padding: 0 2px !important; color: var(--ink, var(--bms-text)); font-size: 13px; font-variant-numeric: tabular-nums; }
thead .hrm-attcal-sum { font-size: 11px; line-height: 1.2; white-space: nowrap; }
tbody .hrm-attcal-sum:first-of-type, .hrm-attcal-sum.strong { font-weight: 800; }
:where(td):is(td, th).hrm-attcal-sum:nth-last-child(1), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(1) { right: 0; } :where(td):is(td, th).hrm-attcal-sum:nth-last-child(2), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(2) { right: var(--ac-sum); }
:where(td):is(td, th).hrm-attcal-sum:nth-last-child(3), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(3) { right: calc(var(--ac-sum) * 2); } :where(td):is(td, th).hrm-attcal-sum:nth-last-child(4), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(4) { right: calc(var(--ac-sum) * 3); }
:where(td):is(td, th).hrm-attcal-sum:nth-last-child(5), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(5) { right: calc(var(--ac-sum) * 4); }
:where(td):is(td, th).hrm-attcal-sum:nth-last-child(6), :where(th):is(td, th).hrm-attcal-sum:nth-last-child(6) { right: calc(var(--ac-sum) * 5); box-shadow: -1px 0 0 var(--line, #E2E8F0); }
thead .hrm-attcal-sum { z-index: 3; }
.hrm-attcal-grid tfoot td:last-child { position: sticky; right: 0; }
.hrm-attcal-sum.warn { color: var(--ac-late); font-weight: 800; }
.hrm-attcal-sum.bad { color: var(--ac-absent); font-weight: 800; }
.hrm-attcal-sum.ot { color: var(--ac-ot); font-weight: 800; cursor: help; }
/* Tăng ca theo kế hoạch (02/11/2026): cột "TC ghi nhận" chữ thường, cột "TC hợp lệ" đậm; còn giờ chưa hợp lệ thì gạch chân cam. */
thead .hrm-attcal-sum small { display: block; font-size: 9.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.hrm-attcal-sum.ot-rec { color: var(--muted); font-weight: 600; }
.hrm-attcal-sum.short { text-decoration: underline 2px #F59E0B; text-underline-offset: 3px; }
.hrm-attcal-swatch.no-plan::before { position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 9px 9px; border-color: transparent transparent #F59E0B transparent; border-bottom-right-radius: 4px; content: ""; }
.hrm-attcal-grid thead th.has-plan small::after { display: block; width: 5px; height: 5px; margin: 2px auto 0; border-radius: 50%; background: var(--ac-ot); content: ""; }
.hrm-attcal-noplan { color: #B45309; font-size: 12px; font-weight: 700; }
.hrm-attcal-warn { color: #B45309; } .hrm-attcal-okv { color: var(--ac-ot); } .hrm-attcal-muted { color: var(--muted); }
.hrm-attcal-act:not(#\#) { height: 48px; padding: 0 16px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
.hrm-attcal-act { position: relative; }
.hrm-attcal-export { position: relative; display: inline-flex; }
.hrm-attcal-export > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; user-select: none; }
.hrm-attcal-export > summary::-webkit-details-marker { display: none; }
.hrm-attcal-export > summary > span { font-size: 11px; line-height: 1; }
.hrm-attcal-export-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 130; display: grid; min-width: 180px; padding: 6px; border: 1px solid var(--bms-border, #E0E0E0); border-radius: 12px; background: var(--bms-surface, #fff); box-shadow: 0 16px 40px rgba(15, 23, 42, .16); }
.hrm-attcal-export-item { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--bms-text, #101010); font: 500 14px/1.2 var(--bms-font-ui, Roboto, system-ui, sans-serif); text-align: left; cursor: pointer; white-space: nowrap; }
.hrm-attcal-export-item:is(:hover, :focus-visible) { outline: none; background: var(--bms-surface-subtle, #F7F7F7); }
.hrm-attcal-export-item:disabled { opacity: .5; cursor: default; }
.hrm-attcal-ico { flex: none; }
.hrm-attcal-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #DC2626; color: #fff; font: 700 11px/20px var(--bms-font-ui, inherit); box-shadow: 0 0 0 2px var(--bms-surface, #fff); }
.hrm-attcal-plans { width: min(860px, calc(100vw - 32px)); }
.hrm-attcal-plist { display: grid; gap: 10px; max-height: min(62vh, 560px); overflow: auto; margin-bottom: 12px; padding: 2px; }
.hrm-attcal-pcard { padding: 12px 14px; border: 1px solid var(--line, #E2E8F0); border-radius: 8px; background: var(--bms-surface, #fff); }
.hrm-attcal-pcard.focus { border-color: var(--bms-primary, #0757b8); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bms-primary, #0757b8) 20%, transparent); }
.hrm-attcal-pcard > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hrm-attcal-pcard > header b { font-size: 15px; } .hrm-attcal-pcard > header small { display: block; color: var(--muted); font-size: 13px; }
.hrm-attcal-pstate { flex: none; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.hrm-attcal-pstate.pending { background: #FEF3C7; color: #92400E; } .hrm-attcal-pstate.approved { background: #DCFCE7; color: #166534; }
.hrm-attcal-pstate.rejected { background: #FEE2E2; color: #991B1B; } .hrm-attcal-pstate.cancelled { background: #F1F5F9; color: #475569; }
.hrm-attcal-pmeta { margin: 6px 0 8px; color: var(--muted); font-size: 12px; }
.hrm-attcal-pmembers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hrm-attcal-pmembers > span:first-child { margin-right: 4px; color: var(--ink, var(--bms-text)); font-size: 12px; font-weight: 700; }
.hrm-attcal-mchip { padding: 3px 8px; border-radius: 8px; background: #F1F5F9; color: #334155; font-size: 12px; font-weight: 600; }
.hrm-attcal-mchip small { color: inherit; opacity: .75; font-weight: 500; }
.hrm-attcal-mchip.ok { background: #DCFCE7; color: #166534; } .hrm-attcal-mchip.no { background: #FEE2E2; color: #991B1B; text-decoration: line-through; } .hrm-attcal-mchip.wait { background: #F1F5F9; color: #475569; }
.hrm-attcal-pdecide { display: flex; gap: 8px; margin-top: 12px; } .hrm-attcal-pdecide input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line, #DCE3EF); border-radius: 8px; font: inherit; }
.hrm-attcal-pdecide .btn { height: 40px; border-radius: 8px; }
.hrm-attcal-grid tfoot :where(th):is(th, td), .hrm-attcal-grid tfoot :where(td):is(th, td) { height: 34px; border-top: 1px solid var(--line, #E2E8F0); border-bottom: 0; background: var(--bms-surface-subtle, #F8FAFC); color: var(--muted); font-size: 12px; font-weight: 700; }
.hrm-attcal-grid tfoot th { z-index: 2; color: var(--ink, var(--bms-text)); }

/* Theo người: lịch tháng 7 cột */
.hrm-attcal-person-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hrm-attcal-person-head label { display: grid; gap: 4px; min-width: 240px; color: var(--muted); font-size: .8rem; }
.hrm-attcal-person-head select { font-weight: 700; font-size: 15px; }
.hrm-attcal-facts { display: flex; gap: 8px; margin-left: auto; }
.hrm-attcal-facts div { min-width: 92px; padding: 8px 12px; border-radius: 10px; background: var(--bms-surface-subtle, #F8FAFC); }
.hrm-attcal-facts span { display: block; color: var(--muted); font-size: .75rem; }
.hrm-attcal-facts b { font-size: 1.25rem; color: var(--ink, var(--bms-text)); }
.hrm-attcal-facts .warn b { color: var(--ac-late); }
.hrm-attcal-facts .bad b { color: var(--ac-absent); }
.hrm-attcal-facts .ot b { color: var(--ac-ot); }
.hrm-attcal-facts b small { display: block; color: var(--muted); font-size: .7rem; font-weight: 500; }
.hrm-attcal-dialog .hrm-facts dd small, .hrm-attcal-edit label small { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; }
.hrm-attcal-week, .hrm-attcal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hrm-attcal-week span { padding: 0 4px 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.hrm-attcal-day { --k: var(--line, #CBD5E1); display: grid; align-content: start; gap: 4px; min-height: 96px; padding: 8px 10px 8px 12px; border: 1px solid var(--line, #E2E8F0); border-left: 4px solid var(--k); border-radius: 8px; background: var(--bms-surface, #fff); color: var(--ink, var(--bms-text)); text-align: left; font: inherit; cursor: pointer; }
.hrm-attcal-day.blank { border: 0; background: transparent; cursor: default; }
.hrm-attcal-day.none { border-left-color: var(--line, #E2E8F0); }
.hrm-attcal-day.sun { background: repeating-linear-gradient(135deg, var(--bms-surface-subtle, #F1F5F9) 0 6px, var(--bms-surface, #fff) 6px 12px); }
.hrm-attcal-day.future { opacity: .55; cursor: default; }
.hrm-attcal-day.today { box-shadow: 0 0 0 2px var(--bms-primary, #0757b8); }
.hrm-attcal-day:hover:not(:disabled):not(.blank) { border-color: var(--bms-primary, #0757b8); }
.hrm-attcal-day.ok { --k: var(--ac-ok); } .hrm-attcal-day.late { --k: var(--ac-late); } .hrm-attcal-day.ot { --k: var(--ac-ot); } .hrm-attcal-day.open { --k: var(--ac-open); }
.hrm-attcal-day.miss { --k: var(--ac-miss); } .hrm-attcal-day.leave { --k: var(--ac-leave); } .hrm-attcal-day.unpaid { --k: var(--ac-unpaid); } .hrm-attcal-day.absent { --k: var(--ac-absent); } .hrm-attcal-day.trip { --k: var(--ac-trip); }
.hrm-attcal-dn { font-size: 15px; font-weight: 800; }
.hrm-attcal-day.today .hrm-attcal-dn { color: var(--bms-primary, #0757b8); }
.hrm-attcal-tag { justify-self: start; padding: 2px 7px; border-radius: 4px; background: var(--k); color: #fff; font-size: 11px; font-weight: 700; }
.hrm-attcal-day.open .hrm-attcal-tag, .hrm-attcal-day.miss .hrm-attcal-tag { background: color-mix(in srgb, var(--k) 14%, var(--bms-surface, #fff)); color: var(--k); }
.hrm-attcal-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hrm-attcal-hours, .hrm-attcal-off { color: var(--muted); font-size: 12px; }
.hrm-attcal-off { color: #B45309; font-weight: 700; }

.hrm-attcal-dialog header { display: grid; gap: 2px; margin-bottom: 12px; }
.hrm-attcal-dialog header h3 { margin: 0; }
.hrm-attcal-dialog .hrm-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.hrm-attcal-dialog .hrm-facts dd { font-size: 1rem; }
.hrm-attcal-edit h4 { margin: 0; }
.hrm-attcal-err { margin: 0; color: var(--bms-danger, #DC2626); }

@media (max-width: 1100px) { .hrm-attcal-head { grid-template-columns: 1fr auto; } .hrm-attcal-tools { grid-column: 1 / -1; justify-content: space-between; } }
@media (max-width: 700px) {
  .hrm-attcal-head { grid-template-columns: 1fr; } .hrm-attcal-tools { flex-wrap: wrap; } .hrm-attcal-search { flex: 1 1 100%; }
  .hrm-attcal-who { min-width: 140px; } .hrm-attcal-facts { margin-left: 0; flex-wrap: wrap; } .hrm-attcal-day { min-height: 64px; padding: 6px; }
  .hrm-attcal-time, .hrm-attcal-hours, .hrm-attcal-off { display: none; } .hrm-attcal-dialog .hrm-facts { grid-template-columns: 1fr 1fr; }
}

/* Điện thoại: phẳng, bảng tháng thấy được ô ngày (cột tổng không dính), chi tiết ngày là tấm trượt từ đáy. */
@media (max-width: 900px), (max-width: 950px) and (max-height: 500px) {
  html.bms-phone-v2 .hrm-attcal { --ac-cell: 30px; --ac-sum: 40px; }
  html.bms-phone-v2 .hrm-attcal-head { gap: 10px; }
  html.bms-phone-v2 .hrm-attcal-head h3 { font-size: 15px; }
  html.bms-phone-v2 .hrm-attcal-head small { font-size: 12px; }
  html.bms-phone-v2 body .hrm-attcal-month .btn:not(#\#) { min-width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0 !important; border-radius: 10px; background: var(--ph-chip-bg, #EEF2F7) !important; color: var(--ph-ink, #1F2937) !important; font-size: 18px; box-shadow: none !important; }
  html.bms-phone-v2 .hrm-attcal-month strong { min-width: 0; flex: 1; font-size: 15px; }
  html.bms-phone-v2 .hrm-attcal-tools { gap: 8px; }
  html.bms-phone-v2 .hrm-attcal-seg { width: 100%; }
  html.bms-phone-v2 .hrm-attcal-seg button { flex: 1; height: 36px; }
  html.bms-phone-v2 .hrm-attcal-legend { gap: 4px 12px; margin: 10px 0; font-size: 12px; }
  html.bms-phone-v2 .hrm-attcal-legend .hrm-attcal-swatch { width: 18px; height: 14px; font-size: 9px; border-radius: 3px; }
  html.bms-phone-v2 .hrm-attcal-otrule { font-size: 11px; }
  html.bms-phone-v2 .hrm-attcal-wrap { margin-inline: -16px; border-radius: 0; border-inline: 0; }
  html.bms-phone-v2 .hrm-attcal-grid thead .hrm-attcal-who, html.bms-phone-v2 .hrm-attcal-grid tfoot .hrm-attcal-who { z-index: 25 !important; }
  html.bms-phone-v2 .hrm-attcal-grid tbody .hrm-attcal-who { z-index: 5; }
  html.bms-phone-v2 .hrm-attcal-cell > button { height: 26px !important; min-height: 0 !important; }
  html.bms-phone-v2 .hrm-attcal-who { min-width: 118px; max-width: 118px; padding: 0 8px !important; }
  html.bms-phone-v2 .hrm-attcal-who .hrm-attcal-pic:not(#\#) { display: none; }
  html.bms-phone-v2 .hrm-attcal-who b { font-size: 12.5px; }
  html.bms-phone-v2 .hrm-attcal-group th { height: 26px; font-size: 11px; }
  html.bms-phone-v2 .hrm-attcal-grid :where(td):is(td, th).hrm-attcal-sum, html.bms-phone-v2 .hrm-attcal-grid :where(th):is(td, th).hrm-attcal-sum, html.bms-phone-v2 .hrm-attcal-grid tfoot td:last-child { position: static; }
  html.bms-phone-v2 .hrm-attcal-grid :where(td):is(td, th).hrm-attcal-sum:nth-last-child(5), html.bms-phone-v2 .hrm-attcal-grid :where(th):is(td, th).hrm-attcal-sum:nth-last-child(5) { box-shadow: inset 1px 0 0 var(--line, #E2E8F0); }
  /* Theo người: chỉ số một khối một hàng, ô ngày gọn */
  html.bms-phone-v2 .hrm-attcal-person-head { gap: 10px; }
  html.bms-phone-v2 .hrm-attcal-person-head label { flex: 1; min-width: 0; }
  html.bms-phone-v2 .hrm-attcal-person-head select { width: 100%; height: 40px; font-size: 14px; }
  html.bms-phone-v2 .hrm-attcal-facts { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 0; width: 100%; border-block: 1px solid var(--line, #E2E8F0); background: var(--bms-surface-subtle, #F8FAFC); }
  html.bms-phone-v2 .hrm-attcal-facts div { min-width: 0; padding: 8px 6px; border-radius: 0; background: transparent; }
  html.bms-phone-v2 .hrm-attcal-facts div + div { border-left: 1px solid var(--line, #E2E8F0); }
  html.bms-phone-v2 .hrm-attcal-facts span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.bms-phone-v2 .hrm-attcal-facts b { font-size: 17px; }
  html.bms-phone-v2 .hrm-attcal-facts b small { display: none; }
  html.bms-phone-v2 .hrm-attcal-week, html.bms-phone-v2 .hrm-attcal-month-grid { gap: 4px; }
  html.bms-phone-v2 .hrm-attcal-week span { font-size: 11px; text-align: center; }
  html.bms-phone-v2 .hrm-attcal-day { min-height: 52px; padding: 4px; gap: 3px; border-radius: 8px; }
  html.bms-phone-v2 .hrm-attcal-dn { font-size: 13px; }
  html.bms-phone-v2 .hrm-attcal-tag { max-width: 100%; padding: 2px 3px; font-size: 10px; line-height: 1.1; }
  /* Chi tiết ngày: tấm trượt từ đáy, cao vừa nội dung */
  html.bms-phone-v2 dialog.hrm-form-dialog.hrm-attcal-dialog { inset: auto 0 0 0 !important; width: 100vw !important; max-width: 100vw !important; height: auto !important; max-height: 92dvh !important; margin: auto 0 0 !important; padding: 16px 16px 0 !important; border: 0 !important; border-radius: 16px 16px 0 0 !important; overflow-y: auto; }
  html.bms-phone-v2 .hrm-attcal-dialog header { margin-bottom: 10px; }
  html.bms-phone-v2 .hrm-attcal-dialog header h3 { font-size: 16px; }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 0 !important; margin: 0 -16px 14px; padding: 0 !important; border-block: 1px solid var(--line, #E2E8F0); background: var(--bms-surface-subtle, #F8FAFC); }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts > div { min-height: 0; padding: 8px 12px !important; border: 0; border-radius: 0; background: transparent; }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts div:nth-child(3n + 2), html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts div:nth-child(3n) { border-left: 1px solid var(--line, #E2E8F0); }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts div:nth-child(n + 4) { border-top: 1px solid var(--line, #E2E8F0); }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts dt { font-size: 11px; }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-facts dd { margin-top: 2px; font-size: 14px; }
  html.bms-phone-v2 .hrm-attcal-edit { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  html.bms-phone-v2 .hrm-attcal-edit .wide { grid-column: 1 / -1; }
  html.bms-phone-v2 .hrm-attcal-edit label { gap: 4px; font-size: 13px; }
  html.bms-phone-v2 .hrm-attcal-edit :where(input):is(input, select), html.bms-phone-v2 .hrm-attcal-edit :where(select):is(input, select) { width: 100%; min-width: 0; height: 40px !important; min-height: 40px !important; font-size: 14px; box-sizing: border-box; }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-form-actions { position: sticky !important; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px -16px 0 !important; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--line, #E2E8F0) !important; background: var(--ph-card, #fff) !important; }
  html.bms-phone-v2 .hrm-attcal-dialog .hrm-form-actions .btn { width: 100%; height: 44px; min-height: 44px; border-radius: 10px; font-size: 15px; justify-content: center; }
}

/* Điện thoại › Theo ngày (anh Hiệp 24/10/2026 "dễ nhìn hơn"): dải đếm chạm để lọc, mỗi người một dòng phẳng tràn mép. */
@media (max-width: 900px), (max-width: 950px) and (max-height: 500px) {
  html.bms-phone-v2 .hrm-attcal-head.is-day > div:first-child { display: none; }
  html.bms-phone-v2 .hrm-attcal-month .btn:disabled { opacity: .35; }
  html.bms-phone-v2 .hrm-attcal-month .btn[data-attcal-today] { padding: 0 12px !important; font-size: 13px !important; }
  html.bms-phone-v2 .hrm-attday { margin: 12px -16px 0; }
  html.bms-phone-v2 .hrm-attday-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 16px; border-top: 1px solid var(--line, #E2E8F0); background: var(--ph-card, #fff); color: var(--muted); font-size: 13px; }
  html.bms-phone-v2 .hrm-attday-sum b { color: var(--ph-ink, #1F2937); font-size: 15px; font-variant-numeric: tabular-nums; }
  html.bms-phone-v2 .hrm-attday-sum .g-in b { color: var(--ac-ok); } html.bms-phone-v2 .hrm-attday-sum .g-late b { color: var(--ac-late); }
  html.bms-phone-v2 .hrm-attday-sum .g-leave b { color: var(--ac-leave); } html.bms-phone-v2 .hrm-attday-sum .g-absent b { color: var(--ac-absent); }
  html.bms-phone-v2 .hrm-attday-sum .active { color: var(--ph-primary, #1A73E8); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
  html.bms-phone-v2 .hrm-attday-group { display: flex; gap: 6px; padding: 10px 16px 6px; background: var(--ph-bg, #F5F7FA); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  html.bms-phone-v2 .hrm-attday-group span { font-weight: 600; }
  html.bms-phone-v2 .hrm-attday-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 58px; height: auto; margin: 0; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--line, #E2E8F0); border-radius: 0; background: var(--ph-card, #fff); color: var(--ph-ink, #1F2937); font: inherit; text-align: left; cursor: pointer; }
  html.bms-phone-v2 .hrm-attday-who { display: grid; gap: 2px; min-width: 0; }
  html.bms-phone-v2 .hrm-attday-who b { overflow: hidden; font-size: 14.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  html.bms-phone-v2 .hrm-attday-who small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  html.bms-phone-v2 .hrm-attday-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  html.bms-phone-v2 .hrm-attday-tag { --k: var(--muted); min-width: 74px; padding: 4px 8px; border-radius: 6px; background: var(--k); color: #fff; font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
  html.bms-phone-v2 .hrm-attday-tag.ok { --k: var(--ac-ok); } html.bms-phone-v2 .hrm-attday-tag.late { --k: var(--ac-late); } html.bms-phone-v2 .hrm-attday-tag.ot { --k: var(--ac-ot); }
  html.bms-phone-v2 .hrm-attday-tag.leave { --k: var(--ac-leave); } html.bms-phone-v2 .hrm-attday-tag.unpaid { --k: var(--ac-unpaid); } html.bms-phone-v2 .hrm-attday-tag.absent { --k: var(--ac-absent); } html.bms-phone-v2 .hrm-attday-tag.trip { --k: var(--ac-trip); }
  html.bms-phone-v2 .hrm-attday-tag:is(.open, .miss) { background: color-mix(in srgb, var(--k) 14%, var(--ph-card, #fff)); color: var(--k); }
  html.bms-phone-v2 .hrm-attday-tag.open { --k: var(--ac-open); } html.bms-phone-v2 .hrm-attday-tag.miss { --k: var(--ac-miss); }
  html.bms-phone-v2 .hrm-attday-tag.none { background: var(--ph-chip-bg, #EEF2F7); color: var(--muted); }
  html.bms-phone-v2 .hrm-attday-list > .hrm-empty { padding: 24px 16px; }
}

/* Điện thoại: ngày/tháng và ô tìm + Lọc cùng một hàng; cách xem, trạng thái nằm trong bảng Lọc (anh Hiệp 24/10/2026) */
@media (max-width: 900px), (max-width: 950px) and (max-height: 500px) {
  html.bms-phone-v2 .hrm-attcal-head:not(#\#) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-month { flex: none; gap: 2px; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-month strong { flex: none; min-width: 0; padding: 0 2px; font-size: 14px; white-space: nowrap; }
  html.bms-phone-v2 body .hrm-attcal-head .hrm-attcal-month .btn:not(#\#) { min-width: 34px; width: 34px; height: 40px; min-height: 40px; font-size: 17px; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-month :is([data-attcal-today], [data-attcal-now]) { display: none !important; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-tools { flex: 1 1 0; min-width: 0; }
  html.bms-phone-v2 .hrm-attcal-head:not(#\#) > div:first-child { display: none; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-search:not(#\#) { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; }
  html.bms-phone-v2 .hrm-attcal-head .hrm-attcal-search .bms-search__input:not(#\#) { flex: 1 1 0 !important; width: 0 !important; min-width: 0 !important; }
  html.bms-phone-v2 .hrm-attcal-fgroup { display: grid; gap: 6px; margin-bottom: 12px; }
  html.bms-phone-v2 .hrm-attcal-fgroup > span { color: var(--muted); font-size: 12px; font-weight: 600; }
  html.bms-phone-v2 .hrm-attcal-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
  html.bms-phone-v2 .hrm-attcal-fchips button { height: 34px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ph-chip-bg, #EEF2F7); color: var(--ph-ink, #1F2937); font: 600 13px/1 inherit; white-space: nowrap; cursor: pointer; }
  html.bms-phone-v2 .hrm-attcal-fchips button b { margin-left: 2px; font-weight: 800; }
  html.bms-phone-v2 .hrm-attcal-fchips button.active { background: var(--ph-primary, #1A73E8); color: #fff; }
}
/* Bảng tháng trên điện thoại: chú thích gom vào một ô, bấm mới mở (anh Hiệp 24/10/2026) */
.hrm-attcal-legend-box { margin: 10px 0; }
@media (max-width: 900px), (max-width: 950px) and (max-height: 500px) {
  html.bms-phone-v2 .hrm-attcal-legend-box > summary { display: flex; align-items: center; gap: 10px; min-height: 32px; list-style: none; cursor: pointer; }
  html.bms-phone-v2 .hrm-attcal-legend-box > summary::-webkit-details-marker { display: none; }
  html.bms-phone-v2 .hrm-attcal-legend-box > summary .hrm-attcal-legend:not(#\#) { flex: 1; min-width: 0; flex-wrap: nowrap; gap: 10px; margin: 0; overflow: hidden; white-space: nowrap; }
  html.bms-phone-v2 .hrm-attcal-legend-box > summary b { flex: none; padding: 6px 10px; border-radius: 10px; background: var(--ph-chip-bg, #EEF2F7); color: var(--ph-primary, #2563EB); font-size: 12.5px; font-weight: 600; }
  html.bms-phone-v2 .hrm-attcal-legend-box > summary .less, html.bms-phone-v2 .hrm-attcal-legend-box[open] > summary .more { display: none; }
  html.bms-phone-v2 .hrm-attcal-legend-box[open] > summary .less { display: inline; }
  html.bms-phone-v2 .hrm-attcal-legend-box > .hrm-attcal-legend:not(#\#) { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line, #E2E8F0); border-radius: 10px; background: var(--ph-card, #fff); }
  html.bms-phone-v2 .hrm-section-spaced.hrm-attcal:not(#\#) { margin-top: 0 !important; }
}
/* Theo người trên điện thoại: chọn người một dòng, số liệu cân đối một hàng (anh Hiệp 24/10/2026) */
@media (max-width: 900px), (max-width: 950px) and (max-height: 500px) {
  html.bms-phone-v2 .hrm-attcal-person-head:not(#\#) { gap: 10px; margin-bottom: 10px; }
  html.bms-phone-v2 .hrm-attcal-pic.big:not(#\#) { flex-basis: 40px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  html.bms-phone-v2 .hrm-attcal-person-head label > span:not(#\#) { display: none; }
  html.bms-phone-v2 .hrm-attcal-facts div:not(#\#) { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; text-align: center; }
  html.bms-phone-v2 .hrm-attcal-facts b:not(#\#) { font-size: 16px; line-height: 1.1; }
}

/* In bảng công: xem trước khổ A4 ngang trong hộp thoại */
