/* Quản lý khách hàng: bổ sung trên nền giao diện phần mềm nội bộ */
.hello { margin: 4px 0 16px; }
.hello-date { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hello h1 { margin: 2px 0 0; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.stat b.sm { font-size: 15px; line-height: 1.35; font-family: "Be Vietnam Pro", system-ui, sans-serif; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.chip.warn.on, .chip.warn { border-color: #e0a200; }
.chip.warn.on { background: #fff3b0; color: #7a5c1c; }
.tag.st { font-weight: 700; }
.tag.st.ok { background: var(--green-bg); color: var(--green); }
.tag.st.lead { background: var(--blue-bg); color: var(--link); }
.tag.st.pause { background: var(--amber-bg); color: var(--amber); }
.tag.st.off { background: #eef0f4; color: #6b7280; }
.crumbs { margin: 0 0 2px; font-size: 13px; }
.crumbs .code { font-family: Consolas, monospace; color: var(--muted); }
.card.form > label { display: block; margin: 14px 0 0; }
.card.form > label textarea, .card.form > label input { margin-top: 5px; }
.card.form > h2 { margin-top: 18px; }
.card.form > h2:first-of-type { margin-top: 0; }
.addrow { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 12px; }
.addrow .w-s { width: 120px; } .addrow .w-m { width: 190px; } .addrow .w-l { flex: 1 1 260px; } .addrow .w-xl { flex: 1 1 360px; }
.addrow input[type=date] { width: 150px; }
.lnk { font-size: 13px; margin: 0 4px; }
.inline-form { display: inline; }
button.danger, .btn.danger { color: var(--red); border-color: #efb4b4; }
button.mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11.5px; padding: 1px 7px; cursor: pointer; color: var(--muted); }
button.mini:hover { color: var(--text); border-color: var(--navy-2); }
.pw { letter-spacing: .1em; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 130px 110px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-2); }
.timeline li.none { display: block; color: var(--muted); text-align: center; }
.timeline time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 120px; padding: 6px 4px 0; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.bar b { display: block; width: 100%; max-width: 44px; background: linear-gradient(180deg, #e07a4c, #c04e33); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar small { font-size: 10px; height: 14px; white-space: nowrap; }
.tbl td.b { font-weight: 700; }
.empty { text-align: center; padding: 40px 0; }

/* Tông Thổ (Canh Ngọ 1990), giao diện phẳng, đơn giản */
:root { --bg: #f7f2ea; --line: #e6dccb; --line-2: #f0e8db; --radius: 12px; --shadow: 0 1px 2px rgba(60, 40, 20, .06); }
body { background: #f7f2ea; }
.card, .stat { border-radius: 12px; box-shadow: var(--shadow); }
.btn, button.btn { border-radius: 10px; }
.btn.primary { background: #b5452f; border-color: #b5452f; color: #fff; box-shadow: none; }
.btn.primary:hover { background: #9a3a27; }
header.top { background: #3a1f14; border-bottom: 2px solid #c9a45c; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .stats.three { grid-template-columns: 1fr; } }
.stat b { color: #7a2a1d; }
.stat.alert { background: #fff6dc; border-color: #ecd49a; }
.tag.st.ok { background: #fff3cf; color: #7a5c1c; }
.bar b { background: #b5452f; }
.hello h1 { color: #3a1f14; font-size: 26px; }
.hello-date { color: #94702c; }
.login-card { border-radius: 16px; }
h1, h2 { font-family: "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: 0; }
.card h2 { font-size: 16.5px; }
.logo span, .stat b, .sec { font-family: "Be Vietnam Pro", system-ui, sans-serif; }
.page-head h1 { font-size: 24px; }

.lic-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lic-wrap h3 { margin: 0 0 4px; font-size: 15px; }
.lic { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: #fffdf8; }
.lic-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lic .addrow { border-top: 0; padding-top: 6px; margin-top: 4px; }
.code-box { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.code-box textarea { flex: 1; font: 12px Consolas, monospace; word-break: break-all; }
.quick { margin: 4px 0 2px; font-size: 13.5px; }
.quick b { font-size: 17px; letter-spacing: .08em; color: #7a2a1d; }


/* Danh mục tính năng & gợi ý nâng cấp */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.feat { border: 1px solid var(--line, #dde3ea); border-radius: 12px; padding: 12px 14px; background: #fff; }
.feat-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.feat-price { white-space: nowrap; font-weight: 700; color: #b45309; font-size: 13.5px; }
.feat p { margin: 6px 0; font-size: 14px; }
.feat-pitch { color: #1f6fb8; }
.fgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; margin-bottom: 10px; }
.fgroup h3 { font-size: 14px; margin: 4px 0 6px; color: var(--muted, #667085); }
.fbox { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.fbox.on { background: #eef7ee; }
.fbox small { display: block; color: var(--muted, #667085); }
.upsell { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #f5d98b; }
.upsell h3 { margin: 0 0 6px; font-size: 15px; }
.upsell ul { margin: 0; padding-left: 18px; }
.upsell li { margin: 4px 0; font-size: 14px; }

/* Trợ lý AI */
.ai-box { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: #eef6ff; border: 1px solid #c7e0fa; }
.ai-out { white-space: pre-wrap; margin: 10px 0; font-size: 14.5px; line-height: 1.55; }
.ai-out:empty { display: none; }
textarea.w-full { width: 100%; }

/* Giá & chi phí vận hành của từng khách */
.cust-fees { margin: 14px 0 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cust-fees h3 { margin: 0 0 8px; font-size: 15.5px; } .cust-fees h3 .muted { font-weight: 400; font-size: 13px; }
.fee-tbl td small { display: block; color: var(--muted); font-size: 12.5px; }
.fee-tbl .money-in { width: 150px; text-align: right; font-variant-numeric: tabular-nums; }
.fee-tbl tfoot th { background: #fbf8f3; font-size: 15px; } .fee-tbl tfoot tr.year th { background: #f6efe4; }
.muted.small { font-size: 12.5px; margin: 6px 0 0; }
/* Bảng chức năng & báo giá */
.qtbl .edit-col { width: 44px; text-align: center; }
.qtbl .edit-col input { width: 13px; height: 13px; opacity: .55; cursor: pointer; vertical-align: middle; }
.qtbl .edit-col input:hover, .qtbl .edit-col input:checked { opacity: 1; }
.qtbl:not(.editing) td.acts a { display: none; }
.quote-opts { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.quote-opts .opt { display: flex; align-items: center; gap: 10px; }
.quote-opts .radio, .quote-opts .check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.quote-opts select { width: auto; } .w-xs { width: 64px; text-align: center; }
.quote-paper { padding: 28px 32px; }
.qp-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 3px double #c9b48f; }
.qp-owner b { font-size: 19px; color: #7a4e2d; display: block; margin-bottom: 4px; }
.qp-owner div { font-size: 13.5px; color: #555; }
.qp-title { text-align: right; font-size: 14px; }
.qp-title h2 { margin: 0 0 4px; font-size: 30px; letter-spacing: .14em; color: #7a4e2d; }
.qp-cust { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 16px 0 6px; }
.qp-cust-h { grid-column: 1 / -1; font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; color: #7a4e2d; }
.qp-cust label { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 14px; color: #555; white-space: nowrap; }
.qp-cust label.wide { grid-column: 1 / -1; }
.qp-cust input { flex: 1; border: 0; border-bottom: 1px dotted #b9ab92; border-radius: 0; background: transparent; padding: 3px 2px; font-weight: 600; color: var(--text); }
.qp-cust input:focus { outline: none; border-bottom-color: #7a4e2d; }
.qp-intro { margin: 12px 0; }
.qtbl { width: 100%; }
.qtbl th.stt, .qtbl td.stt { width: 42px; text-align: center; } .qtbl td.stt { color: #666; }
.qtbl thead th.r { width: 150px; }
.qtbl td small { display: block; color: var(--muted, #667085); font-size: 12.5px; margin-top: 2px; font-weight: 400; }
.qtbl .pick { width: 34px; text-align: center; }
.qtbl thead th { background: #7a4e2d; color: #fff; vertical-align: middle; }
.qtbl thead th small { color: #f3e6d4; font-weight: 400; }
.qtbl tr.qgroup th { background: #f6efe4; text-align: left; font-size: 13.5px; text-transform: uppercase; letter-spacing: .05em; color: #7a4e2d; }
.qtbl tr.off td { opacity: .4; }
.qtbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qtbl tfoot th { font-size: 14.5px; background: #fbf8f3; }
.qtbl tfoot tr.grand th { background: #f6efe4; font-size: 15.5px; }
.qtbl tfoot tr.year th { background: #7a4e2d; color: #fff; font-size: 16px; }
.qtbl tfoot tr.year th small { color: #f3e6d4; font-weight: 400; }
.qp-words { margin: 10px 0 2px; }
.qp-terms { margin-top: 16px; }
.qp-terms textarea { width: 100%; margin-top: 6px; line-height: 1.55; resize: vertical; }
.qp-terms-p { white-space: pre-wrap; line-height: 1.55; margin-top: 6px; }
.qp-sign { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin-top: 28px; min-height: 130px; }
.qp-sign small { display: block; color: #777; } .qp-sign span { display: block; margin-top: 70px; font-weight: 700; }
.save-quote { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.save-quote input { flex: 1 1 320px; }
details.card summary { cursor: pointer; } details.card[open] summary { margin-bottom: 10px; }
tr.on td { background: #fbf6ec; } .mono { font-family: Consolas, monospace; font-size: 13px; }
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; }
  .top, .noprint, .nav, header.top, .side, .qtbl tr.off, .qtbl tr.qgroup.off, .flash, [hidden] { display: none !important; }
  .print-only { display: block; }
  .main, main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; }
  .qp-cust input { border-bottom: 0; }
  .qtbl .pick, .qtbl th.noprint, .qtbl td.noprint { display: table-cell !important; width: 0 !important; padding: 0 !important; border: 0 !important; font-size: 0; }
  .qtbl .pick input, .qtbl .noprint a { display: none; }
  .qp-cust label:has(input:placeholder-shown) { display: none; }
  .qp-cust { gap: 2px 18px; }
  .qtbl thead th, .qtbl tfoot tr.year th, .qtbl tr.qgroup th, .qtbl tfoot th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qtbl tr { break-inside: avoid; }
}

/* Bảo mật 2 lớp & đăng nhập */
.twofa { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.twofa .qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 10px; width: 202px; height: 202px; }
.twofa code { font-size: 15px; letter-spacing: .06em; }
.backup { columns: 2; font-size: 17px; line-height: 2; } .mono.big { font-size: 17px; }
.login-card .remember { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 2px 0 6px; }
.login-card .remember input { width: auto; }

/* Trên điện thoại: không cho trang trôi / nảy khi kéo, như app thật */
html, body { overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
