/* Lịch hẹn · Công & phép · menu Hành chính (CRM) */
@media screen {
  #workWorkspace { max-width:1900px; margin:auto; padding:24px clamp(20px,3vw,52px) 40px; }
  #appView .workspace-nav { overflow-x:auto; scrollbar-width:none; }
  .work-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); gap:20px; align-items:start; }
  .work-book select,.work-book textarea,.work-book input[type=search] { width:100%; }
  .work-book input[type=search] { margin-bottom:8px; }
  .work-book .lbl { display:block; margin-bottom:7px; font-size:12px; color:var(--muted); }
  .wb-picked { margin:-6px 0 16px; padding:10px 12px; border-left:3px solid var(--bronze); background:var(--bronze-wash); border-radius:6px; font-size:13px; color:var(--bronze-deep); }
  .wb-cal { border:1px solid var(--hair-soft); border-radius:var(--r-lg); padding:12px; background:var(--surface-2); }
  .wb-cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
  .wb-grid,.wa-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
  .wb-week,.wa-week { text-align:center; font-size:11px; color:var(--muted); padding:4px 0; }
  .wb-day { min-height:38px; padding:0; justify-content:center; font-variant-numeric:tabular-nums; }
  .wb-day.is-today { border-color:var(--bronze); }
  .wb-day.is-locked { color:var(--crit); text-decoration:line-through; }
  .wb-day[aria-pressed="true"],.wb-slot[aria-pressed="true"] { background:var(--bronze); border-color:var(--bronze); color:#17120c; font-weight:700; }
  .wb-day:disabled,.wb-slot:disabled { opacity:.35; cursor:not-allowed; }
  .wb-slot:disabled { text-decoration:line-through; }
  .wb-slots { display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); gap:8px; }
  .wb-slot { justify-content:center; font-variant-numeric:tabular-nums; }
  .wb-locked { padding:12px; border:1px dashed var(--crit); border-radius:8px; color:var(--crit); background:var(--crit-wash); font-size:13px; }
  .work-book #wbSubmit,.work-book #ciSubmit { width:100%; margin-top:4px; }
  .work-mine h3 { display:flex; align-items:center; gap:8px; font-size:13px; margin:0 0 10px; color:var(--muted); }
  .work-mine details { margin-top:16px; } .work-mine summary { cursor:pointer; font-size:12px; color:var(--muted); }
  .wb-list { list-style:none; margin:0; padding:0; }
  .wb-item { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--hair-soft); }
  .wb-item > div { flex:1; min-width:0; display:grid; gap:3px; }
  .wb-item strong { font-size:14px; font-variant-numeric:tabular-nums; }
  .wb-item span:not(.tag),.wb-item small { font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
  .wb-item a.button,.wb-item .button { display:inline-flex; align-items:center; padding:6px 10px; border:1px solid var(--hair); border-radius:8px; font-size:12px; color:var(--bronze-deep); text-decoration:none; white-space:nowrap; }
  /* Công & phép */
  .wa-month { gap:12px; } .wa-month strong { min-width:118px; text-align:center; }
  .wa-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
  .wa-cards article span { display:block; font-size:12px; color:var(--muted); margin-bottom:8px; }
  .wa-cards article strong { display:block; font-size:28px; color:var(--bronze-deep); }
  .wa-cards article small { font-size:12px; color:var(--muted); }
  .wa-cards p { grid-column:1/-1; margin:0; }
  .wa-board { margin-bottom:20px; }
  .wa-board-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; } .wa-board-head h2 { margin:0; }
  .wa-stats { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
  .wa-stats span { padding:6px 10px; border:1px solid var(--hair-soft); border-radius:999px; font-size:12px; color:var(--muted); }
  .wa-stats b { color:var(--ink); margin-left:4px; }
  .wa-day { min-height:86px; padding:8px; border:1px solid var(--hair-soft); border-radius:10px; background:var(--surface-2); display:flex; flex-direction:column; gap:3px; min-width:0; }
  .wa-day .wa-n { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
  .wa-day strong { font-size:12px; line-height:1.3; }
  .wa-day small { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
  .wa-day[data-kind="full"] { border-color:rgba(34,197,94,.35); } .wa-day[data-kind="full"] strong { color:var(--normal); }
  .wa-day[data-kind="partial"] strong { color:var(--high); }
  .wa-day[data-kind="leave"],.wa-day[data-kind="holiday"],.wa-day[data-kind="trip"] { border-color:rgba(192,154,103,.45); } .wa-day[data-kind="leave"] strong,.wa-day[data-kind="holiday"] strong,.wa-day[data-kind="trip"] strong { color:var(--bronze-deep); }
  .wa-day[data-kind="absent"] strong { color:var(--crit); }
  .wa-day[data-kind="empty"] { opacity:.55; }
  .wa-flag { font-style:normal; font-size:10px; font-weight:600; padding:1px 6px; border-radius:999px; align-self:flex-start; }
  .wa-flag.late { background:var(--crit-wash); color:var(--crit); } .wa-flag.ot { background:var(--info-wash); color:var(--info); }
  /* Menu Hành chính */
  .hr-wrap { position:relative; flex-shrink:0; }
  .hr-menu { position:fixed; z-index:60; margin-top:6px; width:min(320px,calc(100vw - 32px)); padding:8px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface); box-shadow:0 18px 40px rgba(0,0,0,.35); }
  .hr-menu a { display:grid; gap:3px; padding:10px 12px; border-radius:8px; color:var(--ink); text-decoration:none; }
  .hr-menu a:hover,.hr-menu a:focus-visible { background:var(--bronze-wash); }
  .hr-menu a strong { font-size:13px; color:var(--bronze-deep); } .hr-menu a small { font-size:11px; color:var(--muted); }
  .hr-menu p { margin:6px 12px 4px; font-size:11px; color:var(--muted); }
  @media (max-width:900px) {
    #workWorkspace { padding:20px 14px; }
    .work-grid,.wa-cards { grid-template-columns:1fr; }
    .wa-grid { gap:4px; } .wa-day { min-height:64px; padding:5px; } .wa-day strong { font-size:10px; } .wa-day small { display:none; } .wa-flag { font-size:0; width:8px; height:8px; padding:0; } .wa-flag.late { background:var(--crit); } .wa-flag.ot { background:var(--info); }
    .hr-menu { left:16px; right:16px; width:auto; }
  }
}
/* Check-in · Sinh nhật · menu điện thoại */
@media screen {
  .nav-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; margin-left:6px; padding:0 5px; border-radius:999px; background:var(--bronze); color:#17120c; font-size:10px; font-weight:700; }
  .nav-badge.is-today { background:var(--crit); color:#fff; }
  .ci-photo { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:12px; border:1px dashed var(--hair); border-radius:var(--r-lg); background:var(--surface-2); }
  .ci-photo img { width:120px; height:120px; object-fit:cover; border-radius:10px; }
  .ci-gps { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .ci-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
  .ci-dialog { max-width:min(760px,calc(100vw - 24px)); padding:12px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface); color:var(--ink); }
  .ci-dialog img { display:block; max-width:100%; max-height:75vh; margin:0 auto 12px; border-radius:10px; }
  .ci-dialog::backdrop { background:rgba(0,0,0,.6); }
  .bd-dialog { width:min(460px,calc(100vw - 24px)); padding:22px; }
  .bd-dialog h2 { margin:0 0 16px; font-size:16px; }
  .bd-dialog input,.bd-dialog textarea { width:100%; }
  .bd-dialog .btn-row { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
  .mobile-menu-btn { display:none; width:42px; height:42px; min-height:42px; padding:0; justify-content:center; font-size:22px; line-height:1; flex-shrink:0; }
  .mobile-menu { position:fixed; z-index:70; top:58px; right:12px; width:min(300px,calc(100vw - 24px)); max-height:calc(100vh - 80px); overflow:auto; padding:8px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface); box-shadow:0 18px 40px rgba(0,0,0,.45); display:grid; gap:2px; }
  .mobile-menu[hidden] { display:none; }
  .mobile-menu button,.mobile-menu a { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--ink); font-size:14px; text-align:left; text-decoration:none; }
  .mobile-menu button:hover,.mobile-menu a:hover,.mobile-menu button:focus-visible,.mobile-menu a:focus-visible { background:var(--bronze-wash); }
  .mobile-menu button[aria-current="true"] { background:var(--bronze-wash); color:var(--bronze-deep); font-weight:600; }
  .mobile-menu .mm-group { margin:8px 12px 2px; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
  .mobile-menu a { color:var(--bronze-deep); }
  .mobile-menu hr { border:0; border-top:1px solid var(--hair-soft); margin:6px 0; }
  @media (max-width:900px) {
    #appView .appbar .workspace-nav,#appView .appbar #specialistAdminBtn,#appView .appbar #profileBtn,#appView .appbar #logoutBtn { display:none !important; }
    #appView .appbar .mobile-menu-btn { display:inline-flex; }
    #appView .appbar .who { min-width:0; overflow:hidden; }
    .ci-actions { justify-content:flex-start; }
    .wb-item { flex-wrap:wrap; }
  }
}

/* Chữ ký trong Trang cá nhân */
#profileSignatureForm .signature-pad { position:relative; margin:12px 0; border:1px dashed var(--hair); border-radius:var(--r-lg); background:#fff; touch-action:none; }
#profileSignatureForm canvas { display:block; width:100%; height:auto; aspect-ratio:3/1; cursor:crosshair; touch-action:none; }
#profileSignatureForm .signature-guide { position:absolute; left:16px; bottom:12px; font-size:12px; color:#9a8f82; pointer-events:none; }
#profileSignatureForm.has-ink .signature-guide { display:none; }
#profileSignatureForm .signature-actions { display:flex; gap:8px; justify-content:flex-end; }
/* Đơn từ · Báo cáo tuần */
@media screen {
  .hr-menu button { display:grid; gap:3px; width:100%; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; min-height:0; }
  .hr-menu button:hover,.hr-menu button:focus-visible { background:var(--bronze-wash); }
  .hr-menu button strong { font-size:13px; color:var(--ink); } .hr-menu button small { font-size:11px; color:var(--muted); }
  .rq-grid { grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr); }
  .rq-types { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; margin-bottom:16px; }
  .rq-type { display:grid; gap:4px; min-height:64px; padding:10px 12px; text-align:left; align-content:start; justify-items:start; justify-content:stretch; }
  .rq-type strong { font-size:13px; line-height:1.3; } .rq-type small { font-size:11px; color:var(--muted); }
  .rq-type[aria-pressed="true"] { border-color:var(--bronze); background:var(--bronze-wash); }
  .rq-type[aria-pressed="true"] strong { color:var(--bronze-deep); }
  .rq-paper { padding:18px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface-2); }
  .rq-title { margin:0 0 12px; text-align:center; font-size:16px; letter-spacing:.04em; color:var(--bronze-deep); }
  .rq-kinhgui { display:flex; gap:10px; font-size:13px; margin-bottom:12px; } .rq-kinhgui span { font-weight:600; white-space:nowrap; }
  .rq-kinhgui ul { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
  .rq-autos { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px 16px; margin-bottom:14px; padding:10px 12px; border-radius:8px; background:var(--surface); }
  .rq-auto span { display:block; font-size:11px; color:var(--muted); } .rq-auto strong { font-size:13px; } .rq-auto em { font-weight:400; color:var(--muted); }
  .rq-paper .hub-form-grid input,.rq-paper .hub-form-grid select,.rq-paper .hub-form-grid textarea,.rq-paper textarea,.rq-paper select { width:100%; }
  .rq-wide { grid-column:1/-1; }
  .rq-camket { margin:6px 0 14px; font-size:12px; font-style:italic; color:var(--muted); } .rq-camket p { margin:2px 0; }
  .rq-manager { font-size:13px; margin:8px 0; } .rq-consent { display:flex; gap:8px; align-items:flex-start; font-size:13px; margin:10px 0; }
  .rq-inline { display:flex; gap:8px; flex-wrap:wrap; } .rq-inline input { flex:1 1 160px; }
  .rq-paper #rqSend { width:100%; }
  .rq-item { cursor:pointer; } .rq-item:hover { background:#c59b6d08; }
  .rq-dialog { width:min(640px,calc(100vw - 24px)); padding:22px; }
  .rq-dhead { display:flex; align-items:center; justify-content:space-between; gap:12px; } .rq-dhead h2 { margin:0; font-size:17px; }
  .rq-content { white-space:pre-wrap; font:inherit; font-size:13px; padding:12px; border:1px solid var(--hair-soft); border-radius:8px; background:var(--surface-2); max-height:260px; overflow:auto; }
  .rq-ot { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px 16px; margin:10px 0; } .rq-ot dt { font-size:11px; color:var(--muted); } .rq-ot dd { margin:0; font-size:13px; }
  .rq-steps { list-style:none; margin:12px 0; padding:0; display:grid; gap:8px; }
  .rq-steps li { display:grid; gap:2px; padding:8px 12px; border-left:3px solid var(--hair); background:var(--surface-2); border-radius:6px; font-size:13px; }
  .rq-steps li[data-status="approved"] { border-color:var(--normal); } .rq-steps li[data-status="pending"] { border-color:var(--high); } .rq-steps li[data-status="rejected"] { border-color:var(--crit); }
  .rq-steps span,.rq-steps small { color:var(--muted); font-size:12px; }
  .rq-dialog .btn-row,.bd-dialog .btn-row { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
  .rp-paper { margin-bottom:20px; }
  .rp-when { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:10px; } .rp-when .rp-dkdv { align-self:flex-end; margin-left:auto; } .rp-when label { display:grid; gap:4px; font-size:12px; color:var(--muted); } .rp-when input { width:110px; }
  .rp-section { margin-top:18px; } .rp-section h3 { margin:0 0 8px; font-size:14px; color:var(--bronze-deep); } .rp-section textarea { width:100%; margin-bottom:10px; }
  .rp-table { width:100%; border-collapse:collapse; min-width:720px; font-size:13px; }
  .rp-table th { text-align:left; padding:8px; font-size:11px; color:var(--muted); background:var(--surface-2); }
  .rp-table td { padding:4px 6px; border-top:1px solid var(--hair-soft); font-variant-numeric:tabular-nums; }
  .rp-table td input { width:100%; min-width:70px; padding:6px 8px; min-height:34px; }
  /* Mục II / IV (25/10): ô chọn nhân sự và ô tìm khách đủ rộng để đọc hết tên (bảng cuộn ngang khi hẹp) */
  .rp-table td select[data-col="nhanSu"] { width:100%; min-width:165px; min-height:34px; }
  .rp-table td input[data-cust] { min-width:190px; }
  .rp-table td input[type="number"] { min-width:120px; }
  .rp-table td input[data-col="nhanSu"] { min-width:170px; }
  .rp-table tfoot td { font-weight:700; }
  .rp-sigs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:20px; text-align:center; }
  .rp-sig { display:grid; gap:4px; justify-items:center; font-size:12px; } .rp-sig span { color:var(--muted); } .rp-sig img { max-height:70px; max-width:100%; background:#fff; border-radius:6px; padding:4px; } .rp-sig small { color:var(--muted); }
  .rp-leaders { display:grid; gap:8px; border:1px solid var(--hair-soft); border-radius:8px; padding:12px; } .rp-leaders label { display:flex; gap:8px; align-items:center; font-size:13px; color:var(--ink); }
  @media (max-width:900px) { .rq-grid { grid-template-columns:1fr; } .rp-sigs { grid-template-columns:1fr; } }
}
/* Đơn từ: tab + icon */
@media screen {
  .rq-tabs { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:4px; padding:4px; margin-bottom:14px; border:1px solid var(--hair-soft); border-radius:var(--r-lg); background:var(--surface); }
  .rq-tabs button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; border:0; background:transparent; color:var(--muted); font-weight:600; }
  .rq-tabs button[aria-selected="true"] { background:var(--bronze-wash); color:var(--bronze-deep); box-shadow:inset 0 0 0 1px var(--hair); }
  .rq-tabs .nav-badge { margin-left:2px; }
  .rq-label { margin:0 0 10px; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
  .rq-types { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
  .rq-type { justify-items:center !important; text-align:center !important; gap:6px; min-height:112px; padding:14px 10px; align-content:center; }
  .rq-type svg { color:var(--bronze); }
  .rq-type[aria-pressed="true"] svg { color:var(--bronze-deep); }
  .rq-type.is-separate { border-style:dashed; }
  .rq-ico { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; flex:0 0 34px; border-radius:10px; background:var(--bronze-wash); color:var(--bronze-deep); }
  .rq-panel { padding:20px; }
  @media (max-width:900px) { .rq-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); } .rq-types { grid-template-columns:repeat(2,minmax(0,1fr)); } }
}
/* Menu Hành chính: mọi dòng căn trái như nhau (không bị kiểu nút chung của thanh menu đè) */
@media screen {
  #appView .workspace-nav .hr-menu button,#appView .workspace-nav .hr-menu a { display:grid; justify-items:start; justify-content:stretch; gap:3px; width:100%; min-height:0; margin:0; padding:10px 12px; border:0; border-radius:8px; background:transparent; text-align:left; white-space:normal; font-size:13px; }
  #appView .workspace-nav .hr-menu button:hover,#appView .workspace-nav .hr-menu a:hover,#appView .workspace-nav .hr-menu button:focus-visible,#appView .workspace-nav .hr-menu a:focus-visible { background:var(--bronze-wash); }
  #appView .workspace-nav .hr-menu hr { border:0; border-top:1px solid var(--hair-soft); margin:6px 4px; }
  .hr-menu { width:min(260px,calc(100vw - 32px)); }
}
/* Ô xác nhận tăng ca: ô tick nhỏ căn trái, câu xác nhận ngay bên phải (cả trong hộp thoại nổi); lưới loại đơn trải đều chiều ngang */
@media screen {
  #appView :is(.hub-card, .ot-pop) label.rq-consent { display:flex; align-items:flex-start; justify-content:flex-start; gap:10px; margin:12px 0; font-size:13px; color:var(--ink); text-align:left; cursor:pointer; }
  #appView :is(.hub-card, .ot-pop) label.rq-consent input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; min-height:0; margin:1px 0 0; padding:0; accent-color:var(--bronze); }
  /* Kết quả đọc log máy chấm công: có log → xanh lá; thiếu log → cam; lỗi → đỏ */
  #appView .ot-log { font-size:13px; font-weight:600; }
  #appView .ot-log.is-ok { color:var(--normal); }
  #appView .ot-log.is-warn { color:var(--high); }
  #appView .ot-log.is-err { color:var(--crit); }
  #appView .rq-types { grid-template-columns:repeat(7,minmax(0,1fr)); }
  @media (max-width:1200px) { #appView .rq-types { grid-template-columns:repeat(4,minmax(0,1fr)); } }
  @media (max-width:700px) { #appView .rq-types { grid-template-columns:repeat(2,minmax(0,1fr)); } }
}
/* Giải trình chấm công — bảng theo mẫu "Bảng tường trình chấm công" của CRM (dùng cả khi in) */
@media screen, print {
  .xp-banner { display:grid; gap:4px; margin:0 0 12px; padding:12px 14px; border:1px solid var(--hair); border-left:3px solid var(--info); border-radius:var(--r); background:var(--surface); font-size:13px; }
  .xp-banner span { color:var(--ink-2); } .xp-banner a { justify-self:start; font-weight:600; }
  .xp-banner.danger { border-left-color:var(--crit); background:var(--crit-wash); }
  .xp-banner.warn { border-left-color:var(--high); background:var(--high-wash); }
  .xp-banner.ok { border-left-color:var(--normal); }
  .xp-funds { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:12px; } .xp-funds:empty { display:none; }
  .xp-fund { display:grid; gap:2px; min-width:150px; padding:10px 14px; border:1px solid var(--hair); border-radius:var(--r); background:var(--surface); }
  .xp-fund span { font-size:12px; color:var(--muted); } .xp-fund strong { font-size:16px; font-variant-numeric:tabular-nums; }
  .xp-fund.is-short { border-color:var(--crit); } .xp-fund.is-short small { color:var(--crit); font-weight:600; }
  .xp-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin:4px 0 10px; }
  .xp-title-line { display:flex; flex-wrap:wrap; align-items:center; gap:8px; } .xp-title-line h1 { margin:0; font-size:20px; }
  .xp-chip { padding:3px 9px; border:1px solid var(--hair); border-radius:999px; font-size:11px; color:var(--muted); }
  .xp-actions { display:flex; align-items:center; gap:10px; }
  .xp-save { font-size:12px; color:var(--normal); } .xp-save.is-bad { color:var(--crit); }
  /* Tờ giấy: nền trắng, viền đen như CRM, cuộn ngang trong khung khi màn hẹp */
  .xp-scroll { width:100%; overflow:auto; border:1px solid #202020; background:#fff; color:#111; scrollbar-width:thin; }
  .xp-doc-head { min-width:980px; padding:13px 12px 10px; background:#fff; color:#17120e; text-align:center; }
  .xp-doc-head > span { display:block; color:#aa742f; font-size:9px; font-weight:900; letter-spacing:2.8px; line-height:1; }
  .xp-doc-head h3 { margin:3px 0 0; color:#17120e; font-size:24px; font-weight:900; letter-spacing:-.45px; line-height:1.08; }
  .xp-doc-head > p { margin:4px 0 10px; color:#98682f; font-size:11px; font-weight:600; }
  .xp-meta { display:grid; grid-template-columns:1.45fr 1fr .7fr; gap:7px; padding-top:7px; border-top:2px solid #b68141; text-align:left; }
  .xp-meta > div { display:grid; gap:2px; min-height:48px; align-content:center; padding:7px 10px; border:1px solid #e3d4c0; border-radius:7px; background:#fffdfa; }
  .xp-meta small { color:#91877a; font-size:9px; font-weight:800; letter-spacing:.55px; text-transform:uppercase; }
  .xp-meta strong { overflow:hidden; color:#17120e; font-size:13px; font-weight:900; text-overflow:ellipsis; white-space:nowrap; }
  .xp-sheet { width:100%; min-width:980px; border-collapse:collapse; table-layout:fixed; background:#fff; color:#111; font-size:12px; }
  .xp-sheet col.c-stt { width:6%; } .xp-sheet col.c-date { width:8.5%; } .xp-sheet col.c-credit { width:10%; }
  .xp-sheet col.c-in,.xp-sheet col.c-out,.xp-sheet col.c-wd,.xp-sheet col.c-hc { width:6.5%; } .xp-sheet col.c-ot { width:7%; } .xp-sheet col.c-meal { width:7.5%; } .xp-sheet col.c-note { width:36%; }
  .xp-sheet.has-meal col.c-ot { width:6.5%; } .xp-sheet.has-meal col.c-note { width:29%; }
  .xp-sheet th,.xp-sheet td { height:34px; padding:5px 7px; border:1px solid #202020; vertical-align:middle; background:#fff; color:#111; }
  .xp-sheet thead th { font-size:12px; font-weight:800; text-align:center; }
  .xp-sheet th.xp-section { text-align:left; }
  .xp-sheet td.c { text-align:center; font-variant-numeric:tabular-nums; }
  .xp-sheet tbody tr.is-sunday td { background:#d9d9d9; color:#555; }
  .xp-sheet tbody tr.is-locked td { background:#f7f7f7; color:#777; }
  .xp-sheet tbody tr.needs-recheck td:last-child { box-shadow:inset 4px 0 #c53d33; }
  .xp-sheet tbody tr.has-error > td:first-child { box-shadow:inset 4px 0 #d33b32; }
  .xp-credit { font-weight:700; white-space:nowrap; } .xp-credit.has-transition { background:#fffdf9 !important; }
  .xp-credit .is-replaced { text-decoration:line-through 2px #c2352b; }
  .xp-credit .xp-arrow { margin:0 2px; font-family:Arial,sans-serif; font-size:16px; font-weight:700; }
  .xp-credit strong { color:#c2352b; font-weight:900; }
  .xp-hours,.xp-meal { font-size:13px; font-weight:900; }
  .xp-ot { font-size:11px; font-weight:800; } .xp-ot small { display:block; margin-top:3px; color:#6f6254; font-size:9px; font-weight:500; line-height:1.25; }
  .xp-note { padding:2px 4px !important; }
  .xp-note textarea { display:block; width:100%; min-height:28px; margin:0; padding:6px 4px; border:0; border-radius:0; background:transparent; color:#111; font:inherit; line-height:1.25; resize:vertical; box-shadow:none; }
  .xp-note textarea::placeholder { color:#aaa; font-style:italic; }
  .xp-note:focus-within { box-shadow:inset 0 0 0 2px #b68141; }
  .xp-reason { display:block; width:calc(100% - 6px); min-height:29px; margin:3px; padding:4px 28px 4px 8px; border:1px solid #d8b780; border-radius:5px; background:#fffaf1; color:#4f3415; font:inherit; font-size:11px; font-weight:800; }
  .xp-machine,.xp-return { display:block; margin:2px 3px; font-size:10px; line-height:1.3; } .xp-machine { color:#8b6329; } .xp-return { color:#b42318; font-weight:700; }
  .xp-none-needed { display:inline-flex; align-items:center; min-height:28px; margin:2px 4px; color:#4c7650; font-size:10px; font-weight:800; }
  .xp-text { margin:4px; font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
  .xp-proposal { display:block; margin:3px; color:#2f7240; font-size:10px; font-weight:800; line-height:1.3; } .xp-proposal[hidden] { display:none; }
  .xp-trip { display:flex; gap:5px; align-items:center; margin:2px; padding:4px; border:1px solid #e1bd83; border-radius:4px; background:#fff7e8; color:#6e4c1d; font-size:10px; }
  .xp-trip[hidden] { display:none; } .xp-trip span { flex:1; line-height:1.2; }
  .xp-trip select { width:64px; height:24px; min-height:0; padding:0 4px; border:1px solid #d7b06d; border-radius:3px; background:#fff; color:#111; font:inherit; }
  .xp-doc { margin:3px; font-size:10.5px; font-weight:700; color:#4f3415; } .xp-doc.ok { color:#2f7240; } .xp-doc.danger { color:#b42318; }
  .xp-note button.sm { min-height:0; margin:3px; padding:4px 9px; font-size:11px; }
  .xp-doc-btn { background:#fff7e8 !important; border:1px solid #c99757 !important; color:#80551f !important; }
  .xp-doc-actions { margin:0; gap:0; }
  .xp-msgs { list-style:none; margin:2px 3px; padding:0; display:grid; gap:2px; font-size:10.5px; font-weight:700; } .xp-msgs:empty { display:none; }
  .xp-msgs .err { color:#b42318; } .xp-msgs .warn { color:#9b6a25; }
  .xp-hc { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin:3px; padding-top:4px; border-top:1px dashed #d8c7b0; font-size:11px; }
  .xp-hc small { flex-basis:100%; color:#555; }
  .xp-more { margin:2px 3px 3px; } .xp-more summary { cursor:pointer; font-size:10px; color:#8b6329; }
  .xp-more-body { display:grid; gap:8px; margin-top:6px; color:#111; }
  .xp-comments,.xp-files { list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:11px; }
  .xp-comments p { margin:2px 0 0; } .xp-comments small,.xp-files small { color:#777; }
  .xp-files li { display:flex; align-items:center; gap:8px; }
  .xp-comment-new { display:flex; gap:6px; } .xp-comment-new input { flex:1; min-height:28px; padding:3px 8px; background:#fff; color:#111; border:1px solid #d8c7b0; font-size:11px; }
  .xp-upload { justify-self:start; font-size:11px; font-weight:700; color:#80551f; cursor:pointer; }
  .xp-more-body .muted,.xp-more-body small.muted { color:#777; }
  .xp-sheet tfoot th,.xp-sheet tfoot td { font-weight:800; text-align:center; }
  .xp-meal-total { color:#195f33; font-size:11px; white-space:nowrap; }
  .xp-signs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); min-width:980px; min-height:96px; padding:8px 4% 4px; background:#fff; color:#111; font-size:12px; text-align:center; }
  .xp-signs > div { display:grid; min-height:88px; align-content:start; justify-items:center; padding:4px 14px; }
  .xp-signs > div + div { border-left:1px solid #eee4d8; }
  .xp-signs span { margin-top:3px; font-style:italic; }
  .xp-signs img { width:150px; height:42px; margin-top:5px; object-fit:contain; }
  .xp-signs strong { margin-top:24px; font-size:12px; } .xp-signs img + strong { margin-top:4px; }
  .xp-signs strong.pending { color:#9a9187; font-weight:600; }
  button.linklike { min-height:0; padding:0; border:0; background:none; color:#80551f; text-decoration:underline; font:inherit; cursor:pointer; }
  .xp-foot { position:sticky; bottom:0; z-index:5; display:grid; gap:8px; margin-top:16px; padding:14px 16px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--shadow-2); }
  .xp-foot:empty { display:none; } .xp-foot .btn-row { justify-content:flex-end; margin:0; } .xp-foot .field { margin:0; }
  .xp-foot button.linklike { color:var(--bronze-deep); }
  .xp-errs summary { cursor:pointer; font-size:13px; font-weight:600; color:var(--crit); }
  .xp-errs ul { margin:6px 0 0; padding-left:18px; font-size:12.5px; color:var(--ink-2); max-height:180px; overflow:auto; }
  @media (max-width:900px) {
    .xp-foot { position:static; box-shadow:none; }
    .xp-foot .btn-row { justify-content:stretch; } .xp-foot .btn-row button { flex:1; }
  }
}
/* Bảng tường trình: giữ đúng tờ giấy CRM, không nhận kiểu ô/nhập tối của giao diện Sales */
@media screen {
  #appView .xp-sheet th,#appView .xp-sheet td { height:34px; padding:5px 7px; border:1px solid #202020; background:#fff; color:#111; line-height:1.3; font-size:12px; letter-spacing:0; text-transform:none; }
  #appView .xp-sheet thead th { font-weight:800; text-align:center; }
  #appView .xp-sheet th.xp-section { text-align:left; }
  #appView .xp-sheet tbody tr:hover td { background:#fff; }
  #appView .xp-sheet tbody tr.is-sunday td { background:#d9d9d9; color:#555; }
  #appView .xp-sheet tbody tr.is-locked td { background:#f7f7f7; color:#777; }
  #appView .xp-sheet td.xp-credit.has-transition { background:#fffdf9; }
  #appView .xp-sheet td.xp-note { padding:2px 4px; }
  #appView .xp-sheet td.xp-hours,#appView .xp-sheet td.xp-meal { font-size:13px; font-weight:900; }
  #appView .xp-sheet td.xp-ot { font-size:11px; font-weight:800; }
  #appView .xp-sheet td.xp-credit { font-weight:700; }
  #appView .xp-sheet .xp-note textarea { min-height:28px; padding:6px 4px; border:0; border-radius:0; background:transparent; color:#111; line-height:1.25; }
  #appView .xp-sheet .xp-reason { min-height:29px; margin:3px; padding:4px 28px 4px 8px; border:1px solid #d8b780; border-radius:5px; background-color:#fffaf1; color:#4f3415; font-size:11px; font-weight:800; }
  #appView .xp-sheet label.xp-trip { margin:2px; color:#6e4c1d; font-size:10px; font-weight:400; }
  #appView .xp-sheet .xp-trip select { width:64px; height:24px; min-height:0; padding:0 4px; border:1px solid #d7b06d; border-radius:3px; background-color:#fff; color:#111; }
  #appView .xp-sheet .xp-comment-new input { min-height:28px; padding:3px 8px; border:1px solid #d8c7b0; border-radius:4px; background-color:#fff; color:#111; font-size:11px; }
  #appView .xp-sheet label.xp-upload { margin:0; color:#80551f; font-size:11px; font-weight:700; }
  #appView .xp-sheet tfoot th,#appView .xp-sheet tfoot td { font-weight:800; text-align:center; }
  #appView .xp-sheet th.xp-meal-total { color:#195f33; font-size:11px; }
  .xp-foot { position:static; box-shadow:none; }
}
@media screen { .xp-none-needed.is-future { color:#8a8a8a; } }
/* Chuông thông báo */
@media screen {
  .nt-wrap { position:relative; display:inline-flex; }
  #appView .appbar .notice-btn { position:relative; display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; min-height:40px; padding:0; border-radius:10px; }
  #appView .appbar .notice-btn .nav-badge { position:absolute; top:-4px; right:-6px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; font-size:10.5px; line-height:18px; }
  .notice-panel { position:absolute; z-index:75; top:calc(100% + 8px); right:0; width:min(380px,calc(100vw - 24px)); max-height:min(70vh,560px); overflow:auto; padding:6px; border:1px solid var(--hair); border-radius:var(--r-lg); background:var(--surface); box-shadow:0 18px 40px rgba(0,0,0,.45); }
  .notice-panel[hidden] { display:none; }
  .nt-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px 10px; border-bottom:1px solid var(--hair-soft); font-size:14px; }
  .nt-head button.linklike { color:var(--bronze-deep); font-size:12px; } .nt-desktop { display:block; width:100%; padding:7px 10px; border-bottom:1px solid var(--hair-soft); text-align:left; color:var(--bronze-deep); font-size:12px; font-weight:600; }
  .nt-list { list-style:none; margin:4px 0 0; padding:0; display:grid; gap:2px; }
  #appView .notice-panel .nt-item { display:flex; align-items:flex-start; justify-content:flex-start; gap:10px; width:100%; min-height:0; padding:10px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; white-space:normal; font-weight:400; }
  #appView .notice-panel .nt-item:hover,#appView .notice-panel .nt-item:focus-visible { background:var(--bronze-wash); }
  .nt-item.is-unread { background:color-mix(in srgb,var(--bronze) 8%,transparent); }
  .nt-dot { flex:0 0 8px; width:8px; height:8px; margin-top:6px; border-radius:50%; background:var(--info); }
  .nt-dot.ok { background:var(--normal); } .nt-dot.warn { background:var(--high); } .nt-dot.danger { background:var(--crit); }
  .nt-item:not(.is-unread) .nt-dot { opacity:.3; }
  .nt-body { display:grid; gap:3px; min-width:0; font-size:13px; }
  .nt-body strong { font-size:13px; } .nt-item:not(.is-unread) .nt-body strong { font-weight:500; }
  .nt-body span { color:var(--ink-2); overflow-wrap:anywhere; } .nt-body small { color:var(--muted); font-size:11.5px; }
  .nt-empty { padding:14px 10px; margin:0; }
  @media (max-width:900px) {
    .notice-panel { position:fixed; top:58px; right:12px; left:12px; width:auto; }
  }
}
/* Bảng công tháng (số CRM tính) */
@media screen {
  .wa-sum-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin:6px 0 12px; }
  .wa-sum { display:grid; gap:3px; padding:12px 14px; border:1px solid var(--hair); border-radius:var(--r); background:var(--surface-2); }
  .wa-sum span { font-size:12px; color:var(--muted); } .wa-sum strong { font-size:18px; font-variant-numeric:tabular-nums; } .wa-sum small { font-size:12px; color:var(--ink-2); font-variant-numeric:tabular-nums; }
  .wa-sum.is-fine { border-color:var(--crit); } .wa-sum.is-fine strong { color:var(--crit); }
}
/* Thanh đầu trang có thêm chuông: màn vừa chỉ giữ ảnh đại diện, nút không xuống dòng */
@media screen and (max-width:1320px) {
  #appView .appbar .who > span:last-child { display:none; }
  #appView .appbar #specialistAdminBtn,#appView .appbar #profileBtn,#appView .appbar #logoutBtn { display:none !important; }
  #appView .appbar .mobile-menu-btn { display:inline-flex; }
}
/* Giải trình: yêu cầu bổ sung, đơn bị trả về, hoàn tác */
@media screen {
  .xp-banner .xp-req { display:grid; gap:6px; padding-top:8px; margin-top:4px; border-top:1px solid var(--hair); }
  .xp-banner .xp-req .btn-row { margin:0; }
  .xp-req-form { display:flex; gap:8px; } .xp-req-form input { flex:1; min-width:0; }
  .xp-req-bad { color:var(--crit); font-weight:600; }
  #appView .xp-sheet .xp-undo { background:#fff; border:1px solid #d8c7b0; color:#80551f; }
}
/* In / Lưu PDF phiếu giải trình: A4 ngang, chỉ in tờ bảng */
@page xpland { size: A4 landscape; margin: 0; }   /* lề nằm trong #printRoot (app.css --pm, 14/11/2026) */
@media print {
  body.xp-printing #appView { display:none !important; }
  #printRoot .xp-print { page: xpland; }
  #printRoot .xp-scroll { overflow:visible; border:1px solid #202020; }
  #printRoot .xp-doc-head,#printRoot .xp-sheet,#printRoot .xp-signs { min-width:0; width:100%; }
  #printRoot .xp-sheet th,#printRoot .xp-sheet td { height:auto; padding:3px 5px; border:1px solid #202020; background:#fff; color:#111; font-size:8.5pt; letter-spacing:0; text-transform:none; }
  #printRoot .xp-sheet tbody tr.is-sunday td { background:#d9d9d9; }
  #printRoot .xp-sheet tr,#printRoot .xp-signs { break-inside:avoid; }
  #printRoot .xp-print * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
/* Chi tiết bảng công từng ngày */
@media screen {
  .wa-days { margin:4px 0 10px; } .wa-days summary { cursor:pointer; font-size:13px; font-weight:600; color:var(--bronze-deep); padding:6px 0; }
  #appView .wa-day-table { width:100%; border-collapse:collapse; font-size:12.5px; font-variant-numeric:tabular-nums; }
  #appView .wa-day-table th,#appView .wa-day-table td { padding:7px 10px; border-bottom:1px solid var(--hair-soft); text-align:left; white-space:nowrap; line-height:1.4; }
  #appView .wa-day-table td:last-child { white-space:normal; min-width:180px; color:var(--ink-2); }
  #appView .wa-day-table tr.is-sun td { color:var(--muted); background:color-mix(in srgb,var(--surface-3) 45%,transparent); }
  #appView .wa-day-table tr.is-future td { opacity:.55; }
  #appView .wa-day-table tr.is-fine td { color:var(--crit); }
  #appView .wa-day-table tfoot th { font-weight:700; border-top:1px solid var(--hair); }
}
/* Công & phép — theo trang "Lịch công cá nhân" của CRM (hanh-chinh.css 04/09 + desktop-workspace.css) */
@media screen {
  .pa { --pa-line:#ddcfbd; display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:14px; align-items:start; color:#261E16; }
  .pa-frame { min-width:0; border:1px solid var(--pa-line); border-radius:12px; background:#fff; padding:14px; }
  .pa-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin:0 0 12px; }
  .pa-toolbar h1 { margin:0; font-size:20px; font-weight:700; line-height:1.3; color:#171717; letter-spacing:0; }
  .pa-month { display:inline-flex; align-items:center; gap:2px; padding:4px; border:1px solid #EAE1D5; border-radius:999px; background:#fff; }
  .pa-month strong { display:inline-flex; align-items:center; gap:8px; min-width:142px; justify-content:center; padding:5px 8px; font-size:14px; font-weight:700; }
  .pa-month strong svg { color:#7A6D5E; }
  #appView .pa-month button { width:30px; height:30px; min-height:30px; padding:0; border:0; border-radius:50%; background:transparent; color:#7A6D5E; font-size:18px; line-height:1; }
  #appView .pa-month button:hover:not(:disabled) { background:#FAF5EE; color:#A85F1E; }
  #appView .pa-month button:disabled { opacity:.35; }
  #waBody { min-width:0; }
  /* 4 thẻ chỉ số */
  .pa-kpis { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.92fr) minmax(0,1.1fr) minmax(0,1.18fr); gap:10px; margin:0 0 14px; align-items:stretch; }
  .pa-kpi { position:relative; min-width:0; padding:8px; border:1px solid var(--pa-line); border-radius:10px; background:#fff; }
  .pa-kpi:hover { border-color:#D9C8B5; }
  .pa-kpi-head { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
  .pa-kpi-label { font-size:10px; font-weight:700; text-transform:uppercase; line-height:1.3; color:#584831; }
  .pa-kpi-icon { flex:0 0 auto; width:18px; height:18px; display:flex; align-items:center; justify-content:center; border-radius:5px; font-size:11px; font-weight:700; }
  .pa-kpi-figure { display:flex; align-items:baseline; gap:4px 6px; flex-wrap:wrap; margin-top:3px; }
  .pa-kpi-value { font-size:22px; font-weight:800; line-height:1.1; color:#261E16; }
  .pa-kpi-value small { font-size:13px; font-weight:400; color:#7A6D5E; }
  .pa-kpi-side { font-size:10px; color:#7A6D5E; } .pa-kpi-side .is-red { color:#B9382B; font-weight:600; }
  .pa-kpi-note { margin:4px 0 0; color:#605447; font-size:10px; line-height:1.4; }
  .pa-kpi-icon.tone-green { background:#EDF7F1; color:#246B43; } .pa-kpi-value.tone-green { color:#246B43; }
  .pa-kpi-icon.tone-amber { background:#FFF3DF; color:#A66014; } .pa-kpi-value.tone-amber { color:#A66014; }
  .pa-kpi-icon.tone-orange { background:#F5ECE0; color:#7A4917; } .pa-kpi-value.tone-orange { color:#C27A34; }
  .pa-kpi-icon.tone-blue { background:#EEF4FF; color:#1B54C8; } .pa-kpi-value.tone-blue { color:#2970FF; }
  .pa-kpi-icon.tone-mute { background:#F4F0EA; color:#8A7968; } .pa-kpi-value.tone-mute { color:#4F4337; }
  .pa-kpi-bar { height:3px; margin:5px 0 2px; border-radius:999px; background:#F0E7DA; overflow:hidden; }
  .pa-kpi-bar span { display:block; height:100%; border-radius:999px; background:#C27A34; }
  .pa-kpi.has-cta { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; align-content:start; gap:4px 6px; }
  .pa-kpi.has-cta .pa-kpi-head { grid-column:1/-1; }
  .pa-kpi.has-cta .pa-kpi-figure { grid-column:1; grid-row:2; align-self:center; margin:0; }
  #appView .pa-kpi-cta { grid-column:2; grid-row:2; align-self:center; min-height:26px; height:auto; margin:0; padding:4px 8px; border:0; border-radius:6px; background:#AE7C41; color:#fff; font-size:10px; font-weight:700; white-space:nowrap; }
  #appView .pa-kpi-cta:hover { background:#8a5f2a; color:#fff; }
  /* Chú giải */
  .pa-legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin-bottom:10px; color:#352c22; font-size:11px; line-height:1.5; }
  .pa-legend span { display:flex; align-items:center; gap:4px; }
  .pa-legend i { width:14px; height:14px; border-radius:3px; border:1px solid; display:inline-block; }
  .pa-legend b { width:6px; height:6px; border-radius:50%; display:inline-block; }
  /* Lịch */
  .pa-week, .pa-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
  .pa-week span { text-align:center; padding:5px 0; font-size:11px; font-weight:600; color:#635544; }
  .pa-grid { margin-top:6px; }
  .pa-day { min-width:0; min-height:100px; box-sizing:border-box; padding:7px; display:flex; flex-direction:column; justify-content:space-between; gap:2px; border:1px solid #EAE1D5; border-radius:9px; background:#fff; font-size:12px; }
  .pa-day.today { border-color:#AE7C41; background:#FBF6EE; }
  .pa-day.c-full { border-color:#A5D6A7; background:#F1F8E9; }
  .pa-day.c-half { border-color:#FFCC80; background:#FFF8E1; }
  .pa-day.c-absent { border-color:#EF9A9A; background:#FFEBEE; }
  .pa-day.c-trip { border-color:#80DEEA; background:#E0F7FA; }
  .pa-day.has-overtime { border-color:#1565C0; box-shadow:inset 0 0 0 1px #1565C0; cursor:pointer; }
  .pa-day.has-overtime:hover { border-color:#C27A34; }
  .pa-day[role="button"]:focus-visible { outline:2px solid #6e4a24; outline-offset:2px; }
  .pa-top { display:flex; align-items:center; justify-content:space-between; gap:6px; min-width:0; flex-wrap:wrap; }
  .pa-top-right { display:inline-flex; align-items:center; gap:5px; }
  .pa-num { font-weight:700; font-size:13.5px; }
  .pa-badge { padding:1px 5px; border-radius:5px; background:#fff; color:#246B43; font-size:9.5px; font-weight:700; }
  .pa-badge.is-leave { color:#B9382B; border:1px solid #F8C6C3; padding:1px 6px; border-radius:6px; font-size:10px; }
  .pa-dots { display:inline-flex; align-items:center; gap:4px; }
  .pa-dots i { width:7px; height:7px; border-radius:50%; display:inline-block; }
  .pa-dots .dot-late { background:#B9382B; } .pa-dots .dot-ot { background:#2970FF; }
  .pa-punch { margin-top:2px; font-size:11px; line-height:1.4; color:#665747; text-align:center; overflow-wrap:anywhere; }
  .pa-status { font-size:11px; line-height:1.35; text-align:center; overflow-wrap:anywhere; }
  .pa-day.c-full .pa-num, .pa-day.c-full .pa-status { color:#246B43; }
  .pa-day.c-half .pa-num, .pa-day.c-half .pa-status, .pa-day.c-half .pa-badge { color:#9A5212; }
  .pa-day.c-absent .pa-num { color:#B9382B; } .pa-day.c-absent .pa-status { color:#A64B3B; }
  .pa-day.c-trip .pa-num, .pa-day.c-trip .pa-status { color:#00838F; }
  .pa-day.c-weekend { align-items:center; }
  .pa-day.c-weekend .pa-num { color:#8C7D6D; }
  .pa-day.c-weekend.is-plain { align-items:flex-start; } .pa-day.c-weekend.is-plain .pa-num { color:#261E16; }
  .pa-weekend-label { font-size:10px; color:#A89888; text-align:center; }
  /* Thống kê tháng */
  .pa-stats { margin-top:12px; padding:12px; border:1px solid var(--pa-line); border-radius:12px; background:#fff; }
  .pa-stats-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-bottom:10px; margin-bottom:12px; border-bottom:1px solid #EBD8C3; }
  .pa-stats-head h3 { margin:0; font-size:15px; font-weight:800; color:#261E16; }
  .pa-stats-total { font-size:12px; color:#7A6D5E; } .pa-stats-total strong { font-size:14px; color:#246B43; }
  .pa-stat-cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; margin-bottom:8px; }
  .pa-stat-box { padding:13px 14px; border:1px solid #EAE0D3; border-radius:14px; background:#FAF7F2; }
  .pa-stat-title { display:block; padding-bottom:5px; margin-bottom:8px; border-bottom:1px solid #EBD8C3; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:#8A521D; }
  .pa-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 14px; }
  .pa-stat-item { font-size:12.5px; line-height:1.5; color:#4E4133; }
  .pa-stat-item strong { color:#261E16; font-weight:700; } .pa-stat-item strong.is-amber { color:#A66014; } .pa-stat-item strong.is-red { color:#B9382B; }
  .pa-empty, .pa-untracked { margin:0; font-size:12px; color:#7A6D5E; }
  .pa-untracked { padding:18px; border:1px dashed var(--pa-line); border-radius:14px; text-align:center; }
  /* Cột phải */
  .pa-side { display:grid; gap:12px; min-width:0; }
  .pa-panel { min-width:0; padding:12px; border:1px solid var(--pa-line); border-radius:12px; background:#fff; }
  .pa-panel h2 { margin:0 0 10px; font-size:15px; font-weight:700; line-height:1.4; color:#171717; }
  .pa-sheets { display:grid; gap:8px; max-height:320px; overflow-y:auto; overscroll-behavior:contain; padding:2px; }
  #appView .pa-sheet { display:block; width:100%; min-width:0; height:auto; min-height:0; padding:10px; text-align:left; border:1px solid #E9DCC8; border-radius:9px; background:#fffdf9; color:inherit; font:inherit; cursor:pointer; box-shadow:none; }
  #appView .pa-sheet:hover { border-color:#AE7C41; background:#fffdf9; box-shadow:0 12px 26px rgba(174,124,65,.12); }
  #appView .pa-sheet.state-approved { border-color:#9ACDA5; background:linear-gradient(180deg,#F6FFF8 0%,#EAF7ED 100%); box-shadow:inset 4px 0 0 #2E7D32; }
  .pa-sheet strong { display:block; margin-bottom:5px; font-size:13px; line-height:1.4; color:#171717; }
  .pa-sheet-status { display:inline-flex; align-items:center; gap:6px; max-width:100%; box-sizing:border-box; margin-bottom:4px; padding:4px 6px; border-radius:6px; background:#F2EEE7; color:#665E53; }
  .pa-sheet-status b { min-width:0; font-size:11px; line-height:1.35; }
  .pa-sheet-status.manager-reviewing { background:#EEF1FF; color:#4556A6; } .pa-sheet-status.hc-reviewing { background:#FFF3DF; color:#9A5A00; }
  .pa-sheet-status.appeal { background:#FFF0EA; color:#B34A24; } .pa-sheet-status.correction { background:#FDECEC; color:#B42318; } .pa-sheet-status.approved { background:#DDF3E2; color:#176B2C; }
  .pa-sheet-time { display:block; font-size:11px; line-height:1.5; color:#6D665C; }
  .pa-sheet-alert { display:flex; align-items:center; gap:6px; margin-top:6px; padding:7px; border-radius:7px; background:#FDECEC; color:#B42318; font-size:11px; font-weight:600; }
  .pa-fund { display:flex; align-items:flex-start; gap:7px; padding:9px; margin-bottom:8px; border:1px solid var(--pa-line); border-radius:8px; background:#fffdfa; }
  .pa-fund-ico { flex:0 0 auto; width:26px; height:26px; display:flex; align-items:center; justify-content:center; border-radius:7px; font-size:13px; }
  .pa-fund-ico.is-annual { background:#E8F5EE; } .pa-fund-ico.is-comp { background:#FDF0EE; }
  .pa-fund-body { flex:1 1 auto; min-width:0; }
  .pa-fund-line { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 8px; }
  .pa-fund-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.2px; color:#8A7968; }
  .pa-fund-value { font-size:14px; font-weight:800; color:#261E16; } .pa-fund-value.is-accent { color:#C27A34; }
  .pa-fund-note { margin:2px 0 0; font-size:11px; line-height:1.5; color:#8C7D6D; } .pa-fund-note.is-warn { color:#B9382B; font-weight:600; }
  #appView .pa-ot-cta { display:flex; align-items:center; gap:7px; width:100%; height:auto; min-height:42px; margin:8px 0 0; padding:9px; text-align:left; border:1px solid var(--pa-line); border-radius:8px; background:#fff8ee; color:#6D4C41; font:inherit; cursor:pointer; box-shadow:none; }
  #appView .pa-ot-cta:hover { border-color:#C9A227; background:#fff8ee; box-shadow:0 4px 14px rgba(201,162,39,.14); }
  .pa-ot-ico { font-size:18px; }
  .pa-ot-cta span:last-child { display:flex; flex-direction:column; gap:2px; min-width:0; }
  .pa-ot-cta b { font-size:12px; line-height:1.4; font-weight:700; } .pa-ot-cta small { font-size:11px; line-height:1.5; color:#8D7B63; }
  @media (max-width:1365px) { .pa-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  @media (max-width:1199px) { .pa { grid-template-columns:minmax(0,1fr); } .pa-side { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; } }
  @media (max-width:760px) {
    .pa-frame { padding:12px; } .pa-side { grid-template-columns:1fr; }
    .pa-week, .pa-grid { gap:4px; } .pa-day { min-height:64px; padding:5px; } .pa-punch { display:none; } .pa-status { font-size:9.5px; } .pa-badge { font-size:8.5px; padding:0 3px; }
  }
  @media (max-width:560px) { .pa-kpis { grid-template-columns:1fr 1fr; } .pa-stat-grid { grid-template-columns:1fr; } .pa-status, .pa-weekend-label { display:none; } }
}

/* Bản in báo cáo kinh doanh tuần — theo mẫu bao-cao.html của CRM (A4 dọc) */
@media print {
  /* Có bản dựng sẵn trong #printRoot thì không in màn hình đang mở */
  body:has(#printRoot:not(:empty)) #appView { display:none !important; }
  body.rp-printing #appView, body.rp-printing .overlay, body.rp-printing .toast-host, body.rp-printing dialog { display:none !important; }
  /* In từ màn Xem trước danh sách quà: ẩn lớp xem trước, bỏ khóa cuộn (không thì chỉ in được trang đầu). */
  body.rp-printing .bdp2-preview { display:none !important; }
  html.bdp2-lock, html.bdp2-lock body { overflow:visible !important; height:auto !important; }
  body.rp-printing { background:#fff !important; }
  #printRoot .rpp { color:#000; font-family:'Inter','Plus Jakarta Sans',Arial,sans-serif; font-size:10.5pt; line-height:1.5; }
  #printRoot .rpp * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  /* Đầu trang: ảnh header công ty (public/assets/ever-print-header.png) + tiêu đề font thường (Plus Jakarta Sans) — font có chân bị lệch dấu tiếng Việt khi in. */
  #printRoot .rpp-head { text-align:center; margin-bottom:14px; padding-bottom:12px; border-bottom:3px double #a9783a; }
  #printRoot .rpp-logo { display:block; width:100%; height:auto; margin:0 0 12px; }
  #printRoot .rpp-head h2 { margin:0; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:15pt; font-weight:800; font-style:normal; line-height:1.3; color:#1f1f1f; text-transform:uppercase; letter-spacing:.01em; }
  #printRoot .rpp-meta { display:grid; grid-template-columns:1fr 1fr; gap:6px 16px; margin-bottom:8px; padding:10px 14px; border:1px solid #d9c6a5; border-radius:6px; background:#fbf7f0; font-weight:600; }
  #printRoot .rpp-meta .gold { color:#8a5f2a; } #printRoot .rpp-meta .ok { color:#2b8a3e; } #printRoot .rpp-meta .warn { color:#a2560b; } #printRoot .rpp-meta .bad { color:#c62828; }
  #printRoot .rpp-sec { margin-top:14px; }
  #printRoot .rpp-sec h3 { margin:0 0 6px; padding:3px 0 3px 9px; border-left:4px solid #a9783a; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:11pt; font-style:normal; font-weight:800; color:#1f1f1f; letter-spacing:.02em; break-after:avoid; }
  #printRoot .rpp-text { white-space:pre-wrap; overflow-wrap:anywhere; margin:0 0 6px; padding-left:13px; }
  #printRoot .rpp-text.is-empty { color:#777; font-style:italic; font-size:9.5pt; }
  #printRoot table.rpp-table { width:100%; margin-top:6px; border-collapse:collapse; table-layout:fixed; font-size:9.5pt; }
  #printRoot .rpp-table th, #printRoot .rpp-table td { border:1px solid #555; padding:4px 5px; text-align:center; vertical-align:middle; overflow-wrap:anywhere; white-space:normal; line-height:1.35; text-transform:none; letter-spacing:0; height:auto; }
  #printRoot .rpp-table th { background:#fff; color:#000; font-size:8.5pt; font-weight:800; text-transform:uppercase; }
  #printRoot .rpp-table td.l { text-align:left; } #printRoot .rpp-table td.r { text-align:right; font-weight:700; }
  #printRoot .rpp-table td.m { text-align:right; font-weight:600; color:#c62828; }
  #printRoot .rpp-table th:first-child { white-space:nowrap; }
  /* 25/10: tên nhân sự / khách không xuống dòng (cột đủ rộng), số tiền không xuống dòng; bảng I 9 cột chữ nhỏ hơn */
  #printRoot .rpp-table td.nm { white-space:nowrap; overflow-wrap:normal; word-break:keep-all; }
  #printRoot .rpp-table td.m { white-space:nowrap; overflow-wrap:normal; word-break:keep-all; }
  #printRoot table.rpp-table { font-size:8.6pt; }
  #printRoot table.rpp-table th { font-size:7.6pt; }
  #printRoot table.rpp-table td.m { font-size:7.8pt; padding-left:3px; padding-right:3px; letter-spacing:-.1px; }
  #printRoot table.rpp-table td.m { padding-left:3px; padding-right:4px; }
  #printRoot .rpp-when { margin:2px 0 4px; text-align:center; font-size:11pt; font-weight:700; }
  #printRoot .rpp-who { margin:0 0 10px; text-align:center; font-size:10.5pt; }
  #printRoot .rpp-table td.rpp-empty { padding:10px 5px; color:#777; font-style:italic; text-align:center; }
  #printRoot .rpp-table tfoot td { background:#f3ebd9; font-weight:700; }
  #printRoot .rpp-table tr { break-inside:avoid; }
  #printRoot .rpp-sigs { display:flex; justify-content:space-around; gap:12px; margin-top:28px; text-align:center; break-inside:avoid; }
  #printRoot .rpp-sig { flex:1; }
  #printRoot .rpp-sig-title { font-weight:700; text-transform:uppercase; font-size:9.5pt; margin-bottom:6px; }
  #printRoot .rpp-sig-slot { display:flex; align-items:center; justify-content:center; min-height:58px; }
  #printRoot .rpp-sig-slot img { width:46mm; height:14mm; object-fit:contain; }
  #printRoot .rpp-stamp { display:inline-block; padding:2px 10px; border:2px solid #2b8a3e; border-radius:4px; color:#2b8a3e; font-weight:700; font-size:9.5pt; transform:rotate(-8deg); }
  #printRoot .rpp-stamp.reject { color:#c62828; border-color:#c62828; }
  #printRoot .rpp-sig-name { font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:11.5pt; font-weight:700; font-style:normal; color:#8a5f2a; }
  #printRoot .rpp-sig-date { font-size:8.5pt; font-style:italic; color:#444; margin-top:2px; }
  #printRoot .rpp-foot { margin-top:18px; padding-top:6px; border-top:1px solid #d9c6a5; text-align:right; font-size:8pt; color:#666; }
}

/* ---------- Trang Báo cáo (10/10): 3 tab; báo cáo kết quả / kế hoạch tuần của nhân viên (staff-reports.js) ---------- */
@media screen {
  #appView .rp-tabs { margin:0 0 16px; }
  #appView .srp-cardhead { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
  #appView .srp-cardhead h2 { margin:0; font-size:16px; font-weight:700; color:#0a0a0a; }
  #appView .srp-cardhead p { margin:4px 0 0; }
  #appView .srp-actions, #appView .srp-filter { display:flex; gap:8px; flex-wrap:wrap; }
  /* Bộ lọc dạng segmented */
  #appView .srp-filter { gap:2px; padding:3px; border:1px solid #e4dccf; border-radius:11px; background:#f6f2ea; }
  #appView .srp-filter button { min-height:32px; padding:4px 14px; border:0; border-radius:8px; background:transparent; color:#5b524a; font-size:13px; font-weight:700; box-shadow:none; }
  #appView .srp-filter button[aria-pressed="true"] { background:#fff; color:#0a0a0a; box-shadow:0 1px 3px rgba(20,16,10,.12); }
  #appView .srp-empty { margin:6px 0; padding:22px; border:1px dashed #cdb08a; border-radius:12px; background:var(--warm, #fbf6ef); color:#3f3a33; text-align:center; font-size:13px; }
  /* Thẻ nhiệm vụ "Kết quả tuần này" / "Kế hoạch tuần tới" (thiết kế lại 10/10) — viền trái theo trạng thái */
  #appView .srp-nowrow { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; margin-bottom:18px; }
  #appView .srp-task { --st:#a1a1aa; position:relative; display:flex; flex-direction:column; gap:16px; padding:18px 20px 16px 22px; overflow:hidden; border:1px solid #e4dccf; border-radius:16px; background:#fff; box-shadow:0 1px 2px rgba(20,16,10,.05), 0 6px 18px rgba(80,60,30,.06); }
  #appView .srp-task::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--st); }
  #appView .srp-task.is-draft { --st:#a9783a; } #appView .srp-task.is-submitted { --st:#d4891f; } #appView .srp-task.is-approved { --st:#15803d; } #appView .srp-task.is-returned { --st:#b3261e; }
  #appView .srp-task-head { display:flex; align-items:flex-start; gap:12px; }
  #appView .srp-task-head > div { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
  #appView .srp-task-ic { flex:none; display:inline-grid; place-items:center; width:40px; height:40px; border-radius:12px; background:var(--bronze-wash, #f6efe5); color:var(--bronze-deep, #8a5f2a); }
  #appView .srp-task-ic.k-plan { background:#e9effc; color:#1a4fc4; }
  #appView .srp-task-top { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
  #appView .srp-task-kind { color:#5b524a; font-size:11.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
  #appView .srp-task-head strong { font-size:17px; font-weight:800; color:#0a0a0a; letter-spacing:-.01em; }
  #appView .srp-task-body { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:18px; align-items:end; padding:14px 16px; border-radius:12px; background:#faf8f4; }
  #appView .srp-metric { display:flex; flex-direction:column; gap:2px; min-width:0; }
  #appView .srp-metric span, #appView .srp-progress > span { color:#5b524a; font-size:12px; font-weight:600; }
  #appView .srp-metric b { font-size:22px; font-weight:800; color:#0a0a0a; font-variant-numeric:tabular-nums; letter-spacing:-.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #appView .srp-metric b small { font-size:13px; font-weight:700; color:#5b524a; }
  #appView .srp-progress { display:flex; flex-direction:column; gap:8px; }
  #appView .srp-progress b { color:#0a0a0a; }
  #appView .srp-progress i { display:block; height:8px; border-radius:99px; background:#ebe4d8; overflow:hidden; }
  #appView .srp-progress em { display:block; height:100%; border-radius:inherit; background:var(--st); transition:width .3s ease; }
  #appView .srp-task-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  #appView .srp-task-foot p { margin:0; min-width:0; color:#3f3a33; font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
  #appView .srp-task.is-returned .srp-task-foot p { color:#b3261e; font-weight:600; }
  #appView .srp-task-foot button { flex:none; min-width:120px; min-height:40px; font-weight:700; }
  @media (max-width:900px) { #appView .srp-nowrow { grid-template-columns:1fr; } }
  @media (max-width:520px) { #appView .srp-task-body { grid-template-columns:1fr; } #appView .srp-task-foot { flex-direction:column; align-items:stretch; } }
  /* Đầu trang: nhãn tuần hiện tại + tab gạch chân */
  #appView .rp-week { display:inline-flex; align-items:center; padding:6px 14px; border:1px solid #e4d3b8; border-radius:999px; background:#fff; color:var(--bronze-deep, #8a5f2a); font-size:13px; font-weight:700; white-space:nowrap; }
  #appView .rq-tabs.rp-tabs { display:flex; gap:4px; padding:0; margin:0 0 18px; border:0; border-radius:0; background:transparent; box-shadow:inset 0 -1px #e4dccf; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
  #appView .rp-tabs button { flex:none; min-height:46px; padding:0 16px; border:0; border-bottom:3px solid transparent; border-radius:0; background:transparent; box-shadow:none; color:#5b524a; font-weight:700; }
  #appView .rp-tabs button:hover { color:#0a0a0a; background:transparent; }
  #appView .rp-tabs button[aria-selected="true"] { background:transparent; box-shadow:none; color:var(--bronze-deep, #8a5f2a); border-bottom-color:var(--bronze, #a9783a); }
  /* Lịch sử báo cáo */
  #appView .srp-count { display:inline-grid; place-items:center; min-width:24px; height:22px; padding:0 7px; margin-left:6px; border-radius:99px; background:#f0ebe2; color:#5b524a; font-size:12px; font-weight:800; vertical-align:2px; }
  #appView .srp-list th.srp-l, #appView .srp-list td.srp-l { text-align:left; }
  #appView .srp-rep { display:flex; align-items:center; gap:12px; }
  #appView .srp-rep .srp-task-ic { width:34px; height:34px; border-radius:10px; }
  #appView .srp-rep strong { display:block; font-size:14px; color:#0a0a0a; }
  #appView .srp-rep small { display:block; color:#5b524a; font-size:12.5px; }
  #appView .srp-list td.srp-when { color:#3f3a33; font-size:13px; white-space:nowrap; }
  #appView .srp-list th.srp-go-h, #appView .srp-list td.srp-go { width:36px; padding-left:0; padding-right:8px; color:#a1a1aa; }
  #appView .srp-list tbody tr { transition:background .15s; }
  #appView .srp-list tbody tr:hover, #appView .srp-list tbody tr:focus-visible { background:#faf6ef; }
  #appView .srp-list tbody tr:hover td.srp-go { color:var(--bronze-deep, #8a5f2a); }
  /* Chip trạng thái */
  #appView .tag.srp-st { padding:4px 11px; border:1px solid transparent; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap; }
  #appView .tag.srp-st-draft, #appView .tag.srp-st-none { background:#f0f0f2; border-color:#d4d4d8; color:#3f3f46; }
  #appView .tag.srp-st-submitted { background:#fff4e0; border-color:#f0cfa6; color:#a2560b; }
  #appView .tag.srp-st-approved { background:#e6f6ea; border-color:#b4e0c1; color:#15803d; }
  #appView .tag.srp-st-returned { background:#fdecec; border-color:#f5c2bd; color:#b3261e; }
  #appView .srp-list tbody tr { cursor:pointer; }
  #appView .srp-num { text-align:right; font-variant-numeric:tabular-nums; }
  #appView .hub-table.srp-list td.srp-num { text-align:center; font-weight:600; }
  /* Form nhập */
  #appView .srp-top { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
  #appView .srp-paper { padding:22px; }
  #appView .srp-head { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:16px; }
  #appView .srp-head h2 { margin:0; font-size:19px; font-weight:800; letter-spacing:.03em; color:var(--bronze-deep); }
  #appView .srp-info { display:grid; grid-template-columns:1.3fr 1fr .6fr 1.4fr; gap:10px; margin-bottom:14px; padding:12px 14px; border:1px solid #e3d6c4; border-radius:12px; background:#fdfaf6; }
  #appView .srp-info > div { display:flex; flex-direction:column; gap:4px; min-width:0; }
  #appView .srp-info span { color:#3f3a33; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
  #appView .srp-info strong { font-size:14px; }
  #appView .srp-info input { min-height:36px; padding:6px 10px; }
  #appView .srp-weeknav { display:inline-flex; gap:4px; margin-top:2px; }
  #appView .srp-weeknav button { min-height:28px; padding:2px 10px; }
  @media (max-width:900px) { #appView .srp-info { grid-template-columns:1fr 1fr; } }
  #appView .srp-note { margin:0 0 12px; padding:10px 12px; border-radius:10px; background:#f4f1ec; font-size:13px; }
  #appView .srp-note.is-bad { background:var(--crit-wash); color:#7a1a14; }
  #appView .srp-note.is-ok { background:var(--normal-wash); color:#0f4f2b; }
  #appView table.srp-grid { width:100%; min-width:900px; border-collapse:collapse; table-layout:fixed; }
  #appView .srp-grid .c-stt { width:48px; } #appView .srp-grid .c-day { width:76px; } #appView .srp-grid .c-amt { width:170px; } #appView .srp-grid .c-own { width:150px; } #appView .srp-grid .c-note { width:190px; }
  #appView .srp-grid th { padding:10px 8px; background:#fff; color:#111; font-size:11.5px; font-weight:800; line-height:1.3; text-transform:uppercase; text-align:center; white-space:normal; border:1px solid #c9b89e; border-bottom:2px solid #8a6a3c; }
  /* Nút + Thêm nhân sự / doanh thu / kế hoạch: tách khỏi dòng Tổng cộng, chữ + viền xanh */
  #appView button[data-add-row] { margin:12px 0 4px; color:var(--normal); background:#fff; border:1px solid var(--normal); font-weight:700; }
  #appView button[data-add-row]:hover { background:var(--normal-wash); color:#0f4f2b; border-color:#0f4f2b; }
  #appView .rp-table tfoot td { border-bottom:1px solid var(--hair-soft); }
  #appView .srp-grid td { padding:6px; border:1px solid #c9b89e; vertical-align:top; background:#fff; }
  #appView .srp-grid td.srp-c { text-align:center; vertical-align:middle; }
  #appView .srp-grid td.srp-c small { display:block; color:#3f3a33; font-size:11px; }
  #appView .srp-grid textarea, #appView .srp-grid input { width:100%; box-sizing:border-box; margin:0; border-color:#d6c9b5; font-size:13px; }
  #appView .srp-grid textarea { min-height:72px; resize:vertical; line-height:1.5; }
  #appView .srp-grid ::placeholder { color:#8a8078; }
  #appView .srp-ro { min-height:22px; padding:4px 2px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.5; }
  #appView .srp-grid tfoot td { padding:10px 8px; background:#f3ebd9; font-weight:800; vertical-align:middle; }
  #appView .srp-grid .srp-total-label { text-align:right; }
  #appView .srp-grid #srpTotal { color:#b3261e; font-size:15px; }
  /* ---------- Theo dõi nộp báo cáo (Sales Admin / Lãnh đạo) ---------- */
  #appView .trk-bar { display:flex; align-items:stretch; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
  #appView .trk-week, #appView .trk-deadline { display:flex; align-items:center; gap:10px; padding:10px 14px; border:1px solid #e4dccf; border-radius:14px; background:#fff; box-shadow:0 1px 2px rgba(20,16,10,.05); }
  #appView .trk-week > div, #appView .trk-deadline > div { display:flex; flex-direction:column; gap:1px; }
  #appView .trk-week span, #appView .trk-deadline span { color:#5b524a; font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
  #appView .trk-week strong, #appView .trk-deadline strong { font-size:15px; font-weight:800; color:#0a0a0a; white-space:nowrap; }
  #appView .trk-week button { display:inline-grid; place-items:center; width:34px; min-height:34px; padding:0; border-radius:10px; }
  #appView .trk-deadline { flex:1; min-width:280px; }
  #appView .trk-deadline svg { flex:none; color:#5b524a; }
  #appView .trk-deadline b { margin-left:auto; padding:5px 12px; border-radius:999px; font-size:13px; font-weight:800; white-space:nowrap; background:#e7f4ec; color:#15713f; }
  #appView .trk-deadline.is-soon { border-color:#f0cfa6; background:#fffaf2; } #appView .trk-deadline.is-soon b { background:#fff0d9; color:#a2560b; } #appView .trk-deadline.is-soon svg { color:#a2560b; }
  #appView .trk-deadline.is-late { border-color:#f5c2bd; background:#fff7f6; } #appView .trk-deadline.is-late b { background:#fdecea; color:#b3261e; } #appView .trk-deadline.is-late svg { color:#b3261e; }
  #appView .trk-copyall, #appView .trk-copy { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
  #appView .trk-copyall { min-height:auto; padding:0 18px; border-radius:14px; font-weight:800; }
  #appView .trk-kpis { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:14px; margin-bottom:18px; }
  #appView .trk-kpi { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; gap:16px; padding:12px 18px; border:1px solid #e4dccf; border-radius:16px; background:#fff; box-shadow:0 1px 2px rgba(20,16,10,.05), 0 6px 18px rgba(80,60,30,.05); }
  #appView .trk-kpi-main { display:flex; flex-direction:column; gap:7px; min-width:0; text-align:center; }
  #appView .trk-kpi-main > span, #appView .trk-kpi.trk-need > span { display:flex; align-items:center; justify-content:center; gap:6px; color:#5b524a; font-size:12px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
  #appView .trk-kpi i, #appView .trk-line i { display:block; height:8px; border-radius:99px; background:#ebe4d8; overflow:hidden; }
  #appView .trk-kpi em, #appView .trk-line em { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg, #c4955a, #a9783a); }
  #appView .trk-kpi p { margin:0; color:#3f3a33; font-size:12.5px; line-height:1.3; }
  /* Số to cao bằng cả cụm tiêu đề + thanh + ghi chú */
  #appView .trk-kpi-num { font-size:56px; font-weight:800; line-height:.95; color:#0a0a0a; font-variant-numeric:tabular-nums; letter-spacing:-.03em; white-space:nowrap; }
  #appView .trk-kpi-num small { font-size:24px; font-weight:700; color:#8a8078; letter-spacing:0; }
  /* Cần đôn thúc: tiêu đề + một hàng "6 người thiếu báo cáo" */
  #appView .trk-kpi.trk-need { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
  #appView .trk-need-line { display:flex; align-items:baseline; justify-content:center; gap:8px; font-size:15px !important; font-weight:700; white-space:nowrap; }
  #appView .trk-need-line strong { font-size:34px; font-weight:800; line-height:1; letter-spacing:-.02em; }
  #appView .trk-kpi.trk-need.is-bad { border-color:#f5c2bd; background:linear-gradient(135deg, #fff 40%, #fdf0ee); }
  #appView .trk-kpi.trk-need.is-bad > span, #appView .trk-kpi.trk-need.is-bad .trk-need-line { color:#b3261e; }
  #appView .trk-kpi.trk-need.is-good > span, #appView .trk-kpi.trk-need.is-good .trk-need-line { color:#15713f; }
  #appView .srp-cardhead h2 svg { vertical-align:-3px; color:var(--bronze-deep, #8a5f2a); }
  /* Danh sách phòng: bấm để xổ nhân sự */
  #appView .trk-hint { color:#5b524a; font-size:12.5px; }
  #appView .trk-teams { display:flex; flex-direction:column; gap:12px; }
  #appView .trk-team { --c:#b3261e; border:1px solid #e4dccf; border-left:4px solid var(--c); border-radius:14px; background:#fff; overflow:hidden; transition:box-shadow .15s; }
  #appView .trk-team.is-ok { --c:#15803d; }
  #appView .trk-team.is-open { box-shadow:0 6px 20px rgba(80,60,30,.08); }
  #appView .trk-team-head { display:grid; grid-template-columns:22px minmax(150px, 1.1fr) minmax(220px, 1.6fr) minmax(120px, auto) auto; align-items:center; gap:18px; width:100%; min-height:auto; padding:14px 18px; border:0; border-radius:0; background:transparent; box-shadow:none; color:inherit; font-weight:400; text-align:left; cursor:pointer; }
  #appView .trk-team-head:hover { background:#fcfaf6; }
  #appView .trk-team-head:focus-visible { outline:2px solid var(--bronze, #a9783a); outline-offset:-2px; }
  #appView .trk-chev { display:inline-grid; place-items:center; color:#8a8078; transition:transform .2s ease; }
  #appView .trk-team.is-open .trk-chev { transform:rotate(90deg); color:var(--bronze-deep, #8a5f2a); }
  #appView .trk-team-name strong { display:block; font-size:15.5px; font-weight:800; color:#0a0a0a; }
  #appView .trk-team-name small { display:block; color:#5b524a; font-size:12px; }
  #appView .trk-team-bars { display:flex; flex-direction:column; gap:6px; }
  #appView .trk-team-dept { display:flex; flex-direction:column; align-items:flex-start; gap:3px; }
  #appView .trk-team-dept small { color:#5b524a; font-size:11.5px; font-weight:600; }
  #appView .trk-badge { justify-self:end; padding:4px 12px; border-radius:999px; font-size:12.5px; font-weight:800; white-space:nowrap; background:#fdecea; color:#b3261e; }
  #appView .trk-team.is-ok .trk-badge { background:#e6f6ea; color:#15803d; }
  #appView .trk-line { display:grid; grid-template-columns:96px minmax(0, 1fr) 40px; align-items:center; gap:10px; font-size:12.5px; }
  #appView .trk-line span { color:#3f3a33; font-weight:600; }
  #appView .trk-line b { text-align:right; font-variant-numeric:tabular-nums; }
  #appView .trk-miss { margin:0 18px 14px 58px; padding:7px 10px; border-radius:10px; background:#fdf3f1; color:#7a1a14; font-size:12.5px; line-height:1.5; }
  #appView .trk-panel { padding:4px 18px 16px; border-top:1px solid #efe8dc; background:#fdfbf8; animation:trkDrop .18s ease; }
  @keyframes trkDrop { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
  #appView .trk-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:12px 0; }
  #appView .trk-panel .srp-filter b { margin-left:2px; padding:0 6px; border-radius:99px; background:#ebe4d8; font-size:11.5px; }
  #appView .trk-panel .tbl-wrap { border-radius:12px; background:#fff; }
  #appView .trk-copy { display:inline-flex; align-items:center; gap:6px; color:var(--normal, #15713f); border-color:var(--normal, #15713f); background:#fff; font-weight:700; }
  #appView .trk-copy:hover { background:var(--normal-wash, #e7f4ec); }
  @media (max-width:900px) {
    #appView .trk-team-head { grid-template-columns:22px minmax(0, 1fr) auto; gap:10px 12px; }
    #appView .trk-team-bars, #appView .trk-team-dept { grid-column:2 / -1; }
    #appView .trk-team-dept { flex-direction:row; align-items:center; gap:8px; }
    #appView .trk-badge { grid-column:3; grid-row:1; }
    #appView .trk-miss { margin-left:18px; }
  }
  /* Điện thoại: mỗi nhân viên một thẻ thay cho bảng cuộn ngang */
  @media (max-width:640px) {
    #appView .trk-panel { padding:4px 12px 14px; }
    #appView .trk-panel .tbl-wrap { overflow:visible; background:transparent; }
    #appView .trk-panel table.trk-table { min-width:0; width:100%; }
    #appView .trk-panel table.trk-table thead { display:none; }
    #appView .trk-panel table.trk-table, #appView .trk-panel table.trk-table tbody { display:block; }
    #appView .trk-panel table.trk-table tr { display:grid; grid-template-columns:1fr 1fr; gap:8px 10px; margin-bottom:10px; padding:12px; border:1px solid #e4dccf; border-radius:12px; background:#fff; }
    #appView .trk-panel table.trk-table td, #appView .trk-panel table.trk-table td.srp-l { display:flex; flex-direction:column; align-items:flex-start; gap:4px; padding:0; border:0; background:transparent; text-align:left; }
    #appView .trk-panel table.trk-table td.srp-l { grid-column:1 / -1; flex-direction:row; align-items:center; padding:0; }
    #appView .trk-panel table.trk-table td[data-label="Tình trạng"] { grid-column:1 / -1; }
    #appView .trk-panel table.trk-table td[data-label]::before { content:attr(data-label); color:#5b524a; font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
    #appView .trk-panel table.trk-table .trk-cell { align-items:flex-start; padding:0; }
  }
  #appView .trk-table td { vertical-align:middle; }
  #appView .trk-table th.srp-l, #appView .trk-table td.srp-l { text-align:left; padding-left:16px; }
  #appView .trk-tp { margin-left:5px; color:#d4a017; font-size:15px; line-height:1; vertical-align:1px; cursor:help; }
  #appView .trk-cell { display:inline-flex; flex-direction:column; align-items:center; gap:3px; min-height:auto; padding:4px 8px; border:0; border-radius:10px; background:transparent; box-shadow:none; color:inherit; font-weight:400; }
  #appView button.trk-cell:hover { background:#faf6ef; }
  #appView .trk-cell small { color:#5b524a; font-size:11.5px; }
  #appView .trk-st { display:inline-block; padding:3px 10px; border:1px solid transparent; border-radius:999px; font-size:12px; font-weight:800; white-space:nowrap; }
  #appView .trk-none { background:#fdecea; border-color:#f5c2bd; color:#b3261e; }
  #appView .trk-draft { background:#f0f0f2; border-color:#d4d4d8; color:#3f3f46; }
  #appView .trk-returned { background:#fff; border-color:#e8a19a; color:#b3261e; }
  #appView .trk-submitted { background:#e6f6ea; border-color:#b4e0c1; color:#15803d; }
  #appView .trk-approved { background:#15803d; border-color:#15803d; color:#fff; }
  #appView .trk-chips { display:inline-flex; align-items:center; gap:5px; flex-wrap:wrap; justify-content:center; }
  #appView .trk-late { padding:3px 9px; border:1px solid #f0cfa6; border-radius:999px; background:#fff0d9; color:#a2560b; font-size:12px; font-weight:800; white-space:nowrap; }
  #appView .trk-sum { display:inline-block; padding:4px 10px; border-radius:8px; font-size:12.5px; font-weight:800; white-space:nowrap; }
  #appView .trk-sum.is-miss { background:#fdecea; color:#b3261e; } #appView .trk-sum.is-ok { background:#e6f6ea; color:#15803d; }
  @media (max-width:1100px) { #appView .trk-kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
  @media (max-width:640px) { #appView .trk-kpis { grid-template-columns:1fr 1fr; gap:10px; } #appView .trk-kpi { gap:10px; padding:10px 12px; } #appView .trk-kpi-num { font-size:34px; } #appView .trk-kpi-num small { font-size:16px; } #appView .trk-need-line { flex-wrap:wrap; white-space:normal; } #appView .trk-copyall { width:100%; min-height:44px; } #appView .trk-week { flex:1 1 100%; justify-content:space-between; } #appView .trk-deadline { min-width:0; flex:1 1 100%; flex-wrap:wrap; } #appView .trk-deadline b { margin-left:30px; } }
  /* Cột doanh thu, người phụ trách, ghi chú: căn giữa cả ô nhập lẫn chữ chỉ đọc */
  #appView .srp-grid td.srp-mid { text-align:center; vertical-align:middle; }
  #appView .srp-grid td.srp-mid :is(input, .srp-ro), #appView .srp-grid #srpTotal { text-align:center; }
  #appView .srp-history { margin-top:18px; }
  #appView .srp-history ul { margin:0; padding:0; list-style:none; display:grid; gap:6px; font-size:13px; }
  #appView .srp-history small { display:block; color:#3f3a33; }
}

/* Bản in báo cáo kết quả / kế hoạch tuần của nhân viên — A4 ngang như file Excel */
@page srp { size: A4 landscape; margin: 0; }   /* lề nằm trong #printRoot (app.css --pm, 14/11/2026) */
@media print {
  #printRoot .srp-print { page:srp; color:#000; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:10pt; line-height:1.45; }
  #printRoot .srp-print * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  #printRoot .srp-p-head { text-align:center; padding-bottom:8px; margin-bottom:10px; border-bottom:3px double #a9783a; }
  #printRoot .srp-p-head img { display:block; width:100%; height:auto; margin:0 0 8px; }
  #printRoot .srp-p-head h1 { margin:0; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:15pt; font-weight:800; letter-spacing:.01em; text-transform:uppercase; color:#1f1f1f; }
  #printRoot .srp-p-info { display:grid; grid-template-columns:1.4fr 1.2fr .8fr; gap:4px 16px; margin-bottom:8px; padding:8px 12px; border:1px solid #d9c6a5; border-radius:6px; background:#fbf7f0; }
  #printRoot .srp-p-status { text-align:right; }
  #printRoot table.srp-p-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:9.5pt; }
  #printRoot .srp-p-table th { padding:6px 5px; border:1px solid #555; background:#fff; color:#000; font-size:8.5pt; font-weight:800; line-height:1.3; text-transform:uppercase; text-align:center; white-space:normal; }
  #printRoot .srp-p-table td { padding:5px 6px; border:1px solid #555; vertical-align:top; line-height:1.4; }
  #printRoot .srp-p-table td.c { text-align:center; vertical-align:middle; }
  #printRoot .srp-p-table td.w { white-space:pre-wrap; overflow-wrap:anywhere; }
  #printRoot .srp-p-table td.m { text-align:center; vertical-align:middle; font-weight:700; color:#c62828; }
  #printRoot .srp-p-table td.r { text-align:right; font-weight:800; }
  #printRoot .srp-p-table tr { break-inside:avoid; }
  #printRoot .srp-p-table tfoot td { background:#f3ebd9; font-weight:800; }
  #printRoot .srp-sigs { display:flex; justify-content:space-around; margin-top:16px; text-align:center; break-inside:avoid; }
  #printRoot .srp-sig { width:40%; }
  #printRoot .srp-sig-title { font-weight:800; text-transform:uppercase; font-size:9.5pt; }
  #printRoot .srp-sig-slot { display:flex; align-items:center; justify-content:center; min-height:46px; }
  #printRoot .srp-sig-name { font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:11.5pt; font-weight:700; color:#8a5f2a; }
  #printRoot .srp-sig-date { font-size:8.5pt; font-style:italic; color:#444; }
  #printRoot .srp-p-foot { margin-top:10px; padding-top:4px; border-top:1px solid #d9c6a5; text-align:right; font-size:8pt; color:#666; }
}

/* ---------- Giao diện máy tính theo CRM mới (11/2026): Lịch hẹn, Check-in, Sinh nhật, Lịch công cá nhân, Giải trình ---------- */
@media screen {
  #appView .wk-count { display:inline-grid; place-items:center; min-width:26px; height:24px; padding:0 8px; box-sizing:border-box; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:12px; font-weight:700; vertical-align:middle; }
  #appView .wk-count[hidden] { display:none; }
  #appView .wk-actions { display:flex; justify-content:flex-end; }
  #appView .wk-month { display:inline-flex; align-items:center; height:40px; border:1px solid #E4DACA; border-radius:10px; overflow:hidden; background:#fff; }
  #appView .wk-month button { width:36px; min-width:36px; height:40px; min-height:40px; padding:0; border:0; border-radius:0; background:#fff; color:#25211C; font-size:16px; }
  #appView .wk-month button:hover:not(:disabled) { background:#FAF1E1; }
  #appView .wk-month button:disabled { opacity:.35; }
  #appView .wk-month strong { padding:0 10px; font-size:14px; font-weight:700; white-space:nowrap; text-align:center; min-width:112px; }
}
@media (min-width: 901px) {
  /* Lịch hẹn · Check-in · Sinh nhật */
  #appView #workWorkspace .work-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
  #appView #workWorkspace .hub-heading { gap:12px; }
  #appView #workWorkspace .hub-heading > div:first-child { display:flex; align-items:center; gap:12px; }
  #appView #workWorkspace .hub-heading > .hub-actions { margin-left:auto; }
  #appView .work-book { display:flex; flex-direction:column; gap:16px; padding:20px 24px; }
  #appView .work-book > h2 { margin:0; }
  #appView .work-book .field { display:flex; flex-direction:column; gap:8px; margin:0; }
  #appView .work-book input:not([type=file]), #appView .work-book select { height:40px; padding:0 14px; border-radius:10px; font-size:14px; margin:0; box-sizing:border-box; }
  #appView .work-book textarea { padding:10px 14px; border-radius:10px; font-size:14px; }
  #appView .work-book .lbl { margin:0; font-size:13px; font-weight:600; color:#25211C; }
  #appView .work-book .wb-picked { margin:0; border-left:0; border-radius:10px; background:#FAF7F2; color:#25211C; }
  #appView .work-book .wb-cal { padding:12px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .work-book .wb-cal-head button { width:36px; height:36px; min-height:36px; padding:0; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:16px; }
  #appView .work-book .wb-grid { gap:4px; }
  #appView .work-book .wb-week { font-size:12px; color:#6F655A; }
  #appView .work-book .wb-day { height:36px; min-height:36px; border:1px solid #EFE9DD; border-radius:10px; background:#fff; color:#25211C; font-size:13px; font-weight:500; }
  #appView .work-book .wb-day:disabled { color:#6F655A; opacity:.45; }
  #appView .work-book .wb-day.is-today { border-color:#AE7C41; font-weight:700; }
  #appView .work-book .wb-day[aria-pressed="true"], #appView .work-book .wb-slot[aria-pressed="true"] { background:#EFE2CC; border-color:#9A6A2E; color:#6E4A1C; font-weight:700; }
  #appView .work-book .wb-slots { display:flex; flex-wrap:wrap; gap:8px; }
  #appView .work-book .wb-slot { height:36px; min-height:36px; padding:0 12px; border:1px solid #E4DACA; border-radius:18px; background:#fff; color:#25211C; font-size:13px; font-weight:600; }
  #appView .work-book .wb-slot:disabled { background:#F1ECE4; color:#6F655A; opacity:1; text-decoration:none; }
  #appView .work-book .wb-locked { border-color:#9B2F23; background:#FBE7E5; color:#9B2F23; }
  #appView .work-book .ci-photo { display:flex; align-items:center; gap:12px; padding:14px; border:1px dashed #E4DACA; border-radius:12px; background:#FAF7F2; }
  #appView .work-book .ci-photo button, #appView .work-book .ci-gps button { display:inline-flex; align-items:center; gap:8px; height:36px; min-height:36px; padding:0 14px; border-radius:10px; background:#fff; font-size:13px; font-weight:600; }
  #appView .work-book .primary { height:40px; min-height:40px; padding:0 22px; border-radius:10px; font-size:14px; font-weight:700; }
  #appView .work-mine { display:flex; flex-direction:column; gap:14px; padding:20px 24px; }
  #appView .work-mine > h2 { margin:0; }
  #appView .work-mine > h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:700; }
  #appView .work-mine > h3 .tag { min-width:22px; justify-content:center; background:#F1ECE4; color:#6F655A; }
  #appView .work-mine .wb-list { gap:10px; }
  #appView .hub-card.work-mine .wb-item { padding:14px 16px; border:1px solid #EFE9DD; border-radius:12px; }
  #appView .hub-card.work-mine .wb-item:first-child { border-top:1px solid #EFE9DD; }
  #appView .hub-card.work-mine .wb-item strong { font-size:14px; font-weight:700; }
  #appView .hub-card.work-mine .wb-item > div > span:not(.tag) { font-size:13px; color:#25211C; }
  #appView .hub-card.work-mine .wb-item small { font-size:12px; color:#6F655A; }
  #appView .hub-card.work-mine .wb-item button.sm, #appView .hub-card.work-mine .wb-item .button.sm { height:32px; min-height:32px; padding:0 12px; border-radius:10px; font-size:13px; font-weight:600; white-space:nowrap; }
  #appView .hub-card.work-mine .wb-item button.sm.primary { border:0; font-weight:700; }
  #appView .hub-card.work-mine details summary { cursor:pointer; color:#6F655A; font-size:13px; font-weight:600; }
  #appView .hub-card.work-mine .tag.danger { background:#FBE7E5; color:#9B2F23; border:0; }
  #appView .bd-dialog { border-radius:16px; }
  #appView .bd-dialog .btn-row button:not(.primary) { height:40px; border-radius:10px; background:#fff; }

  /* Lịch công cá nhân */
  #appView .pa-strip { display:flex; flex-wrap:wrap; align-items:center; min-height:48px; padding:6px 4px; margin-bottom:16px; border-radius:12px; background:#FAF7F2; }
  #appView .pa-strip-item { display:flex; align-items:baseline; gap:6px; padding:6px 16px; border-left:1px solid #EFE9DD; }
  #appView .pa-strip-item:first-child { border-left:0; }
  #appView .pa-strip-item span { color:#6F655A; font-size:13px; }
  #appView .pa-strip-item strong { color:#25211C; font-size:15px; font-weight:700; }
  #appView .pa-strip-item strong.is-amber { color:#8A4B0C; } #appView .pa-strip-item strong.is-blue { color:#24498A; } #appView .pa-strip-item strong.is-bronze { color:#8A5F27; }
  #appView .pa-strip-item button.sm { align-self:center; height:28px; min-height:28px; margin-left:4px; padding:0 10px; border-radius:10px; background:#fff; font-size:12px; font-weight:600; }
  #appView .pa { gap:20px; grid-template-columns:minmax(0,1fr) 340px; color:#25211C; }
  #appView .pa-frame { padding:0; border:0; border-radius:0; background:none; }
  #appView .pa-calcard, #appView .pa-stats, #appView .pa-panel { border:1px solid #E4DACA; border-radius:16px; background:#fff; box-shadow:none; }
  #appView .pa-calcard { padding:16px; }
  #appView .pa-legend { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
  #appView .pa-legend span { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 12px; border-radius:14px; background:#FAF7F2; color:#25211C; font-size:12px; font-weight:600; }
  #appView .pa-legend i { width:10px; height:10px; border-radius:3px; border:1px solid; }
  #appView .pa-legend i.c-full { background:#E6F2E8; border-color:#BFDDC5; } #appView .pa-legend i.c-half { background:#FFF2E0; border-color:#F0D5A8; }
  #appView .pa-legend i.c-absent { background:#FBE7E5; border-color:#F0BDB7; } #appView .pa-legend i.c-trip { background:#E7EEF9; border-color:#BCCCE8; }
  #appView .pa-legend b.dot-late { background:#9B2F23; } #appView .pa-legend b.dot-ot { background:#24498A; }
  #appView .pa-week, #appView .pa-grid { gap:8px; }
  #appView .pa-week span { font-size:13px; color:#6F655A; }
  #appView .pa-day { min-height:92px; padding:8px 10px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; color:#6F655A; }
  #appView .pa-day.today { border-color:#AE7C41; background:#FBF6ED; }
  #appView .pa-day.c-full { border-color:#BFDDC5; background:#E6F2E8; } #appView .pa-day.c-half { border-color:#F0D5A8; background:#FFF2E0; }
  #appView .pa-day.c-absent { border-color:#F0BDB7; background:#FBE7E5; } #appView .pa-day.c-trip { border-color:#BCCCE8; background:#E7EEF9; }
  #appView .pa-day.c-weekend { background:#FAF7F2; }
  #appView .pa-day.has-overtime { border-color:#24498A; box-shadow:none; }
  #appView .pa-day.c-full .pa-num, #appView .pa-day.c-full .pa-status { color:#1F5E2E; }
  #appView .pa-day.c-half .pa-num, #appView .pa-day.c-half .pa-status, #appView .pa-day.c-half .pa-badge { color:#8A4B0C; }
  #appView .pa-day.c-absent .pa-num, #appView .pa-day.c-absent .pa-status { color:#9B2F23; }
  #appView .pa-day.c-trip .pa-num, #appView .pa-day.c-trip .pa-status { color:#24498A; }
  #appView .pa-num { font-size:14px; } #appView .pa-status { font-size:12px; font-weight:600; } #appView .pa-punch { font-size:12px; color:#6F655A; }
  #appView .pa-badge { background:transparent; font-size:12px; padding:0; color:#1F5E2E; }
  #appView .pa-badge.is-leave { border:0; color:#9B2F23; font-size:12px; padding:0; }
  #appView .pa-dots .dot-late { background:#9B2F23; } #appView .pa-dots .dot-ot { background:#24498A; }
  #appView .pa-stats { margin-top:16px; padding:16px 20px 18px; }
  #appView .pa-stats-head { padding-bottom:0; margin-bottom:12px; border-bottom:0; }
  #appView .pa-stats-head h3 { font-size:16px; font-weight:700; }
  #appView .pa-stats-total { font-size:13px; color:#6F655A; } #appView .pa-stats-total strong { font-size:15px; color:#1F5E2E; }
  #appView .pa-stat-box { padding:14px 16px; border:0; border-radius:12px; background:#FAF7F2; }
  #appView .pa-stat-title { padding:0; margin-bottom:8px; border:0; font-size:14px; font-weight:700; text-transform:none; letter-spacing:0; color:#25211C; }
  #appView .pa-stat-grid { grid-template-columns:1fr; gap:0; }
  #appView .pa-stat-item { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid #EFE9DD; font-size:14px; color:#6F655A; }
  #appView .pa-stat-item strong { color:#25211C; font-weight:700; } #appView .pa-stat-item strong.is-amber { color:#8A4B0C; } #appView .pa-stat-item strong.is-red { color:#9B2F23; }
  #appView .pa-side { gap:16px; }
  #appView .pa-panel { padding:16px; }
  #appView .pa-panel h2 { margin:0 0 12px; font-size:16px; font-weight:700; color:#25211C; }
  #appView .pa-sheet { padding:12px 14px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .pa-sheet:hover { border-color:#B89F7E; background:#FAF1E1; box-shadow:none; }
  #appView .pa-sheet.state-approved { border-color:#EFE9DD; background:#fff; box-shadow:none; }
  #appView .pa-sheet strong { margin-bottom:8px; font-size:14px; font-weight:700; color:#25211C; }
  #appView .pa-sheet-status { height:24px; padding:0 10px; border-radius:12px; background:#F1ECE4; color:#6F655A; margin-bottom:8px; }
  #appView .pa-sheet-status b { font-size:12px; font-weight:600; }
  #appView .pa-sheet-status.draft, #appView .pa-sheet-status.waiting, #appView .pa-sheet-status.hc-reviewing { background:#FFF2E0; color:#8A4B0C; }
  #appView .pa-sheet-status.manager-reviewing { background:#E7EEF9; color:#24498A; }
  #appView .pa-sheet-status.appeal, #appView .pa-sheet-status.correction { background:#FBE7E5; color:#9B2F23; }
  #appView .pa-sheet-status.approved { background:#E6F2E8; color:#1F5E2E; }
  #appView .pa-sheet-time { font-size:12px; color:#6F655A; }
  #appView .pa-sheet-alert { background:#FBE7E5; color:#9B2F23; }
  #appView .pa-fund { align-items:center; gap:12px; padding:12px 14px; margin-bottom:10px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .pa-fund-ico { width:36px; height:36px; border-radius:10px; background:#FBF6ED; color:#946A2B; }
  #appView .pa-fund-ico.is-annual, #appView .pa-fund-ico.is-comp { background:#FBF6ED; }
  #appView .pa-fund-label { font-size:14px; font-weight:700; text-transform:none; letter-spacing:0; color:#25211C; }
  #appView .pa-fund-value, #appView .pa-fund-value.is-accent { font-size:15px; font-weight:800; color:#8A5F27; }
  #appView .pa-fund-note { font-size:12px; color:#6F655A; } #appView .pa-fund-note.is-warn { color:#9B2F23; }
  #appView .pa-ot { display:flex; align-items:center; gap:12px; }
  #appView .pa-ot b { flex:1 1 auto; font-size:14px; font-weight:700; }
  #appView .pa-ot button.sm { height:32px; min-height:32px; padding:0 14px; border-radius:10px; background:#fff; font-size:13px; font-weight:600; }
  #appView .wa-days summary { cursor:pointer; color:#8A5F27; font-size:14px; font-weight:600; }

  /* Giải trình chấm công: danh sách phiếu */
  #appView .xp-sec { display:flex; flex-direction:column; gap:10px; margin-bottom:20px; }
  #appView .xp-sec > h2 { display:flex; align-items:center; gap:8px; margin:0; font-size:16px; font-weight:700; }
  #appView .xp-table-card { border:1px solid #E4DACA; border-radius:16px; overflow:hidden; background:#fff; }
  #appView .xp-table { width:100%; border-collapse:collapse; font-size:14px; }
  #appView .xp-table th { padding:12px 16px; text-align:left; font-size:13px; font-weight:600; }
  #appView .xp-table td { padding:12px 16px; border-top:1px solid #EFE9DD; vertical-align:middle; }
  #appView .xp-row { cursor:pointer; }
  #appView .xp-row-title { font-weight:700; }
  #appView .xp-row-sub { font-size:12px; color:#6F655A; overflow-wrap:anywhere; }
  #appView .xp-row-act { text-align:right; white-space:nowrap; width:1%; }
  #appView .xp-row-act .sm { height:32px; min-height:32px; padding:0 12px; border-radius:10px; font-size:13px; font-weight:600; }
  #appView .xp-row-act .sm.primary { border:0; font-weight:700; }
  #appView .xp-row-act .ui-more { margin-left:4px; vertical-align:middle; }
}

/* Màn hẹp: phần markup mới của Lịch công cá nhân / Giải trình */
@media screen and (max-width: 900px) {
  #appView .pa-strip { display:flex; flex-wrap:wrap; gap:4px 0; margin-bottom:12px; padding:6px 4px; border-radius:12px; background:#FAF7F2; }
  #appView .pa-strip-item { display:flex; align-items:baseline; gap:6px; flex:1 1 50%; box-sizing:border-box; padding:6px 10px; font-size:13px; }
  #appView .pa-strip-item span { color:#6F655A; } #appView .pa-strip-item strong { font-size:14px; }
  #appView .pa-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; border:1px solid; }
  #appView .pa-legend i.c-full { background:#E6F2E8; border-color:#BFDDC5; } #appView .pa-legend i.c-half { background:#FFF2E0; border-color:#F0D5A8; }
  #appView .pa-legend i.c-absent { background:#FBE7E5; border-color:#F0BDB7; } #appView .pa-legend i.c-trip { background:#E7EEF9; border-color:#BCCCE8; }
  #appView .pa-legend b { display:inline-block; width:8px; height:8px; border-radius:50%; }
  #appView .pa-legend b.dot-late { background:#9B2F23; } #appView .pa-legend b.dot-ot { background:#24498A; }
  #appView .pa-stat-item { display:flex; justify-content:space-between; gap:10px; }
  #appView .pa-ot { display:flex; align-items:center; gap:10px; }
  #appView .pa-ot b { flex:1 1 auto; font-size:14px; }
  #appView .pa-day.c-full { border-color:#BFDDC5; background:#E6F2E8; } #appView .pa-day.c-half { border-color:#F0D5A8; background:#FFF2E0; }
  #appView .pa-day.c-absent { border-color:#F0BDB7; background:#FBE7E5; } #appView .pa-day.c-trip { border-color:#BCCCE8; background:#E7EEF9; }
  #appView .pa-stat-title { text-transform:none; letter-spacing:0; }
  #appView .xp-table-card { overflow-x:auto; border:1px solid #E4DACA; border-radius:16px; }
  #appView .xp-table { width:100%; border-collapse:collapse; }
  #appView .xp-table th, #appView .xp-table td { padding:10px 12px; text-align:left; }
  #appView .xp-row-act { white-space:nowrap; text-align:right; }
  #appView .xp-sec > h2 { display:flex; align-items:center; gap:8px; font-size:16px; }
}

/* ---------- Điện thoại (≤ 900px): Lịch hẹn, Check-in, Sinh nhật, Lịch công cá nhân, Giải trình ---------- */
@media screen and (max-width: 900px) {
  #appView #workWorkspace .hub-heading { display:flex; align-items:center; gap:8px; margin:0 0 12px; }
  #appView #workWorkspace .hub-heading > div:first-child { display:flex; align-items:center; gap:8px; min-width:0; }
  #appView #workWorkspace .hub-heading > .hub-actions { margin-left:auto; }
  #appView #workWorkspace .work-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  #appView #workWorkspace .hub-heading:has(> .wk-month) { flex-wrap:wrap; }
  #appView #workWorkspace .hub-heading > .wk-month { flex:1 1 100%; margin-left:0; width:100%; box-sizing:border-box; }
  #appView .wk-month { height:44px; max-width:100%; }
  #appView .wk-month button { width:44px; min-width:44px; height:44px; min-height:44px; }
  #appView .wk-month strong { min-width:0; flex:1 1 auto; }
  #appView .work-book, #appView .work-mine, #appView #workWorkspace .work-grid > .hub-card { display:flex; flex-direction:column; gap:14px; padding:16px; }
  #appView .work-book > h2, #appView .work-mine > h2, #appView #workWorkspace .work-grid > .hub-card > h2 { margin:0; font-size:16px; }
  #appView .work-book .field { display:flex; flex-direction:column; gap:8px; margin:0; }
  #appView .work-book input:not([type=file]), #appView .work-book select { height:44px; min-height:44px; padding:0 14px; border-radius:10px; font-size:16px; margin:0; box-sizing:border-box; width:100%; }
  #appView .work-book textarea { padding:10px 14px; border-radius:10px; font-size:16px; width:100%; box-sizing:border-box; }
  #appView .work-book .hub-form-grid { grid-template-columns:minmax(0,1fr); gap:14px; }
  #appView .work-book .lbl { margin:0; font-size:13px; font-weight:600; color:#25211C; }
  #appView .work-book .wb-picked { margin:0; border-left:0; border-radius:10px; background:#FAF7F2; color:#25211C; }
  #appView .work-book .wb-cal { padding:10px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .work-book .wb-cal-head { margin-bottom:8px; }
  #appView .work-book .wb-cal-head button { width:44px; height:44px; min-height:44px; padding:0; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:18px; }
  #appView .work-book .wb-grid { gap:4px; }
  #appView .work-book .wb-week { font-size:12px; color:#6F655A; text-align:center; }
  #appView .work-book .wb-day { height:40px; min-height:40px; padding:0; border:1px solid #EFE9DD; border-radius:10px; background:#fff; color:#25211C; font-size:14px; font-weight:500; }
  #appView .work-book .wb-day:disabled { color:#6F655A; opacity:.4; }
  #appView .work-book .wb-day.is-today { border-color:#AE7C41; font-weight:700; }
  #appView .work-book .wb-day[aria-pressed="true"], #appView .work-book .wb-slot[aria-pressed="true"] { background:#EFE2CC; border-color:#9A6A2E; color:#6E4A1C; font-weight:700; }
  #appView .work-book .wb-slots { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  #appView .work-book .wb-slot { height:44px; min-height:44px; padding:0 6px; border:1px solid #E4DACA; border-radius:22px; background:#fff; color:#25211C; font-size:13px; font-weight:600; }
  #appView .work-book .wb-slot:disabled { background:#F1ECE4; color:#6F655A; opacity:1; text-decoration:none; }
  #appView .work-book .wb-locked { border-color:#9B2F23; background:#FBE7E5; color:#9B2F23; }
  #appView .work-book .ci-photo { display:flex; align-items:center; gap:12px; padding:12px; border:1px dashed #E4DACA; border-radius:12px; background:#FAF7F2; }
  #appView .work-book .ci-photo img { width:96px; height:96px; }
  #appView .work-book .ci-photo button, #appView .work-book .ci-gps button { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; min-height:44px; padding:0 16px; border-radius:10px; background:#fff; font-size:14px; font-weight:600; }
  #appView .work-book .ci-photo button { margin-left:auto; }
  #appView .work-book .ci-gps { justify-content:space-between; }
  #appView .work-book .wk-actions { display:block; }
  #appView .work-book .primary { width:100%; height:44px; min-height:44px; padding:0 22px; border-radius:10px; font-size:15px; font-weight:700; }
  /* Lịch của tôi / Check-in gần đây / Sinh nhật: mỗi dòng một thẻ */
  #appView .wb-list { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
  #appView .hub-card .wb-item, #appView .hub-card.work-mine .wb-item { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:8px 10px; padding:12px 14px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .hub-card .wb-item:first-child { border-top:1px solid #EFE9DD; }
  #appView .wb-item > div:first-child { grid-column:1; }
  #appView .wb-item strong { font-size:14px; font-weight:700; color:#25211C; }
  #appView .wb-item > .tag { grid-column:2; grid-row:1; justify-self:end; }
  #appView .wb-item > button, #appView .wb-item > .ci-actions { grid-column:1 / -1; }
  #appView .wb-item > button.sm { width:100%; height:44px; min-height:44px; border-radius:10px; font-size:14px; }
  #appView .wb-item .ci-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; justify-content:stretch; }
  #appView .wb-item .ci-actions button, #appView .wb-item .ci-actions .button { display:inline-flex; align-items:center; justify-content:center; width:100%; height:44px; min-height:44px; padding:0 12px; border-radius:10px; font-size:14px; font-weight:600; box-sizing:border-box; white-space:normal; text-align:center; line-height:1.2; }
  #appView .work-mine details summary { min-height:44px; display:flex; align-items:center; }
  #appView .work-mine > h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:700; }
  /* Hộp thoại ảnh / quà: rộng hết màn, bo trên */
  .ci-dialog { position:fixed; inset:auto 0 0 0; width:100%; max-width:100%; margin:0; max-height:92vh; overflow-y:auto; box-sizing:border-box; padding:16px; border:0; border-radius:16px 16px 0 0; }
  .ci-dialog input, .ci-dialog textarea, .ci-dialog select { font-size:16px; min-height:44px; }
  .ci-dialog .btn-row { display:flex; gap:10px; position:sticky; bottom:0; background:inherit; padding-top:8px; }
  .ci-dialog .btn-row button, .ci-dialog > button { flex:1; height:44px; min-height:44px; border-radius:10px; }

  /* Lịch công cá nhân */
  #appView .pa-frame { padding:12px; border-radius:16px; }
  #appView .pa-toolbar { flex-wrap:nowrap; gap:8px; margin-bottom:10px; }
  #appView .pa-toolbar h1 { font-size:18px; }
  #appView .pa-strip { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; padding:0; background:transparent; }
  #appView .pa-strip-item { display:flex; flex-direction:column; align-items:flex-start; gap:2px; flex:none; padding:10px 12px; border-radius:12px; background:#FAF7F2; font-size:12px; min-width:0; }
  #appView .pa-strip-item span { color:#6F655A; font-size:12px; line-height:1.3; }
  #appView .pa-strip-item strong { font-size:16px; font-weight:700; color:#25211C; }
  #appView .pa-legend { flex-wrap:nowrap; overflow-x:auto; gap:12px; margin-bottom:8px; padding-bottom:2px; scrollbar-width:none; }
  #appView .pa-legend::-webkit-scrollbar { display:none; }
  #appView .pa-legend span { flex:0 0 auto; white-space:nowrap; }
  #appView .pa-week, #appView .pa-grid { gap:3px; }
  #appView .pa-day { min-height:46px; padding:4px 2px; border-radius:8px; align-items:center; justify-content:center; text-align:center; gap:2px; }
  #appView .pa-top { flex-direction:column; justify-content:center; gap:2px; }
  #appView .pa-top-right { gap:3px; justify-content:center; }
  #appView .pa-num { font-size:14px; }
  #appView .pa-badge { font-size:9px; padding:0 3px; }
  #appView .pa-status, #appView .pa-weekend-label, #appView .pa-punch { display:none; }
  #appView .pa-day.c-weekend { align-items:center; }
  #appView .pa-side { grid-template-columns:minmax(0,1fr); }
  #appView .pa-stat-cols { grid-template-columns:minmax(0,1fr); }
  #appView .pa-stat-grid { grid-template-columns:minmax(0,1fr); }
  #appView .pa-panel, #appView .pa-stats { padding:14px; border-radius:16px; }
  #appView .pa-sheet { min-height:44px; padding:12px; }

  /* Giải trình: bảng thành thẻ */
  #appView .xp-sec > h2 { margin:12px 0 8px; }
  #appView .xp-table-card { overflow:visible; border:0; border-radius:0; background:transparent; }
  #appView .xp-table, #appView .xp-table tbody { display:block; width:100%; }
  #appView .xp-table thead { display:none; }
  #appView .xp-table tr.xp-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 10px; margin:0 0 10px; padding:12px 14px; border:1px solid #E4DACA; border-radius:16px; background:#fff; }
  #appView .xp-table tr.xp-row td { display:block; padding:0; border:0; }
  #appView .xp-table tr.xp-row td:first-child { grid-column:1; grid-row:1; min-width:0; }
  #appView .xp-table tr.xp-row td:nth-child(2) { grid-column:2; grid-row:1; justify-self:end; }
  #appView .xp-table tr.xp-row td.xp-row-act { grid-column:1 / -1; grid-row:2; display:flex; align-items:center; gap:8px; width:auto; text-align:left; }
  #appView .xp-row-title { font-size:15px; font-weight:700; color:#25211C; }
  #appView .xp-row-sub { margin-top:2px; font-size:13px; color:#6F655A; overflow-wrap:anywhere; }
  #appView .xp-row-act .sm { flex:1 1 auto; height:44px; min-height:44px; border-radius:10px; font-size:14px; }
  #appView .xp-row-act .ui-more { flex:0 0 44px; width:44px; height:44px; margin:0; }
}

/* Giải trình (chi tiết phiếu) trên điện thoại: bảng ngày thành thẻ */
@media screen and (max-width: 900px) {
  #appView .xp-scroll { overflow:visible; border:0; background:transparent; }
  #appView .xp-doc-head { min-width:0; padding:12px; border:1px solid #E4DACA; border-radius:16px; }
  #appView .xp-doc-head h3 { font-size:18px; }
  #appView .xp-meta { grid-template-columns:minmax(0,1fr); }
  #appView .xp-sheet, #appView .xp-sheet tbody, #appView .xp-sheet tfoot { display:block; min-width:0; width:100%; border:0; background:transparent; }
  #appView .xp-sheet colgroup, #appView .xp-sheet thead { display:none; }
  #appView .xp-sheet tbody tr { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 6px; align-items:start; margin:10px 0 0; padding:12px 14px; border:1px solid #E4DACA; border-radius:16px; background:#fff; }
  #appView .xp-sheet tbody tr.is-sunday { background:#F1ECE4; }
  #appView .xp-sheet tbody tr.is-locked { background:#FAF7F2; }
  #appView .xp-sheet tbody tr.needs-recheck { border-color:#9B2F23; }
  #appView .xp-sheet tbody td { display:block; height:auto; padding:0; border:0; background:transparent; text-align:left; min-width:0; }
  #appView .xp-sheet tbody td.c::before { display:block; margin-bottom:2px; color:#6F655A; font-size:11px; font-weight:600; }
  #appView .xp-sheet tbody td:nth-child(1) { display:none; }
  #appView .xp-sheet tbody td:nth-child(2) { grid-column:1 / 3; grid-row:1; font-size:15px; font-weight:700; }
  #appView .xp-sheet tbody td:nth-child(6) { grid-column:3; grid-row:1; color:#6F655A; font-size:13px; }
  #appView .xp-sheet tbody td:nth-child(3) { grid-column:4; grid-row:1; text-align:right; }
  #appView .xp-sheet tbody td:nth-child(4)::before { content:'Giờ vào'; }
  #appView .xp-sheet tbody td:nth-child(5)::before { content:'Giờ ra'; }
  #appView .xp-sheet tbody td.xp-hours::before { content:'Giờ HC'; }
  #appView .xp-sheet tbody td.xp-ot::before { content:'Làm thêm'; }
  #appView .xp-sheet tbody td.xp-meal::before { content:'Ăn ca'; }
  #appView .xp-sheet tbody td.xp-note { grid-column:1 / -1; padding:8px 0 0; border-top:1px solid #EFE9DD; }
  #appView .xp-note textarea { min-height:64px; padding:10px 12px; border:1px solid #E4DACA; border-radius:10px; font-size:16px; background:#fff; }
  #appView .xp-reason { min-height:44px; font-size:16px; margin:3px 0; width:100%; box-sizing:border-box; }
  #appView .xp-note button.sm, #appView .xp-doc-btn { min-height:44px; padding:0 14px; font-size:14px; }
  #appView .xp-more summary { min-height:44px; display:flex; align-items:center; font-size:13px; }
  #appView .xp-sheet tfoot tr { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; padding:12px 14px; border:1px solid #E4DACA; border-radius:16px; background:#FAF7F2; }
  #appView .xp-sheet tfoot td { display:none; }
  #appView .xp-sheet tfoot th { display:block; padding:0; border:0; background:transparent; font-size:14px; }
  #appView .xp-signs { min-width:0; grid-template-columns:minmax(0,1fr); margin-top:10px; padding:8px; border:1px solid #E4DACA; border-radius:16px; }
  #appView .xp-signs > div + div { border-left:0; border-top:1px solid #EFE9DD; }
  #appView .xp-toolbar { gap:8px; }
  #appView .xp-actions { flex-wrap:wrap; }
  #appView .xp-actions button { min-height:44px; }
}

/* ---------- Sinh nhật: danh sách tặng quà theo tháng (Sales Admin / Lãnh đạo) ---------- */
@media screen {
  #appView .bd-gifts { display:flex; flex-direction:column; gap:12px; margin:0 0 20px; padding:20px 24px; min-width:0; }
  #appView .bd-gifts h2 { margin:0; font-size:16px; }
  #appView .bd-gifts-head { display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; }
  #appView .bd-gift-actions button.sm { height:34px; min-height:34px; padding:0 14px; border-radius:10px; font-size:13px; font-weight:600; white-space:nowrap; }
  #appView .bd-gift-actions button.sm.danger { background:#fff; color:#B42318; border:1px solid #F1C2BC; }
  #appView .bd-gift-actions button.sm.danger:hover { background:#FEF3F2; }
  #appView .bd-chips { display:flex; flex-wrap:wrap; gap:6px; }
  #appView .bd-chips .tag { padding:4px 10px; font-size:12px; font-weight:600; }
  #appView .bd-chips .tag:not(.ok):not(.warn):not(.danger):not(.info) { background:#F1ECE4; color:#6F655A; border:0; }
  #appView .bd-table-wrap { overflow-x:auto; max-width:100%; border:1px solid #EFE9DD; border-radius:12px; }
  #appView table.bd-table { width:100%; min-width:760px; border-collapse:collapse; font-size:13px; }
  #appView .bd-table th { padding:9px 10px; background:#FAF7F2; color:#6F655A; font-size:12px; font-weight:700; text-align:left; white-space:nowrap; border-bottom:1px solid #EFE9DD; }
  #appView .bd-table td { padding:8px 10px; border-bottom:1px solid #F1ECE4; vertical-align:middle; color:#25211C; }
  #appView .bd-table tbody tr:last-child td { border-bottom:0; }
  #appView .bd-table td.c, #appView .bd-table th:nth-child(-n+2) { text-align:center; }
  #appView .bd-table td.c { font-variant-numeric:tabular-nums; }
  #appView .bd-table td.nw { white-space:nowrap; }
  #appView .bd-table td.r { text-align:right; }
  /* Tiêu đề cột căn theo dữ liệu bên dưới: cột ngắn / số căn giữa, cột chữ căn trái. */
  #appView .bd-table th.c { text-align:center; }
  #appView .bd-list-table td.bd-actual { text-align:center; }
  #appView .bd-table strong { font-weight:600; }
  #appView .bd-table button.sm { height:30px; min-height:30px; padding:0 12px; border-radius:8px; font-size:12px; }
  #appView .tag.bd-st { white-space:nowrap; }
  #appView .tag.bd-neutral { background:#F1ECE4; color:#6F655A; border-color:#E4DCD0; }
  #appView table.bd-table { min-width:1180px; }
  #appView .bd-table td { font-size:13px; }
  #appView table.bd-table th, #appView table.bd-table td { padding-left:8px; padding-right:8px; }
  #appView .bd-table .bd-none { color:#B5AA9C; }
  #appView .bd-table td.bd-cust { min-width:170px; }
  #appView .bd-table .bd-cust strong { font-weight:500; }
  #appView .bd-table .bd-cust small { display:block; margin-top:1px; font-size:12px; color:#8A7F72; font-variant-numeric:tabular-nums; }
  #appView .bd-table .tag.bd-cat { margin-left:6px; padding:1px 6px; font-size:10.5px; font-weight:700; vertical-align:1px; background:#EEF3FA; color:#3D679B; border-color:#D6E2F1; }
  #appView .bd-table tr.is-gift td { background:#FFFCF6; }
  #appView .bd-table .bd-cust strong { font-weight:700; color:#25211C; }
  #appView .bd-table td.bd-txt { min-width:90px; max-width:140px; }
  #appView .bd-table td.bd-addr { max-width:160px; }
  #appView .bd-table td.bd-addr span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView .bd-table td.bd-budget, #appView .bd-table .bd-money { font-variant-numeric:tabular-nums; }
  #appView .bd-table .bd-money { display:inline-flex; flex-direction:column; align-items:center; gap:1px; }
  #appView .bd-table .bd-money b { font-weight:700; }
  #appView .bd-table .bd-money small { font-size:11px; color:#8A7F72; }
  #appView .bd-table .bd-money small.bd-diff.up { color:#B42318; }
  #appView .bd-table .bd-money small.bd-diff.down { color:#2F7A4B; }
  #appView .bd-table td.r.nw button.sm + button.sm { margin-left:6px; }
  #appView .bd-actual-err { margin:-4px 0 0; font-size:12px; color:#8A7F72; }
  #appView .bd-edit-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 12px; }
  #appView .bd-edit-grid .bd-wide { grid-column:1 / -1; }
  #appView .bd-edit-grid .field[hidden] { display:none; }
  #appView .bd-edit-grid select, #appView .bd-edit-grid input { width:100%; }
  #appView .bd-edit-grid input:disabled { background:#F5F1EB; color:#8A7F72; }
  @media (max-width: 560px) { #appView .bd-edit-grid { grid-template-columns:minmax(0,1fr); } }
  #appView .tag.info { background:#E7EEF9; color:#24498A; border:0; }
  #appView .tag.danger { background:#FBE7E5; color:#9B2F23; border:0; }
  #appView .bd-heading h1 { margin:0; }
  #appView .hub-heading.bd-heading > .bd-title { display:flex; flex-direction:row; align-items:center; gap:14px; min-width:0; }
  #appView .bd-back { display:inline-flex; align-items:center; justify-content:center; flex:none; width:42px; height:42px; min-height:42px; padding:0; margin:0; border:1px solid #E7DCCB; border-radius:50%; background:#fff; color:#a9783a; cursor:pointer; box-shadow:0 2px 6px rgba(80,55,20,.06); transition:background .15s, color .15s, border-color .15s; }
  #appView .bd-back svg { width:20px; height:20px; }
  #appView .bd-back:hover { background:#a9783a; border-color:#a9783a; color:#fff; }
  #appView .bd-back:focus-visible { outline:none; box-shadow:0 0 0 3px rgba(169,120,58,.25); }
  @media (max-width: 760px) { #appView .bd-back { width:38px; height:38px; min-height:38px; } #appView .hub-heading.bd-heading > .bd-title { gap:10px; } }
  #appView .bd-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:16px; }
  #appView .bd-add { grid-column:1 / -1; display:flex; align-items:center; justify-content:center; gap:12px; min-height:96px; padding:18px; border:1.5px dashed #D8C7AE; border-radius:16px; background:#FBF8F3; color:#6F5631; font:inherit; font-size:15px; font-weight:700; cursor:pointer; text-align:left; }
  #appView .bd-add:hover { border-color:#a9783a; background:#F7F0E5; }
  #appView .bd-add-plus { display:inline-flex; align-items:center; justify-content:center; flex:none; width:40px; height:40px; border-radius:50%; background:#a9783a; color:#fff; font-size:26px; font-weight:500; line-height:1; }
  #appView .bd-tile { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:14px; padding:18px 18px 16px; border:1px solid #EAE1D4; border-radius:18px; background:linear-gradient(180deg,#FFFDF9 0%,#fff 60%); font:inherit; text-align:left; cursor:pointer; min-height:0; height:auto; overflow:hidden; transition:border-color .15s, box-shadow .15s, transform .15s; }
  #appView .bd-tile::before { content:''; position:absolute; inset:0 0 auto 0; height:4px; background:linear-gradient(90deg,#a9783a,#D8B27A); }
  #appView .bd-tile:hover { border-color:#D8B27A; box-shadow:0 10px 26px rgba(80,55,20,.10); transform:translateY(-2px); }
  #appView .bd-tile-top { display:flex; align-items:center; gap:12px; }
  #appView .bd-cal { display:flex; flex-direction:column; flex:none; width:52px; border-radius:12px; overflow:hidden; border:1px solid #E7D7BE; background:#fff; box-shadow:0 2px 6px rgba(80,55,20,.06); text-align:center; }
  #appView .bd-cal-h { padding:3px 0 2px; background:#a9783a; color:#fff; font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
  #appView .bd-cal-d { padding:3px 0 5px; font-size:22px; font-weight:800; color:#25211C; line-height:1.15; }
  #appView .bd-tile-title { display:flex; flex-direction:column; gap:2px; min-width:0; }
  #appView .bd-tile-title b { font-size:16px; font-weight:800; color:#25211C; }
  #appView .bd-tile-title small { font-size:12px; color:#8A7F72; }
  #appView .bd-tile-go { margin-left:auto; display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#F5EEE3; color:#a9783a; font-size:18px; font-weight:700; }
  #appView .bd-tile:hover .bd-tile-go { background:#a9783a; color:#fff; }
  #appView .bd-tile-n { font-size:14px; font-weight:600; color:#6F655A; }
  #appView .bd-tile-n b { font-size:30px; font-weight:800; color:#a9783a; margin-right:4px; letter-spacing:-.02em; }
  #appView .bd-bar { display:flex; gap:3px; height:8px; border-radius:99px; overflow:hidden; background:#F1ECE4; }
  #appView .bd-bar i { display:block; min-width:6px; border-radius:99px; }
  #appView .bd-bar i.ok, #appView .bd-legend .ok i { background:#3E9B5F; }
  #appView .bd-bar i.info, #appView .bd-legend .info i { background:#4A84C4; }
  #appView .bd-bar i.warn, #appView .bd-legend .warn i { background:#D9A341; }
  #appView .bd-bar i.danger, #appView .bd-legend .danger i { background:#D0574A; }
  #appView .bd-legend { display:flex; flex-wrap:wrap; gap:6px 12px; font-size:12px; font-weight:600; color:#5F564B; }
  #appView .bd-legend > span { display:inline-flex; align-items:center; gap:6px; }
  #appView .bd-legend i { width:8px; height:8px; border-radius:50%; }
  #appView .bd-gifts-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  #appView .bd-commit { position:sticky; bottom:12px; z-index:5; display:flex; align-items:center; justify-content:flex-end; gap:12px; flex-wrap:wrap; margin-top:12px; padding:12px 16px; border:1px solid #EAE1D4; border-radius:14px; background:rgba(255,255,255,.96); box-shadow:0 8px 24px rgba(40,30,15,.10); }
  #appView .bd-commit #bdSelCount { margin-right:auto; font-weight:700; color:#25211C; }
  #appView .bd-commit button.primary { height:42px; padding:0 22px; border-radius:12px; font-weight:700; }
  #appView .bd-commit button.sm { height:36px; border-radius:10px; }
  @media (max-width: 760px) {
    #appView .bd-tiles { grid-template-columns:1fr; gap:12px; }
    #appView .bd-commit { bottom:84px; }
  }
  .bd-add-dialog { width:min(760px,calc(100vw - 24px)); max-height:min(86vh,860px); padding:0; display:flex; flex-direction:column; overflow:hidden; border-radius:18px; }
  .bd-add-dialog:not([open]) { display:none; }
  .bd-add-head { padding:18px 22px 12px; border-bottom:1px solid #EFE8DD; }
  .bd-add-head h2 { margin:0; font-size:17px; }
  .bd-add-body { flex:1; min-height:200px; overflow:auto; padding:14px 22px 16px; }
  .bd-add-dialog > .hub-error { margin:0 22px 8px; }
  .bd-add-foot { display:flex; align-items:center; gap:10px; padding:12px 22px; border-top:1px solid #EFE8DD; background:#FCFAF6; }
  .bd-add-foot #bdAddCount { margin-right:auto; font-weight:700; color:#25211C; }
  .bd-add-foot button { height:40px; padding:0 20px; border-radius:12px; font-weight:700; }
  .bd-add-dialog.bd-gift-dialog { width:min(1080px,calc(100vw - 24px)); max-width:none; }
  #appView .bd-gd-all { display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 12px; padding:10px 12px; border-radius:12px; background:#FAF7F2; }
  #appView .bd-gd-all > span { font-size:13px; font-weight:700; color:#6F5631; margin-right:4px; }
  #appView .bd-gd-all select, #appView .bd-gd-all input { width:auto; height:36px; padding:0 10px; border:1px solid #E4DCD0; border-radius:10px; background:#fff; font:inherit; font-size:13px; }
  #appView .bd-gd-all select { flex:0 0 170px; }
  #appView .bd-gd-all input { flex:1 1 200px; min-width:160px; }
  #appView .bd-gd-all button.sm { height:36px; padding:0 14px; border-radius:10px; font-weight:700; }
  #appView table.bd-table.bd-gd-table { min-width:860px; table-layout:fixed; }
  #appView .bd-gd-table th:nth-child(1) { width:70px; } #appView .bd-gd-table th:nth-child(2) { width:24%; } #appView .bd-gd-table th:nth-child(3) { width:20%; } #appView .bd-gd-table th:nth-child(4) { width:16%; }
  .bd-gd-table td { vertical-align:middle; }
  .bd-gd-table td strong { display:block; }
  .bd-gd-table td small { display:block; color:#8A7F72; font-size:12px; }
  .bd-gd-table select, .bd-gd-table input { width:100%; min-width:110px; height:36px; padding:0 10px; border:1px solid #E4DCD0; border-radius:10px; background:#fff; font:inherit; font-size:13px; }
  .bd-gd-table input[data-gd-label] { margin-top:6px; }
  .bd-gd-table input[data-gd-budget] { min-width:120px; text-align:right; }
  .bd-gd-table input[data-gd-who] { min-width:170px; }
  .bd-gd-table input:disabled { background:#F4F1EC; color:#A39A8E; }
  .bd-gift-dialog .bd-add-foot > span { margin-right:auto; }
  #appView .bd-search { margin:0 0 10px; }
  #appView .bd-search input { width:100%; height:40px; padding:0 14px; border:1px solid #E4DCD0; border-radius:10px; background:#fff; font:inherit; font-size:14px; color:#25211C; }
  #appView .bd-search input:focus { outline:none; border-color:#a9783a; box-shadow:0 0 0 3px rgba(169,120,58,.15); }
  #appView .bd-group { border:1px solid #EFE8DD; border-radius:12px; margin-top:10px; background:#fff; }
  #appView .bd-group[hidden] { display:none; }
  #appView .bd-group > summary { display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; list-style:none; font-weight:700; color:#25211C; }
  #appView .bd-group > summary::-webkit-details-marker { display:none; }
  #appView .bd-group > summary::after { content:''; margin-left:auto; width:8px; height:8px; border-right:2px solid #8A7F72; border-bottom:2px solid #8A7F72; transform:rotate(45deg); transition:transform .15s; }
  #appView .bd-group[open] > summary::after { transform:rotate(-135deg); }
  #appView .bd-group[open] > summary { border-bottom:1px solid #EFE8DD; }
  #appView .bd-group-in { font-size:12px; font-weight:600; color:#a9783a; }
  .bd-group-sel { display:inline-flex; align-items:center; padding:2px 10px; border-radius:99px; background:#a9783a; color:#fff; font-size:12px; font-weight:700; }
  .bd-group-sel[hidden] { display:none; }
  #appView .bd-group > .wb-list { padding:0 12px; }
  #appView .wb-item[hidden] { display:none; }
  #appView .bd-pick { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:8px 12px; border-radius:10px; background:#FAF7F2; }
  #appView .bd-pick label { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:#25211C; cursor:pointer; }
  #appView .bd-pick button.sm { height:32px; min-height:32px; padding:0 14px; border-radius:10px; font-size:13px; font-weight:700; }
  #appView .bd-pick button.sm:disabled { opacity:.45; cursor:not-allowed; }
  #appView .bd-check { display:inline-flex; align-items:center; justify-content:center; width:20px; flex:0 0 20px; }
  #appView .bd-pick input[type=checkbox], #appView .bd-check input[type=checkbox], #appView .bd-approve-list input[type=checkbox] { width:18px; height:18px; min-height:0; margin:0; accent-color:#a9783a; cursor:pointer; }
  #appView .bd-approve-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
  #appView .bd-approve-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
  #appView .bd-approve-head .lbl { font-size:13px; font-weight:600; color:#25211C; }
  #appView .bd-approve-head .lbl b { margin-left:4px; color:#8A5F27; }
  #appView .bd-approve-head button.sm { height:30px; min-height:30px; padding:0 12px; border-radius:8px; font-size:12px; }
  #appView .bd-approve-list { list-style:none; margin:0; padding:4px; max-height:min(300px,40vh); overflow-y:auto; border:1px solid #EFE9DD; border-radius:10px; }
  #appView .bd-approve-list label { display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:8px; font-size:13px; cursor:pointer; }
  #appView .bd-approve-list label:hover { background:#FAF7F2; }
  #appView .bd-approve-list b { font-weight:600; }
}
@media screen and (min-width: 901px) {
  #appView .hub-card .wb-item.bd-row { gap:12px; }
  #appView .bd-dialog { width:min(560px,calc(100vw - 24px)); }
}
@media screen and (max-width: 900px) {
  #appView .bd-gifts { gap:10px; margin:0 0 12px; padding:16px; }
  #appView .bd-gift-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:8px; width:100%; }
  #appView .bd-gift-actions button.sm { width:100%; height:44px; min-height:44px; font-size:14px; white-space:normal; }
  #appView .bd-table button.sm { height:36px; min-height:36px; }
  #appView .hub-card .wb-item.bd-row { grid-template-columns:auto minmax(0,1fr) auto; }
  #appView .wb-item.bd-row > .bd-check { grid-column:1; grid-row:1; align-self:start; padding-top:2px; }
  #appView .wb-item.bd-row > div:not(.ci-actions) { grid-column:2; grid-row:1; }
  #appView .wb-item.bd-row > .tag { grid-column:3; grid-row:1; }
  #appView .wb-item.bd-row > .ci-actions { grid-column:1 / -1; }
  #appView .bd-pick button.sm { height:44px; min-height:44px; flex:1 1 auto; }
  #appView .bd-check input[type=checkbox], #appView .bd-pick input[type=checkbox], #appView .bd-approve-list input[type=checkbox] { width:22px; height:22px; }
  #appView .bd-approve-grid { grid-template-columns:minmax(0,1fr); }
  #appView .bd-approve-list label { min-height:40px; }
}

/* Bản in danh sách tặng quà sinh nhật = biểu mẫu EVER-CSKH-003 (mẫu T11/2026) — A4 ngang, cùng đầu trang công ty */
@page bdp2 { size: A4 landscape; margin: 0; }   /* lề nằm trong #printRoot (app.css --pm, 14/11/2026) */
@media print {
  #printRoot .bdp2-print { page:bdp2; color:#000; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:9pt; line-height:1.35; }
  #printRoot .bdp2-print * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  #printRoot .bdp2-head { margin-bottom:6px; }
  #printRoot .bdp2-head img { display:block; width:100%; height:auto; margin:0 0 4px; }
  #printRoot .bdp2-co { display:flex; justify-content:space-between; gap:12px; font-size:9.5pt; font-weight:700; }
  #printRoot .bdp2-co b { font-weight:800; }
  #printRoot .bdp2-upd { text-align:right; font-size:9pt; }
  #printRoot .bdp2-head h1 { margin:2px 0 2px; font-size:13pt; font-weight:800; line-height:1.3; text-align:center; text-transform:uppercase; color:#000; }
  #printRoot .bdp2-month { margin:0; text-align:center; font-size:9.5pt; font-weight:400; }
  #printRoot .bdp2-month b { font-weight:800; }
  /* Chừa 1px mỗi bên: viền ngoài của bảng (border-collapse) nằm đè mép khung nên bị cắt ở cột cuối khi in. */
  #printRoot table.bdp2-table { width:calc(100% - 2px); margin:0 1px; border-collapse:collapse; table-layout:auto; font-size:8.5pt; }
  #printRoot .bdp2-table th { padding:4px 3px; border:1px solid #333; background:#fff; color:#000; font-size:8pt; font-weight:800; text-align:center; letter-spacing:0; line-height:1.25; text-transform:none; white-space:normal; overflow-wrap:normal; }
  #printRoot .bdp2-table td { padding:3px 4px; border:1px solid #333; vertical-align:middle; line-height:1.3; overflow-wrap:anywhere; font-weight:400; }
  #printRoot .bdp2-table td.c { text-align:center; }
  #printRoot .bdp2-table td.r { text-align:right; }
  #printRoot .bdp2-table td.nw { white-space:nowrap; overflow-wrap:normal; padding-left:2px; padding-right:2px; }
  #printRoot .bdp2-table td.n { font-weight:600; white-space:nowrap; overflow-wrap:normal; }
  #printRoot .bdp2-table tfoot td { font-weight:800; }
  #printRoot .bdp2-table tr { break-inside:avoid; }
  #printRoot .bdp2-table thead { display:table-header-group; }
  #printRoot .bdp2-sigs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; text-align:center; break-inside:avoid; }
  #printRoot .bdp2-sig-title { font-weight:800; font-size:9.5pt; }
  #printRoot .bdp2-sig-date { margin-top:2px; font-size:9pt; }
  #printRoot .bdp2-sig-slot { min-height:58px; }
  #printRoot .bdp2-sig-name { font-weight:700; font-size:10pt; }
}

/* Xem trước danh sách quà (màn hình): tờ A4 ngang, cùng luật trình bày với bản in EVER-CSKH-003. */
.bdp2-lock, .bdp2-lock body { overflow:hidden; }
.bdp2-preview { position:fixed; inset:0; z-index:2000; display:flex; flex-direction:column; background:#E9E4DC; font-family:'Plus Jakarta Sans',system-ui,sans-serif; }
.bdp2-bar { display:flex; align-items:center; gap:10px; padding:10px 18px; background:#fff; border-bottom:1px solid #E6DED2; box-shadow:0 2px 10px rgba(40,30,15,.06); }
.bdp2-bar strong { font-size:15px; color:#25211C; }
.bdp2-bar .bdp2-sp { flex:1; }
.bdp2-bar > button, .bdp2-menu > button { height:38px; padding:0 16px; border:1px solid #E4DCD0; border-radius:10px; background:#fff; color:#25211C; font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.bdp2-bar > button.primary { background:#a9783a; border-color:#a9783a; color:#fff; }
.bdp2-bar > button.primary:hover { background:#946730; }
.bdp2-menu > button:hover { border-color:#a9783a; color:#a9783a; }
.bdp2-close { display:inline-flex; align-items:center; justify-content:center; width:38px; padding:0 !important; border-radius:50% !important; color:#a9783a !important; }
.bdp2-close svg { width:18px; height:18px; }
.bdp2-menu { position:relative; }
.bdp2-menu-list { position:absolute; right:0; top:calc(100% + 6px); z-index:2; min-width:150px; padding:6px; border:1px solid #E6DED2; border-radius:12px; background:#fff; box-shadow:0 10px 26px rgba(40,30,15,.14); }
.bdp2-menu-list[hidden] { display:none; }
.bdp2-menu-list button { display:block; width:100%; padding:9px 12px; border:0; border-radius:8px; background:none; font:inherit; font-size:14px; font-weight:600; text-align:left; cursor:pointer; color:#25211C; }
.bdp2-menu-list button:hover { background:#F5EEE3; color:#a9783a; }
.bdp2-stage { flex:1; overflow:auto; padding:24px; }
.bdp2-paper { width:297mm; min-height:210mm; margin:0 auto; padding:8mm 9mm 10mm; box-sizing:border-box; background:#fff; box-shadow:0 8px 30px rgba(40,30,15,.18); }
@media (max-width: 1180px) { .bdp2-paper { width:100%; min-height:0; padding:16px; } .bdp2-stage { padding:12px; } }
@media (max-width: 640px) { .bdp2-bar { flex-wrap:wrap; } .bdp2-bar strong { flex:1 1 100%; order:-1; } .bdp2-stage { padding:8px; } .bdp2-paper { overflow-x:auto; } .bdp2-sheet { min-width:760px; } }
  .bdp2-sheet .bdp2-print { color:#000; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:9pt; line-height:1.35; }
  .bdp2-sheet .bdp2-print * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .bdp2-sheet .bdp2-head { margin-bottom:6px; }
  .bdp2-sheet .bdp2-head img { display:block; width:100%; height:auto; margin:0 0 4px; }
  .bdp2-sheet .bdp2-co { display:flex; justify-content:space-between; gap:12px; font-size:9.5pt; font-weight:700; }
  .bdp2-sheet .bdp2-co b { font-weight:800; }
  .bdp2-sheet .bdp2-upd { text-align:right; font-size:9pt; }
  .bdp2-sheet .bdp2-head h1 { margin:2px 0 2px; font-size:13pt; font-weight:800; line-height:1.3; text-align:center; text-transform:uppercase; color:#000; }
  .bdp2-sheet .bdp2-month { margin:0; text-align:center; font-size:9.5pt; font-weight:400; }
  .bdp2-sheet .bdp2-month b { font-weight:800; }
  .bdp2-sheet table.bdp2-table { width:calc(100% - 2px); margin:0 1px; border-collapse:collapse; table-layout:auto; font-size:8.5pt; }
  .bdp2-sheet .bdp2-table th { padding:4px 3px; border:1px solid #333; background:#fff; color:#000; font-size:8pt; font-weight:800; text-align:center; letter-spacing:0; line-height:1.25; text-transform:none; white-space:normal; overflow-wrap:normal; }
  .bdp2-sheet .bdp2-table td { padding:3px 4px; border:1px solid #333; vertical-align:middle; line-height:1.3; overflow-wrap:anywhere; font-weight:400; }
  .bdp2-sheet .bdp2-table td.c { text-align:center; }
  .bdp2-sheet .bdp2-table td.r { text-align:right; }
  .bdp2-sheet .bdp2-table td.nw { white-space:nowrap; overflow-wrap:normal; padding-left:2px; padding-right:2px; }
  .bdp2-sheet .bdp2-table td.n { font-weight:600; white-space:nowrap; overflow-wrap:normal; }
  .bdp2-sheet .bdp2-table tfoot td { font-weight:800; }
  .bdp2-sheet .bdp2-table tr { break-inside:avoid; }
  .bdp2-sheet .bdp2-table thead { display:table-header-group; }
  .bdp2-sheet .bdp2-sigs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; text-align:center; break-inside:avoid; }
  .bdp2-sheet .bdp2-sig-title { font-weight:800; font-size:9.5pt; }
  .bdp2-sheet .bdp2-sig-date { margin-top:2px; font-size:9pt; }
  .bdp2-sheet .bdp2-sig-slot { min-height:58px; }
  .bdp2-sheet .bdp2-sig-name { font-weight:700; font-size:10pt; }

/* ===== MOBILE 11/2026 (≤ 760px) — docs/MOBILE-UI-SPEC.md =====
   Lịch hẹn · Check-in · Sinh nhật (+ danh sách quà) · Lịch công cá nhân · Giải trình.
   Khối ngoài cùng phẳng (không khung trong khung), mỗi bản ghi một thẻ, nút nhỏ hàng cuối bên phải,
   nút Gửi/Lưu dính đáy (data-m-actionbar). Màn ≥ 761px không đổi. */
/* Nút ⋯ (chỉ điện thoại) và khối nút chính gom nhóm: máy tính không thấy / bố cục như cũ */
@media screen and (min-width: 761px) {
  #appView #workWorkspace :is(.bd-m-more, .srp-m-more, .rp-m-more, .bd-strip) { display:none !important; }
}
#appView #workWorkspace :is(.srp-main, .rp-main) { display:contents; }
@media screen and (max-width: 760px) {
  /* ---------- Khung chung ---------- */
  #appView #workWorkspace { padding:12px 12px 24px; }
  /* Đầu màn của các trang nhóm này (con trực tiếp của #workWorkspace, trừ trang module có #rpBody cùng cấp như ĐKDV/Hành trình/Visa/Hoa hồng/Đại lý — Báo cáo có #rpTabs nên vẫn tính; + Sinh nhật trong #bdBody) */
  #appView :is(#workWorkspace > .hub-heading:not(:has(~ #rpBody)), #workWorkspace > .hub-heading:has(+ #rpTabs), #bdBody > .hub-heading) { margin:0 0 12px; gap:10px; }
  #appView :is(#workWorkspace > .hub-heading:not(:has(~ #rpBody)), #workWorkspace > .hub-heading:has(+ #rpTabs), #bdBody > .hub-heading) h1 { margin:0; font-size:20px; font-weight:800; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  #appView #workWorkspace .wk-m-hide { display:none; }
  /* Nút ← quay lại: tròn 40px, cùng hàng tiêu đề */
  #appView #workWorkspace button.wk-back { display:inline-grid; place-items:center; flex:none; width:40px; height:40px; min-height:40px; padding:0; margin:0; border:1px solid var(--m-line); border-radius:50%; background:#fff; color:var(--m-accent); font-size:18px; font-weight:600; line-height:1; box-shadow:none; }
  #appView #workWorkspace .wk-month { border-color:var(--m-line); border-radius:12px; }
  #appView #workWorkspace .tag { font-size:12px; }

  /* Khối form / danh sách: phẳng, phân nhóm bằng tiêu đề + khoảng trắng */
  #appView #workWorkspace .work-grid { gap:20px; }
  #appView #workWorkspace .work-book, #appView #workWorkspace .work-mine, #appView #workWorkspace .work-grid > .hub-card { gap:14px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  #appView #workWorkspace .work-mine { padding-top:16px; border-top:1px solid var(--m-line-soft); }
  #appView #workWorkspace :is(.work-book, .work-mine) > h2 { margin:0; font-size:15px; font-weight:700; color:var(--m-ink); }
  #appView #workWorkspace .work-book .field { gap:6px; }
  #appView #workWorkspace .work-book .lbl, #appView #workWorkspace .work-book .field > label { margin:0; font-size:13px; font-weight:600; color:var(--m-sub); }
  #appView #workWorkspace .work-book input:not([type=file]):not([type=checkbox]):not([type=radio]), #appView #workWorkspace .work-book select { height:46px; min-height:46px; padding:0 14px; border:1px solid var(--m-line); border-radius:12px; background-color:#fff; font-size:16px; }
  #appView #workWorkspace .work-book textarea { min-height:88px; padding:12px 14px; border:1px solid var(--m-line); border-radius:12px; background:#fff; font-size:16px; }
  #appView #workWorkspace .work-book #wbSearch + select, #appView #workWorkspace .work-book #ciSearch + select { margin-top:2px; }
  #appView #workWorkspace .work-book .wb-picked { padding:10px 12px; border-radius:12px; background:var(--m-accent-wash); color:#6E4A1C; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
  /* Khung giờ khi chưa chọn ngày: chỉ còn nhãn trơn → ẩn */
  #appView #workWorkspace .work-book .field:has(> .lbl:only-child) { display:none; }
  /* Lịch chọn ngày: ô không viền, chọn = nền đồng */
  #appView #workWorkspace .work-book .wb-cal { padding:10px 8px 8px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  #appView #workWorkspace .work-book .wb-cal-head { margin:0 2px 6px; }
  #appView #workWorkspace .work-book .wb-cal-head strong { font-size:15px; font-weight:700; }
  #appView #workWorkspace .work-book .wb-cal-head button { width:40px; height:40px; min-height:40px; border:1px solid var(--m-line); border-radius:12px; font-size:18px; }
  #appView #workWorkspace .work-book .wb-grid { gap:2px; }
  #appView #workWorkspace .work-book .wb-week { padding:4px 0 6px; font-size:12px; font-weight:600; color:var(--m-faint); }
  #appView #workWorkspace .work-book .wb-day { height:42px; min-height:42px; border:0; border-radius:12px; background:transparent; font-size:15px; font-weight:500; color:var(--m-ink); box-shadow:none; }
  #appView #workWorkspace .work-book .wb-day.is-today { border:0; color:var(--m-accent); font-weight:800; box-shadow:inset 0 0 0 1.5px #E3C79E; }
  #appView #workWorkspace .work-book .wb-day:disabled { color:var(--m-faint); opacity:.45; }
  #appView #workWorkspace .work-book .wb-day.is-locked { color:var(--m-bad); }
  #appView #workWorkspace .work-book .wb-day[aria-pressed="true"] { background:var(--m-accent); color:#fff; font-weight:700; box-shadow:none; }
  #appView #workWorkspace .work-book .wb-slots { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  #appView #workWorkspace .work-book .wb-slot { height:44px; min-height:44px; border:1px solid var(--m-line); border-radius:12px; font-size:14px; }
  #appView #workWorkspace .work-book .wb-slot[aria-pressed="true"] { background:var(--m-accent); border-color:var(--m-accent); color:#fff; }
  #appView #workWorkspace .work-book .wb-slot:disabled { border-color:var(--m-line-soft); background:var(--m-wash); color:var(--m-faint); }
  #appView #workWorkspace .work-book .wb-locked { border-radius:12px; }
  /* Check-in: ảnh + GPS */
  #appView #workWorkspace .work-book .ci-photo { min-height:64px; padding:10px 12px; border:1px dashed var(--m-line); border-radius:12px; background:var(--m-wash); }
  #appView #workWorkspace .work-book .ci-photo img { width:72px; height:72px; border-radius:10px; }
  #appView #workWorkspace .work-book :is(.ci-photo, .ci-gps) button { height:40px; min-height:40px; padding:0 14px; border:1px solid var(--m-line); border-radius:12px; font-size:14px; }
  #appView #workWorkspace .work-book .ci-gps { flex-wrap:nowrap; }
  #appView #workWorkspace .work-book .hub-form-grid { gap:14px; }
  #appView #workWorkspace .work-book .wk-actions .primary { height:46px; min-height:46px; border-radius:12px; font-size:15px; }
  body.sales-shell.m-form #appView #workWorkspace .work-book .wk-actions[data-m-actionbar] .primary { flex:1 1 auto; width:auto; }

  /* ---------- Thẻ danh sách (Lịch của tôi, Check-in gần đây, Sinh nhật của Sales) ---------- */
  #appView #workWorkspace .wb-list { gap:10px; }
  #appView #workWorkspace .hub-card .wb-item, #appView #workWorkspace .hub-card.work-mine .wb-item, #appView #workWorkspace .hub-card .wb-item:first-child { grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; padding:14px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  #appView #workWorkspace .wb-item > div:first-child { display:grid; gap:3px; min-width:0; }
  #appView #workWorkspace .wb-item strong { font-size:15px; font-weight:700; line-height:1.3; color:var(--m-ink); overflow-wrap:anywhere; }
  #appView #workWorkspace .wb-item span:not(.tag), #appView #workWorkspace .wb-item small { font-size:13px; line-height:1.4; color:var(--m-sub); }
  #appView #workWorkspace .wb-item > .tag { align-self:start; }
  /* Nút của thẻ: hàng cuối, nhỏ, căn phải — mọi thẻ như nhau */
  #appView #workWorkspace .hub-card .wb-item > button.sm { grid-column:1 / -1; justify-self:end; width:auto; height:36px; min-height:36px; margin-top:6px; padding:0 14px; border:1px solid var(--m-line); border-radius:10px; background:#fff; font-size:13px; font-weight:600; }
  #appView #workWorkspace .hub-card .wb-item > button[data-cancel] { color:var(--m-bad); border-color:#F0C9C4; }
  #appView #workWorkspace .hub-card .wb-item > .ci-actions { grid-column:1 / -1; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:6px; }
  #appView #workWorkspace .hub-card .wb-item .ci-actions :is(button, .button) { width:auto; height:36px; min-height:36px; padding:0 14px; border:1px solid var(--m-line); border-radius:10px; background:#fff; font-size:13px; font-weight:600; white-space:nowrap; }
  #appView #workWorkspace .hub-card .wb-item > .ci-actions:empty { display:none; }
  /* "Sắp tới" + "Đã qua / không duyệt": dòng xổ xuống có mũi tên */
  #appView #workWorkspace .work-mine > h3 { font-size:14px; color:var(--m-ink); }
  /* workspace.css đặt viền/bo cho mọi details bằng !important → phải đè bằng !important */
  #appView #workWorkspace .work-mine details { margin:0; padding:0; border:0; border-top:1px solid; border-color:var(--m-line-soft) !important; border-radius:0 !important; background:transparent; box-shadow:none; }
  #appView #workWorkspace .work-mine details > summary { display:flex; align-items:center; justify-content:space-between; min-height:48px; list-style:none; font-size:14px; font-weight:600; color:var(--m-ink); cursor:pointer; }
  #appView #workWorkspace .work-mine details > summary::-webkit-details-marker { display:none; }
  #appView #workWorkspace .work-mine details > summary::after { content:''; width:8px; height:8px; margin-right:6px; border-right:2px solid var(--m-sub); border-bottom:2px solid var(--m-sub); transform:rotate(45deg); transition:transform .15s; }
  #appView #workWorkspace .work-mine details[open] > summary::after { transform:rotate(-135deg); }
  #appView #workWorkspace .work-mine details > .wb-list { margin-bottom:4px; }
  /* Lãnh đạo / không phải Sales: không đặt được lịch → bỏ khối chỉ có lời giải thích */
  #appView #workWorkspace .work-grid > .wb-nobook { display:none; }
  #appView #workWorkspace .work-grid > .wb-nobook + .work-mine { padding-top:0; border-top:0; }

  /* ---------- Sinh nhật ---------- */
  #appView #workWorkspace .hub-heading.bd-heading > .bd-title { gap:10px; }
  #appView #workWorkspace .bd-back { width:40px; height:40px; min-height:40px; border-color:var(--m-line); box-shadow:none; }
  #appView #workWorkspace .hub-card.bd-pick-card { display:flex; flex-direction:column; gap:10px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  #appView #workWorkspace .bd-pick-card > h2 { display:flex; align-items:center; gap:8px; margin:0; font-size:15px; font-weight:700; }
  #appView #workWorkspace .bd-search { margin:0; }
  #appView #workWorkspace .bd-search input { height:46px; min-height:46px; padding:0 14px; border:1px solid var(--m-line); border-radius:12px; font-size:16px; }
  #appView #workWorkspace .bd-pick { min-height:44px; padding:0 12px; border-radius:12px; background:var(--m-wash); }
  #appView #workWorkspace .bd-pick label { min-height:44px; font-size:14px; }
  #appView #workWorkspace .bd-group { margin-top:0; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .bd-pick-card .bd-group + .bd-group { margin-top:0; }
  #appView #workWorkspace .bd-group > summary { display:grid; grid-template-columns:minmax(0,1fr) auto 14px; align-items:center; gap:4px 8px; min-height:52px; padding:10px 14px; box-sizing:border-box; }
  #appView #workWorkspace .bd-group > summary .bd-group-name { grid-column:1; grid-row:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; }
  #appView #workWorkspace .bd-group > summary [data-bd-count] { grid-column:2; grid-row:1; justify-self:end; }
  #appView #workWorkspace .bd-group > summary::after { grid-column:3; grid-row:1; margin:0; }
  #appView #workWorkspace .bd-group > summary .bd-group-in { grid-column:1; grid-row:2; font-size:12px; white-space:nowrap; }
  #appView #workWorkspace .bd-group > summary .bd-group-sel { grid-column:2 / -1; grid-row:2; justify-self:end; padding:2px 8px; font-size:12px; white-space:nowrap; }
  #appView #workWorkspace .bd-group > .wb-list { gap:0; padding:0 14px; }
  #appView #workWorkspace .bd-group .wb-item.bd-row, #appView #workWorkspace .bd-group .wb-item.bd-row:first-child { padding:12px 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; }
  #appView #workWorkspace .bd-group .wb-item.bd-row:first-child { border-top:0; }
  #appView #workWorkspace .wb-item.bd-row > .bd-check { padding-top:0; align-self:center; }
  #appView #workWorkspace .bd-commit #bdSelCount { font-size:14px; }
  #appView #workWorkspace .bd-commit button.sm { height:40px; min-height:40px; font-size:13px; }
  body.sales-shell.m-form #appView #workWorkspace .bd-commit button.primary { flex:1 1 auto; max-width:60%; margin-left:auto; }
  /* Danh sách tặng quà tháng: chip tóm tắt cuộn ngang, nút gọn 1 hàng (+ ⋯), mỗi khách một thẻ */
  #appView #workWorkspace .hub-card.bd-gifts { gap:12px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  #appView #workWorkspace .bd-gifts-head { gap:10px; }
  #appView #workWorkspace .bd-chips { flex-wrap:nowrap; width:100%; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .bd-chips::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .bd-chips .tag { flex:none; white-space:nowrap; }
  #appView #workWorkspace .bd-gift-actions { display:flex; flex-wrap:nowrap; gap:8px; width:100%; }
  #appView #workWorkspace .bd-gift-actions :is(#bdPrint, #bdResend, #bdClear) { display:none; }
  #appView #workWorkspace .bd-gift-actions button.sm { width:auto; flex:0 0 auto; height:40px; min-height:40px; padding:0 14px; border-radius:12px; font-size:14px; white-space:nowrap; }
  #appView #workWorkspace .bd-gift-actions button.sm.primary { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }
  #appView #workWorkspace .bd-gift-actions .bd-m-more { flex:0 0 40px; width:40px; height:40px; min-height:40px; margin-left:auto; }
  #appView #workWorkspace .bd-gifts .bd-table-wrap { overflow:visible; border:0; border-radius:0; }
  #appView #workWorkspace .bd-gifts table.bd-list-table { display:block; min-width:0; width:100%; }
  #appView #workWorkspace .bd-list-table thead { display:none; }
  #appView #workWorkspace .bd-list-table tbody { display:flex; flex-direction:column; gap:10px; }
  #appView #workWorkspace .bd-list-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px 12px; padding:14px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  #appView #workWorkspace .bd-list-table tbody td, #appView #workWorkspace .bd-table tr.is-gift td { display:block; min-width:0; max-width:none; padding:0; border:0; background:transparent; text-align:left; white-space:normal; font-size:14px; }
  #appView #workWorkspace .bd-list-table tbody td:first-child { display:none; }
  #appView #workWorkspace .bd-list-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:2px; color:var(--m-sub); font-size:12px; font-weight:600; }
  #appView #workWorkspace .bd-list-table td.bd-cust { order:-2; grid-column:1; }
  #appView #workWorkspace .bd-list-table .bd-cust strong { font-size:15px; }
  #appView #workWorkspace .bd-list-table td.bd-sttd { order:-1; grid-column:2; justify-self:end; text-align:right; }
  #appView #workWorkspace .bd-list-table td.bd-day { order:1; } #appView #workWorkspace .bd-list-table td.bd-kind { order:2; }
  #appView #workWorkspace .bd-list-table td.bd-budget { order:3; } #appView #workWorkspace .bd-list-table td.bd-actual { order:4; }
  #appView #workWorkspace .bd-list-table :is(td.bd-exec, td.bd-svc, td.bd-pot, td.bd-addr) { grid-column:1 / -1; }
  #appView #workWorkspace .bd-list-table td.bd-exec { order:5; } #appView #workWorkspace .bd-list-table td.bd-svc { order:6; } #appView #workWorkspace .bd-list-table td.bd-pot { order:7; } #appView #workWorkspace .bd-list-table td.bd-addr { order:8; }
  #appView #workWorkspace .bd-list-table td.bd-addr span { white-space:normal; overflow:visible; }
  #appView #workWorkspace .bd-list-table .bd-money { align-items:flex-start; }
  #appView #workWorkspace .bd-list-table td:has(> .bd-none:only-child) { display:none; }
  #appView #workWorkspace .bd-list-table td.bd-act { order:9; grid-column:1 / -1; display:flex; justify-content:flex-end; gap:8px; }
  #appView #workWorkspace .bd-list-table td.bd-act:empty { display:none; }
  #appView #workWorkspace .bd-table td.bd-act button.sm { height:36px; min-height:36px; margin:0; padding:0 14px; border-radius:10px; font-size:13px; }
  #appView #workWorkspace .bd-table td.r.nw.bd-act button.sm + button.sm { margin-left:0; }
  /* Hộp thoại chọn quà / thêm khách: mỗi khách một thẻ, ô nhập 46px */
  .bd-add-dialog .bd-add-head { padding:16px 16px 12px; }
  .bd-add-dialog .bd-add-head h2 { font-size:16px; font-weight:800; }
  .bd-add-dialog .bd-add-body { padding:12px 16px; }
  .bd-add-dialog > .hub-error { margin:0 16px 8px; }
  .bd-add-dialog .bd-add-foot { gap:8px; padding:10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .bd-add-dialog .bd-add-foot button { height:46px; min-height:46px; padding:0 18px; }
  .bd-add-dialog .bd-add-foot button.primary { flex:1 1 auto; }
  #appView #workWorkspace .bd-gd-all { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; padding:12px; }
  #appView #workWorkspace .bd-gd-all > span { grid-column:1 / -1; margin:0; }
  #appView #workWorkspace .bd-gd-all select, #appView #workWorkspace .bd-gd-all input { width:100%; min-width:0; height:46px; min-height:46px; font-size:16px; border-color:var(--m-line); border-radius:12px; }
  #appView #workWorkspace .bd-gd-all button.sm { grid-column:1 / -1; height:40px; min-height:40px; }
  #appView #workWorkspace .bd-gift-dialog .bd-table-wrap { overflow:visible; border:0; border-radius:0; }
  #appView #workWorkspace .bd-gift-dialog table.bd-gd-table { display:block; min-width:0; width:100%; table-layout:auto; }
  #appView #workWorkspace .bd-gd-table thead { display:none; }
  #appView #workWorkspace .bd-gd-table tbody { display:flex; flex-direction:column; gap:10px; }
  #appView #workWorkspace .bd-gd-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px 12px; padding:14px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  #appView #workWorkspace .bd-gd-table tbody td { display:block; min-width:0; padding:0; border:0; background:transparent; text-align:left; }
  #appView #workWorkspace .bd-gd-table td.bd-gd-cust { grid-column:1; grid-row:1; }
  #appView #workWorkspace .bd-gd-table td.bd-gd-cust strong { font-size:15px; }
  #appView #workWorkspace .bd-gd-table td.bd-gd-day { grid-column:2; grid-row:1; justify-self:end; color:var(--m-sub); font-size:13px; font-weight:600; }
  #appView #workWorkspace .bd-gd-table td.bd-gd-whotd { grid-column:1 / -1; }
  #appView #workWorkspace .bd-gd-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:4px; color:var(--m-sub); font-size:13px; font-weight:600; }
  #appView #workWorkspace .bd-gd-table td:has(> [data-gd-budget]) { position:relative; }
  #appView #workWorkspace .bd-gd-table td:has(> [data-gd-budget])::after { content:'đ'; position:absolute; right:14px; bottom:13px; color:var(--m-sub); font-size:15px; pointer-events:none; }
  #appView #workWorkspace .bd-gd-table input[data-gd-budget] { padding-right:30px; text-align:right; }
  #appView #workWorkspace .bd-gd-table :is(select, input) { width:100%; min-width:0 !important; height:46px; min-height:46px; font-size:16px; border-color:var(--m-line); border-radius:12px; }
  /* Hộp thoại nhỏ (Sửa, Ghi duyệt, Nhắc quà, Trả lại báo cáo…) */
  #appView #workWorkspace .bd-dialog h2 { margin:0 0 12px; font-size:16px; font-weight:800; }
  #appView #workWorkspace .bd-dialog .btn-row { padding-bottom:4px; }
  #appView #workWorkspace .bd-dialog .btn-row button { height:46px; min-height:46px; }
  #appView #workWorkspace .bd-dialog .btn-row button.primary { flex:2 1 0; }
  #appView #workWorkspace .bd-approve-list label { min-height:44px; }

  /* ---------- Lịch công cá nhân: khung ngoài phẳng, thống kê 1 lớp thẻ ---------- */
  #appView #workWorkspace .pa-frame { padding:0; border:0; border-radius:0; background:transparent; }
  #appView #workWorkspace .pa-strip-item { border-radius:12px; background:var(--m-wash); }
  #appView #workWorkspace .pa-calcard { padding:10px 8px; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .pa-legend { flex-wrap:wrap; gap:6px 12px; overflow:visible; padding:0 4px; font-size:12px; }
  #appView #workWorkspace .pa-stats { margin-top:12px; padding:14px; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .pa-stats-head h3 { font-size:15px; }
  #appView #workWorkspace .pa-stat-box { padding:12px 0 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; background:transparent; }
  #appView #workWorkspace .pa-stat-cols { gap:12px; }
  #appView #workWorkspace .wa-days { margin:8px 0 0; padding:0; border:0; border-top:1px solid; border-color:var(--m-line-soft) !important; border-radius:0 !important; background:transparent; box-shadow:none; }
  #appView #workWorkspace .wa-days > summary { display:flex; align-items:center; justify-content:space-between; min-height:46px; list-style:none; font-size:14px; }
  #appView #workWorkspace .wa-days > summary::-webkit-details-marker { display:none; }
  #appView #workWorkspace .wa-days > summary::after { content:''; width:8px; height:8px; margin-right:6px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
  #appView #workWorkspace .wa-days[open] > summary::after { transform:rotate(-135deg); }
  #appView #workWorkspace .wa-days .tbl-wrap { border:1px solid var(--m-line); border-radius:12px; }
  #appView #workWorkspace .wa-day-table { font-size:13px; }
  #appView #workWorkspace .wa-day-table th:first-child, #appView #workWorkspace .wa-day-table td:first-child { position:sticky; left:0; z-index:1; background:#fff; }
  #appView #workWorkspace .pa-side { gap:20px; margin-top:20px; }
  #appView #workWorkspace .pa-side > .pa-panel:not(.pa-ot) { padding:0; border:0; border-radius:0; background:transparent; }
  #appView #workWorkspace .pa-side > .pa-panel > h2 { margin:0 0 10px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .pa-panel.pa-ot { padding:12px 14px; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .pa-panel.pa-ot .sm { height:36px; min-height:36px; padding:0 14px; border-radius:10px; }
  #appView #workWorkspace .pa-sheet, #appView #workWorkspace .pa-fund { border-color:var(--m-line); border-radius:14px; }

  /* ---------- Giải trình: danh sách phiếu ---------- */
  #appView #workWorkspace .xp-sec > h2 { display:flex; align-items:center; gap:8px; margin:16px 0 10px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .xp-sec:first-child > h2 { margin-top:0; }
  #appView #workWorkspace .xp-table tr.xp-row { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:6px 10px; padding:14px; border-color:var(--m-line); border-radius:14px; cursor:pointer; }
  #appView #workWorkspace .xp-table tr.xp-row td:first-child { grid-column:1; grid-row:1 / span 2; align-self:start; }
  #appView #workWorkspace .xp-table tr.xp-row td:nth-child(2) { grid-column:2; grid-row:1; align-self:start; }
  #appView #workWorkspace .xp-table tr.xp-row td.xp-row-act { grid-column:2; grid-row:2; justify-content:flex-end; align-self:end; gap:6px; }
  /* Cả thẻ bấm được = Mở phiếu: bỏ nút "Mở" thừa, giữ "Duyệt" (nhỏ) và ⋯ */
  #appView #workWorkspace .xp-row-act .sm:not(.primary) { display:none; }
  #appView #workWorkspace .xp-row-act .sm.primary { flex:none; height:36px; min-height:36px; padding:0 16px; border-radius:10px; font-size:13px; }
  #appView #workWorkspace .xp-row-act .ui-more { flex:0 0 40px; width:40px; height:36px; min-height:36px; }
  #appView #workWorkspace .xp-row-sub { font-size:13px; line-height:1.4; }
  /* Giải trình: chi tiết phiếu */
  /* ← và tiêu đề phiếu cùng một hàng (khối khác xếp dưới theo thứ tự cũ) */
  #appView #workWorkspace:has(> .xp-toolbar) { display:grid; grid-template-columns:40px minmax(0,1fr); column-gap:10px; align-content:start; }
  #appView #workWorkspace:has(> .xp-toolbar) > * { grid-column:1 / -1; min-width:0; }
  #appView #workWorkspace:has(> .xp-toolbar) > .hub-heading { grid-column:1; grid-row:1; align-self:start; margin:0; }
  #appView #workWorkspace:has(> .xp-toolbar) > .xp-toolbar { grid-column:2; grid-row:1; margin:0 0 12px; }
  #appView #workWorkspace:has(> .xp-toolbar) > .xp-funds { margin-bottom:12px; }
  #appView #workWorkspace .xp-funds { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #appView #workWorkspace .xp-fund { min-width:0; padding:12px; border:0; border-radius:12px; background:var(--m-wash); }
  #appView #workWorkspace .xp-fund strong { font-size:18px; font-weight:800; }
  #appView #workWorkspace .xp-fund:last-child:nth-child(odd) { grid-column:1 / -1; }
  #appView #workWorkspace .xp-toolbar { flex-direction:column; align-items:stretch; gap:10px; margin:4px 0 12px; }
  #appView #workWorkspace .xp-title-line h1 { font-size:20px; font-weight:800; line-height:1.25; }
  #appView #workWorkspace .xp-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; }
  #appView #workWorkspace .xp-actions .xp-save { flex:1 1 auto; min-width:0; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .xp-actions button { height:40px; min-height:40px; padding:0 14px; border-radius:12px; font-size:14px; white-space:nowrap; }
  #appView #workWorkspace .xp-doc-head { padding:12px; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .xp-doc-head h3 { font-size:17px; }
  #appView #workWorkspace .xp-meta { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; padding-top:10px; }
  #appView #workWorkspace .xp-meta > div { min-height:0; padding:0; border:0; border-radius:0; background:transparent; }
  #appView #workWorkspace .xp-meta > div:first-child { grid-column:1 / -1; }
  #appView #workWorkspace .xp-meta small { font-size:11px; }
  #appView #workWorkspace .xp-meta strong { font-size:14px; white-space:normal; }
  #appView #workWorkspace .xp-sheet tbody tr { padding:14px; border-color:var(--m-line); border-radius:14px; }
  #appView #workWorkspace .xp-sheet tbody tr.needs-recheck { border-color:var(--m-bad); }
  #appView #workWorkspace .xp-sheet tbody tr.is-sunday { background:var(--m-wash-2); }
  #appView #workWorkspace .xp-sheet tbody tr.is-sunday td { background:transparent; color:var(--m-sub); }
  /* Cột "Thứ" chỉ là số → bỏ, ngày chiếm chỗ */
  #appView #workWorkspace .xp-sheet tbody td:nth-child(6) { display:none; }
  #appView #workWorkspace .xp-sheet tbody td:nth-child(2) { grid-column:1 / 4; }
  #appView #workWorkspace .xp-sheet tbody td.c::before { font-size:12px; }
  #appView #workWorkspace .xp-sheet tfoot tr { border-color:var(--m-line); border-radius:14px; background:var(--m-wash); }
  #appView #workWorkspace .xp-signs { border-color:var(--m-line); border-radius:14px; }
  /* Thanh thao tác dính đáy: lỗi gập gọn, 2 nút một hàng (nút chính rộng hơn) */
  #appView #workWorkspace .xp-foot { display:flex; flex-wrap:wrap; gap:8px; }
  #appView #workWorkspace .xp-foot > :is(.hub-error, p, .field, .xp-errs) { flex:1 1 100%; margin:0; }
  #appView #workWorkspace .xp-foot > p.small { font-size:13px; color:var(--m-sub); }
  #appView #workWorkspace .xp-foot .linklike { min-height:32px; font-size:13px; }
  #appView #workWorkspace .xp-foot .xp-errs > summary { min-height:32px; display:flex; align-items:center; font-size:13px; font-weight:600; color:var(--m-warn); }
  #appView #workWorkspace .xp-foot .xp-errs ul { max-height:28vh; overflow:auto; margin:4px 0 0; padding-left:18px; font-size:13px; }
  #appView #workWorkspace .xp-foot .field textarea { min-height:0; }
  #appView #workWorkspace .xp-foot .btn-row { display:flex; flex:1 1 100%; flex-wrap:wrap; gap:8px; margin:0; }
  #appView #workWorkspace .xp-foot .btn-row button { flex:1 1 0; min-width:0; min-height:46px; padding:0 12px; white-space:nowrap; }
  #appView #workWorkspace .xp-foot .btn-row button.primary { flex:2 1 0; }
  #appView #workWorkspace .xp-foot .btn-row #xpGoDocs { flex:1 1 100%; min-height:40px; }

  /* ---------- Hộp thoại ảnh check-in ---------- */
  .ci-dialog > button { width:100%; height:46px; min-height:46px; border-radius:12px; }
}

/* ===== MOBILE 11/2026 — ĐỢT 2: mật độ & căn chữ (docs/MOBILE-UI-SPEC.md "Đợt 2") =====
   Thẻ ≤ 110px, padding 12, dòng trong thẻ cách 4px, nút trong thẻ 32px; dải số thay ô KPI rời; tiêu đề màn 1 dòng. */
@media screen and (max-width: 760px) {
  /* ---------- Tiêu đề màn: 1 dòng, cắt "…" ---------- */
  #appView :is(#workWorkspace > .hub-heading:not(:has(~ #rpBody)), #workWorkspace > .hub-heading:has(+ #rpTabs), #bdBody > .hub-heading) { flex-wrap:nowrap; }
  #appView :is(#workWorkspace > .hub-heading:not(:has(~ #rpBody)), #workWorkspace > .hub-heading:has(+ #rpTabs), #bdBody > .hub-heading) h1 { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; -webkit-line-clamp:unset; }
  #appView :is(#workWorkspace > .hub-heading:not(:has(~ #rpBody)), #workWorkspace > .hub-heading:has(+ #rpTabs), #bdBody > .hub-heading) > div:first-child { min-width:0; }
  #appView #workWorkspace .hub-heading.bd-heading h1, #appView #workWorkspace .xp-title-line h1 { font-size:18px; }
  #appView #workWorkspace .hub-heading.bd-heading > .bd-title { min-width:0; }

  /* ---------- Form (đặt lịch, check-in): nhãn 12/600, nhãn → ô 4px, giữa các trường 12px ---------- */
  #appView #workWorkspace .work-book, #appView #workWorkspace .work-mine { gap:12px; }
  #appView #workWorkspace .work-grid { gap:16px; }
  #appView #workWorkspace .work-book .field { gap:4px; }
  #appView #workWorkspace .work-book .lbl, #appView #workWorkspace .work-book .field > label { font-size:12px; }
  #appView #workWorkspace .work-book .wb-picked { padding:8px 12px; }
  #appView #workWorkspace .work-book .wb-cal { padding:8px 6px 6px; }
  #appView #workWorkspace .work-book .wb-day { height:38px; min-height:38px; }
  #appView #workWorkspace .work-book .wb-week { padding:2px 0 4px; }
  #appView #workWorkspace .work-book .wb-slot { height:40px; min-height:40px; }
  #appView #workWorkspace .work-book textarea { min-height:72px; }
  #appView #workWorkspace .work-mine { padding-top:12px; }
  #appView #workWorkspace .work-mine > h3 { margin:0; }

  /* ---------- Thẻ danh sách (lịch hẹn, check-in, sinh nhật): bố cục cố định 2 cột ----------
     Cột trái: tiêu đề + ý phụ (mỗi ý 1 dòng, "…"); cột phải: nhãn (trên) · nút 32px (dưới) — mọi thẻ như nhau. */
  #appView #workWorkspace .hub-card .wb-item, #appView #workWorkspace .hub-card.work-mine .wb-item, #appView #workWorkspace .hub-card .wb-item:first-child { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; align-items:start; gap:4px 10px; padding:12px; border-radius:12px; }
  #appView #workWorkspace .wb-list { gap:8px; }
  #appView #workWorkspace .wb-item > div:first-child { grid-column:1; grid-row:1 / span 2; gap:2px; }
  #appView #workWorkspace .wb-item > div:first-child > :is(strong, span, small) { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.35; }
  #appView #workWorkspace .wb-item strong { line-height:1.25; }
  #appView #workWorkspace .wb-item > .tag { grid-column:2; grid-row:1; justify-self:end; }
  #appView #workWorkspace .hub-card .wb-item > button.sm, #appView #workWorkspace .hub-card .wb-item > .ci-actions { grid-column:2; grid-row:2; align-self:end; justify-self:end; margin:0; }
  #appView #workWorkspace .hub-card .wb-item:not(:has(> .tag)) > :is(button.sm, .ci-actions) { grid-row:1 / span 2; align-self:center; }
  #appView #workWorkspace .hub-card .wb-item > button.sm, #appView #workWorkspace .hub-card .wb-item .ci-actions :is(button, .button) { height:32px; min-height:32px; padding:0 12px; font-size:13px; }
  #appView #workWorkspace .hub-card .wb-item > .ci-actions { flex-wrap:nowrap; gap:6px; }
  #appView #workWorkspace .work-mine details > summary { min-height:44px; }
  /* Chọn khách sinh nhật (ô tick): dòng gọn trong nhóm */
  #appView #workWorkspace .bd-group .wb-item.bd-row, #appView #workWorkspace .bd-group .wb-item.bd-row:first-child { grid-template-columns:auto minmax(0,1fr) auto; padding:8px 0; }
  #appView #workWorkspace .wb-item.bd-row > .bd-check { grid-row:1 / span 2; }
  #appView #workWorkspace .wb-item.bd-row > div:not(.ci-actions) { grid-column:2; grid-row:1 / span 2; }
  #appView #workWorkspace .wb-item.bd-row > .tag { grid-column:3; grid-row:1 / span 2; align-self:center; }
  #appView #workWorkspace .bd-group > summary { min-height:48px; padding:8px 12px; }
  #appView #workWorkspace .bd-group > .wb-list { padding:0 12px; }
  #appView #workWorkspace .hub-card.bd-pick-card { gap:8px; }
  #appView #workWorkspace .bd-pick { min-height:40px; }
  #appView #workWorkspace .bd-pick label { min-height:40px; }

  /* ---------- Dải số dùng chung: một hộp nền nhạt, ô ngăn kẻ mảnh ---------- */
  /* Kẻ ngăn = viền phải + dưới của từng ô; clip-path cắt 1px mép phải/dưới của hộp để ô ở cột cuối / hàng cuối không còn kẻ */
  #appView #workWorkspace :is(.pa-strip, .xp-funds, .bd-strip) { display:grid; gap:0; margin:0 0 12px; padding:0; overflow:hidden; border:0; border-radius:12px; background:var(--m-wash); clip-path:inset(0 1px 1px 0 round 12px); }
  #appView #workWorkspace :is(.pa-strip-item, .xp-fund, .bd-strip-i) { display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0; padding:8px 12px; border:0; border-radius:0; background:transparent; box-shadow:inset -1px 0 #EADFCF, inset 0 -1px #EADFCF; }
  #appView #workWorkspace :is(.pa-strip-item, .xp-fund, .bd-strip-i) > span { overflow:hidden; max-width:100%; color:var(--m-sub); font-size:12px; font-weight:600; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace :is(.pa-strip-item, .xp-fund, .bd-strip-i) > :is(strong, b) { font-size:17px; font-weight:800; line-height:1.25; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView #workWorkspace :is(.pa-strip-item, .xp-fund) > small { font-size:12px; line-height:1.35; }
  /* Lịch công: 4 số → 2×2; nhãn dài 2 dòng thay vì cắt */
  #appView #workWorkspace .pa-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView #workWorkspace .pa-strip-item > span { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  /* Giải trình: số dư phép 2 ô cùng hàng */
  #appView #workWorkspace .xp-funds { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView #workWorkspace .xp-fund:last-child:nth-child(odd) { grid-column:auto; }
  /* Sinh nhật: dải số thay hàng chip */
  #appView #workWorkspace .bd-gifts-head > .bd-chips { display:none; }
  #appView #workWorkspace .bd-strip { grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; margin:0; }
  #appView #workWorkspace .bd-strip-i.warn > b { color:var(--m-warn); } #appView #workWorkspace .bd-strip-i.ok > b { color:var(--m-ok); }
  #appView #workWorkspace .bd-strip-i.info > b { color:#24498A; } #appView #workWorkspace .bd-strip-i.danger > b { color:var(--m-bad); }
  #appView #workWorkspace .bd-gifts-head { gap:8px; }
  #appView #workWorkspace .hub-card.bd-gifts { gap:8px; }
  /* Thẻ khách trong danh sách quà: tên | nhãn; các cặp nhãn 12 + giá trị 14, hàng cách 8; Sửa · Bỏ cạnh "Người tặng" */
  #appView #workWorkspace .bd-list-table tbody { gap:8px; }
  #appView #workWorkspace .bd-list-table tbody tr { gap:8px 12px; padding:12px; border-radius:12px; }
  #appView #workWorkspace .bd-list-table td[data-label]::before { margin-bottom:2px; line-height:1.35; }
  #appView #workWorkspace .bd-list-table tbody td { line-height:1.35; }
  #appView #workWorkspace .bd-list-table .bd-cust strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.25; }
  #appView #workWorkspace .bd-list-table .bd-cust small { font-size:13px; }
  #appView #workWorkspace .bd-list-table td.bd-cust { grid-column:1; }
  #appView #workWorkspace .bd-list-table td.bd-exec { order:9; grid-column:1; }
  #appView #workWorkspace .bd-list-table td.bd-act { order:10; grid-column:2; align-self:end; gap:6px; }
  #appView #workWorkspace .bd-list-table td.bd-act:only-child, #appView #workWorkspace .bd-list-table td.bd-exec:has(> .bd-none:only-child) + td + td + td.bd-act { grid-column:1 / -1; }
  #appView #workWorkspace .bd-table td.bd-act button.sm { height:32px; min-height:32px; padding:0 12px; }
  #appView #workWorkspace .bd-list-table td.bd-addr span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  #appView #workWorkspace .bd-list-table .bd-money small { font-size:12px; }
  /* Thẻ khách (danh sách quà) — dạng dòng: [Tên · SĐT | nhãn] / Ngày SN · Loại quà · Ngân sách · Thực chi / Dịch vụ / Tiềm năng / Địa chỉ / Người tặng … Sửa · Bỏ */
  #appView #workWorkspace .bd-list-table tbody tr { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
  #appView #workWorkspace .bd-list-table tbody tr::before { content:''; order:0; flex:0 0 100%; height:0; }
  #appView #workWorkspace .bd-list-table tbody td { flex:0 1 auto; display:inline-flex; align-items:baseline; gap:4px; min-width:0; font-size:13px; }
  #appView #workWorkspace .bd-list-table td[data-label]::before { display:inline; flex:none; margin:0; font-size:12px; }
  #appView #workWorkspace .bd-list-table td.bd-cust { order:-2; flex:1 1 0; display:flex; align-items:baseline; gap:6px; overflow:hidden; }
  #appView #workWorkspace .bd-list-table td.bd-cust strong { flex:0 1 auto; min-width:0; }
  #appView #workWorkspace .bd-list-table td.bd-cust small { flex:none; margin:0; }
  #appView #workWorkspace .bd-list-table td.bd-cust .bd-cat { flex:none; }
  #appView #workWorkspace .bd-list-table td.bd-sttd { order:-1; flex:none; margin-left:auto; align-self:center; }
  #appView #workWorkspace .bd-list-table td.bd-day { order:1; } #appView #workWorkspace .bd-list-table td.bd-kind { order:2; }
  #appView #workWorkspace .bd-list-table td.bd-budget { order:3; } #appView #workWorkspace .bd-list-table td.bd-actual { order:4; }
  #appView #workWorkspace .bd-list-table .bd-money { display:inline-flex; flex-direction:row; flex-wrap:wrap; align-items:baseline; gap:0 6px; }
  #appView #workWorkspace .bd-list-table .bd-money b { font-weight:700; }
  #appView #workWorkspace .bd-list-table :is(td.bd-svc, td.bd-pot, td.bd-addr) { flex:1 1 100%; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .bd-list-table :is(td.bd-svc, td.bd-pot, td.bd-addr)::before { margin-right:4px; }
  #appView #workWorkspace .bd-list-table td.bd-addr span { display:inline; overflow:visible; white-space:nowrap; -webkit-line-clamp:unset; }
  #appView #workWorkspace .bd-list-table td.bd-svc { order:5; } #appView #workWorkspace .bd-list-table td.bd-pot { order:6; } #appView #workWorkspace .bd-list-table td.bd-addr { order:7; }
  #appView #workWorkspace .bd-list-table td.bd-exec { order:8; flex:1 1 auto; align-self:center; overflow:hidden; white-space:nowrap; }
  #appView #workWorkspace .bd-list-table td.bd-act { order:9; flex:none; margin-left:auto; align-self:center; }
  #appView #workWorkspace .bd-list-table td.bd-act:only-child { flex:none; }
  /* Hộp thoại chọn quà: thẻ gọn, ô 40px */
  #appView #workWorkspace .bd-gd-table tbody tr { gap:8px 10px; padding:12px; border-radius:12px; }
  #appView #workWorkspace .bd-gd-table td[data-label]::before { margin-bottom:2px; font-size:12px; }
  #appView #workWorkspace .bd-gd-table :is(select, input) { height:40px; min-height:40px; }
  #appView #workWorkspace .bd-gd-table td:has(> [data-gd-budget])::after { bottom:11px; }
  #appView #workWorkspace .bd-gd-all { gap:6px 8px; padding:8px 12px; }
  #appView #workWorkspace .bd-gd-all select, #appView #workWorkspace .bd-gd-all input { height:40px; min-height:40px; }
  #appView #workWorkspace .bd-gd-all > span { font-size:12px; }
  #appView #workWorkspace .bd-gd-all { grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; }
  #appView #workWorkspace .bd-gd-all button.sm { grid-column:auto; height:40px; min-height:40px; padding:0 12px; }

  /* ---------- Lịch công: thống kê ---------- */
  #appView #workWorkspace .pa-calcard { padding:8px 6px; }
  #appView #workWorkspace .pa-stats { margin-top:12px; padding:12px; }
  #appView #workWorkspace .pa-stats-head { gap:4px; margin-bottom:8px; }
  #appView #workWorkspace .pa-stats-head h3 { margin:0; font-size:15px; }
  #appView #workWorkspace .pa-stats-total { font-size:13px; }
  #appView #workWorkspace .pa-stat-box { padding:8px 0 0; }
  #appView #workWorkspace .pa-stat-cols { gap:8px; }
  #appView #workWorkspace .pa-stat-title { margin:0 0 4px; font-size:12px; }
  #appView #workWorkspace .pa-stat-grid { gap:0; }
  #appView #workWorkspace .pa-stat-item { min-height:28px; align-items:center; font-size:14px; }
  #appView #workWorkspace .pa-stat-item span { font-size:13px; }
  #appView #workWorkspace .pa-side { gap:16px; margin-top:16px; }
  #appView #workWorkspace .pa-side > .pa-panel > h2 { margin:0 0 8px; }
  #appView #workWorkspace .pa-sheets { gap:8px; }
  #appView #workWorkspace .pa-sheet, #appView #workWorkspace .pa-fund { padding:10px 12px; border-radius:12px; }
  #appView #workWorkspace .pa-panel.pa-ot { padding:8px 12px; }
  #appView #workWorkspace .pa-panel.pa-ot .sm { height:32px; min-height:32px; }

  /* ---------- Giải trình: thẻ phiếu (tiêu đề | nhãn; dòng phụ | nút) ---------- */
  #appView #workWorkspace .xp-sec > h2 { margin:16px 0 8px; }
  #appView #workWorkspace .xp-table tr.xp-row { gap:4px 10px; margin:0 0 8px; padding:12px; border-radius:12px; }
  #appView #workWorkspace .xp-row-title, #appView #workWorkspace .xp-row-sub { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .xp-row-title { font-size:15px; line-height:1.25; }
  #appView #workWorkspace .xp-row-sub { margin-top:4px; line-height:1.35; }
  #appView #workWorkspace .xp-row-act .sm.primary { height:32px; min-height:32px; padding:0 14px; }
  #appView #workWorkspace .xp-row-act .ui-more { width:32px; flex-basis:32px; height:32px; min-height:32px; }
  /* Chi tiết phiếu: đầu gọn */
  #appView #workWorkspace .xp-toolbar { gap:8px; }
  #appView #workWorkspace .xp-title-line { flex-wrap:wrap; min-width:0; gap:4px 8px; }
  #appView #workWorkspace .xp-title-line h1 { flex:1 1 100%; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .xp-title-line > :is(.xp-chip, .tag) { flex:none; }
  #appView #workWorkspace .xp-toolbar > * { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
  #appView #workWorkspace .xp-actions { min-width:0; gap:6px; }
  #appView #workWorkspace .xp-actions button { flex:0 1 auto; min-width:0; height:36px; min-height:36px; padding:0 10px; font-size:13px; }
  #appView #workWorkspace .xp-doc-head { padding:10px 12px; }
  #appView #workWorkspace .xp-meta { gap:4px 12px; padding-top:8px; }
  #appView #workWorkspace .xp-sheet tbody tr { gap:4px 6px; margin-top:8px; padding:12px; border-radius:12px; }
}
/* Ghép (08/11 khuya): tiêu đề có tháng/kỳ không được cắt mất tháng — cho xuống tối đa 2 dòng, chia dòng cân */
@media screen and (max-width: 760px) {
  #appView #workWorkspace .hub-heading.bd-heading h1, #appView #workWorkspace .xp-title-line h1 {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; text-overflow: clip; text-wrap: balance; line-height: 1.25;
  }
}

/* ==========================================================================
   LỊCH HẸN (11/2026) — Sales đặt · Lãnh đạo duyệt · Sales Admin + Lãnh đạo xem toàn bộ.
   Khung giữa tối đa 1180px; đầu màn 3 phần: tiêu đề | tháng (giữa) | nút. Dải số, cột chính + cột phải 320px.
   ========================================================================== */
@media screen {
  #appView #workWorkspace .bk { display:flex; flex-direction:column; gap:16px; max-width:1180px; margin:0 auto; padding:8px 0 40px; color:#25211C; }
  #appView #workWorkspace .bk > #wbBody { display:flex; flex-direction:column; gap:16px; min-width:0; }
  #appView #workWorkspace .bk-head { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:16px; min-height:44px; }
  #appView #workWorkspace .bk-title { display:flex; align-items:center; gap:10px; min-width:0; }
  #appView #workWorkspace .bk-title h1 { margin:0; font-size:24px; font-weight:700; letter-spacing:-.3px; line-height:1.25; white-space:nowrap; }
  #appView #workWorkspace .bk-pill { display:inline-flex; align-items:center; height:24px; padding:0 10px; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:12px; font-weight:700; white-space:nowrap; }
  #appView #workWorkspace .bk-pill.is-warn { background:#FFF2E0; color:#8A4B0C; }
  #appView #workWorkspace .bk-pill.is-bad { background:#FBE7E5; color:#9B2F23; }
  #appView #workWorkspace .bk-month { justify-self:center; display:inline-flex; align-items:center; gap:2px; height:40px; padding:0 4px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:20px; background:#fff; }
  #appView #workWorkspace .bk-month button { display:grid; place-items:center; width:32px; height:32px; min-height:32px; padding:0; border:0; border-radius:16px; background:transparent; color:#25211C; font-size:18px; line-height:1; box-shadow:none; }
  #appView #workWorkspace .bk-month button:hover { background:#F5EEE3; }
  #appView #workWorkspace .bk-month strong { min-width:124px; font-size:14px; font-weight:700; text-align:center; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-acts { display:flex; justify-content:flex-end; min-width:0; }
  #appView #workWorkspace .bk-tabs { display:inline-flex; padding:3px; border-radius:12px; background:#F5EEE3; }
  #appView #workWorkspace .bk-tabs button { height:34px; min-height:34px; padding:0 14px; border:0; border-radius:9px; background:transparent; color:#6F655A; font-size:13px; font-weight:600; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .bk-tabs button[aria-selected="true"] { background:#fff; color:#25211C; box-shadow:0 1px 2px #392e2224; }

  /* Dải số */
  #appView #workWorkspace .bk-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-radius:14px; background:#FAF6EF; overflow:hidden; }
  #appView #workWorkspace .bk-stat { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; height:auto; min-height:0; padding:12px 18px; border:0; border-left:1px solid #EADFCF; border-radius:0; background:transparent; color:#25211C; text-align:left; box-shadow:none; }
  #appView #workWorkspace .bk-stat:first-child { border-left:0; }
  #appView #workWorkspace .bk-stat span { color:#6F655A; font-size:12px; font-weight:600; }
  #appView #workWorkspace .bk-stat strong { font-size:22px; font-weight:800; line-height:1.15; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-stat.is-warn strong { color:#8A4B0C; }
  #appView #workWorkspace .bk-stat.is-ok strong { color:#1F5E2E; }
  #appView #workWorkspace button.bk-stat { cursor:pointer; }
  #appView #workWorkspace button.bk-stat:hover { background:#F5EEE3; }
  #appView #workWorkspace button.bk-stat[aria-pressed="true"] { background:#F3E6D2; box-shadow:inset 0 -2px 0 #9A6A2E; }

  /* Cột */
  #appView #workWorkspace .bk-cols { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:20px; align-items:start; }
  #appView #workWorkspace .bk-main { min-width:0; }
  #appView #workWorkspace .bk-side { position:sticky; top:16px; display:flex; flex-direction:column; gap:16px; min-width:0; }
  #appView #workWorkspace .bk-card { padding:18px 20px; box-sizing:border-box; border:1px solid #E2D6C4; border-radius:16px; background:#fff; box-shadow:none; }
  #appView #workWorkspace .bk-card > h2 { display:flex; align-items:center; gap:8px; margin:0 0 12px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .bk-empty p { margin:0; color:#6F655A; font-size:14px; }
  #appView #workWorkspace .bk-none { padding:24px 16px; border:1px dashed #E2D6C4; border-radius:14px; color:#6F655A; font-size:14px; text-align:center; }

  /* Lọc */
  #appView #workWorkspace .bk-filters { display:flex; align-items:center; gap:10px; margin:0 0 12px; }
  #appView #workWorkspace .bk-chips { display:flex; gap:6px; flex:0 0 auto; }
  #appView #workWorkspace .bk-chips button, #appView #workWorkspace .bk-dayclear { height:34px; min-height:34px; padding:0 14px; border:1px solid #E2D6C4; border-radius:17px; background:#fff; color:#25211C; font-size:13px; font-weight:600; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .bk-chips button[aria-pressed="true"] { border-color:#E3C79E; background:#FAF1E1; color:#6E4A1C; }
  #appView #workWorkspace .bk-dayclear { display:inline-flex; align-items:center; gap:8px; border-color:#25211C; background:#25211C; color:#fff; }

  /* Lịch theo ngày */
  #appView #workWorkspace .bk-day + .bk-day { margin-top:16px; }
  #appView #workWorkspace .bk-day > h3 { display:flex; align-items:center; gap:8px; margin:0 0 8px; color:#6F655A; font-size:13px; font-weight:700; letter-spacing:0; text-transform:none; }
  #appView #workWorkspace .bk-rows { margin:0; padding:0; list-style:none; border:1px solid #E2D6C4; border-radius:14px; background:#fff; overflow:hidden; }
  #appView #workWorkspace .bk-row { display:grid; grid-template-columns:60px minmax(0,1fr) auto; align-items:center; gap:14px; padding:12px 16px; border-top:1px solid #EFE8DD; }
  #appView #workWorkspace .bk-row:first-child { border-top:0; }
  #appView #workWorkspace .bk-row.is-past { opacity:.6; }
  #appView #workWorkspace .bk-row.is-off .bk-row-main > strong { color:#6F655A; text-decoration:line-through; }
  #appView #workWorkspace .bk-time { display:flex; flex-direction:column; font-size:16px; font-weight:800; line-height:1.15; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-time small { color:#6F655A; font-size:11px; font-weight:600; }
  #appView #workWorkspace .bk-row-main { display:flex; flex-direction:column; gap:2px; min-width:0; }
  #appView #workWorkspace .bk-row-main > strong { display:block; overflow:hidden; font-size:14px; font-weight:700; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .bk-row-main > strong span { margin-left:8px; color:#6F655A; font-size:13px; font-weight:500; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-row-main > p { margin:0; overflow:hidden; font-size:13px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .bk-row-main > small { overflow:hidden; color:#6F655A; font-size:12px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .bk-row-main > small:empty { display:none; }
  #appView #workWorkspace .bk-row-acts { display:flex; gap:8px; }
  #appView #workWorkspace .bk-btn { height:34px; min-height:34px; padding:0 14px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#9B2F23; font-size:13px; font-weight:700; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .bk-btn:hover { background:#FBF3F2; }
  #appView #workWorkspace .bk-btn.is-primary { border-color:#9A6A2E; background:#9A6A2E; color:#fff; }
  #appView #workWorkspace .bk-btn.is-primary:hover { border-color:#7E5523; background:#7E5523; }
  #appView #workWorkspace .bk-chip { display:inline-flex; align-items:center; height:24px; padding:0 10px; border-radius:12px; font-size:12px; font-weight:700; white-space:nowrap; }
  #appView #workWorkspace .bk-chip.is-ok { background:#E6F2E8; color:#1F5E2E; }
  #appView #workWorkspace .bk-chip.is-warn { background:#FFF2E0; color:#8A4B0C; }
  #appView #workWorkspace .bk-chip.is-danger { background:#FBE7E5; color:#9B2F23; }

  /* Lịch tháng (cột phải) */
  #appView #workWorkspace .bk-cg { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
  #appView #workWorkspace .bk-wk { padding:2px 0 4px; color:#6F655A; font-size:11px; font-weight:600; text-align:center; }
  #appView #workWorkspace .bk-cd { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; aspect-ratio:1; height:auto; min-height:0; padding:0; border:0; border-radius:10px; background:transparent; color:#25211C; font-size:13px; font-weight:600; line-height:1.1; box-shadow:none; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-cd:hover { background:#F5EEE3; }
  #appView #workWorkspace .bk-cd.has { background:#FAF6EF; }
  #appView #workWorkspace .bk-cd i { color:#1F5E2E; font-size:10px; font-style:normal; font-weight:800; }
  #appView #workWorkspace .bk-cd i.is-wait { color:#B0650C; }
  #appView #workWorkspace .bk-cd.is-today { box-shadow:inset 0 0 0 1.5px #9A6A2E; }
  #appView #workWorkspace .bk-cd.is-lock { color:#9B2F23; text-decoration:line-through; }
  #appView #workWorkspace .bk-cd[aria-pressed="true"] { background:#9A6A2E; color:#fff; }
  #appView #workWorkspace .bk-cd[aria-pressed="true"] i { color:#fff; }
  #appView #workWorkspace .bk-legend { display:flex; flex-wrap:wrap; gap:6px 14px; margin:12px 0 0; color:#6F655A; font-size:12px; }
  #appView #workWorkspace .bk-legend span { display:inline-flex; align-items:center; gap:6px; }
  #appView #workWorkspace .bk-legend i { width:8px; height:8px; border-radius:50%; background:#1F5E2E; }
  #appView #workWorkspace .bk-legend i.is-wait { background:#B0650C; }
  #appView #workWorkspace .bk-legend i.is-lock { background:#9B2F23; }
  #appView #workWorkspace .bk-days { display:none; }

  /* Lịch của tôi (Sales) */
  #appView #workWorkspace .bk-minelist { margin:0; padding:0; list-style:none; }
  #appView #workWorkspace .bk-mine { display:grid; grid-template-columns:52px minmax(0,1fr); gap:12px; padding:10px 0; border-top:1px solid #EFE8DD; }
  #appView #workWorkspace .bk-mine:first-child { border-top:0; padding-top:0; }
  #appView #workWorkspace .bk-mine-when { display:flex; flex-direction:column; }
  #appView #workWorkspace .bk-mine-when strong { font-size:15px; font-weight:800; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-mine-when small { color:#6F655A; font-size:12px; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .bk-mine-foot { display:flex; align-items:center; gap:12px; margin-top:4px; }
  #appView #workWorkspace .bk-link { height:auto; min-height:0; padding:0; border:0; background:none; color:#8A5F27; font-size:13px; font-weight:600; box-shadow:none; }
  #appView #workWorkspace .bk-link.is-danger { color:#9B2F23; }
  #appView #workWorkspace .bk-link:hover { text-decoration:underline; background:none; }
  #appView #workWorkspace .bk-more { margin-top:10px; border:0 !important; }
  #appView #workWorkspace .bk-more > summary { padding:6px 0; color:#6F655A; font-size:13px; font-weight:600; cursor:pointer; }
  #appView #workWorkspace .bk-minecard .bk-none { padding:16px; }

  /* Form đặt lịch trong khung mới */
  #appView #workWorkspace .bk .work-book { gap:14px; padding:18px 20px; border:1px solid #E2D6C4; border-radius:16px; background:#fff; }
  #appView #workWorkspace .bk .work-book > h2 { font-size:15px; font-weight:700; }
}
@media screen and (max-width: 1100px) { #appView #workWorkspace .bk-cols { grid-template-columns:minmax(0,1fr) 280px; } }
@media screen and (max-width: 900px) {
  #appView #workWorkspace .bk-cols { grid-template-columns:minmax(0,1fr); }
  #appView #workWorkspace .bk-side { position:static; }
}
/* Điện thoại: đầu màn 2 hàng (tiêu đề | nút, rồi tháng), dải ngày cuộn ngang thay lịch tháng */
@media screen and (max-width: 760px) {
  #appView #workWorkspace .bk { gap:12px; padding:4px 0 16px; }
  #appView #workWorkspace .bk > #wbBody { gap:12px; }
  #appView #workWorkspace .bk-head { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"title acts" "month month"; gap:10px; }
  #appView #workWorkspace .bk-title { grid-area:title; }
  #appView #workWorkspace .bk-title h1 { font-size:20px; font-weight:800; }
  #appView #workWorkspace .bk-acts { grid-area:acts; }
  #appView #workWorkspace .bk-month { grid-area:month; justify-self:stretch; justify-content:space-between; }
  #appView #workWorkspace .bk-tabs button { height:32px; min-height:32px; padding:0 10px; }
  #appView #workWorkspace .bk-stat { padding:8px; }
  #appView #workWorkspace .bk-stat span { max-width:100%; overflow:hidden; font-size:11.5px; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .bk-stat strong { font-size:17px; }
  #appView #workWorkspace .bk-cols { gap:12px; }
  #appView #workWorkspace .bk-side:has(.bk-cal) { display:none; }
  #appView #workWorkspace .bk-card { padding:14px; border-radius:14px; }
  #appView #workWorkspace .bk-filters { margin:0 -12px 8px; padding:0 12px; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .bk-filters::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .bk-chips button, #appView #workWorkspace .bk-dayclear { height:32px; min-height:32px; padding:0 12px; }
  #appView #workWorkspace .bk-days { display:flex; gap:6px; margin:0 -12px 12px; padding:0 12px; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .bk-days::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .bk-days button { display:flex; flex:0 0 48px; flex-direction:column; align-items:center; justify-content:center; gap:0; height:58px; min-height:0; padding:0; border:1px solid #E2D6C4; border-radius:12px; background:#fff; color:#25211C; box-shadow:none; line-height:1.15; }
  #appView #workWorkspace .bk-days button small { color:#6F655A; font-size:11px; font-weight:600; }
  #appView #workWorkspace .bk-days button strong { font-size:16px; font-weight:800; }
  #appView #workWorkspace .bk-days button i { color:#1F5E2E; font-size:10px; font-style:normal; font-weight:800; }
  #appView #workWorkspace .bk-days button i.is-wait { color:#B0650C; }
  #appView #workWorkspace .bk-days button.is-today { border-color:#9A6A2E; }
  #appView #workWorkspace .bk-days button[aria-selected="true"] { border-color:#9A6A2E; background:#9A6A2E; color:#fff; }
  #appView #workWorkspace .bk-days button[aria-selected="true"] :is(small, i) { color:#fff; }
  #appView #workWorkspace .bk-day + .bk-day { margin-top:12px; }
  #appView #workWorkspace .bk-day > h3 { margin-bottom:6px; }
  #appView #workWorkspace .bk-row { grid-template-columns:46px minmax(0,1fr) auto; gap:4px 12px; padding:10px 12px; align-items:start; }
  #appView #workWorkspace .bk-row:has(.bk-row-acts) { grid-template-columns:46px minmax(0,1fr); }
  #appView #workWorkspace .bk-row-acts { grid-column:2; justify-content:flex-end; margin-top:4px; }
  #appView #workWorkspace .bk-btn { height:32px; min-height:32px; }
  #appView #workWorkspace .bk-time { font-size:15px; }
  /* Nhãn trạng thái nằm góc phải trên, chỉ dòng tên chừa chỗ — dịch vụ / Sale dùng hết bề ngang */
  #appView #workWorkspace .bk-row:not(:has(.bk-row-acts)) { position:relative; grid-template-columns:46px minmax(0,1fr); }
  #appView #workWorkspace .bk-row > .bk-chip { position:absolute; top:10px; right:12px; height:20px; padding:0 8px; font-size:11px; }
  #appView #workWorkspace .bk-row:not(:has(.bk-row-acts)) .bk-row-main > strong { padding-right:84px; }
  #appView #workWorkspace .bk .work-book { padding:14px; border-radius:14px; }
  #appView #workWorkspace .bk-mine { padding:8px 0; }
}

/* ---------- Check-in gặp khách — giao diện 11/2026 (.cix-*): ô tìm khách một bước, khung chụp lớn, GPS tự lấy, lịch sử có ảnh nhỏ ---------- */
#appView .cix-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#appView .cix-stats { display:flex; gap:8px; }
#appView .cix-stats[hidden] { display:none; }
#appView .cix-stats span { display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 14px; border:1px solid #EFE9DD; border-radius:16px; background:#fff; color:#6F655A; font-size:13px; white-space:nowrap; }
#appView .cix-stats b { color:#25211C; font-size:15px; font-weight:800; font-variant-numeric:tabular-nums; }
#appView #ciBody .cix-grid { display:grid; grid-template-columns:minmax(0,440px) minmax(0,1fr); gap:20px; align-items:start; }
#appView #ciBody .cix-form { overflow:visible; }
#appView #ciBody .cix-form .field > .lbl, #appView #ciBody .cix-form .field > label { margin:0; font-size:13px; font-weight:600; color:#25211C; }
/* Khách hàng */
#appView #ciBody .cix-cust { display:flex; flex-direction:column; gap:8px; position:relative; }
#appView #ciBody .cix-combo { position:relative; }
#appView #ciBody .cix-combo-ic { position:absolute; left:13px; top:50%; transform:translateY(-50%); display:flex; color:#9A8F82; pointer-events:none; }
#appView #ciBody #ciSearch { width:100%; padding-left:40px; margin:0; }
#appView #ciBody .cix-opts { display:flex; flex-direction:column; max-height:264px; overflow-y:auto; border:1px solid #EFE9DD; border-radius:12px; background:#fff; box-shadow:0 8px 24px #392e2214; }
#appView #ciBody .cix-opts[hidden] { display:none; }
#appView #ciBody .cix-opt { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; height:auto; min-height:44px; padding:8px 14px; border:0; border-bottom:1px solid #F3EEE7; border-radius:0; background:#fff; color:#25211C; text-align:left; cursor:pointer; box-shadow:none; }
#appView #ciBody .cix-opt:last-child { border-bottom:0; }
#appView #ciBody .cix-opt:hover, #appView #ciBody .cix-opt:focus-visible { background:#FAF4EA; outline:none; }
#appView #ciBody .cix-opt strong { font-size:14px; font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView #ciBody .cix-opt small { flex:none; color:#6F655A; font-size:13px; font-variant-numeric:tabular-nums; }
#appView #ciBody .cix-more { margin:0; padding:12px 14px; color:#6F655A; font-size:13px; }
#appView #ciBody .cix-link { align-self:flex-start; width:auto; height:auto; min-height:0; padding:2px 0; border:0; background:none; color:#9A6A2E; font-size:13px; font-weight:700; cursor:pointer; box-shadow:none; }
#appView #ciBody .cix-link:hover { color:#6E4A1C; text-decoration:underline; }
#appView #ciBody .cix-chip { display:flex; align-items:center; gap:12px; padding:10px 14px; border:1px solid #E3D3BA; border-radius:12px; background:#FAF4EA; }
#appView #ciBody .cix-chip > div { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
#appView #ciBody .cix-chip strong { font-size:15px; font-weight:700; color:#25211C; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView #ciBody .cix-chip small { font-size:13px; color:#6F655A; font-variant-numeric:tabular-nums; }
#appView #ciBody .cix-chip .cix-link { align-self:center; }
#appView #ciBody .cix-av { flex:none; display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#AE7C41; color:#fff; font-weight:700; font-size:15px; }
#appView #ciBody .cix-other { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#appView #ciBody .cix-other .field { display:flex; flex-direction:column; gap:6px; margin:0; }
#appView #ciBody .cix-other .field > label { font-size:12px; font-weight:600; color:#6F655A; }
/* Ảnh */
#appView #ciBody .cix-camera { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; width:100%; height:auto; min-height:148px; padding:18px; border:1.5px dashed #E4DACA; border-radius:14px; background:#FAF7F2; color:#9A6A2E; cursor:pointer; box-shadow:none; }
#appView #ciBody .cix-camera:hover { background:#F5EDE0; border-color:#AE7C41; }
#appView #ciBody .cix-camera svg { width:26px; height:26px; padding:12px; box-sizing:content-box; border-radius:50%; background:#fff; border:1px solid #EFE9DD; }
#appView #ciBody .cix-camera strong { color:#25211C; font-size:15px; font-weight:700; }
#appView #ciBody .cix-camera small { color:#6F655A; font-size:12px; font-weight:500; }
#appView #ciBody .cix-shot { position:relative; overflow:hidden; border-radius:14px; background:#25211C; }
#appView #ciBody .cix-shot img { display:block; width:100%; max-height:300px; object-fit:contain; }
#appView #ciBody .cix-retake { position:absolute; right:10px; bottom:10px; display:inline-flex; align-items:center; gap:6px; width:auto; height:36px; min-height:36px; padding:0 14px; border:0; border-radius:18px; background:#fffffff0; color:#25211C; font-size:13px; font-weight:700; box-shadow:0 2px 10px #0003; cursor:pointer; }
#appView #ciBody .cix-retake svg { width:16px; height:16px; }
/* GPS */
#appView #ciBody .cix-gps { display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 14px; box-sizing:border-box; border-radius:12px; border:1px solid #EFE9DD; background:#fff; font-size:14px; }
#appView #ciBody .cix-gps-ic { display:flex; color:#9A8F82; }
#appView #ciBody .cix-gps-t { flex:1; min-width:0; color:#25211C; font-weight:600; }
#appView #ciBody .cix-gps .cix-link { align-self:center; }
#appView #ciBody .cix-gps.is-ok { border-color:#BFDCC6; background:#F0F8F2; }
#appView #ciBody .cix-gps.is-ok .cix-gps-ic { color:#2E7D46; }
#appView #ciBody .cix-gps.is-err { border-color:#EFC2BC; background:#FBE7E5; }
#appView #ciBody .cix-gps.is-err .cix-gps-ic, #appView #ciBody .cix-gps.is-err .cix-gps-t { color:#9B2F23; }
#appView #ciBody .cix-gps.is-busy .cix-gps-t { color:#6F655A; }
#appView #ciBody .cix-gps.is-busy .cix-gps-ic { animation:cixPulse 1s ease-in-out infinite; color:#AE7C41; }
@keyframes cixPulse { 50% { opacity:.3; } }
/* Nút Check-in */
#appView #ciBody .cix-submit { margin:0; }
#appView #ciBody .cix-submit #ciSubmit { width:100%; height:46px; min-height:46px; margin:0; border-radius:12px; font-size:15px; font-weight:700; }
#appView #ciBody #ciSubmit:not(.is-ready) { background:#E8DCCB; color:#6F655A; border-color:#E8DCCB; }
/* Lịch sử */
#appView #ciBody .cix-hist { display:flex; flex-direction:column; gap:14px; padding:20px 24px; }
#appView #ciBody .cix-hist-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#appView #ciBody .cix-hist-head h2 { margin:0; }
#appView #ciBody .cix-hq { position:relative; display:flex; align-items:center; flex:0 1 240px; min-width:0; margin:0; color:#9A8F82; }
#appView #ciBody .cix-hq svg { position:absolute; left:12px; pointer-events:none; }
#appView #ciBody .cix-hist .cix-hq input:not([type=file]) { width:100%; height:36px; min-height:36px; margin:0; padding:0 12px 0 34px; border-radius:18px; font-size:13px; box-sizing:border-box; }
#appView #ciBody .cix-group + .cix-group { margin-top:6px; }
#appView #ciBody .cix-group h3 { display:flex; align-items:center; gap:8px; margin:0 0 8px; color:#6F655A; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
#appView #ciBody .cix-group h3 span { min-width:20px; height:20px; padding:0 6px; display:inline-grid; place-items:center; border-radius:10px; background:#F1ECE4; font-size:11px; letter-spacing:0; box-sizing:border-box; }
#appView #ciBody .cix-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
#appView #ciBody .cix-item { display:flex; gap:12px; padding:12px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
#appView #ciBody .cix-thumb { flex:none; display:grid; place-items:center; width:64px; height:64px; min-height:0; padding:0; overflow:hidden; border:1px solid #EFE9DD; border-radius:10px; background:#F5F0E8; color:#B7AA98; cursor:zoom-in; box-shadow:none; }
#appView #ciBody .cix-thumb.is-none { cursor:default; }
#appView #ciBody .cix-thumb img { width:100%; height:100%; object-fit:cover; }
#appView #ciBody .cix-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
#appView #ciBody .cix-top { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
#appView #ciBody .cix-top strong { min-width:0; font-size:14px; font-weight:700; color:#25211C; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView #ciBody .cix-top time { flex:none; color:#6F655A; font-size:13px; font-variant-numeric:tabular-nums; }
#appView #ciBody .cix-addr { color:#25211C; font-size:13px; overflow-wrap:anywhere; }
#appView #ciBody .cix-note { color:#6F655A; font-size:13px; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#appView #ciBody .cix-meta { display:flex; align-items:center; gap:12px; margin-top:2px; color:#9A8F82; font-size:12px; }
#appView #ciBody .cix-meta:empty { display:none; }
#appView #ciBody .cix-meta a { display:inline-flex; align-items:center; gap:4px; color:#9A6A2E; font-weight:700; text-decoration:none; }
#appView #ciBody .cix-meta a svg { width:14px; height:14px; }
#appView #ciBody .cix-meta a:hover { text-decoration:underline; }
#appView #ciBody .cix-empty { display:flex; flex-direction:column; align-items:center; gap:10px; padding:36px 16px; border:1px dashed #E3D9CB; border-radius:12px; color:#B7AA98; text-align:center; }
#appView #ciBody .cix-empty svg { width:28px; height:28px; }
#appView #ciBody .cix-empty p { margin:0; color:#6F655A; font-size:13px; max-width:260px; }
/* Khách gặp gần đây (một chạm) */
#appView #ciBody .cix-recent { display:flex; flex-direction:column; gap:6px; }
#appView #ciBody .cix-recent-t { color:#6F655A; font-size:12px; font-weight:600; }
#appView #ciBody .cix-recent-row { display:flex; flex-wrap:wrap; gap:6px; }
#appView #ciBody .cix-rchip { display:inline-flex; align-items:center; gap:6px; width:auto; max-width:100%; height:34px; min-height:34px; padding:0 12px 0 4px; border:1px solid #E3D3BA; border-radius:17px; background:#fff; color:#25211C; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; box-shadow:none; }
#appView #ciBody .cix-rchip:hover { background:#FAF4EA; border-color:#AE7C41; }
#appView #ciBody .cix-rchip .cix-av { width:26px; height:26px; font-size:12px; }
/* Thanh 2 tab + ghi chú thu gọn: chỉ dùng trên điện thoại */
#appView #ciBody .cix-tabs, #appView #ciBody .cix-notes-add, #appView #ciBody .cix-hist-stats { display:none; }
#ciPhotoDialog { cursor:zoom-out; }
#ciPhotoDialog img, #ciPhotoDialog button { cursor:auto; }
@media (max-width: 900px) {
  #appView #ciBody .cix-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
}
@media (max-width: 760px) {
  #appView .cix-heading { flex-direction:column; align-items:flex-start; gap:8px; }
  #appView .cix-stats span { height:28px; padding:0 10px; font-size:12px; }
  #appView .cix-stats b { font-size:14px; }
  #appView #ciBody .cix-other { grid-template-columns:minmax(0,1fr); }
  #appView #ciBody .cix-camera { min-height:168px; }
  #appView #ciBody .cix-opt { min-height:48px; }
  #appView #ciBody .cix-shot img { max-height:260px; }
  /* Nút Check-in dính đáy, ngay trên thanh menu dưới (thanh cao 62px, cách đáy 8px); bàn phím mở thì dính sát đáy */
  #appView #ciBody .cix-submit { position:sticky; z-index:5; bottom:calc(78px + env(safe-area-inset-bottom, 0px)); margin:0 -16px -16px; padding:10px 16px 12px; background:linear-gradient(#fff0, #fff 14px); }
  body.sales-shell.m-kb #appView #ciBody .cix-submit { bottom:0; }
  #appView #ciBody .cix-hist { padding:16px; }
  #appView #ciBody .cix-hist-head { flex-direction:column; align-items:stretch; }
  #appView #ciBody .cix-hq { flex:auto; }
  #appView #ciBody .cix-hist .cix-hq input:not([type=file]) { height:40px; min-height:40px; font-size:16px; }
  #appView #ciBody .cix-thumb { width:56px; height:56px; }

  /* ---- Điện thoại 13/11: 2 tab "Check-in mới" / "Lịch sử"; tab Check-in mới gọn để check nhanh ---- */
  #appView .cix-heading { margin-bottom:10px; }
  #appView .cix-heading .cix-stats { display:none; }
  #appView #ciBody .cix-tabs { position:sticky; top:calc(56px + env(safe-area-inset-top, 0px)); z-index:6; display:flex; gap:4px; margin:0 0 12px; padding:4px; border-radius:14px; background:#F1ECE4; box-shadow:0 0 0 6px #fff; }
  #appView #ciBody .cix-tabs button { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:42px; min-height:42px; padding:0 8px; border:0; border-radius:11px; background:none; color:#6F655A; font-size:15px; font-weight:700; box-shadow:none; }
  #appView #ciBody .cix-tabs button[aria-selected="true"] { background:#fff; color:#6E4A1C; box-shadow:0 1px 4px #392e221f; }
  #appView #ciBody .cix-badge { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:10px; background:#AE7C41; color:#fff; font-size:11px; font-weight:800; }
  #appView #ciBody .cix-badge[hidden] { display:none; }
  #appView #ciBody .cix-grid[data-tab="new"] > .cix-hist, #appView #ciBody .cix-grid[data-tab="hist"] > .cix-form { display:none; }
  /* Tab Check-in mới: bỏ khung thẻ và tiêu đề trùng tab, khoảng cách gọn */
  #appView #ciBody .cix-form { gap:16px; padding:0; border:0; background:none; box-shadow:none; }
  #appView #ciBody .cix-form > h2 { display:none; }
  #appView #ciBody .cix-camera { min-height:150px; padding:16px; }
  #appView #ciBody .cix-notes:not(.is-open) > :not(.cix-notes-add) { display:none; }
  #appView #ciBody .cix-notes:not(.is-open) > .cix-notes-add { display:inline-block; font-size:14px; padding:4px 0; }
  #appView #ciBody .cix-recent-row { flex-wrap:nowrap; overflow-x:auto; margin:0 -12px; padding:0 12px 2px; scrollbar-width:none; }
  #appView #ciBody .cix-recent-row::-webkit-scrollbar { display:none; }
  #appView #ciBody .cix-rchip { flex:none; height:38px; min-height:38px; font-size:14px; max-width:220px; }
  #appView #ciBody .cix-submit { margin:0 -12px; padding:10px 12px 12px; }
  /* Tab Lịch sử: bỏ khung thẻ, tiêu đề thay bằng số liệu */
  #appView #ciBody .cix-hist { padding:0; border:0; background:none; box-shadow:none; gap:12px; }
  #appView #ciBody .cix-hist-head h2 { display:none; }
  #appView #ciBody .cix-hist-stats:not([hidden]) { display:block; margin:0; color:#6F655A; font-size:13px; }
  #appView #ciBody .cix-hist-stats b { color:#25211C; font-weight:800; }
}

/* ---------- Quản lý làm việc ngoài VP (Sales Admin / Lãnh đạo) — bố cục theo trang CRM 13/11/2026; .cb-* trong #ciBody.cb, dùng lại .cix-* ---------- */
#appView .cb-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
#appView .cb-titles { min-width:0; }
#appView .cb-titles h1 { margin:0; color:#25211C; font-size:24px; font-weight:700; letter-spacing:-.3px; line-height:1.3; }
#appView .cb-sum { display:flex; flex-wrap:wrap; align-items:center; gap:4px 0; margin:6px 0 0; color:#6F655A; font-size:13px; }
#appView .cb-sum > span + span::before { content:'·'; margin:0 8px; color:#B7AA98; }
#appView .cb-sum b { color:#25211C; font-weight:800; font-variant-numeric:tabular-nums; }
#appView .cb-acts { display:flex; align-items:center; gap:8px; flex:none; }
#appView .cb-xls { display:inline-flex; align-items:center; gap:8px; height:40px; min-height:40px; padding:0 18px; border-radius:10px; font-size:14px; font-weight:700; }
#appView .cb-icon { display:grid; place-items:center; width:40px; height:40px; min-height:40px; padding:0; border:0; border-radius:10px; background:none; color:#25211C; box-shadow:none; cursor:pointer; }
#appView .cb-icon:hover { background:#F1ECE4; }
#appView .cb-icon.sm { width:34px; height:34px; min-height:34px; }
#appView #ciBody.cb { display:flex; flex-direction:column; gap:12px; }
#appView .cb-search { position:relative; display:flex; align-items:center; margin:0; color:#9A8F82; }
#appView .cb-search svg { position:absolute; left:16px; pointer-events:none; }
#appView #ciBody #cbQ { width:100%; height:44px; min-height:44px; margin:0; padding:0 16px 0 44px; border:1px solid #E3D9CB; border-radius:22px; background:#fff; font-size:14px; box-sizing:border-box; }
#appView .cb-periods { display:inline-flex; align-self:flex-start; gap:2px; padding:4px; border:1px solid #E3D9CB; border-radius:14px; background:#fff; max-width:100%; overflow-x:auto; scrollbar-width:none; box-sizing:border-box; }
#appView .cb-periods::-webkit-scrollbar { display:none; }
#appView #ciBody .cb-periods button { flex:none; width:auto; height:34px; min-height:34px; padding:0 12px; border:0; border-radius:10px; background:none; color:#25211C; font-size:13px; font-weight:600; box-shadow:none; white-space:nowrap; }
#appView #ciBody .cb-periods button[aria-pressed="true"] { background:#25211C; color:#fff; font-weight:700; }
#appView .cb-range { display:flex; gap:10px; flex-wrap:wrap; }
#appView .cb-range[hidden] { display:none; }
#appView .cb-range label { display:flex; flex-direction:column; gap:4px; margin:0; color:#6F655A; font-size:12px; font-weight:600; }
#appView #ciBody .cb-range input { height:38px; min-height:38px; margin:0; padding:0 10px; border:1px solid #E3D9CB; border-radius:10px; background:#fff; font-size:14px; }
#appView .cb-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
#appView .cb-chips { display:flex; gap:8px; flex-wrap:wrap; min-width:0; }
#appView #ciBody .cb-chip { display:inline-flex; align-items:center; gap:6px; width:auto; height:34px; min-height:34px; padding:0 14px; border:1px solid #E3D9CB; border-radius:17px; background:#fff; color:#25211C; font-size:13px; font-weight:600; box-shadow:none; white-space:nowrap; }
#appView #ciBody .cb-chip span { min-width:18px; height:18px; padding:0 5px; display:inline-grid; place-items:center; box-sizing:border-box; border-radius:9px; background:#F1ECE4; font-size:11px; font-weight:700; }
#appView #ciBody .cb-chip[aria-pressed="true"] { background:#EFE2CC; border-color:#9A6A2E; color:#6E4A1C; }
#appView .cb-sort { display:inline-flex; align-items:center; gap:6px; height:36px; margin:0; padding:0 4px 0 12px; border:1px solid #E3D9CB; border-radius:10px; background:#fff; color:#6F655A; font-size:13px; }
#appView #ciBody .cb-sort select { width:auto; height:32px; min-height:32px; margin:0; padding:0 26px 0 4px; border:0; background-color:transparent; color:#25211C; font-size:13px; font-weight:700; box-shadow:none; }
#appView .cb-grid { display:grid; grid-template-columns:minmax(0, 300px) minmax(0, 1fr); gap:14px; align-items:start; }
/* Cột Sales đi ngoài VP */
#appView #ciBody .cb-people { position:sticky; top:72px; display:flex; flex-direction:column; gap:0; padding:0; overflow:hidden; }
#appView .cb-ph, #appView .cb-fh { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid #EFE9DD; }
#appView .cb-ph h2, #appView .cb-fh h2 { margin:0; font-size:15px; font-weight:700; color:#25211C; }
#appView .cb-ph > span { color:#6F655A; font-size:12px; }
#appView .cb-plist { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
#appView #ciBody .cb-person { display:flex; align-items:center; gap:10px; width:100%; height:auto; min-height:56px; padding:8px 14px; border:0; border-left:3px solid transparent; border-bottom:1px solid #F3EEE7; border-radius:0; background:#fff; color:#25211C; text-align:left; box-shadow:none; cursor:pointer; }
#appView #ciBody .cb-person:hover { background:#FAF7F2; }
#appView #ciBody .cb-person[aria-pressed="true"] { background:#FAF0E2; border-left-color:#AE7C41; }
#appView .cb-person .cix-av, #appView .cb-idle-p .cix-av { width:34px; height:34px; font-size:12px; background:#FBE7E5; color:#9B2F23; }
#appView .cb-person.is-all .cix-av { background:#25211C; color:#fff; }
#appView .cb-pmain { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
#appView .cb-pmain strong { font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView .cb-pmain small { color:#6F655A; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-variant-numeric:tabular-nums; }
#appView .cb-count { flex:none; display:inline-grid; place-items:center; min-width:24px; height:24px; padding:0 7px; box-sizing:border-box; border-radius:12px; background:#F1ECE4; color:#25211C; font-size:12px; font-weight:800; }
#appView .cb-person[aria-pressed="true"] .cb-count { background:#9A6A2E; color:#fff; }
#appView .cb-idle { border-top:1px solid #EFE9DD; }
#appView .cb-idle summary { display:flex; align-items:center; gap:8px; padding:10px 16px; color:#6F655A; font-size:12px; font-weight:700; cursor:pointer; list-style:none; }
#appView .cb-idle summary::-webkit-details-marker { display:none; }
#appView .cb-idle summary::after { content:'▾'; margin-left:auto; }
#appView .cb-idle[open] summary::after { content:'▴'; }
#appView .cb-idle summary span { min-width:18px; height:18px; display:inline-grid; place-items:center; border-radius:9px; background:#F1ECE4; font-size:11px; }
#appView .cb-idle-p { display:flex; align-items:center; gap:10px; padding:6px 16px; opacity:.6; }
#appView .cb-idle-p .cix-av { background:#EFE9DD; color:#6F655A; }
/* Danh sách lượt */
#appView #ciBody .cb-feed { display:flex; flex-direction:column; gap:0; padding:0; min-height:240px; }
#appView .cb-feed.is-loading #cbList { opacity:.45; pointer-events:none; }
#appView .cb-views { display:inline-flex; gap:2px; padding:3px; border:1px solid #E3D9CB; border-radius:10px; background:#F7F3EE; }
#appView #ciBody .cb-views button { display:inline-flex; align-items:center; gap:6px; width:auto; height:30px; min-height:30px; padding:0 10px; border:0; border-radius:8px; background:none; color:#6F655A; font-size:13px; font-weight:600; box-shadow:none; }
#appView #ciBody .cb-views button[aria-pressed="true"] { background:#fff; color:#25211C; font-weight:700; box-shadow:0 1px 3px #392e221f; }
#appView #cbList { padding:4px 16px 16px; }
#appView #cbList > .cix-empty { margin-top:12px; }
#appView .cb-day-h { display:flex; justify-content:space-between; gap:10px; padding:12px 0 8px; color:#25211C; font-size:13px; font-weight:700; }
#appView .cb-day-h span + span { color:#6F655A; font-weight:500; }
#appView .cb-items { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
#appView .cb-card { display:flex; gap:14px; padding:14px; border:1px solid #EFE9DD; border-radius:14px; background:#fff; }
#appView #ciBody .cb-card .cix-thumb { width:72px; height:72px; border-radius:10px; }
#appView .cix-thumb > span { display:grid; place-items:center; width:100%; height:100%; }
#appView .cix-thumb > span img { width:100%; height:100%; object-fit:cover; }
#appView .cb-cbody { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
#appView .cb-l1 { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
#appView .cb-l1 strong { color:#25211C; font-size:15px; font-weight:700; }
#appView .cb-phone { color:#9A6A2E; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
#appView .cb-l2 { color:#6F655A; font-size:13px; }
#appView .cb-l2 b { color:#25211C; font-variant-numeric:tabular-nums; }
#appView #ciBody .cb-who { display:inline; width:auto; height:auto; min-height:0; padding:0; border:0; background:none; color:#9A6A2E; font-size:13px; font-weight:700; box-shadow:none; cursor:pointer; }
#appView #ciBody .cb-who:hover { text-decoration:underline; }
#appView .cb-addr { display:flex; align-items:flex-start; gap:4px; color:#25211C; font-size:13px; }
#appView .cb-addr svg { flex:none; width:14px; height:14px; margin-top:2px; color:#6F655A; }
#appView .cb-addr span { overflow-wrap:anywhere; }
#appView .cb-note { padding:8px 12px; border-left:3px solid #E4DACA; border-radius:0 8px 8px 0; background:#FAF7F2; color:#25211C; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
#appView .cb-tags { display:flex; gap:6px; flex-wrap:wrap; }
#appView .cb-tag { display:inline-flex; align-items:center; height:22px; padding:0 9px; border-radius:11px; background:#F1ECE4; color:#6F655A; font-size:11px; font-weight:700; }
#appView .cb-tag.ok { background:#E6F2E9; color:#2E7D46; }
#appView .cb-cacts { display:flex; align-items:center; gap:6px; margin-top:2px; }
#appView .cb-btn { display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:13px; font-weight:700; text-decoration:none; }
#appView .cb-btn:hover { background:#FAF7F2; }
/* Lưới ảnh */
#appView .cb-gridview { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; padding-top:12px; }
#appView #ciBody .cb-tile { position:relative; display:block; width:100%; height:auto; min-height:0; aspect-ratio:1; padding:0; overflow:hidden; border:0; border-radius:12px; background:#F1ECE4; color:#B7AA98; box-shadow:none; cursor:zoom-in; }
#appView #ciBody .cb-tile:disabled { cursor:default; opacity:1; }
#appView .cb-tile-img { position:absolute; inset:0; display:grid; place-items:center; }
#appView .cb-tile-img img { width:100%; height:100%; object-fit:cover; }
#appView .cb-tile-cap { position:absolute; left:0; right:0; bottom:0; display:flex; flex-direction:column; gap:1px; padding:20px 10px 8px; background:linear-gradient(#0000, #000b); color:#fff; text-align:left; }
#appView .cb-tile-cap strong { font-size:13px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#appView .cb-tile-cap small { font-size:11px; opacity:.9; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Menu ⋯ */
.cb-menu { position:fixed; z-index:80; min-width:220px; max-width:calc(100vw - 16px); padding:6px; border:1px solid #E3D9CB; border-radius:12px; background:#fff; box-shadow:0 12px 32px #392e2229; }
.cb-menu[hidden] { display:none; }
.cb-menu .cb-menu-h { margin:0; padding:6px 10px 8px; border-bottom:1px solid #F1ECE4; color:#6F655A; font-size:12px; font-weight:600; }
.cb-menu button { display:flex; align-items:center; width:100%; height:38px; min-height:38px; padding:0 10px; border:0; border-radius:8px; background:none; color:#25211C; font-size:14px; font-weight:500; text-align:left; box-shadow:none; cursor:pointer; }
.cb-menu button:hover, .cb-menu button:focus-visible { background:#FAF4EA; outline:none; }
@media (max-width: 900px) {
  #appView .cb-grid { grid-template-columns:minmax(0, 1fr); }
  #appView #ciBody .cb-people { position:static; }
}
@media (max-width: 760px) {
  #appView .cb-head { gap:8px; margin-bottom:10px; }
  #appView .cb-titles h1 { font-size:20px; text-align:left; }
  #appView .cb-sum { font-size:12px; }
  #appView .cb-xls { width:40px; padding:0; justify-content:center; }
  #appView .cb-xls span { display:none; }
  #appView #ciBody #cbQ { font-size:16px; }
  #appView .cb-periods { align-self:stretch; border:0; padding:0; background:none; gap:6px; margin:0 -12px; padding:0 12px; border-radius:0; }
  #appView #ciBody .cb-periods button { height:36px; min-height:36px; padding:0 14px; border:1px solid #E3D9CB; border-radius:18px; background:#fff; }
  #appView #ciBody .cb-periods button[aria-pressed="true"] { border-color:#25211C; }
  #appView .cb-range label { flex:1; }
  #appView #ciBody .cb-range input { width:100%; font-size:16px; }
  #appView .cb-bar { flex-wrap:nowrap; }
  #appView .cb-chips { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; flex:1; }
  #appView .cb-chips::-webkit-scrollbar { display:none; }
  #appView .cb-sort span { display:none; }
  #appView .cb-sort { flex:none; padding-left:4px; }
  /* Sales đi ngoài VP: dải ảnh đại diện vuốt ngang như CRM */
  #appView #ciBody .cb-people { border:0; background:none; box-shadow:none; overflow:visible; }
  #appView .cb-ph, #appView .cb-idle { display:none; }
  #appView .cb-people > div > .cb-plist { flex-direction:row; gap:12px; overflow-x:auto; margin:0 -12px; padding:4px 12px 2px; scrollbar-width:none; }
  #appView .cb-people > div > .cb-plist::-webkit-scrollbar { display:none; }
  #appView #ciBody .cb-person { position:relative; flex-direction:column; gap:4px; width:64px; min-height:0; padding:0; border:0; background:none; }
  #appView #ciBody .cb-person:hover, #appView #ciBody .cb-person[aria-pressed="true"] { background:none; }
  #appView .cb-person .cix-av { width:52px; height:52px; font-size:16px; box-shadow:0 0 0 2px #fff, 0 0 0 3px #E3D9CB; }
  #appView .cb-person[aria-pressed="true"] .cix-av { box-shadow:0 0 0 2px #fff, 0 0 0 4px #9A6A2E; }
  #appView .cb-person .cb-pmain { align-items:center; width:100%; }
  #appView .cb-person .cb-pmain strong { font-size:11px; font-weight:600; max-width:64px; }
  #appView .cb-person .cb-pmain small { display:none; }
  #appView .cb-person .cb-count { position:absolute; top:-2px; right:2px; min-width:20px; height:20px; font-size:11px; background:#25211C; color:#fff; box-shadow:0 0 0 2px #fff; }
  /* Danh sách lượt: bỏ khung thẻ ngoài */
  #appView #ciBody .cb-feed { border:0; background:none; box-shadow:none; scroll-margin-top:64px; }
  #appView .cb-fh { padding:8px 0; border:0; }
  #appView #ciBody .cb-views button span { display:none; }
  #appView #cbList { padding:0; }
  #appView .cb-card { gap:12px; padding:12px; }
  #appView #ciBody .cb-card .cix-thumb { width:60px; height:60px; }
  #appView .cb-gridview { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
}
/* CRM chưa cấp quyền "Xem check-in ngoài VP": báo một lần trên đầu danh sách lượt */
#appView .cb-notice { margin:12px 16px 0; padding:10px 12px; border:1px solid #F0D9A8; border-radius:10px; background:#FFF7E6; color:#7A5310; font-size:13px; line-height:1.45; }
#appView .cb-notice[hidden] { display:none; }
@media (max-width: 760px) { #appView .cb-notice { margin:0 0 10px; } }
