:root{--nav:#172334;--nav2:#203149;--blue:#3d7bfd;--ink:#182333;--muted:#78869a;--line:#e8edf4;--bg:#f5f7fb;--card:#fff;--green:#20a779;--orange:#e89a32;--red:#e35b68}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft Yahei",sans-serif}.app-shell{display:flex;min-height:100vh}.sidebar{width:236px;background:var(--nav);color:#d6dfeb;display:flex;flex-direction:column;flex:none}.brand{height:78px;padding:20px 20px;display:flex;gap:11px;align-items:center;border-bottom:1px solid rgba(255,255,255,.07)}.brand-icon{width:34px;height:34px;border-radius:10px;background:#4d83ff;color:#fff;display:grid;place-items:center;font-weight:700;font-size:17px}.brand strong{display:block;color:#fff;font-size:15px}.brand small{display:block;color:#8ea0b7;font-size:9px;letter-spacing:1.5px;margin-top:2px}.nav-title{padding:25px 20px 10px;color:#8294aa;font-size:11px;letter-spacing:1px}.nav-item{width:100%;border:0;background:transparent;color:#bdcadd;padding:12px 22px;display:flex;align-items:center;gap:13px;text-align:left;font-size:14px;cursor:pointer}.nav-item span{width:20px;color:#92a5c0;font-size:17px;text-align:center}.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}.nav-item.active{background:linear-gradient(90deg,#3467c8,#284f9a);color:#fff;box-shadow:inset 3px 0 #79a6ff}.nav-item.active span{color:#fff}.sidebar-bottom{margin-top:auto;padding:18px 20px 22px;border-top:1px solid rgba(255,255,255,.07);font-size:12px;color:#c5d0df}.sidebar-bottom small{display:block;color:#8294aa;margin:6px 0 0 17px}.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#48ca90;margin-right:9px}.main{flex:1;min-width:0}.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 30px;color:var(--muted)}.crumb{color:#8390a1}.slash{margin:0 9px;color:#cbd3df}.topbar strong{color:#26364a}.top-actions{display:flex;align-items:center;gap:12px}.sync-indicator{padding:5px 10px;border-radius:20px;background:#eef8f3;color:#16885e;font-size:12px}.ghost-btn{border:1px solid var(--line);background:#fff;border-radius:7px;padding:7px 11px;color:#4b6079;cursor:pointer}.user-pill{padding:7px 13px;border-radius:20px;background:#f0f4fa;color:#52647b}.content{padding:28px 32px 45px;max-width:1450px;margin:auto}.page-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:22px}.eyebrow{font-size:11px;color:var(--blue);letter-spacing:1.3px;margin:0 0 5px}.page-head h1{margin:0;font-size:27px;letter-spacing:-.5px}.subtitle{margin:5px 0;color:var(--muted)}.head-actions{display:flex;gap:9px}.button{border:1px solid var(--line);border-radius:7px;padding:9px 14px;background:#fff;color:#506278;cursor:pointer}.button.primary{border-color:var(--blue);background:var(--blue);color:#fff}.button:hover{filter:brightness(.97)}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.metric-card,.panel{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 5px 18px rgba(33,56,89,.035);min-width:0}.metric-card{padding:18px}.metric-label{color:var(--muted);font-size:12px;margin:3px 0 6px}.metric-value{font-size:27px;font-weight:700;letter-spacing:-.6px}.metric-value .unit{font-size:12px;font-weight:400;color:var(--muted);margin-left:5px}.metric-sub{display:flex;justify-content:space-between;margin-top:15px;color:var(--muted);font-size:12px}.metric-sub strong{color:var(--ink);font-size:13px}.section-title{display:flex;align-items:center;justify-content:space-between;margin:23px 0 12px}.section-title h2{font-size:17px;margin:0}.muted{color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:18px}.panel{padding:20px}.panel h3{margin:0;font-size:15px}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}.chart{height:245px;display:flex;align-items:flex-end;gap:18px;padding:20px 12px 36px;border-bottom:1px solid var(--line);overflow:visible}.bar-group{flex:1;height:100%;display:flex;align-items:flex-end;justify-content:center;gap:4px;position:relative;min-width:0}.bar{width:19px;border-radius:4px 4px 0 0;min-height:3px}.bar.income{background:#6595ff}.bar.expense{background:#a9b7cb}.bar-label{position:absolute;bottom:-29px;color:var(--muted);font-size:11px;white-space:nowrap}.legend{display:flex;gap:15px;color:var(--muted);font-size:12px;margin-top:27px}.legend i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px}.rank-row{display:flex;align-items:center;gap:10px;margin:14px 0}.rank-name{width:80px;color:#4c6078}.rank-track{height:9px;background:#edf1f6;border-radius:8px;flex:1;overflow:hidden}.rank-fill{height:100%;background:linear-gradient(90deg,#74a4ff,#3d7bfd);border-radius:8px}.rank-amount{width:90px;text-align:right;font-weight:600}.stats-panel{min-width:0}.stats-chart{height:285px;display:flex;gap:10px;padding:4px 0 0}.stats-y-axis{width:72px;display:flex;flex-direction:column;justify-content:space-between;padding:0 0 34px;color:#6c6f75;font-size:11px;text-align:right}.stats-plot{position:relative;flex:1;min-width:0;padding-bottom:34px}.stats-grid-lines{position:absolute;inset:0 0 34px;display:flex;flex-direction:column;justify-content:space-between}.stats-grid-lines i{display:block;border-top:1px solid #d9d9d9}.stats-bars-row{position:relative;height:100%;display:flex;align-items:stretch;justify-content:space-around;gap:10px}.stats-bar-group{flex:1;min-width:34px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;position:relative}.stats-bars{flex:1;min-height:0;display:flex;align-items:flex-end;justify-content:center;gap:3px;width:100%}.stats-bar{position:relative;width:22px;min-height:2px;background:#f04d40;border-radius:1px 1px 0 0;cursor:pointer}.stats-bar.expense{background:#187b09}.stats-tooltip{display:none;position:absolute;z-index:5;left:50%;bottom:32px;transform:translateX(-50%);white-space:nowrap;background:rgba(51,51,51,.84);color:#fff;padding:6px 8px;border-radius:3px;font-size:12px;line-height:1.5}.stats-bar-group:hover .stats-tooltip{display:block}.stats-month{position:static;display:flex;align-items:flex-end;justify-content:center;height:24px;margin-top:6px;color:#444;font-size:11px;line-height:1;white-space:nowrap}.stats-panel .legend{margin-top:4px}.stats-panel .legend i{width:10px;height:10px}
.filterbar{background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.filterbar input,.filterbar select,.form-grid input,.form-grid select{border:1px solid #dfe5ee;border-radius:6px;padding:9px 10px;color:#405168;background:#fff;min-width:160px}.filterbar input{flex:1;min-width:220px}.stats-row{display:flex;gap:26px;align-items:center;background:#fff;border:1px solid var(--line);padding:15px 18px;border-radius:10px;margin-bottom:14px;flex-wrap:wrap}.stat strong{font-size:18px;margin-left:5px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}.data-table{width:100%;border-collapse:collapse;min-width:800px}.data-table th,.data-table td{padding:13px 15px;border-bottom:1px solid #eef1f5;text-align:left;white-space:nowrap}.data-table th{background:#fafbfd;color:#8390a1;font-weight:500;font-size:12px}.data-table tbody tr:hover{background:#fbfcff}.data-table td.amount{font-weight:600}.badge{padding:4px 9px;border-radius:20px;font-size:12px;background:#eef4ff;color:#3d6dcc}.badge.green{background:#eaf8f2;color:#19895f}.badge.orange{background:#fff4e5;color:#bc7520}.badge.gray{background:#f1f3f6;color:#78869a}.tree{display:grid;gap:11px}.tree-row{display:grid;grid-template-columns:28px 1.5fr 130px 130px 120px;align-items:center;padding:15px 17px;border:1px solid var(--line);border-radius:8px;background:#fff}.tree-row.child{margin-left:35px;background:#fcfdff}.tree-row .name{font-weight:600}.progress{height:8px;background:#edf1f5;border-radius:6px;overflow:hidden}.progress span{display:block;height:100%;background:#5086f7}.empty{padding:50px;text-align:center;color:var(--muted)}.toast{position:fixed;right:30px;top:78px;padding:11px 15px;border-radius:8px;background:#24364e;color:#fff;box-shadow:0 8px 25px rgba(20,35,55,.2);z-index:20}.modal{position:fixed;inset:0;background:rgba(24,37,56,.42);display:grid;place-items:center;z-index:15} .modal[hidden]{display:none}.modal-card{background:#fff;width:min(560px,calc(100vw - 32px));max-height:90vh;overflow:auto;border-radius:12px;box-shadow:0 18px 60px rgba(22,38,63,.25)}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:17px 20px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.icon-btn{border:0;background:transparent;color:#77859a;font-size:24px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;padding:20px}.form-grid label{display:grid;gap:6px;color:#5a6b80;font-size:13px}.form-grid label.full{grid-column:1/-1}.form-grid input,.form-grid select{width:100%;min-width:0}.form-actions{padding:0 20px 20px;display:flex;justify-content:flex-end;gap:9px}.notice{padding:12px 15px;background:#fff7e7;border:1px solid #f4dfb3;color:#a66a16;border-radius:8px;margin-bottom:15px}@media(max-width:1000px){.sidebar{width:190px}.metric-grid{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}}@media(max-width:700px){.sidebar{display:none}.content{padding:20px 14px}.topbar{padding:0 14px}.top-actions .user-pill{display:none}.metric-grid{grid-template-columns:1fr}.page-head{display:block}.head-actions{margin-top:14px}.tree-row{grid-template-columns:25px 1fr 100px}.tree-row .progress,.tree-row .target{display:none}}

.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:12px 2px;color:var(--muted);font-size:12px}.pager>div{display:flex;gap:8px}.pager .button[disabled]{opacity:.45;cursor:not-allowed}
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.permission-chip{display:flex;flex-direction:column;gap:2px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:10px 12px}.permission-chip small{color:var(--muted);font-size:11px}.permission-edit{display:grid;gap:13px}.permission-edit fieldset{border:1px solid var(--line);border-radius:8px;padding:10px 13px;display:flex;gap:15px;flex-wrap:wrap}.permission-edit legend{padding:0 5px;color:var(--blue);font-size:12px}.permission-edit .check{display:flex;align-items:center;gap:5px;color:var(--ink);font-size:12px}
.login-screen{min-height:100vh;display:grid;place-items:center;background:#eef3fb;padding:24px}.login-screen[hidden],.app-shell[hidden]{display:none}.login-card{width:min(420px,100%);padding:34px;background:#fff;border-radius:16px;box-shadow:0 14px 45px rgba(22,38,63,.12)}.login-card .brand-icon{width:48px;height:48px;font-size:24px}.login-card h1{margin:16px 0 3px;font-size:24px}.login-card p{color:var(--muted);margin:0 0 24px}.login-card form,.login-card label{display:grid;gap:10px}.login-card form{gap:18px}.login-card input{width:100%;padding:12px;border:1px solid var(--line);border-radius:8px}.login-error{color:var(--red);min-height:18px}.form-grid .check{display:flex;align-items:center;gap:8px}.form-grid .check input{width:auto;min-width:0}.profit-section{background:#f2f5fa;font-weight:700}.profit-config-section{margin-bottom:14px}.config-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-top:1px solid var(--line)}.config-row small{color:var(--muted);margin-left:8px}.config-row .button{padding:5px 9px}.tree-row{grid-template-columns:28px 1.5fr 130px 130px 120px 72px}
.plan-root{background:#f7f9fd;font-weight:600}.plan-child td:first-child{padding-left:32px}.plan-root .button,.plan-child .button{padding:5px 8px;margin-right:4px}.filterbar select#finance-plan-select{min-width:210px}
.ledger-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));align-items:end;gap:12px}.ledger-filters label{display:grid;gap:5px;color:#596b80;font-size:12px;min-width:0}.ledger-filters label[hidden]{display:none}.ledger-filters input,.ledger-filters select{width:100%;min-width:0}.ledger-filter-actions{display:flex;gap:8px;align-items:center}.ledger-stats{flex-wrap:wrap;gap:12px 20px}.ledger-stats small{flex-basis:100%}.ledger-actions{white-space:nowrap}.ledger-actions .button{padding:5px 8px;margin:2px}

/* Search employee names without changing the staff IDs submitted by each form. */
.staff-search{display:block;position:relative;min-width:0;width:100%}
.staff-search select[hidden],.staff-search-clear[hidden]{display:none}
.staff-search .staff-search-input{width:100%;min-width:0;padding-right:56px;text-overflow:ellipsis}
.staff-search-input:focus{outline:2px solid #acc8ff;outline-offset:1px;border-color:#6f9ff8}
.staff-search-clear,.staff-search-toggle{position:absolute;top:1px;bottom:1px;width:27px;border:0;padding:0;background:transparent;color:#7d8ca0;cursor:pointer;font:inherit}
.staff-search-clear{right:27px;font-size:18px}.staff-search-toggle{right:1px}
.staff-search-clear:hover,.staff-search-toggle:hover{color:#2868d9;background:#f0f5ff}
.staff-search-popup{position:fixed;z-index:30;overflow:auto;overscroll-behavior:contain;border:1px solid #dfe5ee;border-radius:7px;padding:4px;background:#fff;box-shadow:0 8px 24px rgba(22,38,63,.16);color:#405168;font-size:13px;line-height:22px}
.staff-search-option{padding:9px 10px;border-radius:4px;cursor:pointer;overflow-wrap:anywhere}
.staff-search-option:hover,.staff-search-option.active{background:#edf3ff;color:#2868d9}
.staff-search-option[aria-selected="true"]{font-weight:600;color:#2868d9}
.staff-search-empty{padding:12px 10px;color:#8390a1}

/* Keep every ledger column visible while the table scrolls horizontally. */
.ledger-table{table-layout:fixed;width:100%;min-width:1287px}
.ledger-table th,.ledger-table td{padding:13px 10px;vertical-align:middle}
.ledger-table th:nth-child(1){width:140px}.ledger-table th:nth-child(2){width:104px}.ledger-table th:nth-child(3){width:80px}
.ledger-table th:nth-child(4){width:160px}.ledger-table th:nth-child(5){width:125px}.ledger-table th:nth-child(6){width:108px}
.ledger-table th:nth-child(7){width:130px}.ledger-table th:nth-child(8){width:200px}
.ledger-table th:nth-child(9){width:80px}.ledger-table th:nth-child(10){width:160px}
.ledger-table .ledger-actions .button{padding:5px 7px;margin:2px 1px}
.ledger-table td:nth-child(1),.ledger-table td:nth-child(3),.ledger-table td:nth-child(4),.ledger-table td:nth-child(5),.ledger-table td:nth-child(6),.ledger-table td:nth-child(7),.ledger-table .ledger-description{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.ledger-flags{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-bottom:6px}
.ledger-flag{display:inline-flex;align-items:center;padding:2px 7px;border-radius:4px;font-size:12px;font-weight:600;line-height:20px;white-space:nowrap;color:#fff}
.ledger-flag.excluded{background:#ad5700}.ledger-flag.no-invoice{background:#c9363c}
.form-grid .entry-checks{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px}
.entry-checks .ledger-flags{flex-basis:100%;margin:0}.entry-checks .ledger-flags:empty{display:none}
.form-grid textarea{width:100%;min-width:0;resize:vertical;border:1px solid #dfe5ee;border-radius:6px;padding:9px 10px;color:#405168;background:#fff;font:inherit}
.form-error{color:#c63042;min-height:1.3em}
.button.danger{border-color:#d94250;background:#d94250;color:#fff}
.button:disabled{opacity:.6;cursor:not-allowed}

/* Dashboard month filters and independently scrollable chart. */
.dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
.dashboard-metrics .metric-value{overflow-wrap:anywhere}
.dashboard-note{margin:-6px 0 16px;color:var(--muted);font-size:12px}
.dashboard-filter{display:flex;align-items:flex-end;gap:7px;flex-wrap:wrap;margin:-4px 0 14px}
.dashboard-filter label{display:grid;gap:3px;color:#66788c;font-size:12px;min-width:0}
.dashboard-filter input,.dashboard-filter select{height:36px;width:132px;min-width:0;padding:6px 7px;border:1px solid #dfe5ee;border-radius:6px;background:#fff;color:#405168;font:inherit}
.dashboard-filter .button{height:36px;padding:6px 10px}
.dashboard-filter-separator{padding:0 1px 8px;color:var(--muted)}
.dashboard-filter .dashboard-preset select{width:110px}
.dashboard-range{color:var(--muted);font-size:12px;margin:0 0 10px;overflow-wrap:anywhere}
.stats-y-axis{width:105px;flex:none}
.stats-scroll{flex:1;min-width:0;overflow-x:auto;overflow-y:hidden}
.stats-plot{height:100%}
.stats-bar-group:focus-visible .stats-tooltip{display:block}
.stats-bar-group:first-child .stats-tooltip{left:0;transform:none}
.stats-bar-group:last-child .stats-tooltip{left:auto;right:0;transform:none}
.rank-name{width:88px;flex:none;overflow-wrap:anywhere}
.rank-amount{width:auto;min-width:105px;flex:none}
@media(max-width:1000px){.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.dashboard-metrics{grid-template-columns:1fr}.dashboard-filter{gap:6px}.dashboard-filter input{width:120px}.stats-y-axis{width:90px}}
.stats-y-axis{padding-bottom:30px}
.stats-plot{padding-bottom:0}
.stats-grid-lines{bottom:30px}
.stats-bars{position:relative}
.stats-bar{position:absolute;min-height:0;left:calc(50% - 24px)}
.stats-bar.expense{left:calc(50% + 2px)}
.stats-zero-line{position:absolute;left:0;right:0;border-top:1px solid #aab3bd}

/* Account directory: filter accounts by department without hiding unassigned accounts. */
.directory-layout{display:grid;grid-template-columns:230px minmax(0,1fr);background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 5px 18px rgba(33,56,89,.035);overflow:hidden}
.directory-sidebar{padding:20px 14px;border-right:1px solid var(--line);min-width:0}
.directory-sidebar-head h2,.directory-header h2{font-size:16px;margin:0}
.directory-list{display:grid;gap:6px;margin-top:16px}
.directory-department{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:0;border-radius:7px;padding:10px 11px;background:#f7f9fc;color:#405168;font:inherit;text-align:left;cursor:pointer}
.directory-department span:first-child{overflow-wrap:anywhere}
.directory-department span:last-child{color:#8290a3;font-size:12px;flex:none}
.directory-department:hover{background:#f0f5ff}
.directory-department.active{background:#e9f1ff;color:#2c6eea;font-weight:600}
.directory-content{min-width:0;padding:20px}
.directory-header>div{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.directory-filters{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin:16px 0}
.directory-filters label{display:grid;gap:5px;color:#66788c;font-size:12px}
.directory-filters input,.directory-filters select{height:38px;min-width:160px;padding:8px 10px;border:1px solid #dfe5ee;border-radius:6px;background:#fff;color:#405168;font:inherit}
.directory-filters .directory-search input{min-width:220px}
.directory-filters .button{height:38px;padding:8px 13px}
.directory-table .button{padding:6px 10px}
@media(max-width:1000px){.directory-layout{grid-template-columns:190px minmax(0,1fr)}.directory-content{padding:16px}}
@media(max-width:700px){.directory-layout{grid-template-columns:minmax(0,1fr)}.directory-sidebar{border-right:0;border-bottom:1px solid var(--line);padding:16px}.directory-list{display:flex;overflow-x:auto;padding-bottom:4px}.directory-department{width:auto;min-width:max-content}.directory-content{padding:16px}.directory-filters .directory-search{flex:1 1 100%}.directory-filters .directory-search input{width:100%;min-width:0}}
.form-grid [hidden]{display:none}
