/* ═══════════════════════════════════════════════════════════════════════
   NGHIỆM THU TRIỂN KHAI — /pms/config/nghiem-thu (07/10/2026)
   Tiền tố nt- . Token khai trên .nt-page (⛔ :root). Thẻ số liệu: vạch ĐỈNH (⛔ vạch trái).
   ═══════════════════════════════════════════════════════════════════════ */
/* Token khai cho CẢ .nt-overlay: hộp thoại render NGOÀI .nt-page ⇒ thiếu dòng này là mọi var(--nt-*)
   trong hộp rỗng (ô nhập mất viền, nút Lưu chữ trắng trên nền trong suốt). */
.nt-page, .nt-overlay {
    --nt-bg: var(--ez-bg, #faf6f0);
    --nt-surface: #fff;
    --nt-line: #e7e0d5;
    --nt-line-soft: #f0ebe3;
    --nt-ink: #2a2520;
    --nt-ink-soft: #6b6258;
    --nt-brand: #b8742a;
    --nt-ok: #12a66b;
    --nt-ok-bg: #e4f5ec;
    --nt-bad: #d64545;
    --nt-bad-bg: #fbe9e9;
    --nt-warn: #c98a12;
    --nt-warn-bg: #fdf3dc;
    --nt-mute: #8b8378;
    --nt-mute-bg: #f1eee9;
    --nt-info: #2f6fca;
    --nt-info-bg: #e7f0fc;
}
.nt-page {
    background: var(--ez-bg, var(--nt-bg));
    color: var(--nt-ink, #2a2520);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100%;
    padding: 18px 20px 40px;
}

.nt-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.nt-title { font-family: var(--rpt-font-display, 'Inter'); font-size: var(--rpt-title, 22px); font-weight: 600; }
.nt-title .dia { color: var(--nt-brand, #b8742a); margin-right: 6px; }
.nt-sub { color: var(--nt-ink-soft, #6b6258); font-size: 13px; margin-top: 4px; max-width: 760px; }
.nt-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.nt-btn {
    border: 1px solid var(--nt-line, #e7e0d5); background: var(--nt-surface, #fff); color: var(--nt-ink, #2a2520);
    border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.nt-btn:hover:not(:disabled) { border-color: var(--nt-brand, #b8742a); }
.nt-btn:disabled { opacity: .5; cursor: not-allowed; }
.nt-btn.primary { background: var(--nt-brand, #b8742a); border-color: var(--nt-brand, #b8742a); color: #fff; }
.nt-btn.danger { color: var(--nt-bad, #d64545); border-color: #efc3c3; }
.nt-btn.sm { padding: 4px 9px; font-size: 12px; }

.nt-in, .nt-ta, .nt-sel {
    width: 100%; box-sizing: border-box; border: 1px solid var(--nt-line, #e7e0d5); border-radius: 7px;
    background: #fff; color: var(--nt-ink, #2a2520); padding: 7px 9px; font-size: 13px; font-family: inherit;
}
.nt-ta { min-height: 64px; resize: vertical; }
.nt-in:focus, .nt-ta:focus, .nt-sel:focus { outline: none; border-color: var(--nt-brand, #b8742a); box-shadow: 0 0 0 3px rgba(184, 116, 42, .14); }
.nt-lbl { display: block; font-size: 12px; color: var(--nt-ink-soft, #6b6258); font-weight: 600; margin-bottom: 4px; }
.nt-field { margin-bottom: 10px; min-width: 0; }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }

.nt-note { padding: 10px 12px; border-radius: 8px; font-size: 13px; background: var(--nt-mute-bg, #f1eee9); border: 1px solid var(--nt-line, #e7e0d5); margin-bottom: 12px; }
.nt-note.bad { background: var(--nt-bad-bg, #fbe9e9); border-color: #f0c4c4; color: #8f2424; }
.nt-note.ok { background: var(--nt-ok-bg, #e4f5ec); border-color: #b9e3cc; color: #0c6b45; }
.nt-note.warn { background: var(--nt-warn-bg, #fdf3dc); border-color: #f0d9a5; color: #7a5208; }

.nt-card { background: var(--nt-surface, #fff); border: 1px solid var(--nt-line, #e7e0d5); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.nt-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.nt-card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }

/* Thẻ số liệu — vạch ĐỈNH 3px, nền nhạt */
.nt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.nt-kpi { position: relative; background: var(--nt-surface, #fff); border: 1px solid var(--nt-line, #e7e0d5); border-radius: 10px; padding: 12px 14px 10px; overflow: hidden; }
.nt-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k, var(--nt-brand, #b8742a)); }
.nt-kpi .l { font-size: 12px; color: var(--nt-ink-soft, #6b6258); font-weight: 600; }
.nt-kpi .v { font-size: 22px; font-weight: 700; color: var(--k, var(--nt-ink, #2a2520)); margin-top: 2px; font-variant-numeric: tabular-nums; }
.nt-kpi .d { font-size: 11.5px; color: var(--nt-ink-soft, #6b6258); }
.nt-kpi.ok { --k: var(--nt-ok, #12a66b); } .nt-kpi.bad { --k: var(--nt-bad, #d64545); } .nt-kpi.warn { --k: var(--nt-warn, #c98a12); } .nt-kpi.info { --k: var(--nt-info, #2f6fca); }

/* Nhãn trạng thái */
.nt-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.nt-pill.ok { background: var(--nt-ok-bg, #e4f5ec); color: #0c6b45; border-color: #b9e3cc; }
.nt-pill.bad { background: var(--nt-bad-bg, #fbe9e9); color: #8f2424; border-color: #f0c4c4; }
.nt-pill.warn { background: var(--nt-warn-bg, #fdf3dc); color: #7a5208; border-color: #f0d9a5; }
.nt-pill.info { background: var(--nt-info-bg, #e7f0fc); color: #1d4f99; border-color: #c4d8f3; }
.nt-pill.mute { background: var(--nt-mute-bg, #f1eee9); color: var(--nt-ink-soft, #6b6258); border-color: var(--nt-line, #e7e0d5); }

/* Bảng */
.nt-table-wrap { overflow-x: auto; }
.nt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nt-table th { text-align: left; font-size: 12px; color: var(--nt-ink-soft, #6b6258); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--nt-line, #e7e0d5); background: #fbf9f6; white-space: nowrap; }
.nt-table td { padding: 9px 10px; border-bottom: 1px solid var(--nt-line-soft, #f0ebe3); vertical-align: top; }
.nt-table tr.click { cursor: pointer; }
.nt-table tr.click:hover td { background: #fbf7f0; }
.nt-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-code { font-family: var(--rpt-font-mono, 'Inter'); font-size: 12px; color: var(--nt-ink-soft, #6b6258); white-space: nowrap; }
.nt-crit { color: var(--nt-bad, #d64545); font-weight: 700; margin-left: 3px; }
.nt-muted { color: var(--nt-ink-soft, #6b6258); font-size: 12px; }
.nt-how { color: var(--nt-ink-soft, #6b6258); font-size: 12px; margin-top: 3px; }
.nt-how b { color: var(--nt-ink, #2a2520); font-weight: 600; }

/* Thanh tab bộ phận — xuống dòng, ⛔ cuộn ngang */
.nt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.nt-tab { border: 1px solid var(--nt-line, #e7e0d5); background: var(--nt-surface, #fff); border-radius: 8px; padding: 7px 11px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.nt-tab.on { border-color: var(--nt-brand, #b8742a); box-shadow: inset 0 -2px 0 var(--nt-brand, #b8742a); font-weight: 600; }
.nt-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nt-mute, #8b8378); }
.nt-tab .dot.ok { background: var(--nt-ok, #12a66b); } .nt-tab .dot.bad { background: var(--nt-bad, #d64545); } .nt-tab .dot.warn { background: var(--nt-warn, #c98a12); } .nt-tab .dot.info { background: var(--nt-info, #2f6fca); }

/* Ba nút kết quả */
.nt-seg { display: inline-flex; border: 1px solid var(--nt-line, #e7e0d5); border-radius: 8px; overflow: hidden; }
.nt-seg button { border: 0; background: #fff; padding: 5px 9px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--nt-ink-soft, #6b6258); border-right: 1px solid var(--nt-line, #e7e0d5); white-space: nowrap; }
.nt-seg button:last-child { border-right: 0; }
.nt-seg button:disabled { cursor: not-allowed; opacity: .55; }
.nt-seg button.on.ok { background: var(--nt-ok, #12a66b); color: #fff; }
.nt-seg button.on.bad { background: var(--nt-bad, #d64545); color: #fff; }
.nt-seg button.on.mute { background: var(--nt-mute, #8b8378); color: #fff; }

.nt-res-detail { margin-top: 6px; font-size: 12.5px; }
.nt-res-detail .r { color: #8f2424; }
.nt-res-detail .e { color: var(--nt-ink-soft, #6b6258); }

/* Hộp thoại */
.nt-overlay { position: fixed; inset: 0; background: rgba(30, 24, 18, .45); display: flex; align-items: center; justify-content: center; z-index: 1050; padding: 16px; }
.nt-modal { background: #fff; border-radius: 12px; width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--nt-ink, #2a2520); font-family: 'Inter', system-ui, sans-serif; }
.nt-modal.lg { width: min(860px, 100%); }
.nt-modal-h { padding: 14px 18px; border-bottom: 1px solid #ece5da; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nt-modal-h h4 { margin: 0; font-size: 16px; font-weight: 600; }
.nt-modal-b { padding: 14px 18px; overflow-y: auto; flex: 1; }
.nt-modal-f { padding: 12px 18px; border-top: 1px solid #ece5da; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.nt-x { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: #8b8378; line-height: 1; }
.nt-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.nt-checks label { display: flex; gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid #e7e0d5; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* Nhật ký */
.nt-log { border-bottom: 1px solid var(--nt-line-soft, #f0ebe3); padding: 9px 0; font-size: 13px; }
.nt-log .t { color: var(--nt-ink-soft, #6b6258); font-size: 12px; }
.nt-log ul { margin: 4px 0 0 0; padding-left: 18px; }
.nt-log .old { color: #8f2424; text-decoration: line-through; }
.nt-log .new { color: #0c6b45; }
.nt-log .staff { background: var(--nt-info-bg, #e7f0fc); color: #1d4f99; border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 600; margin-left: 4px; }

/* ── BẢN IN BIÊN BẢN ─────────────────────────────────────────────────── */
.nt-doc { display: none; }
@media print {
    .nt-page { padding: 0; background: #fff; }
    .nt-screen { display: none !important; }
    .nt-doc { display: block; color: #000; font-family: 'Inter', Arial, sans-serif; font-size: 11pt; }
    .nt-doc h1 { font-size: 15pt; text-align: center; margin: 6px 0 2px; text-transform: uppercase; }
    .nt-doc .doc-code { text-align: center; font-size: 10pt; margin-bottom: 10px; }
    .nt-doc .nat { text-align: center; font-weight: 700; font-size: 11pt; }
    .nt-doc .nat2 { text-align: center; font-size: 10.5pt; margin-bottom: 10px; }
    .nt-doc .nat2 span { border-bottom: 1px solid #000; padding-bottom: 1px; }
    .nt-doc h2 { font-size: 11.5pt; margin: 12px 0 5px; text-transform: uppercase; }
    .nt-doc h3 { font-size: 11pt; margin: 10px 0 4px; }
    .nt-doc p { margin: 3px 0; }
    .nt-doc table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
    .nt-doc th, .nt-doc td { border: 1px solid #555; padding: 3px 5px; font-size: 9.5pt; vertical-align: top; text-align: left; }
    .nt-doc th { background: #e4e4e4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .nt-doc td.c, .nt-doc th.c { text-align: center; }
    .nt-doc tr { break-inside: avoid; }
    .nt-doc .dept { break-inside: auto; }
    .nt-doc .verdict { font-weight: 700; }
    .nt-doc .sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; break-inside: avoid; text-align: center; }
    .nt-doc .sign-grid .role { font-weight: 700; text-transform: uppercase; font-size: 10.5pt; }
    .nt-doc .sign-grid .hint { font-style: italic; font-size: 9pt; }
    .nt-doc .sign-grid .space { height: 70px; }
    .nt-doc .foot { margin-top: 14px; font-size: 8.5pt; color: #333; border-top: 1px solid #999; padding-top: 4px; }
}

@media (max-width: 959px) {
    .nt-page { padding: 12px 12px 90px; }
    .nt-table .hide-m { display: none; }
}
