:root{--bg:#f5f5f0;--paper:#fff;--ink:#233c34;--body:#40514b;--muted:#7b847d;--line:#e6e8df;--green:#204e40;--green-light:#edf3ec;--sidebar:#173d33;--sidebar-ink:#b8cac0;--gold:#a88345;--gold-bg:#f5f0e5;--red:#ae5e49;--red-bg:#fbf0eb;--radius:12px;--sans:'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;font-family:var(--sans);font-size:13px;color:var(--body)}
*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--bg)}body{overflow:hidden;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit;color:inherit}button,summary{cursor:pointer}button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:35px;padding:7px 13px;border:1px solid var(--line);border-radius:7px;background:var(--paper);font-weight:500;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s}button:hover{background:#f6f8f3;border-color:#b6c7b9}button:active{background:#e8eee5}button:disabled{opacity:.5;cursor:default}.primary{background:var(--green);border-color:var(--green);color:#fff}.primary:hover{background:#173d33;border-color:#173d33;box-shadow:0 3px 8px #173d3314}.soft-button{background:var(--green-light);color:var(--green);border-color:transparent}.icon-button{width:35px;padding:7px}.lucide{width:16px;height:16px;stroke-width:1.7;flex-shrink:0}input,select,textarea{border:1px solid #dfe4db;background:#fff;border-radius:6px;min-height:33px;padding:6px 9px;outline:none;min-width:0;transition:border-color .15s,box-shadow .15s}input:focus,select:focus,textarea:focus{border-color:#719483;box-shadow:0 0 0 3px #204e4010}input[readonly]{background:#f5f7f2;color:#607466}input[type=checkbox]{min-height:0;accent-color:var(--green);width:14px;height:14px;margin:0;vertical-align:middle}button:focus-visible,summary:focus-visible{outline:2px solid #789789;outline-offset:3px}[hidden]{display:none!important}h1,h2,h3,p{margin:0}h1,h2,h3{color:var(--ink)}kbd{font:10px var(--sans);opacity:.65;border:1px solid currentColor;border-radius:3px;padding:1px 4px;white-space:nowrap}hr{border:0;border-top:1px solid var(--line);margin:5px 0}.eyebrow{font-size:9px;letter-spacing:1.8px;color:var(--gold);font-weight:600}
#app-shell{height:100dvh;display:grid;grid-template-columns:216px minmax(0,1fr);grid-template-rows:72px minmax(0,1fr) 29px}.app-header{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:1px solid var(--line);background:#ffffffb8;gap:20px}.identity{display:flex;align-items:center;gap:11px}.identity h1{font-size:14px;font-weight:600}.breadcrumb{color:#929a92;font-size:12px}.local-badge{display:flex;align-items:center;gap:5px;border:1px solid #e3e9df;border-radius:5px;padding:3px 7px;font-size:10px;color:#68816d;margin-left:7px}.local-badge b{width:5px;height:5px;background:#6e9770;border-radius:50%}.account-tools{display:flex;gap:8px;align-items:center}.account-tools>label{display:flex;align-items:center;gap:8px;border-right:1px solid var(--line);padding-right:14px}.account-tools select{border:0;background:transparent;max-width:215px;font-size:12px;padding-left:0}.account-tools .icon-button{border-color:transparent;background:transparent}.app-body{display:contents}.tree-panel{grid-column:1;grid-row:1/-1;background:var(--sidebar);display:flex;flex-direction:column;padding:30px 16px 22px;color:var(--sidebar-ink);overflow:auto}.brand-block{padding:0 15px 34px}.brand{display:block;font:39px/1 Georgia,serif;letter-spacing:7px;color:#f7f7ed;white-space:nowrap}.brand>span{color:#c1a36f;font-size:25px;letter-spacing:0;vertical-align:top}.brand-caption{font-size:8px;letter-spacing:2px;display:block;color:#92ab9e;margin-top:10px}.tree-heading,.tree-group-title{font-size:10px;color:#78998a;letter-spacing:1px;padding:0 14px;margin-bottom:11px}.tree-group-title{margin-top:25px}.tree-panel button{display:flex;justify-content:flex-start;width:100%;border:0;background:transparent;color:#b8cac0;box-shadow:none;font-weight:400;text-align:left;min-height:39px;padding:9px 13px;border-radius:7px;gap:11px}.tree-panel button:hover{background:#ffffff09;color:#fff}.tree-panel button.active{background:#ffffff11;color:#fff}.tree-panel .tree-parent.active{background:#305447;color:#f5f8f0}.tree-parent>span{flex:1}.tree-parent em{font-style:normal;font-size:10px;background:#ffffff0c;border-radius:4px;min-width:22px;text-align:center;padding:2px 4px;color:#b8ccbc}.tree-children{border-left:1px solid #426054;margin:7px 0 17px 21px;padding-left:13px}.tree-panel .tree-children button{font-size:11px;min-height:31px;padding:6px 13px;position:relative}.tree-panel .tree-children button.active{color:#e6d6b7;background:transparent}.tree-panel .tree-children button.active:before{content:'';width:4px;height:4px;border-radius:50%;background:#c4a16a;position:absolute;left:-16px}.tree-note{margin-top:auto;padding:20px 14px 0;border-top:1px solid #ffffff13}.tree-note>span{display:flex;align-items:center;gap:8px;font-size:11px;color:#aec2b4}.tree-note small{display:block;font-size:10px;color:#78998a;line-height:1.9;margin:9px 0 0 24px}.workspace{grid-column:2;grid-row:2;min-width:0;min-height:0;padding:27px 30px 15px}.list-view,.overview-view{height:100%;display:flex;flex-direction:column;min-height:0}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:20px;flex-shrink:0}.page-heading h2{font-size:26px;letter-spacing:-.7px;font-weight:600;margin:5px 0 7px}.page-heading p{font-size:12px;color:var(--muted)}.heading-actions{display:flex;align-items:center;gap:8px}.heading-actions>.primary{padding:10px 17px;min-height:40px}.category-bar{display:flex;gap:24px;border-bottom:1px solid var(--line);min-height:44px;margin-bottom:17px;flex-shrink:0}.category-bar button{border:0;background:transparent;border-radius:0;padding:10px 3px 13px;gap:8px;color:#7b847d;font-size:13px;position:relative}.category-bar button.active{color:var(--green);font-weight:600}.category-bar button.active:after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--green)}.category-bar .count-tag{background:#eaece5;color:#8b9389;min-width:19px}.category-bar .active .count-tag{background:#e4eddf;color:var(--green)}.query-bar{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-bottom:16px;flex-shrink:0}.quick-search{display:flex;align-items:center;gap:9px;border:1px solid #e0e4da;background:white;border-radius:7px;padding:0 10px;min-width:250px;flex:1;max-width:420px}.quick-search:focus-within{border-color:#719483;box-shadow:0 0 0 3px #204e4010}.quick-search>input{border:0;box-shadow:none;padding:9px 0;min-height:37px;width:100%;background:transparent}.quick-search>.lucide{color:#8c9a8e}.clear-search{border:0;background:transparent;min-height:23px;width:22px;padding:3px;color:#829180}.query-date{display:flex;align-items:center;gap:7px;font-size:11px;color:#8d978d;margin-left:3px}.query-date input{font-size:11px;width:130px;min-height:37px}.filter-toggle{gap:7px;min-height:37px;font-size:12px}.filter-toggle[aria-expanded=true]{border-color:#93ab94;background:#edf3e9;color:var(--green)}.filter-count{border-radius:8px;background:var(--green);color:#fff;min-width:16px;padding:0 4px;font-size:10px}.advanced-query{width:100%;display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;padding:16px;background:#eeefe8;border:1px solid var(--line);border-radius:8px;margin-top:3px}.advanced-query>label{display:flex;flex-direction:column;gap:6px;font-size:10px;color:#788475;flex:1;min-width:115px}.advanced-query input,.advanced-query select{width:100%;font-size:12px}.query-buttons{display:flex;gap:6px}.query-buttons button{font-size:11px}.query-summary{font-size:11px;color:var(--green);display:flex;gap:9px;align-items:center;flex:1}.query-summary button{border:0;background:transparent;font-size:11px;text-decoration:underline;padding:0;min-height:22px}.list-card{display:flex;flex-direction:column;flex:1;min-height:0;border:1px solid var(--line);background:white;border-radius:10px;overflow:hidden}.section-title{display:flex;align-items:center;gap:8px;min-height:48px;font-size:13px;font-weight:600;color:var(--ink);padding:12px 17px;background:#fff;flex-shrink:0;border-bottom:1px solid var(--line)}.section-title small{color:#949e92;font-size:10px;font-weight:400;margin-left:auto}.section-title .record-counter{border:0;padding:0;background:transparent;width:35px;min-height:0;color:var(--muted);font-size:11px}.section-title label{font-size:11px;font-weight:400;color:#8b9587;display:flex;align-items:center}.section-title .table-help{margin-left:auto;color:#909b8d;font-size:10px;font-weight:400}.list-table{flex:1;min-height:0;position:relative;background:white;outline:none}.list-table:focus-visible{box-shadow:inset 0 0 0 2px #6a8c75}.list-totals{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 17px;min-height:46px;border-top:1px solid var(--line);background:#fafbf8;font-size:11px;color:#64775f;flex-shrink:0;font-variant-numeric:tabular-nums}.list-totals>span:last-child{color:#939c8e;font-size:10px}.app-status{grid-column:2;grid-row:3;padding:0 30px;display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#91998e;gap:15px}.app-status>span:last-child{white-space:nowrap}.overview-tools{display:flex;align-items:center;gap:9px;margin-bottom:18px}.overview-tools>span{margin-right:auto;font-size:12px;color:var(--muted)}.overview-view #overview-table{height:285px;flex-shrink:0;border:1px solid var(--line);border-radius:10px;margin-bottom:20px}.overview-view #party-overview-table{flex:1;min-height:0;border:1px solid var(--line);border-top:0;border-radius:0 0 10px 10px}.overview-view>.section-title{border:1px solid var(--line);border-radius:10px 10px 0 0}.overview-foot{font-size:10px;padding-top:12px;color:var(--muted)}
/* Compact list header and shared category/query toolbar. */
#app-shell{grid-template-rows:56px minmax(0,1fr) 29px}
.workspace{padding-top:22px}
.list-heading{min-height:40px;margin-bottom:16px;gap:16px}
.list-heading-copy{display:flex;align-items:center;gap:16px;min-width:0}
.list-heading h2{font-size:24px;margin:0;line-height:1.4;white-space:nowrap}
.list-heading p{font-size:11px;border-left:1px solid #dce2d6;padding-left:16px;line-height:1.6}
.list-heading .heading-actions{margin-top:0;gap:8px}
.list-heading .heading-actions>button,.list-heading .heading-actions>details>summary{min-height:38px}
.list-heading .heading-actions>.primary{padding:8px 15px}
.list-toolbar{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:start;gap:24px;padding:11px 14px;margin-bottom:14px;border:1px solid var(--line);border-radius:9px;background:var(--paper);flex-shrink:0}
.list-toolbar .category-bar{border:0;margin:0;min-height:36px;gap:4px}
.list-toolbar .category-bar button{min-height:36px;padding:8px 11px;border-radius:6px;font-size:12px;gap:7px}
.list-toolbar .category-bar button:hover{background:#f5f7f1}
.list-toolbar .category-bar button.active{background:var(--green-light)}
.list-toolbar .category-bar button.active:after{display:none}
.list-toolbar .query-bar{display:grid;grid-template-columns:minmax(180px,1fr) auto auto auto;gap:8px;margin:0;min-width:0;align-items:center}
.list-toolbar .quick-search{min-width:0;max-width:none;gap:7px;background:#fafbf8}
.list-toolbar .quick-search>input{min-height:35px;padding:8px 0;font-size:12px}
.list-toolbar .query-date{margin:0;gap:1px;border:1px solid #e0e4da;border-radius:7px;background:#fafbf8;min-width:0}
.list-toolbar .query-date:focus-within{border-color:#719483;box-shadow:0 0 0 3px #204e4010}
.list-toolbar .query-date input{width:126px;min-height:35px;border:0;background:transparent;box-shadow:none;font-size:11px;padding:7px 8px}
.list-toolbar .query-date>span{padding:0 2px;color:#98a08f}
.list-toolbar .filter-toggle{min-height:37px;padding:7px 11px}
.list-toolbar .browse-button{min-height:37px;padding:7px 12px;font-size:12px;gap:6px}
.list-toolbar .browse-button kbd{font-size:11px;padding:0 3px;line-height:16px}
.list-toolbar .browse-result{grid-column:1/-1;font-size:11px;color:var(--green);line-height:1.6}
.list-toolbar .advanced-query,.list-toolbar .query-summary{grid-column:1/-1}
.list-toolbar .advanced-query{margin:3px 0 0;background:#f6f8f2;padding:13px;gap:12px}
.list-toolbar .query-summary{padding:2px 0 0;min-width:0}
.list-toolbar .query-summary>span{overflow-wrap:anywhere}
.list-toolbar .query-summary>button{flex-shrink:0}
.list-view .section-title{min-height:43px;padding:10px 15px;gap:8px}
.list-view .section-title label{gap:3px;margin-left:3px}
.list-view .section-title .record-counter{width:4ch;text-align:center}
/* Local, native disclosure menus: every action keeps its existing behavior. */
.action-menu{position:relative}.action-menu>summary{list-style:none;display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:7px;background:#fff;min-height:35px;padding:7px 12px;white-space:nowrap;font-size:12px}.action-menu>summary::-webkit-details-marker{display:none}.action-menu>summary:hover{border-color:#b6c7b9;background:#f6f8f3}.action-menu[open]>summary{background:var(--green-light);border-color:#b8c9b9}.menu-popover{position:absolute;top:calc(100% + 7px);right:0;z-index:50;width:205px;padding:6px;border:1px solid var(--line);background:white;border-radius:10px;box-shadow:0 10px 35px #1e3d3317}.menu-popover button{width:100%;justify-content:flex-start;background:transparent;border:0;font-size:12px;padding:9px 10px;font-weight:400}.menu-popover button:hover{background:var(--green-light)}.menu-popover kbd{margin-left:auto}.danger-text{color:var(--red)}
/* Document workspace: the four original business panels stay visible. */
.editor-view{height:100dvh;padding:0 22px;display:flex;flex-direction:column;gap:13px;background:var(--bg)}.editor-commandbar{display:flex;align-items:center;gap:9px;min-height:76px;border-bottom:1px solid var(--line);flex-shrink:0}.editor-commandbar>.icon-button{background:transparent;border-color:transparent;margin-right:4px}.editor-heading{display:flex;flex-direction:column;gap:4px;min-width:105px}.editor-heading .eyebrow{font-size:8px;letter-spacing:1.1px}.editor-heading strong{font-size:19px;font-weight:600;color:var(--ink)}.command-spacer{flex:1}.save-indicator{display:flex;align-items:center;gap:6px;font-size:10px;color:#7b8b78;border-radius:5px;background:#eaf0e5;padding:5px 8px}.save-indicator:before{content:'';width:5px;height:5px;border-radius:50%;background:#7c9b6c}.save-indicator.dirty{background:var(--gold-bg);color:#a17c3b}.save-indicator.dirty:before{background:#b89757}.record-nav{display:flex;gap:0;padding-right:10px;margin-right:3px;border-right:1px solid var(--line)}.record-nav button{width:29px;min-height:31px;background:transparent;padding:4px;border:0;border-radius:4px}.record-nav button:hover{background:#e8ede3}.editor-commandbar .primary{min-width:125px}.document-form{flex-shrink:0;background:#fff;border:1px solid var(--line);border-radius:10px;padding:0 17px 11px}.document-meta{display:flex;gap:25px;align-items:center;min-height:32px;margin-bottom:7px;font-size:10px;color:#939c8f;border-bottom:1px solid #eff0ea}.document-meta b{font-weight:400;color:#6f8169;margin-left:7px}.document-meta #document-state{margin-left:auto;font-size:10px;color:#84917c}.document-header-grid{display:grid;grid-template-columns:minmax(0,1fr) 235px;gap:22px}.header-fields{display:grid;gap:12px}.basic-fields{grid-template-columns:1.18fr 1fr .85fr 1.3fr 1fr}.header-fields>label{display:flex;flex-direction:column;gap:6px;font-size:10px;color:#8a9585;min-width:0}.header-fields>label>input,.header-fields>label>select{width:100%;font-size:12px;color:var(--ink)}.blue-value{color:var(--green)!important;font-variant-numeric:tabular-nums}.document-options{display:flex;align-items:center;gap:17px;margin:12px 0 7px}.note-field{display:flex;align-items:center;gap:11px;flex:1;font-size:11px;color:#899580}.note-field>input{background:#f8f9f5;border-color:transparent;flex:1;font-size:11px;min-height:29px}.check-label{display:flex;align-items:center;gap:6px;font-size:11px;color:#7c8974;white-space:nowrap}.review-control{color:#a1824d}.receipt-field select{font-size:10px;min-height:28px;padding:4px 7px;color:var(--green);background:var(--green-light);border-color:transparent}.extra-fields>summary{display:flex;align-items:center;gap:7px;list-style:none;color:#62795c;font-size:10px;min-height:22px;width:fit-content}.extra-fields summary::-webkit-details-marker{display:none}.extra-fields summary>.lucide{width:13px;height:13px}.extra-fields summary>span{color:#a2aa9b;margin-left:6px}.extra-fields[open] summary{margin-bottom:13px}.extra-fields[open] summary>.lucide:last-child{transform:rotate(180deg)}.advanced-fields{grid-template-columns:repeat(5,minmax(0,1fr));padding-bottom:5px}.recent-records{border-left:1px solid var(--line);padding-left:17px;min-height:100px;max-height:125px;overflow:auto;color:#8a967e;font-size:10px;line-height:1.7}.recent-records>div:first-child{display:flex;align-items:center;gap:7px;color:#798a6f;margin-bottom:9px}.recent-records .lucide{width:13px;height:13px}.recent-records table{border-collapse:collapse;width:100%;font-size:9px;color:#8a967e;font-variant-numeric:tabular-nums}.recent-records th{font-weight:400;color:#b0b7a9}.recent-records td,.recent-records th{padding:3px;text-align:right;white-space:nowrap}.recent-records td:first-child,.recent-records th:first-child{text-align:left}.editor-detail-layout{flex:1;min-height:270px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(140px,1fr) 143px;gap:12px}.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:minmax(0,1.45fr) minmax(0,1fr)}.grid-panel{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid var(--line);border-radius:9px;background:#fff;overflow:hidden}.grid-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:43px;padding:7px 12px;border-bottom:1px solid var(--line);flex-shrink:0}.panel-name{display:flex;align-items:center;gap:7px;min-width:0}.panel-name>.lucide{color:#819476;width:15px;height:15px}.panel-name strong{font-size:12px;font-weight:600;color:var(--ink);white-space:nowrap}.grid-caption>div:last-child{display:flex;gap:5px}.grid-caption button{font-size:10px;min-height:26px;padding:4px 7px;border-color:transparent;background:transparent;gap:4px}.grid-caption button:hover{background:#edf2e8}.grid-caption button .lucide{width:13px;height:13px}.grid-caption .soft-button{background:var(--green-light);color:var(--green)}.grid-caption>span{font-size:9px;color:#a2aa99}.count-tag{font-size:9px;font-weight:500;background:#edf2e8;color:#69825e;padding:2px 5px;border-radius:4px;white-space:nowrap}.subtle-tag{font-size:9px;color:#a5ae9c;white-space:nowrap}.grid-panel>.tabulator{flex:1;min-height:0;height:auto!important}.grid-hint{font-size:9px;padding:5px 12px;color:#adb5a4;background:#fbfcf9;border-top:1px solid #eff2e9;flex-shrink:0}.document-finance{display:grid;grid-template-columns:1.35fr 1fr .65fr;gap:14px;min-height:101px;flex-shrink:0}.document-finance fieldset{margin:0;min-width:0;border:1px solid var(--line);border-radius:8px;padding:10px 13px 12px;background:#fff}.document-finance legend{font-size:10px;color:#93a086;padding:0 6px}.totals-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 13px}.totals-fields label{display:flex;align-items:center;gap:6px;font-size:10px;color:#7f8c73;white-space:nowrap;min-width:0}.totals-fields input{flex:1;width:0;min-width:0;text-align:right;font-size:11px;min-height:29px;padding:5px 6px}.total-value{display:inline-block;text-align:right;flex:1;min-width:0;color:var(--green);font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}.payment-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px}.payment-fields label{display:flex;align-items:center;gap:5px;font-size:9px;color:#839178;white-space:nowrap;min-width:0}.payment-fields input{width:0;flex:1;min-width:0;font-size:10px;min-height:29px;padding:5px}.payment-fields input:last-child{background:#f7f9f3;text-align:right}.document-finance .finance-summary{display:flex;align-content:flex-start;align-items:center;flex-wrap:wrap;gap:7px 12px;position:relative}.finance-summary>div{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;font-size:10px;color:#8a977f}.finance-summary>div:first-of-type .total-value{font-size:20px;font-weight:500;letter-spacing:-.7px}.finance-summary>div:nth-of-type(2){font-size:9px}.finance-summary>button{position:absolute;top:-15px;right:7px;background:var(--bg);border:0;font-size:9px;padding:0 5px;min-height:17px;color:#8e9e81}.finance-summary>span{font-size:8px;color:#a0aa95;line-height:1.5}.editor-bottom{display:flex;align-items:center;justify-content:space-between;min-height:50px;gap:15px;flex-shrink:0;margin-top:-3px;border-top:1px solid var(--line)}.editor-bottom>span{font-size:10px;color:#8b9980}.editor-bottom>div{display:flex;gap:8px}.editor-bottom button{font-size:11px;min-height:31px}
/* Tabulator 6.7.1 retains editing, resizing, scrolling, history and print. */
.tabulator{font:12px var(--sans);border:0;background:white;color:var(--body)}.tabulator .tabulator-header{background:#f7f8f3;border-bottom:1px solid var(--line);color:#8d9885;font-weight:400}.tabulator .tabulator-header .tabulator-col{background:transparent;border-right:1px solid #edf0e7;min-height:36px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:11px 12px;font-size:10px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{background:#eff3e9}.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow{border-bottom-color:#b1bca6;border-top-color:#b1bca6}.tabulator .tabulator-tableholder{background:white;scrollbar-width:thin;scrollbar-color:#dce4d3 #f8faf4}.tabulator-row,.tabulator-row.tabulator-row-even{background:#fff;color:var(--body);border-bottom:1px solid #eff1e8}.tabulator-row.tabulator-row-even{background:#fdfefb}.tabulator-row .tabulator-cell{border-right:1px solid #f1f3ed;padding:11px 12px;font-size:11px;font-variant-numeric:tabular-nums;line-height:17px}.tabulator-row:hover{background:#f4f7ef!important}.tabulator-row.selected-line{background:#edf3e6!important}.tabulator-row.selected-line>.tabulator-cell:first-child{box-shadow:inset 3px 0 var(--green)}.tabulator-row .tabulator-cell.tabulator-editing{padding:0;border:1px solid #6e9576!important;background:#fff!important;box-shadow:inset 0 0 0 1px #6e9576}.tabulator-cell input,.tabulator-cell select{border:0!important;box-shadow:none!important;border-radius:0!important;padding:8px 10px!important;min-height:32px;height:100%;color:var(--green);font-size:11px}.grid-panel .tabulator-row .tabulator-cell{padding:9px 9px;font-size:11px}.grid-panel .tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:9px;font-size:10px}.grid-panel .tabulator .tabulator-header .tabulator-col{min-height:32px}.tabulator .tabulator-placeholder{padding:35px 15px;color:#a2ad96;font-size:12px;background:white}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;color:#9ba78e;font-size:11px;line-height:1.7}.empty-state .lucide{width:29px;height:29px;color:#b7c6aa}.empty-state strong{font-size:14px;font-weight:500;color:#667f59}.empty-state button{font-size:11px;margin-top:3px}.doc-link{display:inline;background:transparent;border:0;box-shadow:none;padding:0;min-height:0;color:var(--green);font-size:11px;font-weight:600;letter-spacing:.1px}.doc-link:hover{background:transparent;text-decoration:underline}.status-badge{display:inline-block;font-size:9px;padding:3px 7px;border-radius:4px;line-height:16px;background:#f3f1e8;color:#aa8c50}.status-badge.done{background:#edf3e8;color:#789565}.status-badge.void{background:var(--red-bg);color:var(--red)}.tabulator-print-table{font-size:11px;border-collapse:collapse;width:100%;font-family:var(--sans)}.tabulator-print-table td,.tabulator-print-table th{padding:5px;border:1px solid #bbb}.tabulator-print-table th{background:#edf2e8}.tabulator-print-header{font-size:18px;margin-bottom:15px;color:var(--green)}
dialog{width:min(590px,calc(100vw - 32px));padding:0;border:1px solid var(--line);border-radius:14px;color:var(--body);background:white;box-shadow:0 25px 100px #173d332e}dialog::backdrop{background:#173d3345;backdrop-filter:blur(3px)}.dialog-heading{padding:21px 24px 16px;font-size:17px;font-weight:600;color:var(--ink);position:relative;border-bottom:1px solid var(--line)}.close-dialog{position:absolute;right:15px;top:13px;border:0;background:transparent;font-size:23px;color:#9ba590;padding:0;width:33px;font-weight:300}.dialog-body{padding:20px 24px;font-size:12px;line-height:1.9;color:#7f8b75}.dialog-body p{margin:13px 0}.dialog-body>label{display:flex;flex-direction:column;gap:9px;color:var(--ink)}.dialog-body input,.dialog-body select{width:100%}.dialog-body .source-note{font-size:10px;color:#a1aa96;border-top:1px solid var(--line);padding-top:12px}.dialog-actions{background:#fafbf7;border-top:1px solid var(--line);padding:15px 24px;display:flex;justify-content:flex-end;gap:8px}#toast{position:fixed;bottom:34px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 28px);background:#204e40;color:#fff;padding:12px 20px;border-radius:9px;font-size:12px;box-shadow:0 8px 30px #173d3325;pointer-events:none;z-index:100;opacity:0;transition:opacity .15s}#toast.visible{opacity:1}
@media(min-width:1800px){.workspace{padding:30px 36px 18px}.page-heading{margin-bottom:28px}.document-form{padding:0 22px 14px}.editor-detail-layout{grid-template-rows:minmax(190px,1fr) 158px}.editor-view{padding:0 28px;gap:15px}.document-header-grid{grid-template-columns:minmax(0,1fr) 300px}.editor-commandbar{min-height:83px}.document-finance{min-height:111px}.tabulator-row .tabulator-cell{font-size:12px}}
@media(max-width:1250px){#app-shell{grid-template-columns:185px minmax(0,1fr)}.workspace{padding:22px 20px 12px}.app-header{padding:0 20px}.tree-panel{padding:29px 10px 20px}.brand-block{padding-left:14px}.query-date input{width:118px}.quick-search{min-width:200px}.header-fields{gap:9px}.document-header-grid{grid-template-columns:minmax(0,1fr) 190px;gap:15px}.editor-commandbar{gap:7px}.editor-commandbar button,.editor-commandbar summary{font-size:11px;padding:7px 9px}.record-nav{margin-right:0;padding-right:5px}.record-nav button{width:23px}.save-indicator{font-size:9px}.editor-view{padding:0 16px;gap:10px}.document-options{gap:11px}.document-finance{grid-template-columns:1.35fr 1fr .6fr;gap:10px}.document-finance fieldset{padding:8px 9px}.totals-fields{gap:7px 8px}.payment-fields{gap:7px}.grid-caption{padding:7px 9px}.grid-caption .subtle-tag{display:none}.grid-caption button{font-size:9px;padding:4px 5px}.app-status{padding:0 20px;font-size:9px}.app-status>span:last-child{display:none}}
@media(max-width:1000px){body{overflow:auto}#app-shell{grid-template-columns:76px minmax(0,1fr);grid-template-rows:64px minmax(0,1fr) 28px;min-height:680px}.tree-panel{padding:25px 10px}.brand{font-size:19px;letter-spacing:2px}.brand>span{font-size:15px}.brand-block{padding:0 0 36px 3px}.brand-caption,.tree-heading,.tree-group-title,.tree-panel button>span,.tree-panel button>em,.tree-children,.tree-note{display:none}.tree-panel button{justify-content:center;margin-bottom:13px;padding:14px 8px}.tree-panel button .lucide{width:20px;height:20px}.tree-parent{font-size:0}.identity .breadcrumb{display:none}.local-badge{display:none}.app-header{padding:0 20px}.page-heading h2{font-size:23px}.heading-actions>.primary{min-height:36px;font-size:12px}.category-bar{gap:20px}.query-bar{gap:8px}.quick-search{max-width:100%;min-width:180px}.query-date{margin-left:0}.query-date input{width:115px}.section-title .table-help{display:none}.list-totals{flex-wrap:wrap;font-size:10px}.editor-view{height:auto;min-height:100dvh}.editor-commandbar{flex-wrap:wrap;padding:12px 0;min-height:68px}.editor-commandbar .record-nav{display:none}.editor-commandbar .save-indicator{margin-right:auto}.command-spacer{display:none}.document-header-grid{display:block}.recent-records{display:none}.editor-detail-layout,.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:1fr 1fr;grid-template-rows:280px 165px;flex:none}.document-finance{grid-template-columns:1fr 1fr}.finance-summary{grid-column:1/-1;min-height:80px}.editor-bottom{position:sticky;bottom:0;background:var(--bg);z-index:8;flex-wrap:wrap;padding:10px 0}.advanced-fields{grid-template-columns:repeat(4,minmax(0,1fr))}.editor-bottom>span{font-size:9px}}
@media(max-width:650px){#app-shell{grid-template-columns:60px minmax(0,1fr)}.tree-panel{padding:25px 6px}.brand{font-size:15px}.brand>span{font-size:12px}.workspace{padding:18px 12px 10px}.app-header{padding:0 12px;gap:8px}.account-tools{gap:2px}.account-tools select{max-width:140px;font-size:10px}.account-tools>label{gap:4px;padding-right:4px}.account-tools .icon-button{width:27px}.identity h1{font-size:12px}.account-tools .action-menu summary{padding:7px}.page-heading{gap:8px;align-items:flex-start;margin-bottom:15px}.page-heading h2{font-size:21px}.page-heading p{font-size:10px;max-width:180px;line-height:1.7}.heading-actions>.primary{padding:8px;font-size:10px;gap:4px}.heading-actions>.action-menu>summary{font-size:0;padding:7px}.heading-actions{gap:5px;margin-top:17px}.category-bar{gap:17px;margin-bottom:13px}.category-bar button{font-size:11px;gap:4px}.query-date{width:100%;order:3}.query-date input{flex:1;width:0}.quick-search{min-width:0;flex:1}.query-bar .filter-toggle{font-size:10px;padding:9px}.section-title{min-height:42px;padding:10px 12px;font-size:11px}.list-totals{padding:11px 12px;line-height:1.8}.app-status{padding:0 12px}.app-status #workspace-status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-tools{flex-wrap:wrap}.overview-tools>span{width:100%;font-size:10px}.overview-tools button{font-size:10px;padding:7px}.overview-view #overview-table{height:270px}.overview-foot{font-size:9px}.section-title small{display:none}.editor-view{padding:0 12px}.editor-commandbar .editor-heading{min-width:80px}.editor-commandbar .editor-heading strong{font-size:17px}.editor-commandbar>.icon-button{margin-right:0}.editor-commandbar #editor-print{display:none}.editor-commandbar .primary{min-width:0}.editor-commandbar #editor-receive{font-size:10px}.editor-commandbar kbd{display:none}.document-meta{gap:12px;flex-wrap:wrap;padding:7px 0;line-height:1.8}.document-meta #document-state{margin-left:0}.basic-fields{grid-template-columns:1fr 1fr}.basic-fields label:last-child{grid-column:1/-1}.advanced-fields{grid-template-columns:1fr 1fr}.document-options{flex-wrap:wrap;gap:13px}.document-options .note-field{min-width:100%}.extra-fields summary>span{display:none}.editor-detail-layout,.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:1fr;grid-template-rows:280px 220px 160px 160px}.document-finance{grid-template-columns:1fr}.finance-summary{grid-column:auto}.totals-fields{grid-template-columns:1fr 1fr}.payment-fields{grid-template-columns:1fr 1fr}.editor-bottom>span{display:none}.editor-bottom>div{width:100%;justify-content:space-between;gap:5px}.editor-bottom button{font-size:10px;padding:6px 9px}.editor-bottom kbd{display:none}}
@media(min-width:1800px){.workspace{padding-top:24px}.list-heading{margin-bottom:16px}}
@media(max-width:1200px){.list-toolbar{grid-template-columns:minmax(0,1fr);gap:10px;padding:11px 12px}.list-toolbar .category-bar{border-bottom:1px solid var(--line);padding-bottom:9px}.list-heading p{display:none}}
@media(max-width:1000px){#app-shell{grid-template-rows:56px minmax(0,1fr) 28px}.list-heading h2{font-size:23px}.list-toolbar .query-date input{width:119px}}
@media(max-width:650px){#app-shell{grid-template-rows:52px minmax(0,1fr) 28px}.list-heading{flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:13px}.list-heading h2{font-size:22px}.list-heading .heading-actions{width:100%;gap:6px;margin:0}.list-heading .heading-actions>.primary{margin-left:auto;padding:8px 10px;font-size:11px}.list-heading .heading-actions>details>summary{font-size:11px;padding:8px}.list-heading .heading-actions>button:not(.primary){font-size:11px;padding:8px}.list-toolbar{padding:10px;gap:10px;margin-bottom:12px}.list-toolbar .category-bar{gap:4px}.list-toolbar .category-bar button{font-size:11px;padding:7px 9px;gap:5px}.list-toolbar .query-bar{grid-template-columns:minmax(0,1fr) auto auto}.list-toolbar .quick-search{grid-column:1;grid-row:1}.list-toolbar .browse-button{grid-column:2;grid-row:1;padding:7px 9px;font-size:11px}.list-toolbar .browse-button kbd{display:none}.list-toolbar .filter-toggle{grid-column:3;grid-row:1;font-size:11px}.list-toolbar .query-date{width:100%;grid-column:1/-1;grid-row:2;order:0}.list-toolbar .query-date input{width:0;flex:1}.list-toolbar .advanced-query{padding:10px}.list-view .section-title{padding:10px 12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}
@media print{body{overflow:visible;background:white}body.printing-document #app-shell,body.printing-document #toast,body.printing-document dialog{display:none!important}body.printing-document .editor-view{display:block!important;position:static;padding:0;height:auto;background:white}body.printing-document .editor-commandbar{border:0;background:white;min-height:30px}body.printing-document .editor-commandbar>*{display:none!important}body.printing-document .editor-commandbar>.editor-heading{display:block!important}body.printing-document .editor-heading>.eyebrow{display:none}body.printing-document .editor-detail-layout{display:block;min-height:0}body.printing-document .grid-panel{display:block;margin:10px 0;break-inside:auto;background:white}body.printing-document .grid-caption{background:#edf2e8}body.printing-document .grid-caption>div:last-child:not(.panel-name),body.printing-document .grid-caption>span,body.printing-document .editor-bottom,body.printing-document .recent-records,body.printing-document .grid-hint{display:none!important}body.printing-document .document-header-grid{display:block}body.printing-document .basic-fields{grid-template-columns:repeat(3,minmax(0,1fr))}body.printing-document .document-finance{display:block;min-height:0}body.printing-document fieldset{margin-top:8px}body.printing-document .document-finance button{display:none}body.printing-document .tabulator-print-table{width:100%;font-size:9px}body.printing-document input,body.printing-document select{border:0;box-shadow:none}body.printing-document .extra-fields>summary{display:none}body.printing-document .extra-fields>div{display:grid!important}body.printing-document .advanced-fields{grid-template-columns:repeat(4,minmax(0,1fr))}}

.check-square{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;border:1px solid #c7d3bc;border-radius:3px;background:white;vertical-align:middle;font-size:10px}.check-square.checked{background:var(--green);color:white;border-color:var(--green)}.tabulator-row .tabulator-cell.tabulator-frozen-right{border-left:1px solid var(--line);box-shadow:-4px 0 8px #204e4004}.tabulator .tabulator-header .tabulator-col.tabulator-frozen-right{border-left:1px solid var(--line)}

/* One persistent application bar, with Electron's native window controls. */
:root{--shellbar-height:56px;--sidebar-width:216px}
.app-header{height:var(--shellbar-height);display:block;position:sticky;top:0;z-index:60;grid-column:auto;grid-row:auto;padding:0;gap:0;background:var(--bg);border-bottom:1px solid var(--line);user-select:none;-webkit-app-region:drag;app-region:drag}
.titlebar-safe{height:100%;display:grid;grid-template-columns:var(--sidebar-width) minmax(0,1fr);margin-left:env(titlebar-area-x,0px);width:env(titlebar-area-width,100%)}
.titlebar-brand{height:var(--shellbar-height);display:flex;align-items:center;gap:13px;padding:0 23px;background:var(--sidebar);color:#f7f7ed;white-space:nowrap}
.titlebar-wordmark{font:27px/1 Georgia,serif;letter-spacing:4px}
.titlebar-wordmark>span{color:#c1a36f;font-size:18px;letter-spacing:0;margin-left:3px;vertical-align:top}
.titlebar-caption{font-size:9px;color:#a4b9aa;letter-spacing:1px;line-height:1.5}
.titlebar-main{display:flex;align-items:center;justify-content:space-between;gap:20px;min-width:0;height:100%;padding:0 24px}
.titlebar-context{display:flex;align-items:center;gap:14px;min-width:0;flex:1}
.app-header .identity{min-width:0;gap:9px}
.app-header .identity h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-header .breadcrumb{font-size:11px;white-space:nowrap}
.app-header .local-badge{font-size:9px;white-space:nowrap;margin-left:4px}
.desktop-menu{border-color:transparent;background:transparent;font-size:11px;padding:6px 8px;min-height:32px;gap:6px;flex-shrink:0}
.desktop-menu:hover{background:#eaf0e5;border-color:transparent}
.app-header .account-tools{flex-shrink:0;gap:6px}
.app-header button,.app-header summary,.app-header select,.app-header label,.app-header a,.app-header .menu-popover{-webkit-app-region:no-drag;app-region:no-drag}
#app-shell{height:calc(100dvh - var(--shellbar-height));grid-template-columns:var(--sidebar-width) minmax(0,1fr);grid-template-rows:minmax(0,1fr) 29px}
.workspace{grid-row:1}
.app-status{grid-row:2}
.tree-panel{padding-top:26px}
.editor-view{height:calc(100dvh - var(--shellbar-height))}
@media(max-width:1250px){:root{--sidebar-width:185px}.titlebar-brand{padding:0 17px;gap:10px}.titlebar-wordmark{font-size:25px;letter-spacing:3px}.titlebar-caption{font-size:8px}.titlebar-main{padding:0 20px;gap:12px}.titlebar-context{gap:8px}}
@media(max-width:1000px){:root{--sidebar-width:76px}.titlebar-brand{padding:0 9px}.titlebar-wordmark{font-size:19px;letter-spacing:1px}.titlebar-wordmark>span{font-size:13px;margin-left:1px}.titlebar-caption{display:none}#app-shell{min-height:calc(680px - var(--shellbar-height));grid-template-rows:minmax(0,1fr) 28px}.editor-view{height:auto;min-height:calc(100dvh - var(--shellbar-height))}.app-header .account-tools{flex-shrink:1;min-width:0}.app-header .account-tools>label{min-width:0}.app-header .account-tools select{max-width:160px;min-width:0}.tree-panel{padding-top:24px}}
@media(max-width:650px){:root{--sidebar-width:60px}.titlebar-brand{padding:0 7px}.titlebar-wordmark{font-size:15px;letter-spacing:1px}.titlebar-wordmark>span{font-size:10px}.titlebar-main{padding:0 10px;gap:8px}.titlebar-context{gap:4px}.desktop-menu{padding:6px;min-height:30px}.desktop-menu>span{display:none}.app-header .identity h1{font-size:11px}.app-header .account-tools{gap:2px}.app-header .account-tools select{max-width:100px;font-size:10px}.app-header .account-tools>label{padding-right:4px;gap:4px}.app-header .account-tools .icon-button{width:27px}.tree-panel{padding-top:24px}}
@media print{.app-header{display:none!important}.editor-view{height:auto;min-height:0}}

/* Document layout: one surface for commands, scope, query, rows and totals. */
.workspace{padding:22px 24px 14px}
.list-view .list-card{border-radius:10px}
.list-card>.list-heading{min-height:68px;padding:14px 20px;margin:0;border-bottom:1px solid var(--line);gap:16px}
.list-heading-copy{gap:11px}
.list-heading h2{font-size:21px;letter-spacing:-.4px}
.page-mark{display:flex;align-items:center;justify-content:center;width:34px;height:34px;background:var(--green-light);color:var(--green);border-radius:7px}
.page-mark .lucide{width:19px;height:19px}
.list-card>.list-toolbar{display:block;padding:0;margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:white}
.list-scope{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:0 20px;border-bottom:1px solid var(--line)}
.list-toolbar .category-bar{min-height:44px;padding:0;gap:24px;border:0;margin:0}
.list-toolbar .category-bar button{min-height:44px;padding:10px 1px;border-radius:0;font-size:13px;gap:8px}
.list-toolbar .category-bar button.active,.list-toolbar .category-bar button:hover{background:transparent}
.list-toolbar .category-bar button.active:after{display:block;bottom:0;height:2px}
.list-scope-meta{display:flex;align-items:center;gap:18px;font-size:12px;color:#728072}
.result-counter{display:flex;align-items:center;gap:3px;white-space:nowrap}
.result-counter .record-counter{width:4ch;min-height:0;padding:0;border:0;background:transparent;color:var(--green);font-weight:600;font-size:12px;text-align:center}
.list-scope .table-help{font-size:11px;color:#7b8879;white-space:nowrap}
.list-toolbar .query-bar{grid-template-columns:minmax(180px,1fr) auto auto auto;align-items:end;padding:12px 20px 14px;gap:10px;background:#fbfcf9}
.query-field{display:flex;flex-direction:column;min-width:0;gap:6px}
.query-field-label{font-size:11px;line-height:1.3;color:#667960}
.list-toolbar .quick-search{width:100%;min-height:38px;background:white;gap:8px}
.list-toolbar .quick-search>input{flex:1;min-width:0;width:0;min-height:37px;padding:8px 0;font-size:12px}
.list-toolbar .query-date{min-height:38px;background:white}
.list-toolbar .query-date input{width:136px;min-height:36px;font-size:12px;padding:7px 9px}
.list-toolbar .browse-button{min-height:38px;padding:8px 13px;border-color:#b3c5b6;background:var(--green-light);color:var(--green);font-weight:600}
.list-toolbar .browse-button:hover{background:#e1ebdc;border-color:#8fa994}
.list-toolbar .filter-toggle{min-height:38px;padding:8px 12px;font-size:12px}
.list-toolbar .advanced-query{margin:2px 0 0;padding:14px;background:white}
.list-toolbar .advanced-query>label{font-size:11px;color:#667960}
.list-toolbar .advanced-query input,.list-toolbar .advanced-query select{min-height:36px}
.list-toolbar .query-summary,.list-toolbar .browse-result{font-size:11px;line-height:1.6;padding-top:1px}
.list-view .list-totals{min-height:48px;padding:12px 20px;background:#f8faf5;color:#4d6755;font-size:12px;flex-wrap:wrap;gap:5px 16px;line-height:1.6}
.list-view .list-totals>span:last-child{font-size:11px;color:#71836f}
.list-view .tabulator .tabulator-header{color:#536b57;background:#f5f8f1}
.list-view .tabulator .tabulator-header .tabulator-col{min-height:44px}
.list-view .tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:13px 12px;font-size:12px}
.list-view .tabulator .tabulator-header .tabulator-col-title{white-space:normal;text-overflow:clip;line-height:1.4}
.list-view .tabulator-row .tabulator-cell{font-size:13px;line-height:20px;padding:12px}
.list-view .doc-link{font-size:12px;font-weight:600}
.list-view .status-badge{font-size:11px;padding:4px 7px}
.tree-panel .tree-root,.tree-panel .tree-parent{font-size:13px}
.tree-panel .tree-children button{font-size:12px}
.overview-heading{margin-bottom:18px;min-height:55px;gap:16px}
.overview-heading h2{font-size:24px;margin:0 0 7px}
.overview-heading p{font-size:12px}
.overview-tables{display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1.2fr);flex:1;min-height:0;gap:16px}
.overview-tables #overview-table,.overview-tables #party-overview-table{height:auto!important;min-height:0;flex:1;border:0;border-radius:0;margin:0}
.overview-tables .grid-caption{min-height:44px;padding:10px 16px}
.overview-tables .panel-name strong{font-size:13px}
.overview-tables .tabulator .tabulator-header .tabulator-col .tabulator-col-content{font-size:11px;padding:12px}
.overview-foot{line-height:1.6}
@media(max-width:1250px){.workspace{padding:20px 20px 12px}.list-card>.list-heading{padding:13px 16px}.list-scope{padding:0 16px}.list-toolbar .query-bar{padding:12px 16px}.list-scope .table-help{display:none}.list-toolbar .query-date input{width:126px}}
@media(max-width:1000px){.overview-heading .heading-actions{flex-wrap:wrap;justify-content:flex-end}.overview-heading .heading-actions button{font-size:11px}.list-heading h2{font-size:20px}.list-toolbar .query-date input{width:118px}}
@media(max-width:650px){.workspace{padding:14px 12px 10px}.list-card>.list-heading{padding:12px;gap:12px}.list-heading .heading-actions{width:100%;margin:0;gap:6px}.list-heading h2{font-size:20px}.page-mark{width:30px;height:30px}.list-scope{padding:0 12px;gap:4px 12px}.list-toolbar .category-bar{min-height:43px;gap:17px}.list-toolbar .category-bar button{font-size:12px;gap:5px;padding:10px 0}.list-scope-meta{font-size:11px;padding:6px 0}.result-counter .record-counter{width:3ch;font-size:11px}.list-toolbar .query-bar{grid-template-columns:minmax(0,1fr) auto auto;padding:12px;gap:10px 7px}.list-toolbar .search-field{grid-column:1/-1;grid-row:1}.list-toolbar .date-field{grid-column:1/-1;grid-row:2}.list-toolbar .quick-search{grid-column:auto;grid-row:auto}.list-toolbar .query-date{grid-column:auto;grid-row:auto;width:100%}.list-toolbar .query-date input{width:0;flex:1}.list-toolbar .browse-button{grid-column:2;grid-row:3;font-size:12px;padding:8px 12px}.list-toolbar .filter-toggle{grid-column:3;grid-row:3;font-size:12px;padding:8px 10px}.list-toolbar .advanced-query{padding:10px}.list-view .list-totals{padding:10px 12px;font-size:11px}.overview-heading{flex-wrap:wrap;gap:10px;margin-bottom:14px}.overview-heading .heading-actions{width:100%;margin:0;justify-content:flex-start}.overview-heading h2{font-size:22px}.overview-tables{gap:12px}.overview-tables .grid-caption{padding:9px 12px}.overview-tables .grid-caption>span{display:none}}

@media(max-width:650px){#app-shell{height:auto;min-height:calc(100dvh - var(--shellbar-height));grid-template-rows:minmax(0,1fr) auto}.workspace{min-height:calc(100dvh - var(--shellbar-height) - 56px)}.list-view{height:auto}.list-view .list-card{height:auto;min-height:calc(100dvh - var(--shellbar-height) - 56px);flex:none}.list-view .list-table{height:300px!important;flex:1 0 300px;min-height:220px}.list-toolbar .search-field{grid-column:1;grid-row:1}.list-toolbar .browse-button{grid-column:2;grid-row:1}.list-toolbar .filter-toggle{grid-column:3;grid-row:1}.overview-view{height:calc(100dvh - var(--shellbar-height) - 56px);min-height:580px}}

#draft-dialog{width:min(650px,calc(100vw - 32px))}#draft-list{display:flex;flex-direction:column;gap:9px;max-height:55vh;overflow:auto}.draft-card{width:100%;justify-content:flex-start;text-align:left;white-space:normal;padding:14px;background:#fafbf7;gap:13px}.draft-card>div{display:flex;flex:1;flex-direction:column;gap:3px}.draft-card strong{font-size:12px;color:var(--ink);font-weight:600}.draft-card span{font-size:11px;color:#829278}.draft-card small{font-size:9px;color:#a2ac99}.draft-card>.draft-direction{padding:4px 7px;background:var(--green-light);border-radius:5px;color:var(--green);font-size:10px}.draft-card>span:last-child{font-size:10px}.draft-empty{padding:30px 15px;text-align:center;color:#7d9273}.draft-empty small{display:block;font-size:11px;margin-top:10px;color:#a4af9a}#draft-issues{color:var(--red);font-size:11px}.heading-actions>button:not(.primary){font-size:12px}@media(max-width:650px){.heading-actions>button:not(.primary){font-size:10px;padding:8px}.heading-actions>button:not(.primary) .lucide{display:none}}

/* V0.4.6: compact original-document editor. List navigation stays unchanged. */




.editor-view{padding:0 16px;gap:8px;height:calc(100dvh - var(--shellbar-height));min-height:0;overflow:auto}
.editor-commandbar{min-height:50px;gap:8px;flex-wrap:nowrap}
.editor-commandbar button,.editor-commandbar .action-menu>summary{min-height:32px;padding:6px 10px;font-size:12px}
.editor-commandbar .editor-back{color:var(--green);background:white;border-color:#cfdbce;gap:7px;margin-right:4px}
.editor-back kbd{font-size:9px;color:#879684;border-color:#dbe3d5}
.editor-heading{min-width:0;padding-right:12px;border-right:1px solid var(--line)}
.editor-heading strong{font-size:17px;line-height:1.4;white-space:nowrap}
.editor-quick-actions{display:flex;gap:5px;margin-left:8px}
.editor-commandbar .save-indicator{font-size:10px;padding:4px 7px;white-space:nowrap}
.editor-commandbar .primary{min-width:115px}
.record-nav{margin:0;padding-right:10px;gap:2px}
.editor-commandbar .record-nav button{min-width:28px;width:auto;min-height:30px;padding:4px 7px;border-color:transparent;background:transparent}
.record-nav span{font-size:11px}
.document-form{padding:0 12px 8px;border-radius:7px}
.document-meta{min-height:24px;gap:22px;font-size:10px;margin-bottom:7px}
.document-header-grid{display:block}
.document-fields{min-width:0}
.header-fields{gap:8px 14px}
.basic-fields,.common-fields{grid-template-columns:1.15fr 1fr .9fr 1.35fr 1.15fr}
.common-fields{margin-top:6px}
.header-fields>label{flex-direction:row;align-items:center;gap:8px;color:#70816b;font-size:11px}
.header-fields>label>span{flex:0 0 65px;white-space:nowrap}
.header-fields>label>input,.header-fields>label>select{flex:1;width:0;min-height:29px;padding:4px 7px;font-size:12px}
.document-options{gap:12px;margin:7px 0 0;min-height:29px;flex-wrap:wrap}
.document-options .note-field{gap:8px;min-width:210px}
.note-field>input{min-height:29px;padding:5px 7px;background:#fafbf8;border-color:#e4e8df}
.document-options .check-label{font-size:11px;gap:5px}
.document-options .receipt-field select{min-height:29px;font-size:11px}
.document-header-tools{display:flex;gap:6px;align-items:center;margin-left:auto}
.document-header-tools .action-menu>summary{min-height:28px;padding:4px 8px;font-size:11px;background:#f7f9f4;border-color:transparent;gap:5px}
.document-header-tools .action-menu>summary:hover,.document-header-tools .action-menu[open]>summary{background:var(--green-light);border-color:#bdcfbc}
.extra-fields[open] summary{margin-bottom:0}
.extra-fields .advanced-fields{position:absolute;top:calc(100% + 7px);right:0;z-index:55;width:620px;grid-template-columns:1fr 1fr;padding:15px;gap:10px 16px;border:1px solid var(--line);border-radius:8px;background:white;box-shadow:0 10px 35px #1e3d3317}
.extra-fields .advanced-fields>label>span{flex-basis:74px}
.recent-menu .recent-records{width:340px;min-height:110px;max-height:300px;overflow:auto;border:1px solid var(--line);padding:12px 15px;font-size:11px}
.recent-records>div:first-child{margin-bottom:7px;font-size:11px}
.recent-records table{font-size:11px}
.recent-records td,.recent-records th{padding:5px 3px}
.editor-detail-layout{min-height:295px;grid-template-rows:minmax(175px,1fr) 112px;gap:8px}
.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
.editor-view .grid-panel{border-radius:7px}
.editor-view .grid-caption{min-height:33px;padding:3px 10px;background:#f7f9f4}
.editor-view .panel-name strong{font-size:12px}
.editor-view .grid-caption>div:last-child{gap:3px}
.editor-view .grid-caption button{min-height:25px;padding:3px 6px;font-size:11px}
.editor-view .grid-caption>span,.editor-view .subtle-tag{font-size:10px}
.editor-view .tabulator .tabulator-header .tabulator-col{min-height:30px}
.editor-view .tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:7px 8px;font-size:11px}
.editor-view .tabulator-row .tabulator-cell{padding:7px 8px;line-height:18px;font-size:12px}
.editor-view .tabulator .tabulator-placeholder{padding:12px;color:#9aa791;font-size:12px;font-weight:400}
.editor-view .tabulator .tabulator-placeholder .tabulator-placeholder-contents{font-size:12px;font-weight:400;color:#9aa791}
.editor-view .grid-hint{padding:3px 10px;font-size:9px}
.document-finance{grid-template-columns:1.3fr 1.15fr .6fr;gap:8px;min-height:79px}
.document-finance fieldset{border-radius:6px;padding:5px 10px 7px}
.document-finance legend{font-size:10px;padding:0 4px}
.totals-fields{gap:5px 10px}
.totals-fields label{font-size:11px;gap:5px}
.totals-fields input{min-height:25px;font-size:11px;padding:3px 5px}
.payment-fields{gap:5px 10px}
.payment-fields label{font-size:10px;gap:4px}
.payment-fields input{min-height:25px;font-size:11px;padding:3px 5px}
.document-finance .finance-summary{gap:3px 10px;padding-top:2px}
.finance-summary>div{font-size:11px}
.finance-summary>div:first-of-type .total-value{font-size:20px}
.finance-summary>span{font-size:9px}
.editor-bottom{min-height:36px;gap:10px;margin:0}
.editor-bottom>span{font-size:10px}
.editor-bottom>div{gap:6px}
.editor-bottom button{min-height:28px;padding:4px 9px;font-size:11px}
@media(min-width:1800px){.editor-view{padding:0 16px;gap:8px}.editor-commandbar{min-height:50px}.document-form{padding:0 12px 8px}.editor-detail-layout{grid-template-rows:minmax(175px,1fr) 112px}.document-finance{min-height:79px}.document-header-grid{display:block}}
@media(max-width:1400px){.editor-commandbar{gap:6px}.editor-commandbar button,.editor-commandbar .action-menu>summary{padding:6px 8px;font-size:11px}.editor-commandbar .record-nav span{display:none}.editor-quick-actions{margin-left:2px}.editor-commandbar kbd{display:none}.header-fields{gap:8px 10px}.header-fields>label>span{flex-basis:61px;font-size:10px}.editor-commandbar .primary{min-width:105px}.editor-heading{padding-right:9px}.totals-fields label{font-size:10px}.payment-fields label{font-size:9px}}
@media(max-width:1000px){.editor-view{height:auto;min-height:calc(100dvh - var(--shellbar-height));overflow:visible;padding:0 12px;gap:8px}.editor-commandbar{flex-wrap:wrap;min-height:50px;padding:8px 0;gap:6px}.editor-commandbar .command-spacer{flex:1}.editor-commandbar .record-nav{display:flex;margin-left:auto}.editor-heading strong{font-size:16px}.editor-commandbar .save-indicator{font-size:9px}.basic-fields,.common-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.document-options{gap:8px}.document-options .note-field{flex-basis:100%}.editor-detail-layout{flex:none;min-height:0;grid-template-rows:300px 130px}.document-finance{grid-template-columns:1fr 1fr}.document-finance .finance-summary{grid-column:1/-1;min-height:50px;flex-direction:row;flex-wrap:nowrap;gap:20px}.finance-summary>div{width:auto;min-width:150px}.finance-summary>span{margin-left:auto}.editor-bottom{flex-wrap:wrap;padding:6px 0}.editor-bottom>span{flex:1;min-width:240px}.editor-back kbd{display:none}}
@media(max-width:650px){.editor-view{padding:0 10px}.editor-commandbar .editor-back{min-height:32px;padding:6px 9px}.editor-commandbar .editor-heading{border:0}.editor-commandbar .save-indicator{margin-left:auto}.editor-commandbar .editor-quick-actions{margin-left:0}.editor-commandbar .command-spacer{display:none}.editor-commandbar .record-nav{order:2}.editor-commandbar .record-nav button{padding:4px;width:25px;min-width:25px}.editor-commandbar .primary{min-width:0}.editor-commandbar #editor-receive{display:inline-flex}.document-form{padding:0 9px 8px}.document-meta{gap:12px;flex-wrap:wrap;padding:5px 0}.document-meta #document-state{display:none}.basic-fields,.common-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px}.header-fields>label{flex-direction:column;align-items:stretch;gap:4px}.header-fields>label>span{flex:auto;font-size:10px}.header-fields>label>input,.header-fields>label>select{width:100%;flex:auto}.document-header-tools{width:100%;justify-content:flex-end}.extra-fields{position:static}.document-header-tools{position:relative}.extra-fields .advanced-fields{right:0;left:0;top:100%;width:100%;grid-template-columns:1fr 1fr;padding:12px}.extra-fields .advanced-fields>label>span{flex-basis:auto}.recent-menu .recent-records{right:0;width:min(340px,calc(100vw - 48px))}.editor-detail-layout,.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:300px 240px 120px 140px}.goods-panel{grid-row:1}.accounts-panel{grid-row:2}.goods-summary-panel{grid-row:3}.customer-panel{grid-row:4}.document-finance{grid-template-columns:1fr}.document-finance .finance-summary{grid-column:auto;flex-wrap:wrap;min-height:80px;gap:8px}.finance-summary>span{flex-basis:100%;margin:0}.document-finance fieldset{padding:7px 9px}.editor-bottom{position:static;justify-content:flex-end}.editor-bottom>span{font-size:9px;min-width:0;flex-basis:100%}.editor-view .grid-caption{padding:3px 8px}.editor-view .panel-name{gap:5px}.editor-view .grid-caption button{font-size:10px;padding:3px 4px}.editor-view .grid-caption>span{font-size:9px}}
@media print{.editor-view{height:auto;overflow:visible;padding:0;gap:8px}.editor-commandbar,.editor-bottom{display:none!important}.extra-fields .advanced-fields{position:static;width:auto;box-shadow:none;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px 0;border:0}.document-header-tools{display:contents}.recent-menu{display:none}.editor-detail-layout{display:grid;grid-template-rows:300px 140px;min-height:0}.document-finance{min-height:79px}}

.editor-view .tabulator .tabulator-header .tabulator-col.tabulator-frozen{background:#f7f8f3}
.editor-view .tabulator-row .tabulator-cell.tabulator-frozen{background:inherit}
.recent-menu[open] .recent-records{display:block}
@media(max-width:650px){.editor-bottom>span{display:block}}

@media(max-width:1000px){.editor-commandbar .command-spacer{display:block}.editor-view[data-direction=out] .editor-detail-layout{grid-template-rows:300px 130px}}
@media(max-width:650px){.editor-commandbar .command-spacer{display:none}.editor-view[data-direction=out] .editor-detail-layout{grid-template-rows:300px 240px 120px 140px}}

/* V0.4.7: one shared sidebar for the list and document editor. */
.tree-panel{position:fixed;top:var(--shellbar-height);left:0;bottom:0;width:var(--sidebar-width);z-index:20}
.editor-view{margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width))}
@media(max-width:1400px) and (min-width:1001px){.editor-commandbar{flex-wrap:wrap;gap:6px;padding:6px 0}.editor-commandbar .command-spacer{min-width:0}.editor-commandbar .record-nav{padding-right:5px}.editor-commandbar .save-indicator{font-size:9px}.editor-commandbar .editor-back{margin-right:0}}
@media print{.tree-panel{display:none!important}.editor-view{margin-left:0;width:100%}}

/* V0.4.8: clearer separators, with the same sizes and layout. */
:root{--line:#c6d0c0;--grid-line:#cbd5c6;--panel-line:#b7c5b3}
.grid-panel,.document-form,.list-card{border-color:var(--panel-line)}
.tabulator .tabulator-header{border-bottom-color:var(--panel-line)}
.tabulator .tabulator-header .tabulator-col,.tabulator-row .tabulator-cell{border-right-color:var(--grid-line)}
.tabulator-row{border-bottom-color:var(--grid-line)}
.document-meta,.grid-hint{border-bottom-color:var(--grid-line);border-top-color:var(--grid-line)}
input,select,textarea,.document-options .note-field>input{border-color:#c9d2c4}
input:focus,select:focus,textarea:focus,.document-options .note-field>input:focus{border-color:#719483}

/* V0.4.9: goods-first detail layout, aligned with its summary below. */
.editor-view .editor-detail-layout,.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:minmax(0,1.8fr) minmax(0,1fr);column-gap:10px}
.editor-view .tabulator .tabulator-header .tabulator-col-title{white-space:normal;text-overflow:clip;overflow-wrap:normal;line-height:1.4}
.editor-view .tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:7px 7px}
.editor-view .grid-hint{line-height:1.5;color:#7e8e75}
@media(max-width:650px){.editor-view .editor-detail-layout,.editor-view[data-direction=out] .editor-detail-layout{grid-template-columns:minmax(0,1fr)}}
.raw-conflict{display:block;color:#865b1b;font-size:11px;line-height:1.35;white-space:normal}

/* Inbound entry follows the original two equal-width grids. */
.editor-view[data-direction=in] .editor-detail-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.grid-caption button[aria-pressed=true]{background:var(--green-light);color:var(--green)}
@media(max-width:1450px){.editor-view[data-direction=in]{overflow:auto}.editor-view[data-direction=in] .editor-detail-layout{flex:none;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:300px 240px 120px 140px}}
@media(max-width:650px){.editor-view[data-direction=in] .editor-detail-layout{grid-template-columns:minmax(0,1fr)}}
