/* Sổ thu chi hộ kinh doanh — /ho-kinh-doanh */
.hk { --hk-ok: #059669; --hk-warn: #d97706; --hk-bad: #dc2626; --hk-in: #0f766e; --hk-out: #b91c1c; }
.hk-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.hk-head h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.hk-head .hk-sub { color: var(--muted); font-size: .85rem; }
.hk-switch { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.hk-switch .form-select { width: auto; padding-top: .3rem; padding-bottom: .3rem; font-size: .88rem; }

/* tabs */
.hk-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; overflow-x: auto; scrollbar-width: none; }
.hk-tabs::-webkit-scrollbar { display: none; }
.hk-tabs button { border: 0; background: none; padding: .6rem .9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; font-size: .92rem; display: inline-flex; gap: .4rem; align-items: center; }
.hk-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.hk-pane { display: none; } .hk-pane.on { display: block; }

/* thẻ */
.hk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.hk-card h2, .hk-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .7rem; display: flex; gap: .45rem; align-items: center; }
.hk-card h2 .bi, .hk-card h3 .bi { color: var(--brand); }
.hk-grid { display: grid; gap: 1rem; grid-template-columns: repeat(12, 1fr); }
.hk-c4 { grid-column: span 4; } .hk-c5 { grid-column: span 5; } .hk-c6 { grid-column: span 6; } .hk-c7 { grid-column: span 7; }
.hk-c8 { grid-column: span 8; } .hk-c12 { grid-column: span 12; } .hk-c3 { grid-column: span 3; }
@media (max-width: 991px) { .hk-c3, .hk-c4, .hk-c5, .hk-c6, .hk-c7, .hk-c8 { grid-column: span 12; } }

/* chỉ số */
.hk-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (max-width: 767px) { .hk-kpis { grid-template-columns: repeat(2, 1fr); } }
.hk-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; }
.hk-kpi small { display: block; color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.hk-kpi b { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.hk-kpi span { font-size: .78rem; color: var(--muted); }
.hk-kpi.is-main { background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; border: 0; }
.hk-kpi.is-main small, .hk-kpi.is-main span { color: rgba(255, 255, 255, .8); }

/* thanh ngưỡng 1 tỷ */
.hk-meter { position: relative; height: 14px; border-radius: 999px; background: #eef2ff; overflow: visible; margin: .6rem 0 1.4rem; }
.hk-meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #84cc16); transition: width .5s; }
.hk-meter.is-warn > i { background: linear-gradient(90deg, #f59e0b, #f97316); }
.hk-meter.is-over > i { background: linear-gradient(90deg, #ef4444, #db2777); }
.hk-meter .mk { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #94a3b8; }
.hk-meter .mk em { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.hk-tier { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; }
.hk-tier.t1 { background: #dcfce7; color: #166534; } .hk-tier.t2 { background: #fef3c7; color: #92400e; }
.hk-tier.t3, .hk-tier.t4 { background: #fee2e2; color: #991b1b; }

/* cảnh báo */
.hk-alert { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 12px; font-size: .9rem; margin-bottom: .6rem; border: 1px solid; }
.hk-alert .bi { font-size: 1.15rem; line-height: 1.2; }
.hk-alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.hk-alert.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.hk-alert.bad { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.hk-alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* quý */
.hk-qs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (max-width: 767px) { .hk-qs { grid-template-columns: repeat(2, 1fr); } }
.hk-q { border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; background: #fff; position: relative; }
.hk-q.is-cur { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.hk-q h4 { font-size: .82rem; font-weight: 700; margin: 0 0 .3rem; display: flex; justify-content: space-between; color: var(--muted); }
.hk-q .v { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hk-q .t { font-size: .76rem; color: var(--muted); margin-top: .2rem; line-height: 1.45; }
.hk-q .t b { color: var(--ink); }
.hk-q .done { position: absolute; top: .55rem; right: .6rem; color: var(--hk-ok); }

/* so sánh 2 cách */
.hk-vs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.hk-vs > div { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; }
.hk-vs > div.best { border-color: #86efac; background: #f0fdf4; }
.hk-vs small { color: var(--muted); font-size: .76rem; display: block; }
.hk-vs b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hk-vs .tag { font-size: .7rem; font-weight: 700; color: #15803d; }

/* lịch hạn */
.hk-dl { list-style: none; padding: 0; margin: 0; }
.hk-dl li { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.hk-dl li:last-child { border-bottom: 0; }
.hk-dl .d { min-width: 3.3rem; text-align: center; border-radius: 10px; background: #f1f5f9; padding: .2rem .3rem; line-height: 1.1; }
.hk-dl .d b { display: block; font-size: 1rem; } .hk-dl .d small { font-size: .68rem; color: var(--muted); }
.hk-dl li.soon .d { background: #fef3c7; } .hk-dl li.past { opacity: .55; } .hk-dl li.done .d { background: #dcfce7; }
.hk-dl .f { margin-left: auto; font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* ô nhập nhanh */
.hk-quick { position: relative; }
.hk-quick textarea { border-radius: 14px; padding: .85rem 1rem; font-size: 1rem; min-height: 54px; resize: vertical; border: 2px solid #c7d2fe; }
.hk-quick textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.hk-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.hk-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; font-size: .78rem; padding: .2rem .65rem; color: #475569; }
.hk-chips button:hover { border-color: var(--brand); color: var(--brand); }
.hk-prev { margin-top: .6rem; }
.hk-prev .row-p { display: grid; grid-template-columns: 6.2rem 5.6rem 1fr 7.5rem 2rem; gap: .4rem; align-items: center; padding: .4rem .5rem;
  border-radius: 10px; background: #f8fafc; margin-bottom: .3rem; font-size: .86rem; }
.hk-prev .row-p input, .hk-prev .row-p select { font-size: .84rem; padding: .25rem .4rem; }
@media (max-width: 575px) { .hk-prev .row-p { grid-template-columns: 1fr 1fr; } .hk-prev .row-p .d-desc { grid-column: 1 / -1; } }

/* bảng dòng sổ */
.hk-table { width: 100%; font-size: .88rem; border-collapse: separate; border-spacing: 0; }
.hk-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding: .5rem .6rem;
  border-bottom: 1px solid var(--line); background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.hk-table td { padding: .5rem .6rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.hk-table tr:hover td { background: #fafbff; }
.hk-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hk-amt.thu, .hk-amt.vao { color: var(--hk-in); font-weight: 700; } .hk-amt.chi, .hk-amt.ra { color: var(--hk-out); font-weight: 700; }
.hk-kind { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; white-space: nowrap; }
.hk-kind.thu { background: #ccfbf1; color: #115e59; } .hk-kind.chi { background: #fee2e2; color: #991b1b; }
.hk-kind.vao { background: #e0f2fe; color: #075985; } .hk-kind.ra { background: #f1f5f9; color: #475569; }
.hk-src { font-size: .7rem; color: var(--muted); }
.hk-act button { border: 0; background: none; color: #94a3b8; padding: .15rem .3rem; } .hk-act button:hover { color: var(--brand); }
.hk-empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.hk-empty .bi { font-size: 2rem; color: #c7d2fe; display: block; margin-bottom: .4rem; }
.hk-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }

@media (max-width: 575px) {
  .hk-ledger thead { display: none; }
  .hk-ledger tr { display: grid; grid-template-columns: 1.7rem auto 1fr auto; grid-template-areas: "c d k a" "c t t x"; align-items: center;
    gap: .15rem .3rem; padding: .55rem .35rem; border-bottom: 1px solid #f1f5f9; }
  .hk-ledger td { border: 0; padding: 0 .15rem; }
  .hk-ledger td:nth-child(1) { grid-area: c; } .hk-ledger td:nth-child(2) { grid-area: d; font-size: .8rem; color: var(--muted); }
  .hk-ledger td:nth-child(3) { grid-area: k; } .hk-ledger td:nth-child(4) { grid-area: t; font-size: .86rem; }
  .hk-ledger td:nth-child(5) { display: none; } .hk-ledger td:nth-child(6) { grid-area: a; } .hk-ledger td:nth-child(7) { grid-area: x; text-align: right; }
  .hk-ledger td.hk-empty { grid-column: 1 / -1; grid-area: auto; }
  .hk-ledger tr.has-empty { display: block; }
  .hk-scroll { max-height: none; }
}

/* nhập tệp */
.hk-drop { border: 2px dashed #c7d2fe; border-radius: 14px; padding: 1.3rem; text-align: center; background: #fafbff; cursor: pointer; transition: .15s; }
.hk-drop:hover, .hk-drop.over { border-color: var(--brand); background: #eef2ff; }
.hk-drop .bi { font-size: 1.7rem; color: var(--brand); }
.hk-srcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .9rem; }
@media (max-width: 767px) { .hk-srcs { grid-template-columns: 1fr; } }
.hk-srcs label { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; cursor: pointer; display: flex; gap: .6rem; align-items: flex-start; }
.hk-srcs input { margin-top: .25rem; }
.hk-srcs label:has(input:checked) { border-color: var(--brand); background: #eef2ff; }
.hk-srcs b { display: block; font-size: .9rem; } .hk-srcs small { color: var(--muted); font-size: .77rem; }

/* xuất sổ */
.hk-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.hk-book { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; background: #fff; display: flex; flex-direction: column; gap: .35rem; }
.hk-book.need { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .08); }
.hk-book .code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: var(--brand); font-size: .86rem; }
.hk-book .ttl { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.hk-book small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.hk-book .acts { display: flex; gap: .35rem; margin-top: auto; padding-top: .3rem; }
.hk-badge-need { font-size: .66rem; font-weight: 700; background: #e0e7ff; color: #3730a3; border-radius: 999px; padding: .08rem .45rem; margin-left: .3rem; }
.hk-big { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.1rem; border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #faf5ff); border: 1px solid #c7d2fe; }
.hk-big .bi-file-zip { font-size: 2rem; color: #6d28d9; }

/* danh sách khách (kế toán dịch vụ) */
.hk-clients td .nm { font-weight: 700; } .hk-clients td .nm a { color: var(--ink); text-decoration: none; }
.hk-clients td .nm a:hover { color: var(--brand); }
.hk-due { font-size: .8rem; white-space: nowrap; } .hk-due.soon { color: var(--hk-warn); font-weight: 700; } .hk-due.late { color: var(--hk-bad); font-weight: 700; }
.hk-mini { height: 6px; border-radius: 99px; background: #eef2ff; width: 90px; overflow: hidden; display: inline-block; vertical-align: middle; }
.hk-mini i { display: block; height: 100%; background: #22c55e; } .hk-mini i.w { background: #f59e0b; } .hk-mini i.o { background: #ef4444; }

/* bắt đầu */
.hk-roles { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 575px) { .hk-roles { grid-template-columns: 1fr; } }
.hk-roles label { border: 2px solid var(--line); border-radius: 14px; padding: .9rem; cursor: pointer; display: flex; gap: .7rem; }
.hk-roles label:has(input:checked) { border-color: var(--brand); background: #eef2ff; }
.hk-roles .bi { font-size: 1.6rem; color: var(--brand); } .hk-roles b { display: block; } .hk-roles small { color: var(--muted); }

/* trang giới thiệu */
.hk-calc { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.2rem; text-align: left; }
@media (max-width: 991px) { .hk-calc { grid-template-columns: 1fr; } }
.hk-calc .grow { display: grid; grid-template-columns: 1fr 10.5rem; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.hk-calc .grow label { font-size: .86rem; line-height: 1.3; } .hk-calc .grow label small { display: block; color: var(--muted); font-size: .74rem; }
.hk-res { background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 1.1rem 1.2rem; }
.hk-res .big { font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hk-res .ln { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: .9rem; }
.hk-res .ln b { font-variant-numeric: tabular-nums; color: #fff; }
.hk-res .pill { display: inline-block; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 700; }
.hk-res .best { color: #86efac; }
.hk-feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 991px) { .hk-feat { grid-template-columns: 1fr; } }
.hk-feat > div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.hk-feat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: #eef2ff; color: var(--brand); margin-bottom: .7rem; }
.hk-feat h3 { font-size: 1.02rem; font-weight: 700; } .hk-feat p { color: #475569; font-size: .9rem; margin: 0; }
.hk-demo { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem; }
.hk-tbl-rules { font-size: .9rem; } .hk-tbl-rules th { background: #f8fafc; font-size: .78rem; text-transform: uppercase; color: var(--muted); }
.hk-who { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 767px) { .hk-who { grid-template-columns: 1fr; } }
.hk-who > div { border-radius: 18px; padding: 1.4rem; border: 1px solid var(--line); background: #fff; }
.hk-who h3 { font-size: 1.15rem; font-weight: 800; display: flex; gap: .5rem; align-items: center; }
.hk-who ul { padding-left: 1.1rem; margin: .6rem 0 0; color: #334155; } .hk-who li { margin-bottom: .35rem; }

/* hướng dẫn */
.hk-guide { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; }
@media (max-width: 991px) { .hk-guide { grid-template-columns: 1fr; } .hk-toc { display: none; } }
.hk-toc { position: sticky; top: 80px; align-self: start; font-size: .88rem; }
.hk-toc a { display: block; padding: .3rem .6rem; border-left: 2px solid var(--line); color: #475569; text-decoration: none; }
.hk-toc a:hover { border-color: var(--brand); color: var(--brand); }
.hk-guide section { margin-bottom: 2.4rem; scroll-margin-top: 80px; }
.hk-guide h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .8rem; }
.hk-guide h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.2rem; }
.hk-steps { counter-reset: s; list-style: none; padding: 0; }
.hk-steps > li { counter-increment: s; position: relative; padding: 0 0 1rem 2.6rem; }
.hk-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.hk-steps > li b { display: block; margin-bottom: .15rem; }
.hk-kbd { font-family: ui-monospace, Consolas, monospace; background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; padding: .05rem .4rem; font-size: .85em; }

/* link khách nhập */
.hk-client { max-width: 640px; margin: 0 auto; }

[data-bs-theme="dark"] .hk-q, [data-bs-theme="dark"] .hk-book, [data-bs-theme="dark"] .hk-chips button, [data-bs-theme="dark"] .hk-feat > div,
[data-bs-theme="dark"] .hk-who > div, [data-bs-theme="dark"] .hk-demo { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .hk-meter { background: #1e293b; } [data-bs-theme="dark"] .hk-table th, [data-bs-theme="dark"] .hk-prev .row-p { background: #0f172a; }

@media print { .hk-noprint { display: none !important; } }
