/* =========================================================
   Quản lý phòng trọ: stylesheet
   1. Nền tảng   2. Khung trang   3. Thành phần   4. Form
   5. Hộp thoại  6. Trang chủ     7. Ghi chỉ số   8. Hóa đơn
   9. Phòng / mẫu giá   10. Lịch sử   11. In   12. Cài đặt
   13. Đăng nhập / đăng ký   14. Admin
   ========================================================= */

/* ---------- 1. Nền tảng ---------- */
:root {
  --primary: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --zalo: #0068ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.4;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 21px; }
h3 { font-size: 17px; margin: 4px 0 10px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--red); }
p.error:empty { display: none; }
.spacer { flex: 1; }
b.green { color: var(--green); }
b.red { color: var(--red); }

/* ---------- 2. Khung trang ---------- */
/* Một cột duy nhất: tiêu đề, thanh tab và nội dung cùng độ rộng, cùng lề */
:root { --col: 1100px; }
.wrap, main { max-width: var(--col); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
main { padding-top: 16px; padding-bottom: 16px; }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--primary); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 12px; background: rgba(255, 255, 255, .18); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge.imp { background: #fbbf24; color: #422006; font-weight: 700; }

/* Điện thoại: thanh tab cố định ở đáy */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; border: 0; background: none; padding: 8px 0 10px; cursor: pointer; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font: inherit; font-size: 12px;
}
.tabs button i { font-style: normal; font-size: 21px; }
.tabs button.active { color: var(--primary); font-weight: 700; }
body.no-nav { padding-bottom: 24px; }
body.no-nav .tabs { display: none; }

/* Máy tính: thanh tab nằm cùng dòng với tên trọ (bên phải) */
@media (min-width: 821px) {
  body { padding-bottom: 24px; }
  .topbar .wrap { min-height: 60px; }
  .tabs { position: static; background: none; border: 0; padding: 0; gap: 4px; margin-left: auto; }
  .tabs button {
    flex: 0 0 auto; flex-direction: row; gap: 7px; min-height: 0; padding: 9px 14px; border-radius: 10px;
    font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .82);
  }
  .tabs button i { font-size: 17px; }
  .tabs button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .tabs button.active { background: rgba(255, 255, 255, .2); color: #fff; font-weight: 700; }
}

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--card); border-radius: var(--radius); }

#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 1000; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 3. Thành phần ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards .card { margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.kv span { color: var(--muted); }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.zalo { background: var(--zalo); border-color: var(--zalo); color: #fff; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 48px; padding: 12px 18px; font-size: 16px; }
.btn.round { width: 44px; height: 44px; min-height: 0; border-radius: 50%; font-size: 22px; padding: 0; }
.link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 0; white-space: nowrap; }
.chip.gray { background: #f1f5f9; color: var(--muted); }
.chip.green { background: #dcfce7; color: #166534; }
.chip.red { background: #fee2e2; color: #991b1b; }
.chip.amber { background: #fef3c7; color: #92400e; }

.seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 10px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.seg input:checked + span { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 18px; }
.stat.green b { color: var(--green); }
.stat.red b { color: var(--red); }
.stat.amber b { color: #d97706; }

/* ---------- 4. Form ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 4px 0 6px; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 16px; }
input, select, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--text);
  padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--primary); }
input.hl { background: #fefce8; border-color: #facc15; font-weight: 700; }
input.bad { border-color: var(--red) !important; background: #fef2f2 !important; }
input.warn { border-color: var(--amber) !important; background: #fffbeb !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }

.sect { border-top: 1px solid var(--line); padding: 12px 0 2px; }
.sect-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.sect-h b { font-size: 13px; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 99px; font-weight: 700; }
.sect-h b:empty { display: none; }
.sect-h small { font-weight: 400; font-size: 12px; }

.fees { display: contents; }
.fee-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.fixed-name { padding: 9px 11px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.link-add { background: none; border: 0; color: var(--primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0 10px; }
.del-x { width: 32px; height: 32px; border: 0; background: none; color: var(--faint); border-radius: 8px; cursor: pointer; font-size: 15px; }
.del-x:hover { background: #fee2e2; color: var(--red); }
.inline-select { width: auto; padding: 5px 9px; font-size: 14px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-color: transparent; }

/* ---------- 5. Hộp thoại ---------- */
dialog {
  border: 0; border-radius: 16px; padding: 18px; width: min(560px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  max-height: calc(var(--vvh, 100dvh) - 16px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
/* điện thoại: neo hộp thoại lên trên vùng nhìn thấy (không bị bàn phím che) */
@media (max-width: 640px) {
  dialog { margin: calc(var(--vvt, 0px) + 8px) auto auto; }
}
dialog.wide { width: min(1100px, calc(100vw - 16px)); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }
dialog h2 { margin-bottom: 14px; padding-right: 44px; }
.modal-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.modal-x-wrap { position: sticky; top: 0; height: 0; z-index: 30; display: flex; justify-content: flex-end; }
.modal-x {
  margin: -8px -8px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #475569;
  font-size: 17px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); display: grid; place-items: center;
}
.modal-x:hover { background: #fee2e2; color: var(--red); border-color: #fecaca; }
.modal-x:focus { outline: none; }

/* ---------- 6. Trang chủ ---------- */
.month-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mb-title { text-align: center; display: flex; flex-direction: column; align-items: center; }
.card.setup { border: 2px dashed #bfdbfe; background: #f8fbff; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.step .txt { flex: 1; }
.step.done .num { background: var(--green); }
.step.done .txt { color: var(--muted); text-decoration: line-through; }

.summary .big { font-size: 30px; font-weight: 700; color: var(--green); line-height: 1.15; }
.summary .big small { font-size: 16px; }

.hint { margin: 2px 2px 12px; font-size: 15px; color: var(--text-2); }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 2px 10px; flex-wrap: wrap; }
.list-head h3 { margin: 0; }
.hint-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.mlist { display: flex; flex-direction: column; gap: 8px; }
.mrow {
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
  display: grid; grid-template-columns: minmax(90px, 1fr) auto auto; align-items: center; gap: 10px 14px; border-left: 4px solid #cbd5e1;
}
.mrow.new { border-left-color: #cbd5e1; }
.mrow.draft { border-left-color: var(--amber); }
.mrow.paid { border-left-color: var(--green); opacity: .85; }
.mr-info { display: flex; flex-direction: column; min-width: 0; }
.mr-info b { font-size: 18px; }
.mr-info span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mr-amount b { font-size: 18px; }
.mr-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 7. Ghi chỉ số hàng loạt ---------- */
.meter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.meter-head .mb-title { flex: 1; }
.meter-head .spacer { flex: 0 0 110px; }
.mt-month { font-size: 15px; color: var(--muted); }
.mt-month .link { text-decoration: none; font-size: 20px; padding: 0 10px; }
.mt-table { display: flex; flex-direction: column; gap: 8px; padding-bottom: 84px; }
.mt-row {
  display: grid; grid-template-columns: 170px 1fr 1fr 130px; gap: 12px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; border-left: 4px solid #cbd5e1; box-shadow: var(--shadow);
}
.mt-row.ready { border-left-color: var(--green); }
.mt-row.paid { opacity: .6; }
.mt-headrow { background: none; box-shadow: none; padding: 0 14px; border: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.mt-name { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.mt-name b { font-size: 18px; }
.mt-name span:not(.chip) { font-size: 13px; color: var(--muted); }
.mt-cell { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "old input" "use use"; gap: 4px 10px; align-items: center; }
.mt-cell .mt-lbl { display: none; }
.mt-cell.na { opacity: .6; }
.mt-old { grid-area: old; font-size: 13px; color: var(--muted); white-space: nowrap; }
.mt-old b { color: var(--text); font-size: 16px; }
.mt-cell input { grid-area: input; font-size: 19px; font-weight: 700; padding: 10px 12px; background: #fefce8; border-color: #fde68a; }
.mt-cell input:disabled { background: #f1f5f9; border-color: var(--line); color: var(--muted); }
.mt-use { grid-area: use; font-size: 13px; color: var(--green); font-weight: 600; min-height: 16px; }
.mt-use.warn { color: #b45309; }
.mt-use.bad { color: var(--red); }
.mt-total { text-align: right; font-size: 17px; }
.mt-bar {
  position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 15;
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mt-bar .btn { min-height: 48px; padding: 11px 20px; font-size: 16px; }

/* ---------- 8. Hóa đơn ---------- */
.inv-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.inv-layout > * { min-width: 0; }
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding-right: 44px; }
.inv-head h2 { margin: 0; padding: 0; }
input.note { margin: 6px 0 10px; }
.total-line { font-size: 18px; margin-bottom: 8px; }
.total-line b { color: var(--text); font-size: 23px; }
.inv-canvas-wrap canvas, #setCanvas { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); display: block; }
.inv-actions { display: flex; flex-direction: column; gap: 8px; }
.inv-actions .zalo { min-height: 50px; font-size: 17px; }
.ia-row { display: flex; gap: 8px; }
.ia-row > .btn { flex: 1; }
.ia-row > #delInv { flex: 0 0 auto; }
.inv-actions .btn.next { flex: 1.4; border-color: var(--primary); color: var(--primary); }

@media (min-width: 821px) {
  dialog.inv { height: calc(100dvh - 16px); overflow: hidden; flex-direction: column; padding-bottom: 14px; }
  dialog.inv[open] { display: flex; }
  dialog.inv #modalBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  dialog.inv .inv-layout {
    flex: 1; min-height: 0; gap: 12px 22px; align-items: stretch;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "form preview" "actions preview";
  }
  dialog.inv .inv-form { grid-area: form; overflow-y: auto; padding-right: 8px; margin-right: -8px; }
  dialog.inv .inv-preview { grid-area: preview; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  dialog.inv .inv-actions { grid-area: actions; border-top: 1px solid var(--line); padding-top: 12px; }
  dialog.inv .inv-canvas-wrap { flex: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
}
@media (max-width: 820px) {
  dialog.inv { padding: 14px; }
  dialog.inv .inv-actions {
    position: sticky; bottom: -14px; margin: 0 -14px -14px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0, 0, 0, .08); z-index: 5;
  }
}

/* ---------- 9. Phòng / mẫu giá ---------- */
.subnav { display: flex; width: max-content; max-width: 100%; margin-bottom: 14px; }
.room-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.room-head h3 { margin: 0; font-size: 19px; }
.room-head .rent { font-size: 16px; }

.card.room .actions .btn { flex: 1; }
.price-grid { display: grid; grid-template-columns: 80px 1fr 64px; gap: 8px; align-items: center; margin-bottom: 10px; }
.pg-label { font-weight: 600; font-size: 15px; }
.pg-water { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pg-water .seg { margin: 0; }
.pg-water input { flex: 1; min-width: 90px; }
.unit { font-size: 12px; color: var(--muted); }

/* ---------- 10. Lịch sử ---------- */
.room-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.rchip { flex: none; position: relative; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.rchip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rchip .dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hist-head h3 { margin: 0 0 2px; font-size: 19px; }
.hist-stats { display: flex; gap: 22px; }
.hist-stats div { display: flex; flex-direction: column; }
.hist-stats span { font-size: 12px; color: var(--muted); }
.hist-stats b { font-size: 18px; }
.hist-stats small { font-size: 11px; color: var(--faint); }
.hist-list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hrow { display: grid; grid-template-columns: 90px 110px 100px 1fr 170px; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.hrow:hover { background: #f8fafc; }
.hrow.debt { background: #fff7f7; }
.hhead { cursor: default; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; background: #f8fafc; }
.h-use { font-size: 14px; color: #475569; }
.h-amt { display: flex; flex-direction: column; gap: 4px; }
.h-amt .bar { height: 5px; background: #eef2f7; border-radius: 99px; overflow: hidden; max-width: 220px; }
.h-amt .bar i { display: block; height: 100%; background: #93c5fd; border-radius: 99px; }
.h-st { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.h-st small { font-size: 12px; color: var(--muted); }

/* ---------- 11. In ---------- */
.print-layouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.pl { margin: 0; cursor: pointer; }
.pl input { display: none; }
.pl > span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 2px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--text); text-align: center; }
.pl input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.pl-sheet { display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--faint); }
.pl-sheet.portrait { width: 34px; height: 48px; }
.pl-sheet.landscape { width: 48px; height: 34px; }
.pl-sheet b { background: #bfdbfe; border-radius: 1px; }
.pr-head { display: flex; justify-content: space-between; align-items: center; }
.print-list { max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pr-item { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); gap: 8px; font-size: 15px; }
.pr-item:last-child { border-bottom: 0; }

/* ---------- 12. Cài đặt ---------- */
.settings-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; align-items: start; }
.settings-layout > * { min-width: 0; }

.theme { flex-direction: row; margin: 0; cursor: pointer; }
.theme input { display: none; }
.theme span { padding: 8px 13px; border-radius: 99px; border: 2px solid var(--line); color: var(--text); display: flex; align-items: center; gap: 6px; font-size: 14px; }
.theme span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.theme input:checked + span { border-color: var(--c); background: #f8fafc; }

/* ---------- 13. Đăng nhập / đăng ký ---------- */
.login { max-width: 460px; margin: 20px auto 0; display: flex; flex-direction: column; gap: 12px; }
.login label { margin-bottom: 0; }
.login a { color: var(--primary); font-weight: 600; }
.auth-page { background: linear-gradient(180deg, var(--primary) 0, var(--primary) 250px, var(--bg) 250px); min-height: 100vh; }
body.auth-page .topbar { display: none; }
.auth-hero { text-align: center; color: #fff; padding: 24px 12px 0; max-width: 460px; margin: 0 auto; }
.auth-logo { font-size: 44px; }
.auth-hero h1 { font-size: 25px; margin: 4px 0 8px; }
.auth-hero p { opacity: .92; margin: 0; line-height: 1.5; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.features { max-width: 460px; margin: 16px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; font-size: 22px; }
.features div { background: var(--card); border-radius: var(--radius); padding: 12px 6px; display: flex; flex-direction: column; gap: 4px; }
.features b { font-size: 13px; }
.features span { font-size: 12px; color: var(--muted); }

/* ---------- 14. Admin ---------- */
.admin .topbar { background: #111827; }
button.badge { border: 0; color: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.stats5 { grid-template-columns: repeat(5, 1fr); }
details.card summary { cursor: pointer; }
.cfg { margin-top: 12px; }
.seg.filter { display: flex; flex-wrap: wrap; margin-bottom: 12px; width: max-content; max-width: 100%; }
.seg.filter small { opacity: .7; }
#search { flex: 1; max-width: 420px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cred { background: #f1f5f9; padding: 12px; border-radius: 10px; white-space: pre-wrap; font-size: 15px; user-select: all; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mt-headrow { display: none; }
  .mt-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mt-name { grid-column: 1; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
  .mt-total { grid-column: 2; grid-row: 1; }
  .mt-cell { grid-template-columns: 1fr; grid-template-areas: "lbl" "input" "use"; }
  .mt-cell .mt-lbl { display: flex; grid-area: lbl; font-size: 12px; font-weight: 700; color: var(--muted); }
  .mt-old { grid-area: lbl; justify-self: end; font-size: 12px; }
  .meter-head .spacer { display: none; }
}
@media (max-width: 700px) {
  .stats5 { grid-template-columns: repeat(2, 1fr); }
  .stats5 .stat:first-child { grid-column: 1 / -1; }
  
}
@media (max-width: 640px) {
  .mrow { grid-template-columns: 1fr auto; }
  .mrow .mr-actions { grid-column: 1 / -1; }
  .mrow .mr-actions:empty { display: none; }
  .mrow .mr-actions .btn { flex: 1; min-height: 46px; }
  .mrow.paid .mr-actions { justify-content: flex-end; }
  .summary .big { font-size: 26px; }
  .hhead { display: none; }
  .hrow { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .h-month { grid-column: 1; }
  .h-amt { grid-column: 2; grid-row: 1; align-items: flex-end; }
  .h-amt .bar { display: none; }
  .h-use { grid-row: 2; }
  .h-use:nth-of-type(2) { grid-column: 1; }
  .h-use:nth-of-type(3) { grid-column: 2; text-align: right; }
  .h-st { grid-column: 1 / -1; justify-content: space-between; }
  .hist-stats { gap: 16px; width: 100%; justify-content: space-between; }
  
}
@media (max-width: 480px) {
  .wrap, main { padding-left: 12px; padding-right: 12px; }
  main { padding-top: 12px; }
  dialog { padding: 14px; }
  .grid3 { gap: 0 6px; }
  .fee-row { grid-template-columns: 1fr 104px 32px; }
  .stat b { font-size: 16px; }
  .seg span { padding: 7px 11px; }
  .print-layouts { grid-template-columns: repeat(2, 1fr); }
}

/* Máy tính: các thanh cố định ở đáy (không còn tab bên dưới) */
@media (min-width: 821px) {
  .mt-bar { bottom: 0; padding-left: max(16px, calc((100vw - var(--col)) / 2 + 16px)); padding-right: max(16px, calc((100vw - var(--col)) / 2 + 16px)); }
  #toast { bottom: 28px; }
}.admin .topbar { position: sticky; top: 0; z-index: 10; }

/* ---- Admin: bảng tài khoản ---- */
.utable-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em;
  padding: 11px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.utable th.sortable { cursor: pointer; user-select: none; }
.utable th.sortable:hover { color: var(--text); }
.utable th.on { color: var(--primary); }
.utable th i { font-style: normal; margin-left: 4px; opacity: .6; font-size: 10px; }
.utable td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.utable tbody tr:last-child td { border-bottom: 0; }
.utable tbody tr:hover { background: #f8fafc; }
.utable tr.pending { background: #fffbeb; }
.utable tr.disabled td { opacity: .65; }
.utable tr.disabled td.act-col { opacity: 1; }
.utable .num { text-align: center; white-space: nowrap; }
.utable .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.u-name { font-weight: 700; font-size: 15px; }
.u-note { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.act-col { text-align: right; white-space: nowrap; }
.u-acts { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.ibtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; display: inline-grid; place-items: center; }
.ibtn:hover { background: var(--primary-soft); border-color: #bfdbfe; }
.ibtn.danger:hover { background: #fee2e2; border-color: #fecaca; }
@media (max-width: 760px) {
  .utable-wrap { background: none; box-shadow: none; overflow: visible; }
  .utable, .utable tbody, .utable tr, .utable td { display: block; }
  .utable thead { display: none; }
  .utable tr { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; padding: 6px 0; border-left: 4px solid var(--green); }
  .utable tr.pending { border-left-color: var(--amber); }
  .utable tr.disabled { border-left-color: var(--red); }
  .utable td { border: 0; padding: 5px 14px; display: flex; justify-content: space-between; gap: 12px; }
  .utable td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; flex: none; }
  .utable td[data-label="Tài khoản"] { display: block; }
  .utable td[data-label="Tài khoản"]::before { display: none; }
  .utable .num { text-align: right; }
  .act-col { padding-top: 8px !important; }
  .u-acts { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .ibtn { width: 40px; height: 40px; }
}

/* ---- Icon SVG ---- */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.dim { opacity: .45; }
.tabs button i { display: grid; place-items: center; }
.tabs button i .ic { width: 22px; height: 22px; }
@media (min-width: 821px) { .tabs button i .ic { width: 18px; height: 18px; } }
.topbar h1 { display: flex; align-items: center; gap: 8px; }
.topbar h1 .ic { width: 22px; height: 22px; }
.ibtn .ic { width: 17px; height: 17px; }
.modal-x .ic { width: 18px; height: 18px; }
.del-x .ic { width: 16px; height: 16px; }
.step .num .ic { width: 15px; height: 15px; stroke-width: 3; }
.auth-logo { display: grid; place-items: center; }
.auth-logo .ic { width: 52px; height: 52px; stroke-width: 1.6; }
.features div > .ic { width: 26px; height: 26px; margin: 0 auto; color: var(--primary); }
.sect-h span .ic, .meta .ic, .h-use .ic, .mt-lbl .ic, .pg-label .ic { color: var(--muted); }
.h-use .ic { width: 15px; height: 15px; }
.hint.ok { color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.badge .ic { width: 14px; height: 14px; }
button.badge { display: inline-flex; align-items: center; gap: 5px; }
.utable th .sort-ic { width: 12px; height: 12px; margin-left: 4px; }
.utable th .sort-ic.dim { opacity: .35; }
summary .ic { color: var(--muted); }
#approvalNote, .login h2 { display: flex; align-items: center; gap: 6px; }

/* ---- Phòng: nhóm theo tầng / dãy + kéo thả ---- */
.rgroup { margin-bottom: 18px; }
.rg-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; }
.rg-name { margin: 0; font-size: 18px; cursor: text; padding: 2px 6px; border-radius: 6px; }
.rg-name:hover { background: #e2e8f0; }

.gdrag { cursor: grab; color: var(--faint); display: grid; place-items: center; touch-action: none; }
.gdrag .ic { width: 20px; height: 20px; }

.rgroup.loose .rg-name { color: var(--muted); font-size: 16px; }
.card.room .room-head { cursor: grab; justify-content: flex-start; }
.card.room .room-head .rent { margin-left: auto; }
.card.room .drag { color: var(--faint); display: grid; place-items: center; margin-left: -6px; }
.card.room .drag .ic { width: 18px; height: 18px; }
.drag-ghost { opacity: .35; outline: 2px dashed var(--primary); outline-offset: -2px; }
.drag-chosen { box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }

/* ---- Bộ lọc khu trọ ---- */
.prop-switch { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }

/* ---- Tab Phòng: Khu → Tầng/dãy → Phòng ---- */
.prop { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px 6px; margin-bottom: 16px; }
.prop-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.prop-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.prop-ic .ic { width: 22px; height: 22px; }
.prop-title { display: flex; flex-direction: column; min-width: 0; }
.prop-name { font-size: 19px; margin: 0; cursor: text; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.prop-name:hover { background: #f1f5f9; }
.prop-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-name { width: auto; min-width: 160px; max-width: 280px; font-size: 17px; font-weight: 700; padding: 5px 9px; }
.auto-group { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; text-decoration: none; }
.prop .rgroup { margin-bottom: 10px; }
.prop .rg-head { margin: 0 0 8px; gap: 6px; }
.prop .rg-name { font-size: 15px; color: var(--text-2); }
.rg-name.dim { color: var(--muted); font-weight: 600; cursor: default; }
.rg-name.dim:hover { background: none; }
.ibtn.sm { width: 30px; height: 30px; }
.ibtn.sm .ic { width: 15px; height: 15px; }

.rt-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); min-height: 56px; padding: 2px; margin-bottom: 8px; border-radius: 12px; }
.rt-list:empty { border: 2px dashed #cbd5e1; display: grid; place-items: center; grid-template-columns: 1fr; }
.rt-list:empty::before { content: "Kéo phòng vào đây"; color: var(--faint); font-size: 14px; }
.rt-list.empty-drop:empty::before { content: "Chưa có phòng. Bấm “+ Phòng” để thêm, hoặc kéo phòng từ khu khác vào đây."; padding: 0 12px; text-align: center; }
.room-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s; user-select: none; }
.room-tile:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(29, 78, 216, .08); }
.room-tile.empty { background: #fafafa; border-style: dashed; }
.rt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rt-name { font-size: 17px; }
.rt-rent { font-size: 14px; font-weight: 700; color: var(--text-2); }
.rt-tenant { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-tile.empty .rt-tenant { font-style: italic; }
.rt-tenant .ic { width: 14px; height: 14px; }
.rt-foot { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.rt-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.rt-foot .ic { width: 14px; height: 14px; color: var(--muted); }
.rt-foot .ibtn { margin-left: auto; }
@media (max-width: 640px) {
  .prop { padding: 12px 12px 4px; border-radius: 14px; }
  .prop-acts { width: 100%; }
  .prop-acts .btn { flex: 1; }
  .rt-list { grid-template-columns: 1fr 1fr; }
  .rt-rent { font-size: 13px; }
}
.rgroup.loose.is-empty { display: none; }
body.dragging .rgroup.loose.is-empty { display: block; }

/* ---- Nhắc nợ ---- */
.card.late { border: 1px solid #fecaca; background: #fff7f7; }

.late-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed #fecaca; }
.lr-room { display: flex; flex-direction: column; min-width: 0; }
.lr-room span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mrow.late { border-left-color: var(--red); }
.chip.amber { background: #fef3c7; color: #92400e; }
.tabs button i { position: relative; }
.tab-badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; font-style: normal; line-height: 1; box-shadow: 0 0 0 2px #fff; }
.topbar .tab-badge { box-shadow: 0 0 0 2px var(--primary); }
.rem-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rem-info b { font-size: 18px; }
.rem-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.due-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 15px; }
.due-row input { width: 74px; }
.due-row select { width: auto; }
@media (max-width: 640px) {
  .late-row { grid-template-columns: 1fr auto; }
  .late-row .chip { justify-self: end; }
  .late-row .btn { grid-column: 1 / -1; }
  .rem-acts { grid-template-columns: 1fr; }
}

/* ---- Đánh giá sạch sẽ ---- */
.ic.star-on { fill: #f59e0b; stroke: #f59e0b; }
.ic.star-off { color: #cbd5e1; }
.rate-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.rate-row > input { flex: 1; min-width: 180px; }
.star-input { display: inline-flex; gap: 2px; }
.star-input label { margin: 0; cursor: pointer; }
.star-input input { display: none; }
.star-input span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: #cbd5e1; }
.star-input span .ic { width: 28px; height: 28px; }
.star-input label:hover span { background: #fffbeb; }
.star-input label.on span .ic { fill: #f59e0b; stroke: #f59e0b; }
.rate-hist { margin-top: 8px; border-top: 1px solid var(--line); }
.rh-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.rh-row .stars .ic { width: 15px; height: 15px; }
.rh-note { font-size: 13px; color: var(--text-2); }
.rt-star { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #92400e; }
.rt-foot .rt-star .ic { color: #f59e0b; }
.stars-b { display: inline-flex; align-items: center; gap: 4px; }

/* ---- Thu chi ---- */

.fin-kpis { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font-size: 22px; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.hero b { font-size: 28px; }
.kpi.hero.pos { background: #f0fdf4; } .kpi.hero.pos b { color: var(--green); }
.kpi.hero.neg { background: #fef2f2; } .kpi.hero.neg b { color: var(--red); }
.fin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.fin-cols .card { margin: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-h h3 { margin: 0; }
h3.mt { margin-top: 16px; }
.kv.total { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.kv b.green { color: var(--green); } .kv b.red { color: var(--red); }
.kv span .ic { color: var(--muted); }
.exp-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; border-radius: 8px; }
.exp-row:hover { background: #f8fafc; }
.exp-ic { width: 34px; height: 34px; border-radius: 9px; background: #fff4ed; color: #c2410c; display: grid; place-items: center; flex: none; }
.exp-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.exp-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend span, .chart-tip span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .chart-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-wrap { position: relative; }
.year-chart { width: 100%; height: auto; display: block; }
.year-chart .ax { font-size: 12px; fill: var(--muted); font-family: inherit; }
.year-chart .hit { cursor: pointer; }
.year-chart .hit.on { fill: rgba(15, 23, 42, .05); }
.chart-tip { position: absolute; top: 0; background: #0f172a; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px;
  display: flex; flex-direction: column; gap: 3px; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); white-space: nowrap; z-index: 2; }
.fin-table-wrap { overflow-x: auto; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fin-table th, .fin-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 700; background: #f8fafc; }
.fin-table tbody tr { cursor: pointer; }
.fin-table tbody tr:hover { background: #f8fafc; }
.fin-table td.red { color: var(--red); }
.fin-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
@media (max-width: 760px) {
  .fin-kpis { grid-template-columns: 1fr 1fr; }
  .kpi.hero { grid-column: 1 / -1; }
  .fin-cols { grid-template-columns: 1fr; }
}
.tabs button i:has(.tab-badge) { margin-right: 8px; }
.rt-foot { gap: 8px; font-size: 12.5px; }
.rt-foot > span { white-space: nowrap; }

/* ---- Số ngày ở ---- */
.stay-row { display: flex; align-items: flex-end; gap: 6px 16px; flex-wrap: wrap; margin: -2px 0 10px; }
.stay-days { margin: 0; }
.stay-in { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 400; font-size: 14px; }
.stay-in input { width: 76px; }
.stay-fees { margin: 0 0 9px; font-size: 14px; }
#stayHint { flex-basis: 100%; color: #b45309; font-weight: 600; }
#stayHint:empty { display: none; }

/* ---- Lập phiếu / trả phòng ---- */
.room-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.co-sum { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin-top: 6px; }
.co-sum .kv.debt span { color: #b45309; }
.co-sum .kv.total { font-size: 17px; }
.co-sum .kv.total.green b { color: var(--green); }
.co-sum .kv.total.red b { color: var(--red); }

/* ---- Hợp đồng ---- */
.warn-line { display: flex; align-items: center; gap: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.rt-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.rt-chip .ic { width: 13px; height: 13px; }
.rt-chip.amber { background: #fef3c7; color: #92400e; }
.rt-chip.red { background: #fee2e2; color: #991b1b; }
@media (max-width: 560px) {
  #roomForm .modal-actions #roomInvoice { order: -1; flex: 1 1 100%; }
  #roomForm .modal-actions .btn.primary { flex: 1; }
}

/* ---- Nút phụ nổi bật (vd. "Sửa thông tin phòng") ---- */
.btn.soft { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); }
.btn.soft:hover { background: #dbeafe; filter: none; }
.btn.soft .ic { width: 16px; height: 16px; }
.inv-head { align-items: center; flex-wrap: wrap; row-gap: 8px; }
.inv-head #editRoomFromInv { margin-left: auto; }
@media (max-width: 560px) { .inv-head #editRoomFromInv { margin-left: 0; } }

/* ---- Ô địa chỉ hành chính có lọc ---- */
.addr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 4px; }
.addr .addr-street { grid-column: 1 / -1; }
.addr label.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin-top: 2px; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16); padding: 4px; }
.combo-opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 15px; font-weight: 400; color: var(--text); }
.combo-opt:hover, .combo-opt.on { background: var(--primary-soft); color: var(--primary); }
.combo-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); font-weight: 400; }
.addr-preview { grid-column: 1 / -1; margin: -2px 0 8px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.addr-preview .ic { width: 14px; height: 14px; color: var(--muted); }
.addr-warn { display: inline-flex; align-items: center; gap: 4px; color: #b45309; font-weight: 600; }
.addr-warn .ic { color: #b45309; }
@media (max-width: 560px) { .addr { grid-template-columns: 1fr; } }

/* ---- Ô màu ảnh hóa đơn (chỉ màu, gọn) ---- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin: 2px 0 14px; }
.swatch { margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { width: 36px; height: 36px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); transition: box-shadow .15s, transform .15s; }
.swatch span .ic { width: 18px; height: 18px; stroke-width: 3; opacity: 0; }
.swatch:hover span { transform: scale(1.06); }
.swatch input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.swatch input:checked + span .ic { opacity: 1; }
.swatch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 4px; }

/* ---- Địa chỉ khu trọ ---- */
.prop-addr { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 2px 4px; margin: 2px 0 0 -4px; border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; text-align: left; }
.prop-addr .ic { width: 14px; height: 14px; color: var(--muted); flex: none; }
.prop-addr:hover { background: #f1f5f9; }
.prop-addr.empty { color: var(--primary); font-weight: 600; }
.prop-addr.empty .ic { color: var(--primary); }
.addr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr-head .btn { margin-left: auto; }
#paForm > .btn.soft { margin-bottom: 10px; }

/* =========================================================
   Điện thoại nhỏ (320–420px): chống tràn / lệch cột
   ========================================================= */
/* Cột lưới được phép co nhỏ hơn nội dung (ô ngày, số tiền dài…) → không đẩy tràn ngang */
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 > *, .grid3 > *, .fin-kpis > *, .fin-cols > *, .rt-list > *, .kpi, .exp-main, .mr-info, .lr-room { min-width: 0; }
input[type=date], input[type=month] { min-width: 0; }
.fin-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fin-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.kv { flex-wrap: wrap; }
.kv b { margin-left: auto; text-align: right; }
.sect-h { flex-wrap: wrap; }
.ia-row > .btn { min-width: 0; }
/* nước tính theo người / cố định: ô giá chiếm phần cột còn trống */
.grid3:has(> [data-w="person"]:not([hidden])) > label:last-child { grid-column: span 2; }
.grid3:has(> [data-w]):not(:has(> [data-w]:not([hidden]))) > label:last-child { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .fin-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fin-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rt-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rt-foot { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 420px) {
  /* thẻ phòng: 1 cột cho dễ đọc */
  .rt-list { grid-template-columns: minmax(0, 1fr); }
  /* bảng giá trong form phòng / mẫu giá */
  .price-grid { grid-template-columns: 58px minmax(0, 1fr) 46px; gap: 8px 6px; }
  .pg-label { font-size: 14px; }
  .pg-water { flex-direction: column; align-items: stretch; }
  .pg-water .seg { display: flex; }
  .pg-water .seg label { flex: 1; }
  .seg span { padding: 6px 4px; font-size: 13px; text-align: center; white-space: nowrap; }
  .unit { font-size: 11px; }
  /* hóa đơn: nút gọn, không tràn */
  .inv-actions .btn { padding: 8px 6px; font-size: 14px; gap: 4px; }
  .ia-row { gap: 6px; }
  /* form hợp đồng / trả phòng: ngày chiếm cả hàng */
  #ctForm .grid3, #coForm .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #ctForm .grid3 > :first-child, #coForm .grid3 > :first-child { grid-column: 1 / -1; }
  /* thu chi */
  .kpi { padding: 12px; }
  .kpi b { font-size: 18px; word-break: break-word; }
  .kpi.hero b { font-size: 24px; }
  .fin-table th:nth-child(2), .fin-table td:nth-child(2) { display: none; }
  .fin-table th, .fin-table td { padding: 7px 6px; font-size: 13px; }
  /* lịch sử: chỉ số 2 × 2 */
  .hist-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  /* in hóa đơn: danh sách gọn */
  .pr-item .muted { display: none; }
  .pr-item .chip { font-size: 11px; padding: 2px 6px; }
  #prInfo { flex-basis: 100%; }
  /* hộp thoại */
  dialog { padding: 12px; }
  dialog h2 { font-size: 19px; }
  .modal-actions { gap: 6px; }
  /* ô nhập: bớt đệm ngang để số / ngày không bị cắt */
  input:not([type=checkbox]):not([type=radio]), select { padding-left: 9px; padding-right: 6px; }
  input[type=date], input[type=month] { font-size: 15px; }
  .ia-row > .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.features div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 340px) {
  .features { gap: 6px; }
  .features b { font-size: 12px; }
  .features span { font-size: 11px; }
  .inv-actions .btn { font-size: 13px; padding: 8px 4px; }
  input[type=date], input[type=month] { font-size: 14px; }
}

/* ---- Điểm nhấn nhẹ: Đã thu (xanh dương) / Chi phí (cam) — cùng màu biểu đồ năm ---- */
.kpi-in, .kpi-out { border-left: 4px solid var(--acc); }
.kpi-in { --acc: #257de0; --acc-bg: #eaf3fd; }
.kpi-out { --acc: #f47230; --acc-bg: #fff1e8; }
.kpi-in > span .ic, .kpi-out > span .ic { width: 24px; height: 24px; padding: 4px; border-radius: 7px; background: var(--acc-bg); color: var(--acc); }

/* ---- Tầng / dãy: thanh nhấn bên trái + chip số phòng ---- */
.rgroup:not(.loose) > .rg-head { border-left: 3px solid var(--primary); padding: 4px 0 4px 6px; background: linear-gradient(90deg, var(--primary-soft), transparent 70%); border-radius: 0 8px 8px 0; }
.rg-count { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.rgroup.loose .rg-count { color: var(--muted); background: #eef2f7; }

/* ---- Lịch sử: chỉ số thành các ô đều nhau, canh trái ---- */
.hist-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; width: 100%; justify-content: stretch; }
.hist-stats > div { background: #f8fafc; border-radius: 10px; padding: 8px 12px; border-left: 3px solid #cbd5e1; min-width: 0; }
.hist-stats > .hs-in { border-left-color: var(--green); }
.hist-stats > .hs-debt { border-left-color: var(--red); background: #fef2f2; }
.hist-stats > .hs-ok { border-left-color: #cbd5e1; }
.hist-stats b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .hist-stats { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* =================== Tháng này (thiết kế lại) =================== */
.month-bar.compact { justify-content: center; gap: 14px; margin-bottom: 12px; }
.month-bar.compact .mb-title { min-width: 150px; }
.month-bar.compact h2 { margin: 0; font-size: 21px; }
.month-bar.compact .ibtn { width: 38px; height: 38px; border-radius: 50%; }

/* bước bắt đầu còn 1: dải mỏng */
.setup-strip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: #f8fbff; border: 1px dashed #bfdbfe; font-size: 14px; flex-wrap: wrap; }
.ss-dots { display: flex; gap: 4px; }
.ss-dots i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.ss-dots i.on { background: var(--green); }
.ss-txt { flex: 1; min-width: 160px; }

/* tổng quan + cần làm: 2 cột trên máy tính */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 16px; align-items: start; }
@media (min-width: 900px) { .home-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.home-top > .card { margin: 0; }

.hero-sum { background: linear-gradient(135deg, var(--primary), #1e40af); color: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 8px 24px rgba(37, 99, 235, .25); }
.hs-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.hs-lbl { font-size: 13px; opacity: .85; }
.hs-big { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.hs-big small, .hs-pct small { font-size: 15px; font-weight: 700; opacity: .85; }
.hs-pct { font-size: 26px; font-weight: 700; opacity: .95; }
.hs-bar { height: 8px; background: rgba(255, 255, 255, .22); border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
.hs-bar i { display: block; height: 100%; background: #4ade80; border-radius: 99px; transition: width .4s; }
.hs-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; opacity: .92; flex-wrap: wrap; }
.hs-sub b { font-weight: 700; }
.hs-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hs-tile { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); color: #fff; border-radius: 10px; padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; }
.hs-tile:hover { background: rgba(255, 255, 255, .24); }
.hs-tile b { font-size: 20px; line-height: 1.2; }
.hs-tile b small { font-size: 13px; opacity: .75; }
.hs-tile span { font-size: 12px; opacity: .9; }
.hs-tile.warn { background: rgba(254, 202, 202, .25); border-color: rgba(254, 202, 202, .55); }

/* cần làm */
.card.todo { padding: 12px 14px; }
.todo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.todo-head h3 { margin: 0; font-size: 16px; }
.todo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.todo-head + .todo-row { border-top: 0; }
.todo-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.todo-ic .ic { width: 18px; height: 18px; }
.todo-ic.red { background: #fee2e2; color: #b91c1c; }
.todo-ic.blue { background: var(--primary-soft); color: var(--primary); }
.card.todo.done { display: flex; align-items: center; gap: 12px; }
.card.todo.done > .ic { width: 30px; height: 30px; color: var(--green); flex: none; }
.card.todo.done > div { display: flex; flex-direction: column; }
/* ghi đè bố cục .late-row cũ trên điện thoại */
.todo-row.late-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.todo-row.late-row .btn { grid-column: auto; }

/* tab lọc danh sách */
.list-head { align-items: center; flex-wrap: nowrap; }
.ftabs { display: flex; gap: 4px; background: #e9eef5; padding: 3px; border-radius: 10px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.ftabs::-webkit-scrollbar { display: none; }
.ftab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.ftab span { font-size: 11px; background: rgba(15, 23, 42, .08); padding: 1px 6px; border-radius: 99px; }
.ftab.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.ftab.on span { background: var(--primary-soft); color: var(--primary); }
.ftab:disabled { opacity: .45; cursor: default; }
.hint-btns { flex-wrap: nowrap; gap: 6px; }

/* dòng phòng: 1 hàng gọn */
.mlist { gap: 6px; }
.mlist .mrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-left: 0; opacity: 1; }
.mr-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.mrow.draft .mr-dot { background: var(--amber); }
.mrow.late .mr-dot { background: var(--red); box-shadow: 0 0 0 3px #fee2e2; }
.mrow.paid .mr-dot { background: var(--green); }
.mlist .mr-info b { font-size: 16px; }
.mlist .mr-info span { font-size: 13px; }
.mlist .mr-amount { gap: 1px; }
.mlist .mr-amount b { font-size: 16px; }
.mr-st { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mrow.draft .mr-st { color: #b45309; }
.mrow.late .mr-st { color: var(--red); }
.mrow.paid .mr-st { color: var(--green); }
.mrow.paid .mr-info b, .mrow.paid .mr-amount b { color: var(--text-2); }
.mlist .mr-actions { gap: 6px; align-items: center; }
.mlist .mr-actions .btn { min-height: 36px; }
.ibtn.zalo { color: #0068ff; border-color: #bfdbfe; }
.ibtn.warn { color: #b91c1c; border-color: #fecaca; background: #fff7f7; }
.empty-sm { text-align: center; padding: 16px; }

@media (max-width: 640px) {
  /* ghi đè bố cục 2 hàng cũ: 1 hàng duy nhất, nút nhỏ */
  .mlist .mrow { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; padding: 10px; }
  .mlist .mrow .mr-actions { grid-column: auto; gap: 5px; }
  .mlist .mrow .mr-actions .btn { flex: none; min-height: 36px; padding: 6px 10px; }
  .mlist .mrow .mr-actions .ibtn { width: 36px; height: 36px; }
  .hs-big { font-size: 26px; }
}
@media (max-width: 400px) {
  .mlist .mrow [data-paid] { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; }
  .mlist .mrow [data-paid] .ic { width: 18px; height: 18px; }
  .mlist .mr-info b, .mlist .mr-amount b { font-size: 15px; }
}
@media (max-width: 380px) {
  .ftab { padding: 6px 7px; font-size: 13px; }
  .hs-tile b { font-size: 18px; }
}
.list-head h3 { margin: 0 6px 0 0; }
.list-head .ftabs { margin-right: auto; }
@media (max-width: 640px) {
  .list-head { flex-wrap: wrap; row-gap: 8px; }
  .list-head .ftabs { order: 3; width: 100%; margin: 0; }
  .list-head .ftab { flex: 1; justify-content: center; }
}
@media (max-width: 380px) {
  .list-head .ftab { padding: 6px 4px; min-width: 0; }
}

/* Xem trước hợp đồng (Cài đặt) */
.cp-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cp-room { flex: 1; min-width: 180px; margin: 0; }
.cp-frame { width: 100%; height: min(72dvh, 900px); border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }
#setForm .modal-actions .btn { flex: none; }
@media (max-width: 420px) { #setForm .modal-actions .btn { flex: 1; } }

/* Đầu khu trọ: icon + tên/địa chỉ cùng 1 hàng, địa chỉ dài tự xuống dòng */
.prop-head .prop-title { flex: 1 1 200px; }
.prop-addr { text-align: left; white-space: normal; align-items: flex-start; line-height: 1.35; }
.prop-addr .ic { margin-top: 2px; }
@media (max-width: 640px) { .prop-head .prop-title { flex-basis: 0; } .prop-head { align-items: flex-start; } }

/* Phóng to ảnh hóa đơn */
canvas.zoomable { cursor: zoom-in; }
.inv-canvas-wrap, #setCanvas { position: relative; }
#zoomDlg { padding: 0; width: min(820px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; border-radius: 0; background: #0f172a; overflow: hidden; display: none; flex-direction: column; }
#zoomDlg[open] { display: flex; }
#zoomDlg::backdrop { background: rgba(15, 23, 42, .85); }
.zoom-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.zoom-scroll img { display: block; width: 100%; height: auto; cursor: zoom-in; }
#zoomDlg.z2 .zoom-scroll img { width: 200%; max-width: none; cursor: zoom-out; }
.zoom-x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.zoom-tip { margin: 0; padding: 8px; text-align: center; color: #cbd5e1; font-size: 13px; }
@media (min-width: 821px) { #zoomDlg { height: calc(100dvh - 32px); margin: 16px auto; border-radius: 14px; } }
.inv-canvas-wrap::after { content: "Bấm ảnh để phóng to"; position: absolute; right: 8px; bottom: 8px; background: rgba(15, 23, 42, .7); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 99px; pointer-events: none; }
.prop-head > .spacer { display: none; }

/* Cần làm: thu gọn / xổ ra */
details.todo > summary { list-style: none; cursor: pointer; margin: 0; user-select: none; }
details.todo > summary::-webkit-details-marker { display: none; }
details.todo .todo-head h3 { display: flex; align-items: center; gap: 6px; }
.todo-n { font-size: 12px; background: var(--red); color: #fff; border-radius: 99px; padding: 1px 7px; }
.todo-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.todo-chev { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f1f5f9; transition: transform .2s; flex: none; }
.todo-chev .ic { width: 16px; height: 16px; }
details.todo[open] .todo-chev { transform: rotate(180deg); }
details.todo[open] > summary { margin-bottom: 4px; }
details.todo > .todo-row:first-of-type { border-top: 1px solid var(--line); }
.chip.blue { background: var(--primary-soft); color: var(--primary); }
.todo-head { flex-wrap: nowrap; }
@media (max-width: 420px) { .todo-chips .chip { font-size: 11px; padding: 3px 8px; } }

/* Danh sách theo khu / tầng */
.mg-prop { display: flex; align-items: center; gap: 8px; margin: 10px 2px 2px; font-size: 16px; color: var(--text); }
.mg-prop .ic { width: 18px; height: 18px; color: var(--primary); }
.mg-prop:first-child { margin-top: 0; }
.mg-group { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--primary); background: linear-gradient(90deg, var(--primary-soft), transparent 75%); border-radius: 0 8px 8px 0; font-size: 14px; font-weight: 700; color: var(--text-2); }
.mg-stat { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.todo-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 4px; padding: 8px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 0 0 8px 8px; }
.todo-more:hover { background: var(--primary-soft); }
.todo-more .ic { width: 16px; height: 16px; }

/* Tab lọc danh sách: luôn vừa 1 hàng, không kéo ngang */
.list-head .ftabs { display: grid; grid-template-columns: repeat(4, auto); overflow: visible; }
@media (max-width: 640px) {
  .list-head .ftabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .list-head .ftab { min-width: 0; padding: 7px 2px; font-size: 13.5px; gap: 4px; justify-content: center; }
  .list-head .ftab span { font-size: 10.5px; padding: 1px 5px; }
}
/* màn hẹp: số nằm dưới chữ — luôn hiện số, vẫn vừa 1 hàng */
@media (max-width: 480px) {
  .list-head .ftab { flex-direction: column; gap: 1px; padding: 5px 2px; line-height: 1.2; }
  .list-head .ftab span { font-size: 12px; font-weight: 700; padding: 0 6px; }
}
@media (max-width: 340px) { .list-head .ftab { font-size: 12.5px; } }

/* Lịch sử: chip phòng tự xuống dòng, không kéo ngang */
.room-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; overflow: visible; padding: 2px 0 12px; }
.rchip { padding: 8px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 480px) {
  .room-chips { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
  .rchip { padding: 7px 4px; font-size: 14px; }
  .rchip .dot { top: 3px; right: 4px; width: 7px; height: 7px; }
}

/* Chọn khu: ô chọn dạng danh sách */
.prop-switch { overflow: visible; padding: 2px 0 12px; }

/* ô chọn khu ở các tab khác: co vừa chữ, căn thẳng */

/* Tháng này: tiêu đề danh sách là ô chọn khu */

/* hàng tiêu đề không xuống dòng theo độ dài tên khu → chiều cao cố định, không nhảy khi đổi khu */

.list-head .hint-btns { flex: none; margin-left: auto; }
@media (max-width: 640px) {
  .list-head { flex-wrap: wrap; }
  .list-head > h3 { flex: 1 1 0; }
  
}

/* ===== Chọn khu: nút + danh sách thả xuống ===== */
.ppick { position: relative; display: inline-flex; max-width: 100%; padding: 0 0 12px; overflow: visible; }
.list-head .ppick { padding: 0; flex: 0 1 auto; min-width: 0; }
.pp-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 5px; max-width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: border-color .15s, box-shadow .15s; }
.pp-btn:hover { border-color: #bfdbfe; }
.ppick.open .pp-btn, .pp-btn:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); outline: none; }
.pp-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.pp-ic .ic { width: 17px; height: 17px; }
.pp-btn.one .pp-ic { background: var(--primary); color: #fff; }
.pp-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pp-chev { display: grid; place-items: center; color: var(--muted); flex: none; transition: transform .2s; }
.pp-chev .ic { width: 16px; height: 16px; }
.ppick.open .pp-chev { transform: rotate(180deg); }

.pp-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 260px; max-width: min(340px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  display: flex; flex-direction: column; gap: 2px; animation: ppIn .14s ease-out; }
.ppick:not(.list-head .ppick) .pp-menu { top: calc(100% - 6px); }
@keyframes ppIn { from { opacity: 0; transform: translateY(-4px); } }
.pp-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.pp-opt:hover, .pp-opt:focus-visible { background: #f1f5f9; outline: none; }
.pp-opt.on { background: var(--primary-soft); }
.pp-opt.on .pp-ic { background: var(--primary); color: #fff; }
.pp-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pp-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-check { color: var(--primary); display: grid; place-items: center; flex: none; }
.pp-check .ic { width: 18px; height: 18px; stroke-width: 3; }
@media (max-width: 640px) { .list-head .ppick { flex: 1 1 0; } }

/* ===== Màu nhấn riêng từng khu (--pc) ===== */
.toolbar .ppick { padding: 0; min-width: 0; }
.toolbar .ppick .pp-menu { top: calc(100% + 6px); }
.ppick[style*="--pc"] .pp-btn.one { border-color: color-mix(in srgb, var(--pc) 45%, white); }
.ppick[style*="--pc"] .pp-btn.one .pp-ic { background: var(--pc); }
.pp-opt[style*="--pc"] .pp-ic { background: color-mix(in srgb, var(--pc) 13%, white); color: var(--pc); }
.pp-opt.on[style*="--pc"] .pp-ic { background: var(--pc); color: #fff; }

/* tab Phòng: thẻ khu */
.prop[style*="--pc"] { border-top: 4px solid var(--pc); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 6%, white) 0, #fff 120px); }
.prop[style*="--pc"] .prop-ic { background: var(--pc); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--pc) 30%, transparent); }
.prop[style*="--pc"] .prop-name { color: color-mix(in srgb, var(--pc) 80%, black); }
.prop[style*="--pc"] .prop-head { border-bottom-color: color-mix(in srgb, var(--pc) 18%, white); }

/* tab Tháng này: tiêu đề khu trong danh sách */
.mg-prop[style*="--pc"] { margin: 14px 0 4px; padding: 8px 12px 8px 8px; border-radius: 12px; background: color-mix(in srgb, var(--pc) 9%, white); border: 1px solid color-mix(in srgb, var(--pc) 22%, white); }
.mg-prop:first-child { margin-top: 0; }
.mg-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--pc, var(--primary)); color: #fff; display: grid; place-items: center; flex: none; }
.mg-ic .ic { width: 16px !important; height: 16px !important; color: #fff !important; }
.mg-prop[style*="--pc"] b { color: color-mix(in srgb, var(--pc) 80%, black); font-size: 16px; }
.mg-prop[style*="--pc"] .mg-stat { color: color-mix(in srgb, var(--pc) 70%, black); background: #fff; padding: 2px 8px; border-radius: 99px; }
/* tầng / dãy theo màu khu */
.prop[style*="--pc"] .rgroup:not(.loose) > .rg-head { border-left-color: var(--pc); background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 10%, white), transparent 70%); }
.prop[style*="--pc"] .rg-count { color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, white); }
.mg-group[style*="--pc"] { border-left-color: var(--pc); background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 10%, white), transparent 75%); }
/* tiêu đề khu sát nội dung bên dưới */
.mlist .mg-prop[style*="--pc"] { margin-bottom: -2px; }
.mlist .mg-prop + .mg-group, .mlist .mg-prop + .mrow { margin-top: 0; }
@media (max-width: 360px) {
  .list-head .pp-btn > .pp-ic { display: none; }
  .list-head .pp-btn { padding-left: 10px; gap: 4px; }
  .list-head .pp-name { font-size: 15px; }
  .list-head .hint-btns .ibtn { width: 38px; height: 38px; }
}

/* Thu chi: chọn khu + Tháng/Năm cùng hàng; Lợi nhuận ròng đứng đầu */
.fin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fin-row .ppick { padding: 0; min-width: 0; flex: 0 1 auto; }
.fin-row .ppick .pp-menu { top: calc(100% + 6px); }
.fin-row .seg { margin: 0 0 0 auto; flex: none; }
.fin-kpis { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .fin-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .fin-kpis .kpi.hero { grid-column: 1 / -1; } }

/* Cài đặt: Nhắc nợ / Hợp đồng gộp, có xem trước */
.tpl-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.tpl-pick h3 { margin: 0; }
.tpl-seg { margin: 0; }
.tpl-seg span { display: inline-flex; align-items: center; gap: 6px; }
.tpl-seg .ic { width: 15px; height: 15px; }
.tpl-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fcfdff; }
.tpl-prev { margin-top: 10px; }
.tpl-prev-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.tpl-prev-h .ic { width: 15px; height: 15px; color: var(--primary); }
.tpl-prev-h .btn { margin-left: auto; }
.chat-bubble { background: #e5f1ff; color: #0f172a; border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 14px; line-height: 1.5; max-width: 92%; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.ct-mini { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }
/* Hạn thanh toán: "Ngày [5] [của tháng sau]" trên cùng 1 hàng */
.due-row { flex-wrap: nowrap; }
.due-row input { width: 64px; flex: none; text-align: center; }
.due-row select { flex: 1 1 auto; min-width: 0; max-width: 220px; }
.tpl-pick.first { margin-top: 0; }
.own-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 12px; }
.own-card .kv { font-size: 14px; padding: 5px 0; }
.own-card .kv span { color: var(--muted); }

/* Cài đặt: tách các khối bằng đường kẻ + thanh nhấn trước tiêu đề */
#setForm .tpl-pick:not(.first) { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); position: relative; }
#setForm .tpl-pick:not(.first)::before { content: ""; position: absolute; top: -1px; left: 0; width: 56px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
#setForm .tpl-pick h3 { display: flex; align-items: center; gap: 8px; }
#setForm .tpl-pick h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--primary); }
#setForm .tpl-pick + .tpl-panel { box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
/* Cài đặt: Mẫu ảnh hóa đơn nằm trên ảnh xem trước */
.set-preview .swatches { margin-bottom: 10px; }
.set-preview .tpl-prev-h { margin: 6px 0 8px; }
.set-preview h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.set-preview h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--primary); }
.set-preview .tpl-pick { margin: 0 0 4px; }
.tpl-prev-h .btn .ic { color: inherit; }

/* Đổi giá điện nước cho cả khu */
.pp-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.pp-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pp-item:has(input[type=checkbox]:checked) { border-color: #bfdbfe; background: var(--primary-soft); }
.pp-item:not(:has(input[type=checkbox]:checked)) .pp-in { opacity: .55; }
.pp-lbl { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer; }
.pp-lbl .ic { width: 17px; height: 17px; color: var(--primary); }
.pp-in { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-in > input, .pp-row > input { flex: 1; min-width: 0; }
.pp-in .unit { flex: none; font-size: 13px; color: var(--muted); }
.pp-water { flex-direction: column; align-items: stretch; gap: 6px; }
.pp-water .seg { display: flex; margin: 0; }
.pp-water .seg label { flex: 1; }
.pp-row { display: flex; align-items: center; gap: 8px; }
.pp-sum { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }
.pp-sum .kv { font-size: 14px; }
.pp-note { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin: 8px 0 0; }
.pp-note .ic { width: 15px; height: 15px; color: var(--primary); flex: none; margin-top: 2px; }
@media (max-width: 420px) { .pp-item { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* Bỏ ô xanh khi chạm / bấm */
* { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible) { box-shadow: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: none; }
.ppick.open .pp-btn { box-shadow: none; }

/* Tháng này (máy tính): ô Cần làm và ô Đã thu cao bằng nhau, đáy ngang hàng */
@media (min-width: 900px) {
  /* bình thường: 2 ô đáy ngang nhau; bấm "Xem thêm" thì chỉ ô Cần làm dài ra */
  .home-top { align-items: start; }
  .home-top.fit { align-items: stretch; }
  .home-top > .hero-sum, .home-top > .card.todo { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .home-top > .hero-sum .hs-tiles { margin-top: auto; padding-top: 14px; }
  .home-top > details.todo > .todo-more { margin-top: auto; }
}

/* ===== Lịch sử (PC): thanh bên danh sách phòng + chi tiết ===== */
.hist-side, .hchart, .hc-legend { display: none; }
@media (min-width: 1000px) {
  .hist-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
  .hist-main .room-chips { display: none; }
  .hist-side { display: flex; flex-direction: column; margin: 0; padding: 10px; position: sticky; top: 72px; max-height: calc(100vh - 88px); }
  .hs-search { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0 10px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
  .hs-search .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
  .hs-search input { border: 0; background: none; padding: 0; height: 100%; font-size: 14px; }
  .hs-search input:focus { border: 0; }
  .hs-list { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
  .hs-grp { font-size: 12px; font-weight: 700; color: var(--pc, var(--muted)); text-transform: uppercase; letter-spacing: .3px; padding: 10px 8px 4px; }
  .hs-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
  .hs-item:hover { background: #f1f5f9; }
  .hs-item.on { background: var(--primary); color: #fff; }
  .hs-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .hs-name b { font-size: 15px; }
  .hs-name small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hs-item.on .hs-name small { color: rgba(255, 255, 255, .8); }
  .hs-debt { font-size: 12px; font-weight: 700; color: #b91c1c; background: #fee2e2; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
  .hs-okk { font-size: 12px; font-weight: 600; color: var(--green); }
  .hs-item.on .hs-debt { background: rgba(255, 255, 255, .9); }
  .hs-item.on .hs-okk { color: #bbf7d0; }

  /* thẻ phòng: tiêu đề + 4 ô số dàn ngang, biểu đồ bên dưới */
  .hist-main .hist-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 12px; }
  .hist-main .hist-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hchart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 120px; padding-top: 6px; border-top: 1px dashed var(--line); }
  .hc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
  .hc-bar { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; }
  .hc-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; }
  .hc-bar i.p { background: #22c55e; }
  .hc-bar i.d { background: #ef4444; }
  .hc-bar i.e { height: 2px; background: #e2e8f0; border-radius: 1px; }
  .hc-col span { font-size: 11px; color: var(--muted); }
  .hc-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: -6px; }
  .hc-legend span { display: inline-flex; align-items: center; gap: 5px; }
  .hc-legend i { width: 10px; height: 10px; border-radius: 3px; }
  .hc-legend i.p { background: #22c55e; } .hc-legend i.d { background: #ef4444; }
  .hc-legend .muted { margin-left: auto; }

  /* bảng: cột co giãn, không còn khoảng trống giữa */
  .hist-main .hrow { grid-template-columns: 90px 110px 100px minmax(0, 1fr) 210px; }
  .hist-main .h-amt { flex-direction: row; align-items: center; gap: 12px; }
  .hist-main .h-amt b { min-width: 110px; }
  .hist-main .h-amt .bar { flex: 1; max-width: none; height: 8px; }
}
@media (min-width: 1000px) {
  .hist-main .hist-stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .hist-main .hrow { grid-template-columns: 84px 100px 90px minmax(0, 1fr) auto; gap: 16px; }
  .hist-main .hhead > div:last-child { text-align: right; }
}

/* ===== Thu chi (thiết kế lại) ===== */
.toolbar.fin-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar.fin-top .seg { margin: 0; }
.fin-period { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.fin-period .ibtn { width: 34px; height: 34px; border: 0; border-radius: 9px; }
.fp-title { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 0 6px; line-height: 1.15; }
.fp-title b { font-size: 16px; white-space: nowrap; }
.fp-title .link { font-size: 11px; }
.fin-row { margin-bottom: 14px; }

/* thẻ số liệu */
.kpi-bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 2px 0 2px; }
.kpi-bar i { display: block; height: 100%; background: #257de0; border-radius: 99px; }

/* cột trái nhiều thẻ */
.fin-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fin-col .card { margin: 0; }
.fin-cols { margin-top: 2px; }
.card-h { flex-wrap: wrap; gap: 6px 10px; }

/* cơ cấu thu / chi */
.mix-bar { display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; margin: 4px 0 10px; background: #f1f5f9; }
.mix-bar i { display: block; min-width: 3px; }
.mix-list { display: flex; flex-direction: column; }
.mix-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 44px auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mix-row:last-child { border-bottom: 0; }
.mix-dot { width: 10px; height: 10px; border-radius: 3px; }
.mix-k { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-k small { color: var(--muted); font-size: 12px; }
.mix-p { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* điện nước thu vs trả */
.spr { padding: 8px 0; }
.spr + .spr { border-top: 1px dashed var(--line); }
.spr-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.spr-h .ic { width: 16px; height: 16px; color: var(--muted); }
.spr-h .chip { margin-left: auto; }
.spr-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); padding: 3px 0; }
.spr-row b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.spr-bar { height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.spr-bar i { display: block; height: 100%; border-radius: 99px; }
.spr-bar i.g { background: #22c55e; } .spr-bar i.o { background: #f97316; }

/* chi phí: danh sách gọn */
.exp-sub { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 14px 0 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.exp-row { padding: 7px 4px; }
.exp-ic { width: 30px; height: 30px; }

/* năm */
.yr-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--text-2); }
.yr-facts span { display: inline-flex; align-items: center; gap: 6px; }
.yr-facts .ic { width: 15px; height: 15px; color: var(--primary); }
.fin-table tr.dim td { color: #cbd5e1; }
.fin-table td.green { color: var(--green); }

@media (max-width: 640px) {
  .fin-row { flex-wrap: nowrap; }
  .fin-period { margin-left: auto; }
  .fp-title { min-width: 96px; }
  .fp-title b { font-size: 15px; }
  .spr-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .spr-row b { min-width: 0; }
}
@media (max-width: 360px) { .fin-row .ppick .pp-ic { display: none; } }
.card-h #yrAll { margin-left: auto; }
@media (max-width: 360px) {
  .fin-row { gap: 6px; }
  .fin-row .ppick { flex: 0 0 auto; }
  .fin-period { padding: 2px; }
  .fin-period .ibtn { width: 28px; height: 30px; }
  .fp-title { min-width: 0; padding: 0 2px; }
  .fp-title b { font-size: 14px; }
}

/* Email: liên kết & quên mật khẩu */
.forgot-link { align-self: center; margin-top: -2px; text-decoration: none; }
.code-in { font-size: 24px !important; letter-spacing: 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.le-sent, .fg-sent { display: flex; gap: 8px; align-items: flex-start; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 10px; }
.fg-sent { background: var(--primary-soft); border-color: #bfdbfe; color: var(--text-2); }
.le-sent .ic, .fg-sent .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.acc-hint { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; }
.acc-hint .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--primary); }
.fg-help { margin: 6px 0 0; }
/* Đăng ký: ô email tùy chọn */
.opt { font-weight: 400; color: var(--faint); }
.field-hint { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.field-hint .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--primary); }
#verSkip { align-self: center; text-decoration: none; }
/* Lập phiếu: nét đứt tách dòng Tổng với ảnh hóa đơn */
.inv-preview .total-line { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px dashed #cbd5e1; }
/* Lập phiếu: "Tạm tính" mảnh, sát phần nhập liệu phía trên, cách xa ảnh hóa đơn */
.inv-preview .total-line { font-size: 15px; color: var(--muted); margin: -24px 0 6px; padding-bottom: 22px; display: flex; align-items: baseline; gap: 8px; }
.inv-preview .total-line b { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
@media (min-width: 821px) { .inv-preview .total-line { margin-top: 0; } }
/* Cài đặt: hỗ trợ qua Zalo */
.support-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(90deg, #eff6ff, #fff 70%); border: 1px solid #bfdbfe; }
.sup-ic { width: 44px; height: 44px; border-radius: 12px; background: #0068ff; color: #fff; display: grid; place-items: center; flex: none; }
.sup-ic .ic { width: 22px; height: 22px; }
.sup-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.sup-txt b { font-size: 16px; }
.sup-txt span { font-size: 14px; color: var(--muted); }
.support-card .btn.zalo { flex: none; }
@media (max-width: 480px) { .support-card .btn.zalo { width: 100%; } }
