.table-sm td, .table-sm th { vertical-align: middle; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-rest { background: #f1f4f3; }
.row-holiday { background: #fff4e5; }
.row-locked input, .row-locked select { pointer-events: none; background: #f8f9fa; }
.att-grid input[type=time] { min-width: 6.5rem; }
.att-grid input.form-control-sm, .att-grid select.form-select-sm { padding: .15rem .4rem; }
.clock { font-size: 2.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-responsive { -webkit-overflow-scrolling: touch; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
}
.progress-bar { min-width: 2rem; }
.progress-w-0 { width: 0%; }
.progress-w-10 { width: 10%; }
.progress-w-20 { width: 20%; }
.progress-w-30 { width: 30%; }
.progress-w-40 { width: 40%; }
.progress-w-50 { width: 50%; }
.progress-w-60 { width: 60%; }
.progress-w-70 { width: 70%; }
.progress-w-80 { width: 80%; }
.progress-w-90 { width: 90%; }
.progress-w-100 { width: 100%; }
.kpi-bar { height: .5rem; }
.notif-unread { background: #eef7f5; }
.step-list { list-style: none; padding-left: 0; margin: 0; }
.step-list li { position: relative; padding: 0 0 1rem 2.6rem; }
.step-list li::before { content: ""; position: absolute; left: .95rem; top: 1.9rem; bottom: 0; width: 2px; background: #dee2e6; }
.step-list li:last-child::before { display: none; }
.step-no { position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 600; background: #e9ecef; color: #495057; }
.step-done .step-no { background: var(--green); color: #fff; }
.step-current .step-no { background: var(--lagoon); color: #fff; box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb),.22); }
.step-stopped .step-no { background: #dc3545; color: #fff; }
.step-row .form-control, .step-row .form-select { font-size: .875rem; }


/* ---------- CRM ---------- */
.quote-form .form-label { margin-bottom: .1rem; font-size: .85rem; }
.quote-result td, .quote-result th { font-size: .85rem; }
.quote-total { font-size: 1.4rem; font-weight: 600; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.frp-icon { height: 48px; }
.frp-choice label, .frp-usage label { cursor: pointer; }
@media (min-width: 992px) { .frp-sticky { position: sticky; top: 1rem; } }
.quote-public { max-width: 760px; }

/* Thanh gợi ý "Cài ứng dụng" (PWA) */
.install-bar { position: fixed; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 1060;
  max-width: 30rem; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem .7rem .8rem;
  background: var(--ink, #0f2f2b); color: #fff; border-radius: var(--radius, 10px); box-shadow: 0 12px 32px rgba(15, 47, 43, .28);
  font-size: .86rem; line-height: 1.35; }
.install-bar img { border-radius: 9px; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-text .ico { width: 16px; height: 16px; }
.install-bar .btn { flex: none; font-weight: 600; }
.install-close { flex: none; border: 0; background: transparent; color: #c9dbd6; font-size: 1.4rem; line-height: 1; padding: .1rem .35rem; border-radius: 6px; }
.install-close:hover { color: #fff; background: rgba(255,255,255,.08); }
@media print { .install-bar { display: none !important; } }

/* v17.4: trạng thái online – xanh = rảnh, đỏ = bận, đen = không online */
.pres-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: middle;
  border: 2px solid var(--surface, #fff); box-sizing: content-box; background: #1f2328; }
.pres-dot.pres-free { background: #1fa855; }
.pres-dot.pres-busy { background: #e5363d; }
.pres-dot.pres-off { background: #1f2328; }
.pres-wrap { position: relative; }
.pres-wrap > .pres-dot { position: absolute; right: -2px; bottom: -2px; }
.shell-user-menu form.pres-menu { border-top: 0; margin: 0 0 .3rem; padding: 0 0 .3rem; border-bottom: 1px solid var(--line); }
.pres-menu button[aria-current="true"] { font-weight: 600; }
.pres-legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .78rem; color: var(--muted); }
.pres-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.pres-list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; }
.pres-list li { display: flex; align-items: center; gap: .55rem; padding: .35rem .75rem; }
.pres-list li + li { border-top: 1px solid var(--line); }
.pres-list .pres-who { flex: 1; min-width: 0; line-height: 1.2; }
.pres-list .pres-who b { display: block; font-weight: 600; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-list .pres-who small { color: var(--muted); font-size: .74rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-list .pres-chat { font-size: .78rem; text-decoration: none; }
.pres-list .avatar { width: 30px; height: 30px; font-size: .7rem; }
.pres-off-list summary { cursor: pointer; padding: .45rem .75rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }
.pres-off-list .pres-who b { font-weight: 500; color: var(--muted); }
.chat-ri .pres-wrap > .pres-dot, .chat-title .pres-dot { width: 9px; height: 9px; }
.chat-title .pres-dot { margin-right: .3rem; border-width: 0; }

/* v17.6: cổng khách hàng (khachhang.php, kh_portal.php) */
.public-top .shell-brand-link { min-width: 0; flex: 1 1 auto; }
.kh-nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; flex-wrap: nowrap; overflow-x: auto; }
.kh-nav a, .kh-nav button { color: #d9ece8; text-decoration: none; font-size: .85rem; padding: .35rem .6rem; border-radius: 6px; background: none; border: 0; white-space: nowrap; }
.kh-nav a:hover, .kh-nav button:hover, .kh-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.kh-nav form { margin: 0; }
@media (max-width: 575.98px) {
  .public-top { height: auto; flex-wrap: wrap; padding: .5rem 1rem; gap: .25rem; }
  .kh-nav { width: 100%; margin-left: 0; }
}
.kh-wrap { max-width: 1100px; margin: 0 auto; }
.kh-hero { background: var(--lagoon-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.kh-hero h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
.kh-steps { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .85rem; color: var(--muted); margin: .4rem 0 0; padding: 0; list-style: none; }
.kh-steps b { color: var(--lagoon); }
.kh-choice label { cursor: pointer; }
.kh-choice input:checked + b, .kh-choice label:has(input:checked) { color: var(--lagoon); }
.kh-choice label:has(input:checked) { border-color: var(--lagoon) !important; background: var(--lagoon-50); }
.kh-size { font-size: .8rem; color: var(--muted); }
.kh-promo { border: 1px dashed var(--lagoon); border-radius: var(--radius-sm); padding: .75rem; background: var(--surface); }
.kh-promo-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .05em; color: var(--lagoon); }
.kh-thread { list-style: none; padding: 0; margin: 0; }
.kh-thread li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; margin-bottom: .5rem; background: var(--surface); max-width: 46rem; }
.kh-thread li.from-staff { margin-left: auto; background: var(--lagoon-50); }
.kh-thread li.is-internal { background: var(--amber-50); border-style: dashed; }
.kh-thread li.from-system { background: transparent; border: 0; padding: .1rem .75rem; font-size: .8rem; color: var(--muted); max-width: none; text-align: center; }
.kh-thread .meta { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.kh-thread .body { white-space: pre-wrap; word-break: break-word; }
.kh-stars { display: inline-flex; flex-direction: row-reverse; gap: .1rem; }
.kh-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kh-stars label { font-size: 1.6rem; line-height: 1; color: var(--line-strong); cursor: pointer; }
.kh-stars input:checked ~ label, .kh-stars label:hover, .kh-stars label:hover ~ label { color: #e0a100; }
.kh-stars input:focus-visible + label { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.kh-pre { white-space: pre-wrap; word-break: break-word; }
.kh-minw { min-width: 11rem; }
/* v17.7: đăng ký thành viên dạng cửa sổ nổi, nhập kích thước, cột giá deal, chat với khách */
.kh-dialog { border: 0; border-radius: var(--radius); padding: 1rem 1.25rem; width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.kh-dialog::backdrop { background: rgba(10,30,28,.55); }
.kh-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.kh-mode label { cursor: pointer; font-size: .9rem; }
.kh-volcalc { background: var(--lagoon-50); border-radius: var(--radius-sm); padding: .35rem .6rem; font-size: .9rem; }
.kh-price th { font-weight: 600; font-size: .75rem; color: var(--muted); }
.kh-price td + td, .kh-price th + th { white-space: nowrap; }
.khc { position: fixed; right: 16px; bottom: 16px; z-index: 1050; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.khc-btn { position: relative; border: 0; border-radius: 999px; background: var(--lagoon); color: #fff; padding: .6rem 1rem; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.khc-btn:hover { filter: brightness(1.08); }
.khc.is-open .khc-btn { display: none; }
.khc-dot { position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #e53935; border: 2px solid #fff; }
.khc-panel { width: min(360px, calc(100vw - 32px)); height: min(520px, calc(100vh - 32px)); background: var(--surface); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.khc-panel[hidden] { display: none; }
.khc-head { background: var(--lagoon); color: #fff; padding: .6rem .8rem; display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; font-size: .9rem; line-height: 1.3; }
.khc-body, .cs-chat { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: .4rem; background: var(--lagoon-50); }
.cs-chat { height: 420px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.khc-msg { max-width: 82%; padding: .4rem .6rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; font-size: .9rem; }
.khc-msg.me { align-self: flex-end; background: var(--lagoon); color: #fff; border-color: var(--lagoon); }
.khc-msg.sys { align-self: center; background: transparent; border: 0; font-size: .78rem; color: var(--muted); text-align: center; max-width: 100%; }
.khc-text { white-space: pre-wrap; word-break: break-word; }
.khc-who { font-size: .72rem; font-weight: 600; color: var(--lagoon); }
.khc-time { font-size: .68rem; opacity: .7; text-align: right; }
.khc-start { padding: .6rem; border-top: 1px solid var(--line); }
.khc-send { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid var(--line); }
.khc-send[hidden], .khc-start[hidden] { display: none; }
.khc-send textarea { resize: none; }
.cs-chat-list { max-height: 560px; overflow-y: auto; }
@media print { .khc { display: none; } }
/* v17.8 Tính cột lọc áp lực */
.loc-sketch { width: 100%; max-width: 260px; height: auto; }
.loc-stage { break-inside: avoid; }

/* v18: cổng khách dễ dùng hơn */
.kh-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex; gap: .6rem; align-items: center; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.10); }
.kh-bar[hidden] { display: none; }
.kh-bar-sum { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; line-height: 1.2; color: inherit; }
.kh-bar-lbl { display: block; font-size: .72rem; color: var(--muted); }
.kh-bar-val { font-size: 1.1rem; color: #c62828; white-space: nowrap; }
.kh-bar.is-empty .kh-bar-val { font-size: .85rem; color: var(--muted); font-weight: 500; }
.kh-bar-more { display: block; font-size: .72rem; color: var(--lagoon); }
.kh-bar .btn { white-space: nowrap; }
@media (min-width: 992px) { .kh-bar { display: none !important; } }
@media (max-width: 991.98px) {
  body.has-kh-bar .shell-main { padding-bottom: 5.5rem; }
  body.has-kh-bar .khc { bottom: 5rem; }
  body.kh-typing .khc { display: none; }
}
@media (max-width: 575.98px) {
  .khc-btn { width: 3.25rem; height: 3.25rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }
  .khc-btn .khc-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shell-brand-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.kh-more { border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--radius-sm); padding: .5rem .75rem; margin-top: .75rem; background: var(--surface); }
.kh-more > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--lagoon); list-style: none; }
.kh-more > summary::-webkit-details-marker { display: none; }
.kh-more > summary::before { content: '＋ '; }
.kh-more[open] > summary::before { content: '－ '; }
.kh-more > summary .text-muted { font-weight: 400; }
.kh-more[open] > summary { margin-bottom: .5rem; }
.kh-contact { display: flex; flex-wrap: wrap; gap: .5rem; }
.kh-plain { background: var(--lagoon-50); border-radius: var(--radius-sm); padding: .5rem .65rem; font-size: .9rem; margin-bottom: .5rem; }
.kh-tech > summary { cursor: pointer; font-size: .8rem; color: var(--lagoon); }
.kl-sym-ico { width: 2rem; height: 2rem; flex: none; }
.kl-sym .form-check { display: flex; align-items: center; gap: .5rem; padding-left: 0; margin-bottom: .35rem; }
.kl-sym .form-check-input { margin: 0; flex: none; }
.kl-add .form-check { margin-bottom: .25rem; }
.kh-price.kh-nodeal th:nth-child(3), .kh-price.kh-nodeal td:nth-child(3) { display: none; }
@media (max-width: 575.98px) {
  table.kh-cards thead { display: none; }
  table.kh-cards, table.kh-cards tbody, table.kh-cards tr, table.kh-cards td { display: block; width: 100%; }
  table.kh-cards tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .65rem; margin-bottom: .5rem; background: var(--surface); }
  table.kh-cards td { border: 0; padding: .15rem 0; display: flex; justify-content: space-between; gap: .75rem; text-align: right; }
  table.kh-cards td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: none; }
  table.kh-cards td.kh-card-head { display: block; text-align: left; font-weight: 600; }
  table.kh-cards td.kh-card-head::before { content: none; }
  .table-responsive:has(> table.kh-cards) { overflow: visible; }
}

/* v18.1: xem Word / Excel / CSV trong trình xem hồ sơ */
.lb-is-doc [data-act="rot"] { display: none; }
.lb-is-doc .lb-inner { display: block; width: 100%; }
.ov-root { background: #fff; color: #1d2327; margin: 0 auto 2rem; max-width: 900px; border-radius: 6px; box-shadow: 0 2px 14px rgba(0,0,0,.35); text-align: left; }
.ov-word { padding: 2.2rem 2.4rem; font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.45; }
.ov-excel, .ov-csv { max-width: none; padding: .5rem; font-size: 13px; }
.ov-doc .ov-p { margin: 0 0 .45em; white-space: pre-wrap; word-break: break-word; }
.ov-doc h1.ov-p { font-size: 1.6em; } .ov-doc h2.ov-p { font-size: 1.35em; } .ov-doc h3.ov-p { font-size: 1.18em; } .ov-doc h4.ov-p, .ov-doc h5.ov-p, .ov-doc h6.ov-p { font-size: 1.05em; }
.ov-doc h1.ov-p, .ov-doc h2.ov-p, .ov-doc h3.ov-p, .ov-doc h4.ov-p, .ov-doc h5.ov-p, .ov-doc h6.ov-p { font-weight: 700; margin: .8em 0 .4em; color: #1d2327; }
.ov-doc .ov-pb { display: block; border-top: 1px dashed #b8c2c8; margin: 1.2em -1rem; }
.ov-doc .ov-img { max-width: 100%; height: auto; vertical-align: middle; }
.ov-tablewrap { overflow: auto; max-width: 100%; margin: .4em 0 .8em; }
.ov-table { border-collapse: collapse; width: 100%; }
.ov-table td { border: 1px solid #9aa5ab; padding: .25em .45em; vertical-align: top; }
.ov-table td .ov-p { margin: 0; }
.ov-xl { border-collapse: collapse; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ov-xl th, .ov-xl td { border: 1px solid #d0d7dc; padding: .15rem .4rem; white-space: nowrap; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; }
.ov-xl td.ov-wrap { white-space: normal; }
.ov-xl thead th { position: sticky; top: 0; background: #eef2f4; color: #4b5960; font-weight: 600; text-align: center; z-index: 1; }
.ov-xl th.ov-rn { position: sticky; left: 0; background: #eef2f4; color: #4b5960; font-weight: 500; text-align: right; z-index: 1; }
.ov-xl th.ov-corner { left: 0; z-index: 2; }
.ov-tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem .25rem .5rem; }
.ov-tab { border: 1px solid #c9d2d7; background: #f6f8f9; border-radius: 6px; padding: .2rem .65rem; font-size: 13px; color: #33434b; }
.ov-tab.active { background: var(--lagoon, #0b6b5c); border-color: var(--lagoon, #0b6b5c); color: #fff; }
.ov-note { font-size: 12px; color: #5b6970; margin: .4rem 0 0; }
.ov-imgph { color: #8a959b; }
.lb-msg .lb-dl { display: inline-block; margin-top: .5rem; padding: .35rem .9rem; border-radius: 6px; background: var(--lagoon, #0b6b5c); color: #fff; text-decoration: none; }
@media (max-width: 575.98px) { .ov-word { padding: 1.2rem 1rem; font-size: 14px; } }

/* ---------- v18.1: logo đầu trang + logo chìm trên chứng từ, báo giá (inc/brand_lib.php) ---------- */
.voucher-print, .hd-paper, .doc-wm-host { position: relative; isolation: isolate; }
/* bảng trong chứng từ: nền trong suốt để thấy logo chìm phía sau (dòng nhóm / tiêu đề có màu vẫn giữ màu) */
.voucher-print .table, .hd-paper .table, .doc-wm-host .table { --bs-table-bg: transparent; }
.doc-co { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.doc-co .doc-logo { flex: 0 0 auto; height: 3.6rem; width: auto; }
.doc-co.small .doc-logo { height: 3.2rem; }
.doc-co-txt { min-width: 0; }
.doc-wm { position: absolute; left: 50%; top: 50%; width: 70%; max-width: 520px; height: auto; transform: translate(-50%, -50%);
  z-index: -1; pointer-events: none; user-select: none; }
.hd-paper .hd-logo { position: absolute; top: 1.4rem; left: 1.8rem; height: 3.4rem; width: auto; }
@media (max-width: 575.98px) {
  .hd-paper .hd-logo { position: static; display: block; height: 2.8rem; margin: 0 0 .6rem; }
  .doc-co .doc-logo { height: 2.8rem; }
}
@media print {
  .doc-wm { position: fixed; left: 50%; top: 50%; width: 130mm; max-width: none; }
  .hd-paper .hd-logo { top: 0; left: 0; }
}

/* ---------- v18.2: chọn nhiều người dạng thẻ (data-people-pick) + khung người liên quan của công việc ---------- */
.pp { position: relative; }
.pp-chips, .tw-list { list-style: none; margin: 0 0 .4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.pp-chips[hidden] { display: none; }
.pp-chip, .tw-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .2rem .25rem .2rem .6rem; border-radius: 99px;
  background: var(--lagoon-50, #e7f3f1); color: var(--lagoon-600, #0b6b5c); font-size: .85rem; font-weight: 500; border: 1px solid rgba(11,107,92,.18); }
.pp-chip > span, .tw-chip > span:not(.tw-ava) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-chip { padding-left: .25rem; }
.tw-ava { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--lagoon-600, #0b6b5c); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .02em; }
.tw-chip:not(:has(form)) { padding-right: .6rem; }
.pp-x, .tw-x { flex: none; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.pp-x:hover, .tw-x:hover, .pp-x:focus-visible, .tw-x:focus-visible { background: rgba(11,107,92,.14); }
.pp-list { position: absolute; z-index: 30; left: 0; right: 0; margin: .2rem 0 0; padding: .25rem 0; list-style: none; max-height: 15rem; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--line-strong, #c9d2d7); border-radius: var(--radius-sm, 8px); box-shadow: 0 8px 24px rgba(15,47,43,.14); }
.pp-opt { padding: .5rem .75rem; cursor: pointer; font-size: .92rem; }
.pp-opt.is-active, .pp-opt:hover { background: var(--lagoon-50, #e7f3f1); }
.pp-empty { padding: .5rem .75rem; color: var(--muted, #5b6970); font-size: .88rem; }
.pp-note { font-size: .8rem; color: #8a5a00; min-height: 0; }
.pp-note:empty { display: none; }
@media (max-width: 575.98px) { .pp-opt { padding: .7rem .8rem; } .pp-x, .tw-x { width: 2rem; height: 2rem; } }

/* v18.2: nút Quay lại – điện thoại / máy tính bảng chỉ có biểu tượng (cạnh nút menu); v18.11: máy tính hiện thêm chữ */
.shell-back { display: none; align-items: center; justify-content: center; flex: none; width: 2.5rem; height: 2.5rem; margin-left: -.35rem; border-radius: 10px;
  color: var(--ink, #0f2f2b); text-decoration: none; }
.shell-back .ico { width: 22px; height: 22px; }
.shell-back:hover, .shell-back:focus-visible { background: rgba(15,47,43,.08); color: var(--ink, #0f2f2b); }
.public-back { color: #fff; margin-right: .35rem; }
.public-back:hover, .public-back:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 991.98px) {
  .shell-back { display: inline-flex; }
  .shell-top { gap: .35rem; }
  .shell-back-label { display: none; }
}
/* v18.11: máy tính – nút "← Quay lại" có chữ, đầu thanh tiêu đề */
@media (min-width: 992px) {
  .shell-back { display: inline-flex; width: auto; height: 2.25rem; margin-left: -.5rem; padding: 0 .75rem 0 .55rem; gap: .35rem;
    border: 1px solid var(--line, #dfe7e5); background: #fff; font-size: .875rem; font-weight: 500; }
  .shell-back .ico { width: 18px; height: 18px; }
  .shell-back:hover, .shell-back:focus-visible { background: var(--lagoon-50, #eaf4f2); border-color: #b9d3ce; }
}

/* ===== v18.4: Gợi ý theo dữ liệu + Trợ lý AI ===== */
.ai-hints { border: 1px solid #cfe0f3; background: #f6f9fe; border-radius: var(--radius, 10px); padding: .55rem .75rem; margin: .75rem 0; font-size: .875rem; }
.ai-hints-head { display: flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--blue, #2d5f99); margin-bottom: .3rem; }
.ai-hints-head .ico { width: 18px; height: 18px; }
.ai-hints-spin { width: 12px; height: 12px; border: 2px solid #b7cbe6; border-top-color: var(--blue, #2d5f99); border-radius: 50%; animation: ai-spin .8s linear infinite; margin-left: auto; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-hints-list { list-style: none; margin: 0; padding: 0; }
.ai-hints-list li { position: relative; padding: .22rem 0 .22rem 1.15rem; line-height: 1.4; }
.ai-hints-list li::before { content: ""; position: absolute; left: .2rem; top: .62rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--blue, #2d5f99); }
.ai-hints-list li.hint-danger { color: var(--red, #b3261e); }
.ai-hints-list li.hint-danger::before { background: var(--red, #b3261e); }
.ai-hints-list li.hint-warn::before { background: #d08a1b; }
.ai-hints-list li.hint-warn { color: #7a4a08; }
.ai-hints-list li.hint-ok::before { background: var(--green, #1f7a4d); }
.ai-hints-list li.hint-tip { color: var(--muted, #5e716c); }
.ai-hints-list li.hint-tip::before { background: #9db0ab; }
.ai-hints-list li a { white-space: nowrap; font-weight: 500; }
.ai-hints-static { margin-top: 0; }
.ai-write-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; font-size: .8rem; }
.ai-write-btn .ico { width: 15px; height: 15px; }
.ai-label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.ai-suggest { border: 1px dashed #9fb8dc; background: #fbfdff; border-radius: var(--radius-sm, 7px); padding: .55rem .7rem; margin-top: .4rem; font-size: .9rem; }
.ai-suggest-text { white-space: pre-wrap; margin-bottom: .45rem; }
.ai-suggest-err { color: var(--red, #b3261e); }
.ai-suggest .btn { margin-right: .35rem; }
.shell-ai { position: relative; color: var(--blue, #2d5f99); line-height: 0; padding: .45rem; border-radius: 8px; border: 0; background: transparent; }
.shell-ai:hover, .shell-ai[aria-expanded="true"] { background: var(--blue-50, #e5eef8); }
.shell-ai .ico { width: 22px; height: 22px; }
.ai-panel { position: fixed; top: var(--top-h, 56px); right: 0; bottom: 0; width: 380px; max-width: 100vw; z-index: 1600; background: var(--surface, #fff);
  border-left: 1px solid var(--line, #d9e3e0); box-shadow: -8px 0 24px rgba(15, 47, 43, .12); display: flex; flex-direction: column; }
.ai-panel[hidden] { display: none; }
.ai-panel-head { display: flex; align-items: center; gap: .45rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line, #d9e3e0); color: var(--blue, #2d5f99); }
.ai-panel-head .ico { width: 18px; height: 18px; }
.ai-panel-left { color: var(--muted, #5e716c); margin-left: auto; }
.ai-panel-new, .ai-panel-x { border: 0; background: transparent; color: var(--muted, #5e716c); padding: .2rem .4rem; border-radius: 6px; line-height: 1; }
.ai-panel-new:hover, .ai-panel-x:hover { background: var(--paper, #f2f5f4); }
.ai-panel-body { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; background: var(--paper, #f2f5f4); }
.ai-msg { max-width: 92%; padding: .5rem .7rem; border-radius: 12px; white-space: pre-wrap; line-height: 1.45; font-size: .9rem; }
.ai-msg-a { background: var(--surface, #fff); border: 1px solid var(--line, #d9e3e0); align-self: flex-start; }
.ai-msg-u { background: var(--lagoon, #0b6e62); color: #fff; align-self: flex-end; }
.ai-msg-err { background: var(--red-50, #fbe7e5); color: var(--red, #b3261e); align-self: flex-start; }
.ai-msg-wait { color: var(--muted, #5e716c); font-style: italic; }
.ai-panel-form { display: flex; gap: .4rem; padding: .55rem .75rem; border-top: 1px solid var(--line, #d9e3e0); }
.ai-panel-form textarea { flex: 1; resize: none; border: 1px solid var(--line-strong, #b9cac5); border-radius: 8px; padding: .4rem .55rem; font-size: .9rem; }
.ai-panel-form .btn .ico { width: 18px; height: 18px; }
.ai-panel-foot { font-size: .72rem; color: var(--muted, #5e716c); padding: 0 .75rem .5rem; }
@media (max-width: 575.98px) { .ai-panel { width: 100vw; border-left: 0; } }
@media print { .ai-panel, .ai-hints, .shell-ai { display: none !important; } }
/* v18.5: ô số liệu (Điều hành, Kế toán…) – số lớn / âm 13 ký tự không tràn ngang trên điện thoại */
.stat { min-width: 0; }
.stat-value { overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .row > .col-6 > .stat .stat-value { font-size: 1.12rem; }
  .row > .col-6 > .stat { padding-left: .75rem; padding-right: .75rem; }
}
/* v18.10: chứng nhận xuất xưởng, phiếu bảo hành */
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.cert-qr img { width: 96px; height: 96px; image-rendering: pixelated; }
.cert-qr-cap { font-size: .7rem; color: #6c757d; }
.cert-public { max-width: 720px; }

/* v18.16: nút đổi dấu ô giá deal, chia sẻ file, Quay lại trong trình xem */
.signed-group .signed-btn { flex: 0 0 auto; min-width: 5.2rem; font-weight: 600; }
.signed-group .signed-btn[hidden] { display: none; }
.signed-group .signed-btn[hidden] + input { border-radius: var(--bs-border-radius-sm, .25rem) !important; }
.lb-bar { position: relative; }
.lb-back { font-size: .85rem; font-weight: 600; }
.lb-share { font-size: .8rem; }
.share-menu { position: absolute; right: .5rem; top: calc(100% + 4px); z-index: 1090; min-width: 220px; display: flex; flex-direction: column; padding: .3rem; border-radius: 10px; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #222); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
.share-item { display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: .6rem .8rem; border-radius: 7px; font-size: .92rem; text-decoration: none; }
.share-item:hover, .share-item:focus-visible { background: rgba(11, 107, 92, .1); color: inherit; }
@media (max-width: 575.98px) {
  .lb-bar { padding-top: max(.45rem, env(safe-area-inset-top)); }
  .lb-cap { order: 3; flex-basis: 100%; }
}
@media (max-width: 991.98px) { .lb-bar { background: #0f2421; } }

/* v18.17: gợi ý tức thì ở ô Tìm… đầu trang */
.shell-search { position: relative; }
.ss-pop { position: absolute; top: calc(100% + 6px); right: 0; width: min(30rem, 92vw); max-height: min(70vh, 32rem); overflow-y: auto; z-index: 1080; background: var(--surface, #fff); border: 1px solid var(--line, #dde3e1); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); padding: .3rem; }
.ss-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7b78); padding: .45rem .6rem .15rem; }
.ss-item, .ss-all { display: block; padding: .4rem .6rem; border-radius: 7px; color: var(--text, #1d2b28); text-decoration: none; }
.ss-item:hover, .ss-all:hover, .ss-item.active, .ss-all.active { background: rgba(11, 107, 92, .1); color: var(--text, #1d2b28); }
.ss-label { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-sub { display: block; font-size: .76rem; color: var(--muted, #6b7b78); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-all { font-size: .82rem; font-weight: 600; color: var(--lagoon, #0b6b5c); border-top: 1px solid var(--line, #dde3e1); margin-top: .25rem; border-radius: 0 0 7px 7px; }
.ss-empty { padding: .6rem; font-size: .85rem; color: var(--muted, #6b7b78); }
@media (max-width: 575.98px) { .ss-pop { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; } }

/* v18.18: khung tìm cho danh sách thả xuống dài */
.sel-pop { position: fixed; z-index: 1090; display: flex; flex-direction: column; background: var(--surface, #fff); border: 1px solid var(--line, #dde3e1); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: .4rem; }
.sel-pop[hidden] { display: none; }
.sel-q { flex: 0 0 auto; margin-bottom: .3rem; }
.sel-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.sel-opt { padding: .38rem .55rem; border-radius: 6px; cursor: pointer; font-size: .9rem; line-height: 1.3; }
.sel-opt.cur { font-weight: 600; }
.sel-opt.active { background: var(--lagoon, #0b6b5c); color: #fff; }
.sel-opt.dis { color: var(--muted, #8a9693); cursor: not-allowed; }
.sel-group { padding: .45rem .55rem .15rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7b78); }
.sel-empty { padding: .6rem .55rem; font-size: .86rem; color: var(--muted, #6b7b78); }
.sel-info { flex: 0 0 auto; font-size: .76rem; color: var(--muted, #6b7b78); padding: .3rem .3rem 0; border-top: 1px solid var(--line, #dde3e1); margin-top: .3rem; }
.sel-info[hidden] { display: none; }
