/* Shared Homie interface. Loaded after page-specific styles. */
:root{--homie-font:'Inter','Segoe UI',Arial,sans-serif;--homie-accent:#1769df;--homie-accent-soft:#edf4ff;--homie-navy:#174a8b;--homie-navy-light:#1e5ca7;--homie-ink:#203047;--homie-muted:#62748b;--homie-line:#dfe7f0;--homie-surface:#fff;--homie-bg:#f5f7fb;--homie-success:#16794b;--homie-warning:#996000;--homie-danger:#c33038;--bs-primary:#1769df;--bs-primary-rgb:23,105,223;--bs-success:#16794b;--bs-success-rgb:22,121,75;--bs-danger:#c33038;--bs-danger-rgb:195,48,56}
html{font-size:14px}body,button,input,select,textarea,.table,.sp-table,.bh-table{font-family:var(--homie-font)!important}body.bg-light{background:var(--homie-bg)!important;color:var(--homie-ink);line-height:1.5}
h1,h2,h3,h4,h5,h6{font-family:var(--homie-font)!important;color:var(--homie-ink);font-weight:650;letter-spacing:-.025em}h4{font-size:1.35rem}a{color:var(--homie-accent)}a:focus-visible,button:focus-visible,[tabindex]:focus-visible{outline:3px solid #83b5ff;outline-offset:2px}
#topbar{height:58px;background:#fff!important;color:var(--homie-ink)!important;border-bottom:1px solid var(--homie-line);box-shadow:none;padding:0 16px;gap:12px}#topbar .co-name{font-size:.94rem}#topbar .co-sub,#topbar .tb-urole{color:var(--homie-muted)}#topbar .tb-search{width:420px;max-width:36vw}#topbar .tb-search input{background:#f5f8fc;color:var(--homie-ink);border:1px solid #d7e1ee;min-height:36px}#topbar .tb-search input::placeholder{color:var(--homie-muted)}#topbar .tb-avatar{color:#fff;background:var(--homie-accent)}#topbar .tb-bell{color:var(--homie-ink)}
#sidebar{width:215px;min-width:215px;top:58px;height:calc(100dvh - 58px);background:#fff!important;border-right:1px solid var(--homie-line);box-shadow:none;transition:width .16s ease,min-width .16s ease}#sidebar .text-white,#sidebar .tree-parent,#sidebar .tree-parent[aria-expanded=true]{color:var(--homie-ink)!important}#sidebar .nav-link{color:#425b77!important;border-radius:6px;margin:2px 8px;padding:.62rem .7rem}#sidebar .tree-parent{border-radius:6px;margin:3px 8px;width:calc(100% - 16px);padding:.65rem .7rem;font-size:.91rem}#sidebar .tree-parent:hover,#sidebar .nav-link:hover{background:#f0f5fc!important;color:var(--homie-accent)!important}#sidebar .nav-link.active{background:var(--homie-accent-soft)!important;color:var(--homie-accent)!important;box-shadow:inset 3px 0 var(--homie-accent)}#sidebar .tree-children .nav-link{padding-left:2.15rem;font-size:.88rem}#sidebar .group-title,#sidebar .text-muted{color:var(--homie-muted)!important}
#main-content{height:calc(100dvh - 58px);scroll-padding-top:100px}.homie-menu-btn{background:#fff;border:1px solid var(--homie-line);border-radius:6px;width:34px;height:34px;color:var(--homie-accent);flex-shrink:0;font-size:1.2857rem}.homie-nav-closed #sidebar{display:none}
#worktabs{background:#f5f8fc;box-shadow:none;border-bottom:1px solid var(--homie-line);padding-bottom:3px;scrollbar-width:thin;max-height:45px}.worktab{background:transparent;border:1px solid transparent;border-radius:5px;margin-top:3px;font-size:.83rem;padding:.35rem .65rem}.worktab.active{background:#fff;color:var(--homie-accent);border-color:var(--homie-line);font-weight:600}.worktab .closebtn{border:0;background:transparent;color:inherit;padding:0 3px;line-height:1.3}.worktab>a{color:inherit;text-decoration:none;overflow:hidden;text-overflow:ellipsis}
.homie-viewbar{display:flex;align-items:center;gap:8px;padding:7px 16px;background:#fff;border-bottom:1px solid var(--homie-line);min-height:40px;flex-wrap:wrap}.homie-viewbar strong{font-size:.85rem;font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:100px}.homie-viewbar label{display:flex;align-items:center;gap:6px;font-size:.78rem;margin:0}.homie-viewbar select{font-family:var(--homie-font);border:1px solid var(--homie-line);border-radius:5px;padding:3px 6px;color:#425b77;background:#fff;font-size:.78rem}.homie-viewbar .homie-state{font-size:.75rem;color:var(--homie-muted)}
.card{background:var(--homie-surface);border:1px solid var(--homie-line)!important;border-radius:8px!important;box-shadow:none!important}.card-header{border-color:var(--homie-line);border-radius:8px 8px 0 0!important;background:#fff}.card-body{padding:14px 16px}.btn,.sp-btn{font-family:var(--homie-font)!important;border-radius:6px!important;font-weight:600!important;font-size:.86rem!important;line-height:1.45!important;box-shadow:none!important}.btn-primary{--bs-btn-bg:var(--homie-accent);--bs-btn-border-color:var(--homie-accent);--bs-btn-hover-bg:#1057bd;--bs-btn-hover-border-color:#1057bd}.btn-success{--bs-btn-bg:var(--homie-success);--bs-btn-border-color:var(--homie-success)}.btn-outline-secondary{--bs-btn-color:#425b77;--bs-btn-border-color:#ced9e6;--bs-btn-hover-bg:#f0f5fc;--bs-btn-hover-color:#174a8b;--bs-btn-hover-border-color:#b7cbe4}.btn-sm{padding:.35rem .65rem}.form-control,.form-select{font-size:.9rem!important;border-color:#ced9e6;border-radius:6px;min-height:34px}.form-label,label{color:#425b77;font-weight:550;font-size:.84rem}.form-control:focus,.form-select:focus{border-color:#83b5ff;box-shadow:0 0 0 3px #1769df18}.form-check-input:checked{background-color:var(--homie-accent);border-color:var(--homie-accent)}
.table,.sp-table,.bh-table{font-size:.9rem!important;color:var(--homie-ink)}.table>:not(caption)>*>*,.sp-table td{padding:9px 11px;border-bottom-color:#e9eef5;vertical-align:middle}.table thead th,.sp-table th,.bh-table thead th{font-family:var(--homie-font)!important;font-size:.8rem!important;letter-spacing:0!important;text-transform:none!important;font-weight:600!important;color:#425b77!important;background:#edf4fc!important;border-color:#dfe7f0}.table-hover>tbody>tr:hover>*,.sp-table tr:hover td{--bs-table-bg-state:#f0f6ff;background-color:#f0f6ff}.table-responsive{border-radius:7px;scrollbar-width:thin}.text-end,.text-money-green,.text-money-red,.text-money-blue{font-variant-numeric:tabular-nums}.badge{font-size:.76rem!important;border-radius:5px;font-weight:600}.text-bg-success{background:#e4f5ec!important;color:#11613a!important}.text-bg-warning{background:#fff1cf!important;color:#835000!important}.text-bg-danger{background:#fde9ea!important;color:#a31f2c!important}.text-bg-primary{background:#e7f0ff!important;color:#1458bd!important}.text-bg-secondary{background:#edf1f6!important;color:#52657c!important}.nav-tabs,.io-toggle{border-color:var(--homie-line);gap:3px}.nav-tabs .nav-link,.io-toggle a{font-family:var(--homie-font)!important;font-size:.9rem!important;color:#52657c;white-space:nowrap}.nav-tabs .nav-link.active,.io-toggle a.active.in{color:var(--homie-accent)!important;background:var(--homie-accent-soft)!important;border-color:#b8d3fa!important}.nav-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}.erp-ribbon{box-shadow:none;border-color:var(--homie-line)}.erp-ribbon .lbl{text-transform:none;font-size:.8rem;color:var(--homie-muted)}.erp-ribbon .val{font-size:1.05rem}.hq-tabs{background:var(--homie-bg)}
.homie-compact .table>:not(caption)>*>*,.homie-compact .sp-table td{padding:5px 9px}.homie-compact .card-body{padding:10px 12px}.homie-compact .form-control,.homie-compact .form-select{min-height:30px}.homie-compact .btn-sm{padding:.25rem .55rem}.homie-table-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:8px 0;font-size:.8rem}.homie-table-tools details{position:relative}.homie-table-tools summary{cursor:pointer;list-style:none;padding:5px 10px;border:1px solid var(--homie-line);border-radius:6px;background:#fff}.homie-columns{position:absolute;right:0;top:100%;z-index:40;width:230px;padding:12px;background:#fff;border:1px solid var(--homie-line);box-shadow:0 8px 25px #2030471a;border-radius:7px}.homie-columns label{display:flex;gap:8px;align-items:center;padding:5px}.homie-hidden-column{display:none!important}.homie-preview-row{cursor:pointer}.homie-preview-row:focus-visible{outline:2px solid #1769df;outline-offset:-2px}.homie-preview-header{display:flex;gap:12px;align-items:start;justify-content:space-between}.homie-preview-facts{display:flex;flex-wrap:wrap;gap:10px 24px;margin:12px 0;color:#425b77}.homie-preview-facts strong{display:block;color:var(--homie-ink)}.homie-preview-summary{background:#f5f8fc;padding:12px;border:1px solid var(--homie-line);border-radius:7px}.homie-preview-error{padding:30px;text-align:center}.homie-preview-dialog .modal-content{border:1px solid var(--homie-line);border-radius:10px}.homie-preview-dialog .modal-header{border-bottom-color:var(--homie-line)}.homie-preview-dialog .modal-body{max-height:75dvh;overflow:auto}.homie-preview-dialog .modal-footer{justify-content:space-between}
.fin-tab-nav .nav-link,.sp-tabs a{font-family:var(--homie-font)!important;font-size:.9rem!important;color:#52657c!important}.fin-tab-nav .nav-link.active,.sp-tabs a.active{color:var(--homie-accent)!important;border-bottom-color:var(--homie-accent)!important;background:var(--homie-accent-soft)}
@media(max-width:900px){#sidebar{position:fixed;left:0;top:58px;z-index:1040;width:235px;box-shadow:4px 0 20px #20304725}body:not(.homie-nav-open) #sidebar{display:none}.homie-nav-closed #sidebar{display:none}#topbar .co-sub,#topbar .tb-uname,#topbar .tb-urole{display:none}#topbar .co-name{font-size:.8rem}#topbar .tb-search{max-width:none;flex:1;min-width:100px}#topbar .co{max-width:35%}.homie-viewbar{padding:6px 10px}#main-content{width:100%}.homie-viewbar .homie-state{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
@media print{.homie-viewbar,.homie-table-tools,.homie-menu-btn{display:none!important}.homie-hidden-column{display:table-cell!important}body{font-size:0.7857rem}#sidebar{display:none!important}}
/* Bootstrap d-flex also uses !important; collapsed navigation must override it. */
.homie-nav-closed #sidebar{display:none!important}
@media(max-width:900px){body:not(.homie-nav-open) #sidebar{display:none!important}}
/* Task-oriented lists: readable rows, compact context, full table workspace. */
.homie-viewbar{min-height:32px;padding:4px 16px}.homie-viewbar>strong{display:none}.homie-viewbar .homie-state{margin-left:auto}
.homie-period{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:0.9286rem}.homie-period select{width:auto;min-width:165px}
.homie-summary-strip{display:flex;align-items:center;flex-wrap:wrap;gap:8px 24px;padding:10px 14px;background:#fff;border:1px solid var(--homie-line);border-radius:7px;margin:8px 0;font-size:0.9286rem}.homie-summary-strip strong{margin-left:8px;color:var(--homie-ink);font-variant-numeric:tabular-nums}.homie-summary-strip details{margin-left:auto}.homie-summary-strip summary{cursor:pointer;color:var(--homie-muted)}
.homie-filter-form{background:#fff;border:1px solid var(--homie-line);border-radius:7px;padding:10px 12px;margin-bottom:10px}.homie-filter-main{display:flex;flex-wrap:wrap;gap:8px;align-items:end}.homie-filter-main>.col-6{width:auto;flex:0 1 150px}.homie-filter-main>.homie-search-field{flex:1 1 260px}.homie-filter-main label{display:block}.homie-filter-actions{display:flex;gap:6px}.homie-extra-filters{margin:7px 0;font-size:0.9286rem}.homie-extra-filters>summary{cursor:pointer;color:var(--homie-accent);padding:5px 0}.homie-extra-filters[open]>.homie-filter-main{padding-top:7px}
.homie-scroll{overflow:auto!important;max-height:var(--homie-table-height,65dvh)!important;position:relative;overscroll-behavior:contain;scrollbar-gutter:stable;border-radius:5px}
.homie-scroll>table{width:100%;font-size:0.9286rem!important;border-collapse:separate!important;border-spacing:0;table-layout:auto!important}.homie-scroll>table>thead{position:sticky;top:0;z-index:12;background:#edf4fb}.homie-scroll>table>thead th{background:#edf4fb!important;color:#344c68!important;font-size:0.8571rem!important;line-height:1.4;text-transform:none!important;letter-spacing:0!important;white-space:normal;min-width:60px;padding:9px 10px!important;border-bottom:1px solid #cddbec}.homie-scroll>table>thead th:not(.bh-frz){position:static!important}.homie-scroll>table>thead th.bh-frz{top:auto!important}.homie-scroll>table>tbody>tr>td{font-size:0.9286rem!important;line-height:1.45;padding:9px 10px!important;vertical-align:middle}.homie-scroll>table>tbody>tr:nth-child(even)>td{background-color:#f8fafc}.homie-scroll>table>tbody>tr:hover>td{background-color:#edf4ff}.homie-scroll td.text-end,.homie-scroll td.num{white-space:nowrap;font-variant-numeric:tabular-nums}.homie-scroll .homie-stt{width:45px;min-width:40px;text-align:center}.homie-scroll>table>tfoot{background:#f5f8fc;font-size:0.9286rem}.homie-compact .homie-scroll>table>tbody>tr>td{padding:5px 9px!important}
.homie-list-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0;font-size:0.8571rem;color:var(--homie-muted)}.homie-list-tools button{font-size:0.8571rem}.homie-table-focus{position:fixed!important;inset:100px 16px 16px!important;z-index:1045!important;background:white;max-height:none!important;width:auto!important;box-shadow:0 0 0 100vmax #20304799;border:1px solid #cddbec}.homie-focus-close{position:fixed;z-index:1046;top:65px;right:16px;background:white;border:1px solid #cddbec;border-radius:6px;padding:6px 12px;color:#1769df}.homie-table-focus>table{min-width:100%}
@media(max-width:700px){.homie-filter-main>.col-6{flex:1 1 130px}.homie-filter-main>.homie-search-field{flex-basis:100%}.homie-summary-strip{gap:6px 12px}.homie-summary-strip details{margin-left:0}.homie-table-focus{inset:100px 6px 6px!important}}
@media print{.homie-list-tools,.homie-focus-close{display:none!important}.homie-scroll,.homie-table-focus{position:static!important;max-height:none!important;overflow:visible!important;box-shadow:none!important}.homie-scroll>table>thead{display:table-header-group;position:static}}
#topbar .homie-viewbar{border:0;padding:0;min-height:0;background:none;gap:5px}#topbar .homie-viewbar .homie-state{display:none}#topbar .homie-viewbar label{font-size:0.7857rem;margin:0}#topbar .homie-viewbar select{min-height:28px;width:70px;font-size:0.8571rem}.homie-period{margin:0 0 0 auto}.homie-summary-strip{padding:7px 12px;gap:6px 20px}.homie-filter-form{padding:7px 10px}.homie-extra-filters{margin:3px 0}.homie-inline-tools{margin:0;margin-right:auto}.homie-list-tools:has(.homie-inline-tools)>span{display:none}.homie-list-tools{padding:0 10px;margin:4px 0}.homie-task-warning{display:block;font-size:0.8571rem;color:#8b650f;padding:3px 0;margin-bottom:6px}.homie-work-board>.card-header{background:#fff!important;color:#203047!important;padding:6px 10px}.homie-work-board>.card-header .btn{padding:5px 9px}.homie-filter-main>.homie-search-field{flex-basis:230px}.homie-work-board .homie-scroll{border-radius:0}
@media(max-width:700px){#topbar .homie-viewbar label{display:none}#topbar .tb-right{gap:5px}.homie-period{margin:4px 0}.homie-period label{display:none}}
.homie-scroll>table>tbody>tr>td.p-0{padding:0!important}
.homie-scroll>#behTable{min-width:1250px!important}.homie-scroll>#behTable>thead th{white-space:nowrap;min-width:70px;padding:7px 10px!important}.homie-scroll>#behTable .bh-frz-3{min-width:155px}.homie-scroll>#behTable .bh-frz-2{min-width:135px}

.homie-filter-dock{display:flex;align-items:end;gap:8px;padding:8px 10px;background:#fff;border:1px solid #e2e8f0;border-radius:7px;margin:8px 0}.homie-dock-search{flex:1;max-width:640px;min-width:120px}.homie-dock-search label{display:block;font-size:0.8571rem;color:#52647a;margin-bottom:3px}.homie-dock-search input{width:100%;min-width:0;font-size:0.9286rem}.homie-filter-drawer{--bs-offcanvas-width:420px}.homie-filter-drawer form,.homie-filter-drawer .sp-filter{display:block!important;padding:0!important;width:100%!important;border:0!important;margin:0!important}.homie-filter-drawer .homie-filter-main,.homie-filter-drawer .homie-filter-grid{display:grid!important;grid-template-columns:1fr!important;gap:14px!important}.homie-filter-drawer .homie-filter-main>div,.homie-filter-drawer .homie-filter-grid>div,.homie-filter-drawer form>.col-auto{width:100%!important;margin:0 0 12px!important}.homie-filter-drawer select,.homie-filter-drawer input:not([type=hidden]),.homie-filter-drawer .sp-filter select{width:100%!important;min-width:0!important;margin:0!important;border-radius:6px!important}.homie-filter-drawer .homie-search-field:empty,.homie-filter-drawer .sp-search:has(input[form]){display:none}.homie-debt-groups{display:flex;gap:6px;padding:8px 10px;overflow-x:auto;background:#f8fafc}.homie-debt-groups a{flex:1;min-width:190px;padding:6px 9px;border:1px solid #dde5ef;border-radius:6px;text-decoration:none;font-size:0.8571rem;color:#52647a;background:white}.homie-debt-groups strong{display:block;font-size:1rem;color:#233b57}.homie-debt-groups a.active{border-color:#1769df;background:#eff6ff}.homie-scroll>table[data-homie-table^="debt-"]{min-width:1450px}.homie-scroll>table[data-homie-table^="debt-"] th{white-space:nowrap}.homie-scroll>table[data-homie-table^="debt-"] td:nth-child(2){min-width:135px}.homie-scroll>table[data-homie-table^="debt-"] td:nth-child(5){min-width:180px;max-width:260px}.homie-scroll>table[data-homie-table^="debt-"] td:nth-child(6){min-width:190px}
@media(max-width:600px){.homie-filter-dock{gap:5px}.homie-filter-dock>.btn{padding:6px;font-size:0.8571rem}.homie-filter-drawer{--bs-offcanvas-width:min(420px,100vw)}}

.homie-filter-drawer .homie-search-field:not(:has(input)),.homie-filter-drawer .sp-search:not(:has(input)),.homie-filter-drawer .sc-search-wrap>.ic{display:none!important}.homie-filter-drawer .sp-group{display:grid!important;gap:12px!important;margin:0!important}.homie-filter-drawer .sp-pop{position:static!important;display:block!important;box-shadow:none!important;min-width:0!important;width:100%!important;border:0!important;padding:8px 0!important}.homie-filter-drawer .sp-dd{display:block!important;width:100%!important;margin-bottom:12px}.homie-filter-drawer .sp-dd>button{pointer-events:none;border:0!important;padding:0!important;font-weight:600;background:none!important}.homie-filter-drawer .homie-filter-more{border-top:1px solid #e2e8f0;padding-top:12px}.homie-filter-drawer .sc-search-wrap{max-width:100%}.sc-toolbar>.homie-filter-dock{flex:1}.homie-filter-drawer .col{margin-bottom:12px}

.homie-dock-search label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.homie-filter-dock{padding:6px 10px;margin:5px 0}.homie-debt-note{padding:5px 10px;font-size:0.8571rem;color:#52647a}.homie-debt-groups a{padding:4px 8px}.homie-debt-groups strong{font-size:0.9286rem}

.homie-scroll>table[data-homie-table="debt-contracts-v1"] td:nth-child(6){min-width:125px}.homie-scroll>table[data-homie-table="debt-contracts-v1"]{min-width:1350px}
.homie-scroll>table[data-homie-table="debt-contracts-v1"] td:nth-child(8){min-width:185px}.homie-scroll>table[data-homie-table="debt-contracts-v1"] td:nth-child(13){min-width:155px}.homie-scroll>table[data-homie-table="debt-contracts-v1"] td:nth-child(14){min-width:95px}.homie-scroll>table[data-homie-table="debt-contracts-v1"] td:nth-child(7){white-space:nowrap}
/* ===== Tỷ lệ theo màn hình (bà chủ 2026-11-01): chữ, khoảng cách co giãn theo bề rộng màn, không cố định 14px.
   Mốc cỡ chữ gốc: 1920px = 14px (như cũ) · 1366px ≈ 12,8px · ≤1110px = 12,25px · ≥2340px = 15px.
   Cỡ chữ trong CSS chung đều theo rem nên co giãn cùng. */
html{font-size:clamp(12.25px,calc(9.84px + .2166vw),15px)}
@media(min-width:901px){#sidebar{width:clamp(180px,13.5vw,215px);min-width:clamp(180px,13.5vw,215px)}}
#topbar .tb-search{width:clamp(220px,28vw,420px)}
.table>:not(caption)>*>*,.sp-table td{padding:.6rem .75rem}
.homie-compact .table>:not(caption)>*>*,.homie-compact .sp-table td{padding:.36rem .62rem}
.table td.text-end,.table td.lm-num,.table th.lm-num{white-space:nowrap;font-variant-numeric:tabular-nums}
