/* =====================================================================
   Giao diện v17 – "Văn phòng số" cho doanh nghiệp kinh doanh bất động sản.
   Màu xanh biển đậm (navy), nền xám-xanh dương nhạt, font Be Vietnam Pro. (Biến --lagoon* giữ tên cũ, nay là màu chủ đạo xanh biển.)
   Khung: menu dọc bên trái theo nhóm, thanh trên mảnh; khối nội dung viền mảnh, không đổ bóng.
   ===================================================================== */
:root {
  --ink: #0a1f3d;
  --ink-2: #13325e;
  --lagoon: #0b4a8f;
  --lagoon-600: #083b73;
  --lagoon-50: #e7eef9;
  --paper: #f1f4f9;
  --surface: #ffffff;
  --line: #d7e0ec;
  --line-strong: #b5c3d8;
  --text: #17233a;
  --muted: #59697f;
  --amber: #9a5b0f;
  --amber-50: #fbf0de;
  --red: #b3261e;
  --red-50: #fbe7e5;
  --green: #1f7a4d;
  --green-50: #e2f3ea;
  --blue: #1f6f9e;
  --blue-50: #e3f1f8;
  --nav-w: 248px;
  --top-h: 56px;
  --radius: 10px;
  --radius-sm: 7px;

  --bs-body-font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .9375rem;
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--text);
  --bs-body-bg: #ffffff;   /* nền ô nhập, bảng, danh sách; nền trang dùng --paper ở body */
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: var(--radius);
  --bs-primary: var(--lagoon);
  --bs-primary-rgb: 11, 74, 143;
  --bs-link-color: var(--lagoon);
  --bs-link-color-rgb: 11, 74, 143;
  --bs-link-hover-color: var(--lagoon-600);
  --bs-link-hover-color-rgb: 8, 59, 115;
  --bs-heading-color: var(--ink);
  --bs-focus-ring-color: rgba(11, 74, 143, .28);
}

body { background: var(--paper); font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h1, .h4 { font-size: 1.35rem; }
.h5 { font-size: 1.1rem; }
.h6 { font-size: .95rem; }
.text-muted, .form-text { color: var(--muted) !important; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.num, table td.num, .clock { font-variant-numeric: tabular-nums; }

/* ---------- Khung trang ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--surface); padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

.shell-nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 1040;
  background: var(--ink); color: #c7d5ea; display: flex; flex-direction: column;
}
.shell-brand { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 .9rem 0 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.07); }
.shell-brand-link { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.shell-brand-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; color: #86b9f2; flex: none; }
.shell-menu { flex: 1; overflow-y: auto; padding: .6rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.shell-group + .shell-group { margin-top: .9rem; }
.shell-group-title { font-size: .75rem; color: #8197b8; padding: 0 .65rem .3rem; font-weight: 500; }
.shell-link {
  position: relative; display: flex; align-items: center; gap: .7rem; padding: .48rem .65rem; border-radius: 8px;
  color: #c7d5ea; text-decoration: none; font-size: .92rem; line-height: 1.3;
}
.shell-link .ico { width: 19px; height: 19px; flex: none; opacity: .85; }
.shell-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.shell-link.active { background: var(--ink-2); color: #fff; font-weight: 600; }
.shell-link.active::before { content: ""; position: absolute; left: -.6rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: #86b9f2; }
.shell-link.active .ico { opacity: 1; color: #86b9f2; }
.nav-count { margin-left: auto; min-width: 1.4rem; padding: .05rem .4rem; border-radius: 99px; background: #e0563f; color: #fff; font-size: .72rem;
  font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.shell-company { padding: .8rem 1.1rem 1rem; font-size: .75rem; color: #8197b8; border-top: 1px solid rgba(255,255,255,.07); }
.shell-close, .shell-burger { display: none; border: 0; background: transparent; padding: .35rem; border-radius: 8px; color: inherit; line-height: 0; }
.shell-close .ico, .shell-burger .ico { width: 22px; height: 22px; }

.shell-top {
  position: sticky; top: 0; z-index: 1020; height: var(--top-h); margin-left: var(--nav-w);
  display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem 0 1.75rem;
  background: rgba(241, 244, 249, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.shell-title { font-weight: 600; color: var(--ink); font-size: .98rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-bell { position: relative; color: var(--ink); line-height: 0; padding: .45rem; border-radius: 8px; }
.shell-bell:hover { background: var(--lagoon-50); }
.shell-bell .ico { width: 22px; height: 22px; }
.notif-badge { position: absolute; top: 0; right: -.15rem; font-size: .65rem; }

.shell-user { position: relative; }
.shell-user summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .25rem .4rem; border-radius: 10px; }
.shell-user summary::-webkit-details-marker { display: none; }
.shell-user summary:hover { background: var(--lagoon-50); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--lagoon); color: #fff; font-weight: 600; font-size: .82rem; letter-spacing: .02em; }
.shell-user-name { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: .88rem; color: var(--ink); max-width: 12rem; }
.shell-user-name small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.shell-user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(10, 31, 61, .14); padding: .35rem; z-index: 1050; }
.shell-user-menu a, .shell-user-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .65rem; border: 0;
  background: none; border-radius: 7px; color: var(--text); text-decoration: none; font: inherit; font-size: .9rem; text-align: left; }
.shell-user-menu a:hover, .shell-user-menu button:hover { background: var(--lagoon-50); }
.shell-user-menu .ico { width: 18px; height: 18px; color: var(--muted); }
.shell-user-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }

.shell-main { margin-left: var(--nav-w); padding: 1.5rem 1.75rem 4rem; max-width: calc(1360px + var(--nav-w)); }
.no-shell .shell-main { margin: 0 auto; max-width: 1180px; padding: 1.5rem 1rem 4rem; }
.public-top { height: var(--top-h); display: flex; align-items: center; padding: 0 1.25rem; background: var(--ink); }
.ico { width: 18px; height: 18px; vertical-align: -.2em; }
.shell-backdrop { display: none; }

@media (max-width: 991.98px) {
  .shell-nav { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  body.nav-open .shell-nav { transform: none; }
  body.nav-open .shell-backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 31, 61, .45); z-index: 1030; }
  body.nav-open { overflow: hidden; }
  .shell-close, .shell-burger { display: inline-flex; }
  .shell-close { color: #c7d5ea; }
  .shell-top, .shell-main { margin-left: 0; }
  .shell-top { padding: 0 .75rem; }
  .shell-main { padding: 1rem 1rem 4rem; }
  .shell-user-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { .shell-nav { transition: none; } }

/* ---------- Khối nội dung ---------- */
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-cap-bg: transparent; --bs-card-cap-padding-y: .8rem; background: var(--surface); }
.card.shadow-sm, .shadow-sm.card { box-shadow: none !important; }
.card-header { font-weight: 600; color: var(--ink); border-bottom-color: var(--line); }
.card-header .small, .card-header a { font-weight: 500; }
a.card { transition: border-color .15s; }
a.card:hover { border-color: var(--lagoon); }
.list-group { --bs-list-group-border-color: var(--line); }
.alert { --bs-alert-border-radius: var(--radius); border-width: 1px; }
.alert-success { --bs-alert-bg: var(--green-50); --bs-alert-color: #145536; --bs-alert-border-color: #bfe3cf; }
.alert-danger { --bs-alert-bg: var(--red-50); --bs-alert-color: #7c1a14; --bs-alert-border-color: #f2c4bf; }
.alert-warning { --bs-alert-bg: var(--amber-50); --bs-alert-color: #6b3f08; --bs-alert-border-color: #efd3a6; }
.alert-info { --bs-alert-bg: var(--blue-50); --bs-alert-color: #1f4470; --bs-alert-border-color: #c6d8ee; }
.alert-secondary { --bs-alert-bg: #ecf1f8; --bs-alert-color: var(--text); --bs-alert-border-color: var(--line); }

/* Bảng: tiêu đề nhạt, dòng thưa vừa phải */
.table { --bs-table-border-color: var(--line); --bs-table-hover-bg: #f2f6fb; --bs-table-striped-bg: #f6f9fd; }
.table > thead > tr > th, .table-light, .table > thead.table-light th {
  --bs-table-bg: #f4f7fb; --bs-table-color: var(--muted); font-weight: 600; font-size: .82rem; border-bottom-color: var(--line-strong); }
.table > :not(caption) > * > * { padding: .55rem .65rem; }
.table-sm > :not(caption) > * > * { padding: .4rem .55rem; }
.card > .table-responsive > .table, .card > .table { margin-bottom: 0; }

/* Nút */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: 8px; --bs-btn-padding-x: .9rem; }
.btn-sm { --bs-btn-border-radius: 7px; --bs-btn-padding-x: .6rem; }
.btn-primary { --bs-btn-bg: var(--lagoon); --bs-btn-border-color: var(--lagoon); --bs-btn-hover-bg: var(--lagoon-600); --bs-btn-hover-border-color: var(--lagoon-600);
  --bs-btn-active-bg: #062f5c; --bs-btn-active-border-color: #062f5c; --bs-btn-disabled-bg: var(--lagoon); --bs-btn-disabled-border-color: var(--lagoon); }
.btn-outline-primary { --bs-btn-color: var(--lagoon); --bs-btn-border-color: #9dbbe0; --bs-btn-hover-bg: var(--lagoon); --bs-btn-hover-border-color: var(--lagoon);
  --bs-btn-active-bg: var(--lagoon-600); --bs-btn-active-border-color: var(--lagoon-600); }
.btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: #e7edf6; --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-bg: #dce4ef; --bs-btn-active-color: var(--ink); }
.btn-success { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: #186240; --bs-btn-hover-border-color: #186240; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); }

/* Ô nhập */
.form-control, .form-select { border-color: var(--line-strong); }
.form-control:focus, .form-select:focus { border-color: var(--lagoon); box-shadow: 0 0 0 .2rem rgba(11, 74, 143, .18); }
.form-check-input:checked { background-color: var(--lagoon); border-color: var(--lagoon); }
.form-label { font-weight: 500; color: var(--ink); font-size: .88rem; }
.input-group-text { background: #edf2f8; border-color: var(--line-strong); color: var(--muted); }

/* Nhãn trạng thái: nền nhạt, chữ đậm màu (giữ nguyên lớp bg-* của Bootstrap trong mã) */
.badge { font-weight: 600; letter-spacing: 0; padding: .3em .55em; border-radius: 6px; }
.badge.bg-success { background: var(--green-50) !important; color: #165c3a !important; }
.badge.bg-danger { background: var(--red-50) !important; color: #8f1d17 !important; }
.badge.bg-warning { background: var(--amber-50) !important; color: #7a4609 !important; }
.badge.bg-info { background: #e1f1f6 !important; color: #1d5a6b !important; }
.badge.bg-primary { background: var(--lagoon-50) !important; color: var(--lagoon-600) !important; }
.badge.bg-secondary { background: #e6ebf2 !important; color: #3c4a60 !important; }
.badge.bg-dark { background: #dee4ee !important; color: #222d40 !important; }
.badge.bg-light { background: #f0f3f8 !important; color: var(--muted) !important; border: 1px solid var(--line); }
.badge.rounded-pill.bg-danger.notif-badge, .nav-link .badge.bg-danger { background: #e0563f !important; color: #fff !important; }

/* Thanh tab con (CRM, Nhân sự, Quy trình…) và tab trong trang: gạch chân thay cho viên thuốc */
.nav-pills, .nav-tabs { gap: .25rem; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-pills::-webkit-scrollbar, .nav-tabs::-webkit-scrollbar { display: none; }
.nav-pills .nav-link, .nav-tabs .nav-link {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none !important; color: var(--muted);
  padding: .55rem .75rem !important; font-weight: 500; white-space: nowrap; margin-bottom: -1px;
}
.nav-pills .nav-link:hover, .nav-tabs .nav-link:hover { color: var(--ink); }
.nav-pills .nav-link.active, .nav-tabs .nav-link.active { color: var(--lagoon-600) !important; border-bottom-color: var(--lagoon); font-weight: 600; }
.nav-tabs + .card { border-top-left-radius: 0; border-top-right-radius: 0; }

.pagination { --bs-pagination-color: var(--lagoon); --bs-pagination-active-bg: var(--lagoon); --bs-pagination-active-border-color: var(--lagoon);
  --bs-pagination-border-color: var(--line); }
.progress { --bs-progress-bar-bg: var(--lagoon); background: #e1e8f2; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* ---------- Đăng nhập ---------- */
.login-wrap { min-height: calc(100vh - var(--top-h) - 5.5rem); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; }
.login-card .card-body { padding: 2rem; }
.login-card h1 { font-size: 1.5rem; }

@media print {
  .shell-nav, .shell-top, .shell-backdrop, .public-top { display: none !important; }
  .shell-main { margin: 0 !important; padding: 0 !important; max-width: none; }
}

/* Liên kết trong bảng, danh sách, tiêu đề khối: không gạch chân (gạch khi rê chuột) */
.table a:not(.btn), .list-group a:not(.btn), .card-header a:not(.btn), .nav a, a.card, .card-body > a.d-block { text-decoration: none; }
.table a:not(.btn):hover, .list-group a:not(.btn):hover, .card-header a:not(.btn):hover { text-decoration: underline; }
.table a:not(.btn) { font-weight: 500; }

/* ---------- Chuyển cách xem ---------- */
.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.view-switch a { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; font-size: .85rem; color: var(--muted); text-decoration: none; }
.view-switch a + a { border-left: 1px solid var(--line-strong); }
.view-switch a.active { background: var(--lagoon-50); color: var(--lagoon-600); font-weight: 600; }
.view-switch .ico { width: 16px; height: 16px; }
.btn-secondary { --bs-btn-bg: var(--ink-2); --bs-btn-border-color: var(--ink-2); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); }

/* ---------- Bảng Kanban ---------- */
.kb-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem;
  scroll-snap-type: x proximity; }
.kb-col { background: #e7edf6; border-radius: var(--radius); display: flex; flex-direction: column; min-height: 260px; scroll-snap-align: start; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .8rem .5rem; font-weight: 600; font-size: .88rem; color: var(--ink); }
.kb-col-head .kb-count { min-width: 1.6rem; text-align: center; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; background: rgba(10,31,61,.08); color: var(--muted); }
.kb-col-head small { font-weight: 500; color: var(--muted); }
.kb-col-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.kb-col-head > span:first-child { flex: 1; }
.kb-col-in_progress .kb-col-head::before, .kb-col-quoted .kb-col-head::before { background: var(--lagoon); }
.kb-col-review .kb-col-head::before, .kb-col-negotiation .kb-col-head::before { background: #d39028; }
.kb-col-done .kb-col-head::before, .kb-col-won .kb-col-head::before { background: var(--green); }
.kb-col-lost .kb-col-head::before { background: var(--red); }
.kb-col-qualified .kb-col-head::before { background: var(--blue); }
.kb-col-body { flex: 1; padding: .15rem .5rem .6rem; display: flex; flex-direction: column; gap: .5rem; min-height: 80px; border-radius: 0 0 var(--radius) var(--radius);
  transition: background .15s; max-height: 72vh; overflow-y: auto; }
.is-dragging .kb-col-body { outline: 2px dashed transparent; }
.kb-col-body.kb-over { background: rgba(11,74,143,.08); outline: 2px dashed rgba(11,74,143,.35); outline-offset: -4px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .6rem .7rem .55rem; cursor: grab; touch-action: manipulation;
  font-size: .86rem; position: relative; }
.kb-card:hover { border-color: var(--line-strong); }
.kb-card.is-locked { cursor: default; }
.kb-card.is-overdue { border-left: 3px solid var(--red); }
.kb-card.is-saving { opacity: .55; }
.kb-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .4rem; margin-bottom: .3rem; }
.kb-due { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.is-overdue .kb-due { color: var(--red); font-weight: 600; }
.kb-title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.35; word-break: break-word; }
.kb-title:hover { color: var(--lagoon); text-decoration: underline; }
.kb-sub { color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.kb-value { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .25rem; }
.kb-progress { height: 3px; background: #e1e8f2; border-radius: 3px; margin: .45rem 0 .4rem; overflow: hidden; }
.kb-progress span { display: block; height: 100%; background: var(--lagoon); }
.kb-meta { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--muted); }
.kb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-cmt { margin-left: auto; white-space: nowrap; }
.kb-stars { color: #c98a14; margin-left: auto; letter-spacing: .05em; }
.avatar-xs { width: 22px; height: 22px; font-size: .62rem; }
.kb-ghost { opacity: .35; background: var(--lagoon-50); border-style: dashed; }
.kb-chosen { box-shadow: 0 10px 24px rgba(10,31,61,.18); cursor: grabbing; }
.kb-drag { transform: rotate(1.5deg); }
@media (max-width: 575.98px) { .kb-board { grid-auto-columns: 82vw; } }

/* Hộp thoại xác nhận khi kéo thả */
.kb-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem; width: min(420px, 92vw); box-shadow: 0 24px 60px rgba(10,31,61,.25); }
.kb-dialog::backdrop { background: rgba(10,31,61,.4); }
.star-pick { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick label { font-size: 1.7rem; line-height: 1; color: #ced7e4; cursor: pointer; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: #d6951a; }
.star-pick input:focus-visible + label { outline: 2px solid var(--lagoon); border-radius: 4px; }

/* Thông báo nhanh */
#toast-box { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast-msg { padding: .65rem .9rem; border-radius: 9px; background: var(--ink); color: #fff; font-size: .88rem; box-shadow: 0 10px 30px rgba(10,31,61,.25);
  transition: opacity .3s, transform .3s; }
.toast-msg.toast-danger { background: #8f1d17; }
.toast-msg.out { opacity: 0; transform: translateY(6px); }

/* Vùng kéo thả file */
.dropzone { position: relative; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: .9rem 1rem; text-align: center; color: var(--muted);
  font-size: .86rem; background: #f8fafd; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--lagoon); background: var(--lagoon-50); color: var(--lagoon-600); }
.dropzone .ico { width: 22px; height: 22px; display: block; margin: 0 auto .3rem; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone-files { list-style: none; padding: 0; margin: .5rem 0 0; text-align: left; font-size: .82rem; color: var(--text); }
.dropzone-files li { display: flex; justify-content: space-between; gap: .5rem; padding: .15rem 0; }
.dropzone-files li span:last-child { color: var(--muted); white-space: nowrap; }

/* Kéo sắp xếp các bước quy trình */
.drag-handle { cursor: grab; color: var(--muted); line-height: 0; padding: .25rem; border-radius: 6px; touch-action: none; }
.drag-handle:hover { background: var(--lagoon-50); color: var(--lagoon); }
.drag-handle .ico { width: 18px; height: 18px; }
.sort-ghost { opacity: .4; background: var(--lagoon-50) !important; }
.kb-col-sum { padding: 0 .8rem .45rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kb-board-deals { grid-auto-columns: minmax(215px, 1fr); }

/* ---------- Thẻ chấm công (điểm nhấn của trang chủ) ---------- */
.checkin { background: var(--ink); color: #d5e2f2; border-radius: 14px; padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.checkin-date { font-size: .9rem; color: #9cb2d1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.checkin-tag { background: rgba(255,255,255,.1); color: #f2d7a6; padding: .1rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.checkin .clock { font-size: clamp(3.2rem, 7vw, 4.4rem); font-weight: 700; line-height: 1; color: #fff; letter-spacing: -.03em; margin: 0; }
.checkin-day-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,.1); overflow: hidden; }
.checkin-day-track span { display: block; height: 100%; background: linear-gradient(90deg, #4a90d9, #86b9f2); border-radius: 8px; }
.checkin-day-labels { display: flex; justify-content: space-between; font-size: .75rem; color: #8ba2c2; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.checkin-times { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0; }
.checkin-times > div { background: rgba(255,255,255,.06); border-radius: 10px; padding: .6rem .75rem; }
.checkin-times dt { font-weight: 400; font-size: .78rem; color: #9cb2d1; }
.checkin-times dd { margin: 0; font-size: 1.35rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.checkin-btn { width: 100%; border: 0; border-radius: 10px; padding: .85rem 1rem; font: inherit; font-weight: 700; font-size: 1.05rem;
  background: #86b9f2; color: var(--ink); transition: background .15s, transform .1s; }
.checkin-btn:hover { background: #9cc6f2; }
.checkin-btn:active { transform: translateY(1px); }
.checkin-btn.is-out { background: #f2b8a8; color: #4a1610; }
.checkin-btn.is-out:hover { background: #f6cabd; }
.checkin-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.checkin-note { background: rgba(255,255,255,.08); border-radius: 10px; padding: .65rem .8rem; font-size: .9rem; color: #e5edf8; }

.table-nowrap td, .table-nowrap th { white-space: nowrap; }
/* Đăng nhập: khối thương hiệu màu xanh biển đậm + biểu mẫu */
body.no-shell:has(.login-wrap) .public-top { display: none; }
.login-wrap { min-height: calc(100vh - 3rem); }
.login-split { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 860px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; }
.login-brand { background: var(--ink); color: #c7d5ea; padding: 2.5rem 2.25rem; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px;
  background-image: radial-gradient(120% 70% at 0% 100%, rgba(80,145,222,.35), transparent 60%); }
.login-mark { width: 44px; height: 44px; color: #86b9f2; margin-bottom: auto; }
.login-app { font-size: 1.9rem; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.15; }
.login-company { color: #9cb2d1; margin-top: .25rem; }
.login-lead { margin: 1.25rem 0 0; font-size: .92rem; max-width: 30ch; color: #c7d5ea; }
.login-form { padding: 2.5rem 2.25rem; }
.login-form h1 { font-size: 1.5rem; }
@media (max-width: 767.98px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { min-height: 0; padding: 1.5rem; }
  .login-mark { margin-bottom: 1rem; }
  .login-app { font-size: 1.4rem; }
  .login-lead { display: none; }
  .login-form { padding: 1.5rem; }
}

/* ---------- Kế toán ---------- */
.acc-chart .acc-lv2 { padding-left: 1.4rem; }
.acc-chart .acc-lv3 { padding-left: 2.6rem; }
.acc-lines-table th, .acc-lines-table td { padding-left: .25rem; padding-right: .25rem; }
.acc-lines-table th:first-child, .acc-lines-table td:first-child { padding-left: .75rem; }
.acc-lines-table td { min-width: 7rem; }
.acc-lines-table td:first-child { min-width: 11rem; }
.acc-lines-table select.acc-acct { min-width: 11rem; }
.acc-lines-table td.c-unit { min-width: 4rem; width: 4.5rem; }
.acc-lines-table td.c-qty { min-width: 4.5rem; width: 5rem; }
.acc-lines-table td.c-rate { min-width: 5rem; width: 5.5rem; }
.acc-lines-table td.c-money { min-width: 7.5rem; width: 8rem; }
.acc-lines-table td.c-apply { min-width: 14rem; }
.acc-lines-table td.c-btn { min-width: 0; width: 2.5rem; padding-right: .75rem; }
.acc-lines-table .num, .acc-form input.num { text-align: right; }
.acc-totals { font-variant-numeric: tabular-nums; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--text); text-decoration: none; height: 100%; }
a.stat:hover { border-color: var(--lagoon); }
.stat-label { font-size: .84rem; color: var(--muted); }
.stat-value { font-size: 1.45rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.25; }
.stat-note { font-size: .78rem; color: var(--muted); }
.stat-note.bad { color: var(--red); font-weight: 600; }
.tb-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.voucher-print { max-width: 820px; margin: 0 auto; background: #fff; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); }
.voucher-print p { margin-bottom: .45rem; }
.voucher-sign .col { min-height: 7rem; }
@media print { .voucher-print { border: 0; padding: 0; } }
.cf-chart { width: 100%; height: auto; display: block; }
.cf-in { fill: #1662b5; }
.cf-out { fill: #c4791f; }
.cf-grid { stroke: #e1e8f2; stroke-width: 1; }
.cf-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cf-hit { fill: transparent; }
.cf-hit:hover { fill: rgba(10,31,61,.04); }
.chart-legend { color: var(--muted); font-weight: 500; }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.lg-in { background: #1662b5; }
.lg-out { background: #c4791f; }

/* Bộ lọc dạng hàng: ô chọn dài (tên tài khoản) không làm tràn ngang trên điện thoại */
form.d-flex .form-select.w-auto { max-width: 100%; }
/* Chứng từ mới lập: trên điện thoại, diễn giải không bị ép thành cột chữ hẹp */
.acc-recent td:nth-child(2) { min-width: 12rem; }
@media (max-width: 575.98px) { .acc-recent td:nth-child(2) { min-width: 9rem; } .acc-recent td:last-child { white-space: nowrap; } }

/* ---------- Sản xuất (v9) ---------- */
.pre-wrap { white-space: pre-wrap; }
.form-narrow { max-width: 760px; }
.kb-prod .kb-card-top { gap: .35rem; }
.kb-prod .kb-title { font-size: .9rem; }
.kb-col-done .kb-col-head { color: var(--green); }
.prod-progress-lg { height: 8px; border-radius: 4px; }
.prod-prog-cell { min-width: 9rem; }
.prod-prog-cell .kb-progress { margin: .2rem 0; }
.prod-dl dt { font-weight: 500; color: var(--muted); }
.prod-dl dd { margin-bottom: .35rem; }
.prod-steps tr.step-done td { color: var(--muted); }
.prod-steps tr.step-done td:nth-child(2) { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.worker-pick { position: relative; }
.worker-pick > summary { cursor: pointer; list-style: none; padding: .2rem .5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); max-width: 22rem; }
.worker-pick > summary::-webkit-details-marker { display: none; }
.worker-pick[open] > summary { border-style: solid; border-color: var(--lagoon); }
.worker-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 16rem; max-height: 18rem; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(10, 31, 61, .14); padding: .5rem .75rem; }
.worker-list .form-check { margin-bottom: .25rem; }
.acc-lines-table td.c-qty2 { min-width: 7rem; width: 9rem; }
.qc-table td:nth-child(n+2):nth-child(-n+4) { width: 6rem; }
.sign-cell { min-width: 7rem; }
.prod-print { max-width: 900px; }
.prod-deliver .form-control { min-width: 10rem; }
@media print {
  .prod-print table { font-size: 11px; }
  .worker-pick > summary { border: 0; padding: 0; }
}
/* Bảng sản xuất trên điện thoại: giữ chữ 1 dòng, cuộn ngang trong khung thay vì ép cột hẹp */
@media (max-width: 767.98px) {
  .prod-tbl th, .prod-tbl td { white-space: nowrap; }
  .prod-tbl td.pre-wrap, .prod-tbl .worker-list, .prod-tbl .worker-list * { white-space: normal; }
  .prod-tbl .worker-pick > summary { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- v10: sơ đồ khối quy trình ---------- */
.flowchart { display: block; width: 100%; max-width: 680px; height: auto; margin: 0 auto; font-family: inherit; }
.flowchart .fc-t { fill: var(--text); font-size: 13px; }
.flowchart .fc-tb { font-weight: 600; }
.flowchart .fc-ts { font-size: 11.5px; fill: var(--muted); font-weight: 400; }
.flowchart .fc-box { fill: #fff; stroke: var(--line-strong); stroke-width: 1.4; }
.flowchart .fc-decision { fill: var(--amber-50); stroke: #c99a52; }
.flowchart .fc-document { fill: var(--blue-50); stroke: #8cc3df; }
.flowchart .fc-terminal { fill: var(--lagoon-50); stroke: var(--lagoon); stroke-width: 1.4; }
.flowchart .fc-branch { fill: var(--red-50); stroke: #e3a39e; stroke-dasharray: 4 3; }
.flowchart .fc-line { stroke: #7a8ba5; stroke-width: 1.5; fill: none; }
.flowchart .fc-no { stroke: #c0564f; stroke-dasharray: 5 4; }
.flowchart .fc-arrow { fill: #7a8ba5; }
.flowchart .fc-lab { font-size: 11px; fill: var(--muted); font-style: italic; }
.flowchart .fc-done { fill: var(--green-50); stroke: var(--green); }
.flowchart .fc-current { stroke: var(--lagoon); stroke-width: 3; }
.flowchart .fc-stopped { stroke: var(--red); stroke-width: 2.5; }
.flowchart .fc-mark { fill: var(--green); font-size: 16px; font-weight: 700; }
.flowchart .fc-mark-cur { fill: var(--lagoon); }
.flow-preview { background: var(--paper); max-height: 760px; overflow-y: auto; }
details.flow-card > summary { cursor: pointer; list-style: none; }
details.flow-card > summary::-webkit-details-marker { display: none; }
.handbook-cover { min-height: 60vh; padding: 3rem 1rem; }
.handbook-toc { columns: 2; column-gap: 2rem; }
.handbook-proc { border-top: 2px solid var(--line); padding-top: 1.5rem; margin-top: 2rem; }
@media print {
  .handbook-proc { break-before: page; border-top: 0; margin-top: 0; }
  .handbook-cover { min-height: auto; }
  .handbook-flow .flowchart { max-height: 24cm; }
}
/* ---------- nhắc tên @ ---------- */
.mention { background: var(--lagoon-50); color: var(--lagoon-600); border-radius: 4px; padding: 0 .2em; font-weight: 600; }
.mention-me { background: #fde9b8; color: #6b4300; }
.mention-box { position: absolute; left: var(--mx, 0); top: var(--my, 0); width: var(--mw, 320px); z-index: 1080; list-style: none; margin: 0; padding: .25rem 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 10px 28px rgba(10, 31, 61, .16); max-height: 18rem; overflow-y: auto; }
.mention-box li { padding: .35rem .7rem; cursor: pointer; display: flex; flex-direction: column; line-height: 1.25; }
.mention-box li span { font-size: .78rem; color: var(--muted); }
.mention-box li.is-active, .mention-box li:hover { background: var(--lagoon-50); }
.mention-hint { margin-top: -.25rem; margin-bottom: .4rem; }
/* ---------- chấm công định vị ---------- */
.checkin-geo { margin-top: .3rem; }
.checkin-geo .badge { font-size: .7rem; }
.checkin .geo-map { color: #a2c4ec; }
.checkin-hint { font-size: .8rem; color: #9cb2d1; display: flex; gap: .35rem; align-items: center; }
.checkin-hint .ico { width: 1rem; height: 1rem; flex: none; }
.checkin-geo-msg { margin-top: .6rem; background: rgba(255, 120, 110, .16); color: #ffd6d2; border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; }
.att-geo { margin-top: .15rem; white-space: nowrap; }
.att-geo .badge, .geo-badge { font-size: .68rem; font-weight: 600; }
/* ---------- công tác ---------- */
.trip-flow { list-style: none; padding: 0; margin: 0 0 .75rem; }
.trip-flow li { position: relative; padding: 0 0 .65rem 1.6rem; color: var(--muted); }
.trip-flow li::before { content: ""; position: absolute; left: .3rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; }
.trip-flow li:not(:last-child)::after { content: ""; position: absolute; left: .6rem; top: 1.05rem; bottom: 0; width: 2px; background: var(--line); }
.trip-flow li.is-done { color: var(--text); }
.trip-flow li.is-done::before { background: var(--green); border-color: var(--green); }
.trip-flow li.is-current { color: var(--lagoon-600); font-weight: 600; }
.trip-flow li.is-current::before { border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-50); }
.trip-flow li.is-stop::before { background: var(--red); border-color: var(--red); }

/* ---------- v11: Soạn quy trình bằng khối ---------- */
.view-switch button { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; font-size: .85rem; color: var(--muted); background: none; border: 0; }
.view-switch button + button { border-left: 1px solid var(--line-strong); }
.view-switch button.active { background: var(--lagoon-50); color: var(--lagoon-600); font-weight: 600; }
.view-switch button:focus-visible { outline: 2px solid var(--lagoon); outline-offset: -2px; }
.fb-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.fb-palette { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; min-width: 0; }
.fb-pal-title { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-right: .1rem; }
.fb-pal-sep { margin-left: .5rem; }
.fb-chip { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: .28rem .75rem .28rem .5rem; font-size: .82rem; color: var(--text); cursor: grab; user-select: none; -webkit-user-select: none; transition: box-shadow .15s, border-color .15s; }
.fb-chip:hover { border-color: var(--lagoon); box-shadow: 0 2px 8px rgba(10,31,61,.12); }
.fb-chip:active { cursor: grabbing; }
.fb-chip-decision { background: var(--amber-50); border-color: #e2c48f; }
.fb-chip-document { background: var(--blue-50); border-color: #b7cbe4; }
.fb-chip-preset { border-style: dashed; }
.fb-mini { width: 18px; height: 12px; border: 1.6px solid var(--ink-2); border-radius: 3px; flex: none; background: var(--surface); }
.fb-mini-decision { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 1px; margin: 0 3px; border-color: #b07a26; background: var(--amber-50); }
.fb-mini-document { border-radius: 2px 2px 7px 1px; border-color: var(--blue); background: var(--blue-50); }
.fb-starter { display: flex; align-items: center; gap: .5rem; color: var(--muted); margin: 0; }
.fb-starter span { white-space: nowrap; }
.fb-starter select { max-width: 16rem; }
.fb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.fb-canvas { padding: 1.25rem 1rem 1.75rem; background-color: var(--paper); background-image: radial-gradient(#d2dcea 1px, transparent 1.2px); background-size: 18px 18px;
  min-height: 440px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.fb-term { background: var(--lagoon-50); border: 1.6px solid var(--lagoon); color: var(--ink); border-radius: 999px; padding: .45rem 1.4rem; font-weight: 600; font-size: .86rem;
  text-align: center; max-width: 340px; position: relative; z-index: 1; }
.fb-list { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; min-height: 24px; }
.fb-list.is-empty { min-height: 96px; max-width: 380px; margin-top: 18px; border: 2px dashed var(--line-strong); border-radius: 14px; justify-content: center; background: rgba(255,255,255,.6); }
.fb-list.is-empty::after { content: "Kéo khối từ thanh trên thả vào đây, hoặc bấm + bên dưới"; color: var(--muted); font-size: .85rem; text-align: center; padding: 0 1rem; }
.fb-list > .fb-chip { margin: 14px auto 0; }
.fb-link { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 46px; }
.fb-link::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 40px; margin-left: -1px; background: #7a8ba5; }
.fb-link::after { content: ""; position: absolute; top: 36px; left: 50%; margin-left: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #7a8ba5; }
.fb-ins { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--lagoon); font-weight: 700; font-size: 15px; line-height: 1; padding: 0; opacity: .6; transition: opacity .15s, transform .15s, border-color .15s; }
.fb-link:hover > .fb-ins, .fb-ins:focus-visible { opacity: 1; border-color: var(--lagoon); }
.fb-ins:hover { transform: translateX(-50%) scale(1.15); }
.fb-ins:focus-visible { outline: 3px solid rgba(11,74,143,.35); }
.fb-yes { position: absolute; top: 12px; left: calc(50% + 18px); font-size: .72rem; font-style: italic; color: var(--muted); }
.fb-box { position: relative; width: 100%; max-width: 380px; min-height: 64px; background: var(--surface); border: 1.6px solid var(--line-strong); border-radius: 10px;
  padding: .6rem .9rem .6rem 2.5rem; cursor: pointer; box-shadow: 0 1px 2px rgba(10,31,61,.06); transition: box-shadow .15s, border-color .15s; z-index: 1; }
.fb-box:hover { border-color: var(--lagoon); box-shadow: 0 4px 14px rgba(10,31,61,.12); }
.fb-box:focus-visible { outline: 3px solid rgba(11,74,143,.35); outline-offset: 3px; }
.fb-node.is-selected .fb-box { border-color: var(--lagoon); box-shadow: 0 0 0 3px rgba(11,74,143,.22); }
.fb-node.is-warn .fb-box { border-style: dashed; border-color: #d48a84; }
.fb-body { position: relative; z-index: 1; min-width: 0; }
.fb-no { position: absolute; left: -1.9rem; top: .05rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--ink-2); color: #fff; font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.fb-name { font-weight: 600; font-size: .9rem; line-height: 1.32; overflow-wrap: anywhere; }
.fb-noname { color: var(--red); font-style: italic; font-weight: 500; }
.fb-who, .fb-meta { font-size: .76rem; color: var(--muted); margin-top: .2rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.fb-who .ico { width: 13px; height: 13px; flex: none; }
.fb-warn { color: var(--red); font-weight: 500; }
.fb-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 0; pointer-events: none; }
.fb-shape path { stroke-width: 1.6px; transition: stroke .15s; }
.fb-s-decision .fb-box, .fb-s-document .fb-box { background: transparent; border: 0; box-shadow: none; }
.fb-s-decision .fb-shape path { fill: var(--amber-50); stroke: #c99a52; }
.fb-s-document .fb-shape path { fill: var(--blue-50); stroke: #8cc3df; }
.fb-s-decision .fb-box:hover .fb-shape path, .fb-s-document .fb-box:hover .fb-shape path,
.fb-s-decision.is-selected .fb-shape path, .fb-s-document.is-selected .fb-shape path { stroke: var(--lagoon); stroke-width: 2.4px; }
.fb-node.is-selected .fb-shape { filter: drop-shadow(0 0 4px rgba(11,74,143,.45)); }
.fb-s-decision.is-warn .fb-shape path, .fb-s-document.is-warn .fb-shape path { stroke: #d48a84; stroke-dasharray: 5 4; }
.fb-s-decision .fb-box { max-width: 430px; min-height: 140px; padding: 1.7rem 23%; display: flex; align-items: center; justify-content: center; text-align: center; }
.fb-s-decision .fb-no { position: static; display: inline-flex; margin: 0 auto .2rem; }
.fb-s-decision .fb-who, .fb-s-decision .fb-meta { justify-content: center; }
.fb-s-document .fb-box { padding-bottom: 1.5rem; }
.fb-branch { margin-top: .4rem; font-size: .74rem; color: var(--red); background: var(--red-50); border: 1px dashed #e3a39e; border-radius: 8px; padding: .2rem .6rem; max-width: 380px; text-align: center; }
.fb-ghost { opacity: .35; }
.fb-chosen .fb-box { box-shadow: 0 10px 24px rgba(10,31,61,.2); }
.fb-inspector { border-left: 1px solid var(--line); background: var(--surface); padding: 1rem; min-width: 0; }
.fb-insp-inner { position: sticky; top: calc(var(--top-h) + 12px); }
.fb-insp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.fb-insp-tools { display: flex; gap: .25rem; }
.fb-insp-tools .btn { padding: .15rem .45rem; }
.fb-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.fb-shape-btn { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: .45rem .2rem .35rem; font-size: .76rem; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.fb-shape-btn[aria-pressed="true"] { border-color: var(--lagoon); background: var(--lagoon-50); color: var(--lagoon-600); font-weight: 600; box-shadow: inset 0 0 0 1px var(--lagoon); }
.fb-insp-warn { color: var(--red); min-height: 1.2em; }
.fb-insp-warn:empty { display: none; }
@media (max-width: 991.98px) {
  .fb-layout { grid-template-columns: minmax(0, 1fr); }
  .fb-inspector { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060; max-height: 72vh; overflow-y: auto; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px rgba(10,31,61,.22); transform: translateY(105%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .fb-inspector.is-open { transform: none; visibility: visible; }
  .fb-insp-inner { position: static; }
  .fb-canvas { padding: 1rem .75rem 1.5rem; min-height: 360px; }
  .fb-starter { width: 100%; }
  .fb-starter select { max-width: none; flex: 1; }
  .fb-ins { opacity: 1; }
}
@media (hover: none) { .fb-ins { opacity: 1; } }
@media print { .fb-card { display: none; } }

/* ---------- v11: Dự án ---------- */
.min-w-0 { min-width: 0; }
.proj-c-teal { --pj: #0b6e62; --pj-50: #e4f2ef; }
.proj-c-blue { --pj: #1f6f9e; --pj-50: #e3f1f8; }
.proj-c-green { --pj: #1f7a4d; --pj-50: #e2f3ea; }
.proj-c-amber { --pj: #9a5b0f; --pj-50: #fbf0de; }
.proj-c-red { --pj: #b3261e; --pj-50: #fbe7e5; }
.proj-c-purple { --pj: #6b3fa0; --pj-50: #f0e9f8; }
.proj-c-gray { --pj: #4d5b70; --pj-50: #ecf1f8; }
.proj-tag { display: inline-block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: .72rem; font-weight: 600;
  padding: .05rem .5rem; border-radius: 999px; color: var(--pj); background: var(--pj-50); border: 1px solid var(--pj); text-decoration: none; line-height: 1.5; }
a.proj-tag:hover { background: var(--pj); color: #fff; }
.kb-proj { margin: -.15rem 0 .3rem; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.proj-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--pj); border-radius: var(--radius); padding: .9rem 1rem;
  box-shadow: 0 1px 2px rgba(10,31,61,.05); transition: box-shadow .15s, transform .15s; }
.proj-card:hover { box-shadow: 0 6px 20px rgba(10,31,61,.12); transform: translateY(-1px); }
.proj-code { font-size: .72rem; font-weight: 700; letter-spacing: .03em; color: var(--pj); text-transform: uppercase; }
.proj-name { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.proj-bar { height: 7px; border-radius: 7px; background: #e1e8f2; overflow: hidden; }
.proj-bar span { display: block; height: 100%; background: var(--pj, var(--lagoon)); border-radius: 7px; }
.proj-bar-lg { height: 10px; }
.proj-people { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; position: relative; z-index: 2; }
.proj-people .avatar { border: 2px solid var(--surface); }
.proj-owner { box-shadow: 0 0 0 2px var(--pj); }
.proj-head { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--pj); border-radius: var(--radius); padding: 1rem 1.1rem; }
.proj-prog-cell { min-width: 6rem; }
.proj-swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.proj-swatch { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: .2rem .7rem .2rem .3rem; cursor: pointer; font-size: .82rem; }
.proj-swatch input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--pj); margin: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--pj); }
.proj-swatch input:checked { box-shadow: 0 0 0 2px var(--pj), 0 0 0 4px var(--pj-50); }
.proj-swatch:has(input:checked) { border-color: var(--pj); background: var(--pj-50); font-weight: 600; }
.proj-swatch input:focus-visible { outline: 2px solid var(--pj); outline-offset: 2px; }
.member-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25rem .75rem; max-height: 320px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .75rem; background: var(--surface); }
.member-opt { display: flex; align-items: center; gap: .45rem; padding: .2rem .25rem; border-radius: 6px; cursor: pointer; font-size: .88rem; min-width: 0; }
.member-opt:hover { background: var(--paper); }
.member-opt > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-node.is-selected.fb-s-decision .fb-box, .fb-node.is-selected.fb-s-document .fb-box { box-shadow: none; }
.fb-who { flex-wrap: nowrap; align-items: flex-start; }
.fb-who .ico { margin-top: .15rem; }
.fb-who > span { min-width: 0; }
.fb-node { scroll-margin-top: calc(var(--top-h) + 8px); }

/* ---------- v12: Phân quyền module ---------- */
.mod-wrap { max-height: 72vh; }
.mod-table thead th { position: sticky; top: 0; z-index: 2; background: #f3f6fb; vertical-align: bottom; }
.mod-table th.mod-emp, .mod-table td.mod-emp { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 13rem; max-width: 17rem; box-shadow: 1px 0 0 var(--line); }
.mod-table thead th.mod-emp { z-index: 3; background: #f3f6fb; }
.mod-col { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; border: 0; background: none; padding: .2rem .25rem; font-size: .76rem; font-weight: 600;
  color: var(--ink); line-height: 1.2; min-width: 3.6rem; max-width: 5.6rem; border-radius: 6px; }
button.mod-col:hover { background: var(--lagoon-50); color: var(--lagoon-600); }
.mod-col .ico { width: 18px; height: 18px; }
.mod-col small { font-weight: 400; color: var(--muted); }
.mod-chk { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.mod-prod { min-width: 7.2rem; }
.mod-table td, .mod-table th { padding-left: .3rem; padding-right: .3rem; }
.mod-admin td { background: var(--paper); }
.mod-rowbtn { font-size: .74rem; white-space: nowrap; }
.mod-foot { position: sticky; bottom: 0; background: var(--surface); z-index: 2; }

/* ---------- v12: Tài liệu đính kèm lệnh sản xuất ---------- */
.prod-files { border-top: 1px solid var(--line); padding-top: .75rem; }
.pf-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .4rem; }
.pf-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.pf-thumb { flex: none; width: 46px; height: 46px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--paper); }
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pf-ext { font-size: .66rem; font-weight: 700; letter-spacing: .03em; color: #fff; background: var(--ink-2); }
.pf-ext-pdf { background: #b3261e; }
.pf-ext-cad { background: #1f6f9e; }
.pf-ext-xls { background: #1f7a4d; }
.pf-ext-doc { background: #2b579a; }
.pf-ext-zip { background: #7a5b16; }
.pf-info { flex: 1; }
.pf-name { display: block; font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-upload { background: var(--paper); border-radius: var(--radius-sm); padding: .6rem; }

/* ---------- v13: Hợp đồng lao động ---------- */
.hd-doc { font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.55; color: #111; }
.hd-paper { background: #fff; max-width: 820px; margin: 0 auto; padding: 2.2rem 2.6rem; border: 1px solid var(--line); box-shadow: 0 2px 14px rgba(10,31,61,.08); }
.hd-doc p { margin: 0 0 .55rem; text-align: justify; }
.hd-doc .hd-center { text-align: center; margin: 0; }
.hd-doc .hd-title { text-align: center; font-size: 1.35rem; font-weight: 700; margin: 1.1rem 0 .2rem; font-family: inherit; }
.hd-doc .hd-h { font-size: 1rem; font-weight: 700; margin: .9rem 0 .35rem; font-family: inherit; }
.hd-doc ul { margin: 0 0 .55rem; padding-left: 1.3rem; }
.hd-doc li { margin-bottom: .2rem; text-align: justify; }
.hd-var { background: #fff3c4; border-radius: 2px; padding: 0 .1rem; }
.hd-paper .hd-var { background: transparent; padding: 0; }
.hd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: center; margin-top: 1.6rem; }
.hd-sig-img { display: block; width: 220px; max-width: 100%; height: auto; margin: .3rem auto; }
.hd-sig-blank { min-height: 80px; padding-top: .4rem; font-style: italic; font-size: .85rem; color: #555; }
.hd-sig-meta { font-size: .72rem; color: #555; line-height: 1.35; margin-top: .2rem; }
.hd-foot { font-size: .72rem !important; color: #666; border-top: 1px solid #ddd; padding-top: .5rem; margin-top: 1.4rem !important; }
.hd-vars { display: flex; flex-wrap: wrap; gap: .3rem; }
.hd-vars .btn { font-size: .72rem; padding: .1rem .45rem; }
.hd-editor { font-size: .8rem; line-height: 1.45; }
.sign-pad { display: block; width: 100%; max-width: 600px; aspect-ratio: 3 / 1; height: auto; background: #fff; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  touch-action: none; cursor: crosshair; }
@media (max-width: 575.98px) { .hd-paper { padding: 1.1rem .9rem; } .hd-doc { font-size: 14px; } }
@media print {
  .hd-paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .hd-doc { font-size: 13pt; }
}
.fb-link-flag { margin-top: .25rem; font-size: .72rem; font-weight: 600; color: #8a5a00; background: #fff3c4; border-radius: 99px; padding: .05rem .5rem; display: inline-block; }
.link-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem 1rem .9rem; background: var(--paper); }
.link-box legend { float: none; width: auto; font-size: .9rem; font-weight: 600; padding: 0 .4rem; margin: 0; color: var(--ink); }
.link-lines td { vertical-align: middle; }
.link-card { border: 1px solid #f0d78a; background: #fffbeb; border-radius: var(--radius-sm); padding: .75rem 1rem; }

/* ===== v14: Màn hình điều hành ===== */
.exec-jump { display: flex; flex-wrap: wrap; gap: .4rem; }
.exec-jump a { font-size: .82rem; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); text-decoration: none; }
.exec-jump a:hover { border-color: var(--lagoon); color: var(--lagoon-600); }
.exec-sec { scroll-margin-top: calc(var(--top-h) + 12px); }
#retention, #stock, #pending { scroll-margin-top: calc(var(--top-h) + 12px); }
.cf-axis-strong { fill: var(--ink-2); font-weight: 600; }
.exec-bal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.exec-bal-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .6rem; font-variant-numeric: tabular-nums; min-width: 0; }
.exec-bal-item .num { text-align: left; overflow-wrap: anywhere; }
.exec-bal-item.neg { border-color: var(--red); background: var(--red-50); }
@media (max-width: 575.98px) { .exec-bal { grid-template-columns: repeat(2, minmax(0, 1fr)); } .exec-bal-item:first-child { grid-column: 1 / -1; } }
.exec-debt th:first-child { min-width: 11rem; white-space: nowrap; }
.exec-debt td { white-space: nowrap; }
.exec-late td:first-child { min-width: 12rem; }
.exec-prog-col { width: 8rem; min-width: 7rem; }
.exec-people { display: flex; flex-wrap: wrap; gap: .5rem; }
.exec-person { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem .6rem; color: var(--text); text-decoration: none; min-width: 9rem; }
.exec-person:hover { border-color: var(--lagoon); }
.exec-person .badge { margin-left: .4rem; }
.exec-profit td, .exec-profit th { white-space: nowrap; }
.exec-profit td:first-child { white-space: normal; min-width: 13rem; }
.exec-profit thead th.exec-grp { border-bottom: 1px solid var(--line-strong); }
.exec-profit { font-size: .86rem; }
.exec-profit td, .exec-profit th { padding-left: .4rem; padding-right: .4rem; }
/* Điện thoại: bảng trong màn hình điều hành cuộn ngang trong khung thay vì bóp chữ thành cột hẹp */
.exec-sec .table td.num, .exec-sec .table th.num { white-space: nowrap; }
@media (max-width: 767.98px) {
  .exec-sec .table td:first-child, .exec-sec .table th:first-child { min-width: 9.5rem; }
  .exec-sec .table td:not(.num):not(:first-child) { min-width: 7rem; }
  .exec-plans .table td:nth-child(2) { min-width: 11rem; }
}

/* ===== v15: Công văn đến – đi ===== */
.doc-info th { width: 9.5rem; font-weight: 600; color: var(--muted); }
.doc-ext { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 1.9rem; border-radius: 6px; background: var(--blue-50); color: var(--blue); font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.doc-results { position: absolute; left: calc(var(--bs-gutter-x) * .5); right: calc(var(--bs-gutter-x) * .5); top: 100%; z-index: 20; max-height: 16rem; overflow-y: auto; box-shadow: 0 6px 18px rgba(10,31,61,.14); }
.doc-pick { max-height: 11rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .25rem; display: block; }
.doc-unseen td:first-child { box-shadow: inset 3px 0 0 var(--lagoon); }
.doc-unseen td:nth-child(3) a { font-weight: 600; }
.doc-table td:nth-child(3) { min-width: 15rem; }
.doc-table td:nth-child(2) { min-width: 9rem; }
.doc-directive { border-left: 3px solid var(--amber); }
.doc-log li { line-height: 1.4; }
.doc-q { min-width: 12rem; }
.doc-steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; counter-reset: st; }
.doc-steps li { counter-increment: st; flex: 1 1 8rem; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .6rem; background: var(--surface); }
.doc-steps li span::before { content: counter(st) ". "; color: var(--muted); }
.doc-steps li span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); }
.doc-steps li small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-steps li.done { border-color: var(--green); background: var(--green-50); }
.doc-steps li.done span { color: var(--green); }
.doc-steps li.cur { border-color: var(--amber); background: var(--amber-50); }
.doc-steps li.cur span { color: var(--amber); }
.doc-box .list-group-item { overflow-wrap: anywhere; }
details.card > summary { cursor: pointer; }
.ot-reason { min-width: 13rem; }
.ot-state { min-width: 8.5rem; }
.privacy-text { white-space: normal; line-height: 1.55; }
.sel-shrink { max-width: min(100%, 22rem); min-width: 0; }
form.d-flex:has(> .sel-shrink) { min-width: 0; max-width: 100%; }
/* Ô tìm kiếm chung trên thanh trên cùng (v16.2) */
.shell-search { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); height: 34px; flex: 0 1 15rem; min-width: 0; }
.shell-search input { border: 0; background: transparent; padding: 0 .55rem; font-size: .88rem; min-width: 0; width: 100%; height: 100%; color: var(--text); outline: none; }
.shell-search button { border: 0; background: transparent; color: var(--muted); padding: 0 .5rem; line-height: 0; height: 100%; }
.shell-search:focus-within { border-color: var(--lagoon); }
@media (max-width: 575.98px) { .shell-search { flex-basis: 6.5rem; } .shell-search input::placeholder { color: transparent; } }
.xc-card .list-group-item a { text-decoration: none; }
/* Hợp đồng bán hàng (v16.3) */
.sc-steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; counter-reset: sc; }
.sc-steps li { counter-increment: sc; flex: 1 1 9rem; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .65rem; background: var(--surface); font-size: .86rem; font-weight: 600; color: var(--muted); }
.sc-steps li::before { content: counter(sc) ". "; }
.sc-steps li.done { border-color: var(--green); background: var(--green-50); color: var(--green); }
.sc-steps li.done::before { content: "✓ "; }
.sc-steps li.cur { border-color: var(--amber); background: var(--amber-50); color: var(--amber); }

/* ---- Công trình (v16.4) ---- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.site-card { border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.site-card:hover { border-color: var(--lagoon); box-shadow: 0 2px 10px rgba(11, 74, 143, .08); }
.site-prog .proj-bar + .proj-bar { margin-top: 3px; }
.proj-bar-acc span { background: var(--green); }
.proj-bar-over span { background: var(--red); }
.site-tabs .nav-link { padding: .45rem .75rem; font-size: .9rem; }
.site-items-table td:nth-child(1) { min-width: 5.5rem; }
.site-items-table td:nth-child(2) { min-width: 15rem; }
.site-items-table td:nth-child(3) { min-width: 4.5rem; }
.site-items-table td:nth-child(4), .site-items-table td:nth-child(5) { min-width: 7.5rem; }
.site-budget-table td:nth-child(1) { min-width: 8.5rem; }
.site-budget-table td:nth-child(2) { min-width: 9rem; }
.site-budget-table td:nth-child(3), .site-budget-table td:nth-child(4) { min-width: 12rem; }
.site-budget-table td:nth-child(6), .site-budget-table td:nth-child(7) { min-width: 7rem; }
.site-qty-in { min-width: 8.5rem; width: 9.5rem; }
.site-photos { display: flex; flex-wrap: wrap; gap: .6rem; }
.site-photos figure { margin: 0; width: 132px; }
.site-photos .pf-thumb { width: 132px; height: 100px; }
.site-events { max-height: 520px; overflow-y: auto; }
.site-gantt-wrap { overflow-x: auto; }
.site-gantt { width: 100%; min-width: 620px; height: auto; font-family: inherit; }
.site-gantt .g-label { font-size: 11px; fill: var(--text); }
.site-gantt .g-month { font-size: 10px; fill: var(--muted); }
.site-gantt .g-grid { stroke: var(--line); stroke-width: 1; }
.site-gantt .g-today { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 2; }
.site-gantt .g-bar { fill: var(--blue); }
.site-gantt .g-bar.g-done { fill: var(--green); }
.site-gantt .g-bar.g-late { fill: var(--red); }
.site-gantt .g-bar.g-cancel { fill: var(--line-strong); }
.site-gantt .g-prog { fill: var(--ink); opacity: .55; }
.site-gantt a:hover .g-label { fill: var(--lagoon); text-decoration: underline; }
.g-key { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin: 0 .2rem 0 .6rem; background: var(--blue); }
.g-key.g-done { background: var(--green); }
.g-key.g-late { background: var(--red); }
.site-print-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .5rem; }
.site-print-photos img { width: 31%; max-height: 170px; object-fit: cover; border: 1px solid var(--line); }
@media print { .site-print-log { break-inside: avoid; } }
.site-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.site-tabs .nav-link { white-space: nowrap; }
@media (max-width: 575.98px) {
  .site-stats .stat { padding: .7rem .75rem; }
  .site-stats .stat-value { font-size: 1.12rem; overflow-wrap: anywhere; }
}
.site-req-table td:nth-child(1) { min-width: 15rem; }
.site-req-table td:nth-child(2) { min-width: 5.5rem; width: 7rem; }
.site-req-table td:nth-child(3) { min-width: 8rem; }
.site-print-table td:nth-child(2) { min-width: 14rem; }
.site-print-table th { font-size: .78rem; vertical-align: bottom; }
/* ---------- Mua hàng (v16.5) ---------- */
.pur-lines-table td:nth-child(2) { min-width: 15rem; }
.pur-lines-table td:nth-child(1) { min-width: 7rem; }
.pur-qty-in { min-width: 6rem; width: 7.5rem; }
.pur-price-in { min-width: 8rem; width: 9.5rem; }
.pur-compare th, .pur-compare td { white-space: nowrap; }
.pur-compare td:first-child { white-space: normal; min-width: 12rem; }
.pur-compare .pur-min { color: var(--green); font-weight: 600; }
.pur-compare .pur-sel { background: var(--green-50); }
/* ---------- Tài sản, máy móc (v16.5) ---------- */
.asset-facts b { color: var(--ink); }
.asset-photo { max-width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; margin: 0 auto; }
.asset-qr { width: 132px; height: 132px; image-rendering: pixelated; display: block; margin: 0 auto .25rem; }
.asset-actions details > summary { cursor: pointer; list-style: none; }
.asset-actions details > summary::-webkit-details-marker { display: none; }
.asset-actions details > summary::before { content: "▸ "; }
.asset-actions details[open] > summary::before { content: "▾ "; }
.asset-gallery { display: flex; flex-wrap: wrap; gap: 6px; }
.asset-gallery img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.asset-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.asset-labels-big { grid-template-columns: repeat(2, 1fr); }
.asset-label { display: flex; gap: 3mm; align-items: center; border: 1px dashed var(--line-strong); border-radius: 3mm; padding: 2.5mm; background: #fff; break-inside: avoid; page-break-inside: avoid; min-width: 0; }
.asset-label img { width: 24mm; height: 24mm; flex: 0 0 auto; image-rendering: pixelated; }
.asset-labels-big .asset-label img { width: 34mm; height: 34mm; }
.asset-label-text { min-width: 0; line-height: 1.25; color: #000; }
.asset-label-co { font-size: 7pt; text-transform: uppercase; letter-spacing: .02em; }
.asset-label-code { font-size: 12pt; font-weight: 700; }
.asset-labels-big .asset-label-code { font-size: 15pt; }
.asset-label-name { font-size: 8pt; overflow-wrap: anywhere; }
.asset-label-sn { font-size: 7pt; }
@media (max-width: 575.98px) { .asset-labels, .asset-labels-big { grid-template-columns: 1fr; } }
@media print { .asset-labels { grid-template-columns: repeat(3, 1fr); } .asset-labels-big { grid-template-columns: repeat(2, 1fr); } .asset-label { border-color: #999; } }

/* ---------- Kinh doanh BĐS (v17) ---------- */
:root {
  --u-locked: #eef1f5;    --u-locked-b: #c3ccd9;    --u-locked-t: #7a8699;
  --u-available: #dff3e7; --u-available-b: #59b37f; --u-available-t: #155c36;
  --u-reserved: #fdecc8;  --u-reserved-b: #e0a33b;  --u-reserved-t: #7a4609;
  --u-deposited: #d6edf7; --u-deposited-b: #3f9cc0; --u-deposited-t: #1b5670;
  --u-contracted: #0b4a8f; --u-contracted-b: #0b4a8f; --u-contracted-t: #fff;
  --u-handed_over: #34557f; --u-handed_over-b: #34557f; --u-handed_over-t: #fff;
  --u-certified: #6b7f99; --u-certified-b: #6b7f99; --u-certified-t: #fff;
}
.bds-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05rem; border: 1px solid transparent; }
.bds-dot.u-locked, .bds-bar .u-locked { background: var(--u-locked); border-color: var(--u-locked-b); }
.bds-dot.u-available, .bds-bar .u-available { background: var(--u-available-b); }
.bds-dot.u-reserved, .bds-bar .u-reserved { background: var(--u-reserved-b); }
.bds-dot.u-deposited, .bds-bar .u-deposited { background: var(--u-deposited-b); }
.bds-dot.u-contracted, .bds-bar .u-contracted { background: var(--u-contracted); }
.bds-dot.u-handed_over, .bds-bar .u-handed_over { background: var(--u-handed_over); }
.bds-dot.u-certified, .bds-bar .u-certified { background: var(--u-certified); }
.bds-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); }
.bds-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); gap: 1px; }
.bds-bar span { display: block; min-width: 3px; }

.bds-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.bds-proj-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); text-decoration: none; }
.bds-proj-card:hover { border-color: var(--lagoon); box-shadow: 0 2px 10px rgba(10, 31, 61, .08); color: var(--text); }

.bds-stat .stat-value { font-size: 1.3rem; }
.bds-block { margin-bottom: 1.5rem; }
.bds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.bds-cell { display: flex; flex-direction: column; gap: 1px; padding: .45rem .5rem; border-radius: 7px; border: 1px solid; text-decoration: none; line-height: 1.2; min-height: 64px;
  font-variant-numeric: tabular-nums; transition: transform .08s ease; }
.bds-cell:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(10, 31, 61, .16); }
.bds-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bds-cell-code { font-weight: 700; font-size: .86rem; }
.bds-cell-meta { font-size: .72rem; opacity: .85; }
.bds-cell-price { font-size: .76rem; font-weight: 600; margin-top: auto; }
.bds-cell.u-locked { background: var(--u-locked); border-color: var(--u-locked-b); color: var(--u-locked-t); border-style: dashed; }
.bds-cell.u-available { background: var(--u-available); border-color: var(--u-available-b); color: var(--u-available-t); }
.bds-cell.u-reserved { background: var(--u-reserved); border-color: var(--u-reserved-b); color: var(--u-reserved-t); }
.bds-cell.u-deposited { background: var(--u-deposited); border-color: var(--u-deposited-b); color: var(--u-deposited-t); }
.bds-cell.u-contracted { background: var(--u-contracted); border-color: var(--u-contracted-b); color: var(--u-contracted-t); }
.bds-cell.u-handed_over { background: var(--u-handed_over); border-color: var(--u-handed_over-b); color: var(--u-handed_over-t); }
.bds-cell.u-certified { background: var(--u-certified); border-color: var(--u-certified-b); color: var(--u-certified-t); }
.bds-cell.is-expired { box-shadow: inset 0 0 0 2px var(--red); }

.bds-steps { display: flex; list-style: none; padding: 0; margin: 0; counter-reset: st; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bds-steps li { flex: 1; position: relative; padding: .6rem .8rem .55rem 2.3rem; font-size: .86rem; color: var(--muted); counter-increment: st; border-right: 1px solid var(--line); min-width: 0; }
.bds-steps li:last-child { border-right: 0; }
.bds-steps li::before { content: counter(st); position: absolute; left: .7rem; top: .62rem; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--line); color: var(--muted);
  font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bds-steps li span { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bds-steps li small { display: block; font-size: .74rem; min-height: 1em; }
.bds-steps li.done { color: var(--text); }
.bds-steps li.done::before { content: "✓"; background: var(--green); color: #fff; }
.bds-steps li.current { background: var(--lagoon-50); color: var(--ink); }
.bds-steps li.current::before { background: var(--lagoon); color: #fff; }
@media (max-width: 767.98px) {
  .bds-steps { flex-direction: column; }
  .bds-steps li { border-right: 0; border-bottom: 1px solid var(--line); }
  .bds-steps li:last-child { border-bottom: 0; }
}

.bds-calc td { padding: .3rem .25rem; }
.bds-chart { display: flex; align-items: stretch; gap: 6px; height: 180px; }
.bds-chart-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bds-chart-bars { height: 156px; flex: none; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line-strong); }
.bds-chart-bars span { width: 42%; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; }
.bds-chart-bars .b-s { background: var(--u-contracted); }
.bds-chart-bars .b-c { background: var(--u-available-b); }
.bds-chart-lbl { text-align: center; font-size: .72rem; color: var(--muted); padding-top: .2rem; }
@media print { .bds-cell { border-color: #999 !important; } }
@media (max-width: 575.98px) { .bds-stat { padding: .55rem .6rem; } .bds-stat .stat-label { font-size: .74rem; } .bds-stat .stat-value { font-size: 1.1rem; } }
.bds-narrow { max-width: 640px; }
.bds-w2 { width: 2rem; } .bds-w3 { width: 3rem; } .bds-w7 { width: 7rem; } .bds-w9 { width: 9rem; } .bds-w32p { width: 32%; } .bds-w45p { width: 45%; }
