/* Keep wide ledgers inside their own viewport. */
.app{grid-template-columns:240px minmax(0,1fr)}.main,.view,.card,.grid>*,.two>*,[id$=List],.form,.field{min-width:0;max-width:100%}.main{overflow-x:clip}.scroll,.erp-table-scroll,.sd-sales-table{max-width:100%;min-width:0;overflow:auto;overscroll-behavior-x:contain;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#899caf #edf2f7}.scroll{width:100%;padding-bottom:4px}.scroll::-webkit-scrollbar,.erp-table-scroll::-webkit-scrollbar{width:12px;height:12px}.scroll::-webkit-scrollbar-thumb,.erp-table-scroll::-webkit-scrollbar-thumb{background:#899caf;border:2px solid #edf2f7;border-radius:8px}.scroll::-webkit-scrollbar-track{background:#edf2f7}.view .scroll>table{min-width:760px}.view .scroll th{white-space:nowrap}.view .scroll td{vertical-align:middle}.view .scroll td.right{white-space:nowrap;font-variant-numeric:tabular-nums}.erp-scroll-top{height:16px;overflow-x:scroll;overflow-y:hidden;max-width:100%;background:#edf2f7;border-radius:5px;margin:5px 0;scrollbar-color:#899caf #edf2f7}.erp-scroll-top>div{height:1px}.erp-scroll-top[hidden]{display:none!important}
.sd-sales-table table{table-layout:fixed;width:1560px;min-width:1560px!important;font-size:12px}.sd-sales-table th,.sd-sales-table td{padding:7px 5px;overflow-wrap:anywhere}.sd-sales-table th:first-child,.sd-sales-table td:first-child{width:38px}.sd-sales-table th:nth-child(2),.sd-sales-table td:nth-child(2){width:34px}.sd-sales-table th:nth-child(3){width:86px}.sd-sales-table th:nth-child(4){width:140px}.sd-sales-table th:nth-child(5){width:160px}.sd-sales-table th:nth-child(6){width:56px}.sd-sales-table th:nth-child(7){width:92px}.sd-sales-table th:nth-child(8){width:96px}.sd-sales-table th:nth-child(n+9):nth-child(-n+13){width:108px}.sd-sales-table th:nth-child(14){width:110px}.sd-sales-table th:nth-child(15){width:118px}.sd-sales-table th:nth-child(16){width:94px}.sd-sales-table .sd-row-actions{min-width:0;white-space:normal}.sd-row-actions .btn{display:block;width:100%;margin:3px 0;padding:5px 3px;font-size:11px}#salesInList .scroll>table{min-width:1080px;table-layout:fixed}#salesInList th:nth-child(1){width:90px}#salesInList th:nth-child(2){width:155px}#salesInList th:nth-child(3){width:110px}#salesInList th:nth-child(n+4):nth-child(-n+8){width:112px}
.form{grid-template-columns:repeat(4,minmax(0,1fr))}.field input,.field select{min-width:0;max-width:100%;height:36px;box-sizing:border-box}.field select{overflow:hidden;text-overflow:ellipsis}.field textarea{min-width:0;box-sizing:border-box}.bb-sheet-box{width:min(1120px,calc(100vw - 32px))!important;max-width:1120px!important;overflow:auto;padding:16px!important}.bb-sheet-box form{display:block;min-width:0}.bb-sheet-party th{width:64px!important;min-width:0}.bb-sheet-party th,.bb-sheet-party td{padding:5px!important;height:auto;white-space:normal!important}.bb-sheet-party input{height:32px!important;font-size:12px!important}.bb-sheet-parties{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.bb-sheet-customer{justify-content:flex-start}.bb-sheet-customer>input{height:34px;flex:1 1 180px;max-width:310px;min-width:140px}.bb-sheet-lines{min-width:940px!important;width:100%!important}.bb-sheet-lines-scroll{max-width:100%;overflow:auto;padding-bottom:5px}.bb-sheet-summary div{gap:8px;flex-wrap:wrap}.bb-sheet-meta{grid-template-columns:1fr 1fr 1.7fr}.bb-email-extra{display:flex;gap:5px;margin-top:5px;align-items:center}.bb-email-extra input{flex:1;min-width:0}.bb-email-extra .btn{flex:0 0 auto}.bb-mail-info{padding:8px;background:#f3f7fc;font-size:12px}.erp-tax-summary{margin:14px 0;padding:14px;border:1px solid #cbdcec;border-radius:9px;background:#f8fbff}.erp-tax-summary h3{margin:0 0 10px}.erp-tax-summary .toolbar{align-items:center}.erp-tax-summary select,.erp-tax-summary input{height:34px;padding:5px;border:1px solid #cbd5e1;border-radius:5px}.erp-tax-summary th,.erp-tax-summary td{padding:9px;white-space:nowrap}.erp-tax-summary .scroll>table{min-width:600px}.erp-integration-status{font-size:12px;color:#607087;line-height:1.6}.erp-card-tools{padding:12px;background:#f0f6ff;border:1px solid #cbdcec;border-radius:8px;margin:10px 0}.erp-card-tools input{padding:7px}.erp-card-tools button{margin:4px}.erp-operational-actions{display:flex;gap:5px;flex-wrap:wrap}.erp-mail-history{font-size:12px}.erp-mail-history td{white-space:normal}
@media(max-width:1100px){.form{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:850px){.bb-sheet-parties{grid-template-columns:minmax(0,1fr)}.bb-sheet-meta{grid-template-columns:minmax(0,1fr)}}@media(max-width:720px){.app{grid-template-columns:minmax(0,1fr)}.form{grid-template-columns:minmax(0,1fr)}.bb-sheet-box{width:calc(100vw - 16px)!important;padding:10px!important}.modal{padding:8px}.erp-tax-summary{padding:10px}}@media print{.erp-scroll-top{display:none!important}.scroll,.erp-table-scroll{overflow:visible!important}.bb-email-extra .btn{display:none}}

/* Invoice editors use their own grid, never ledger column widths. */
@media screen {
 .modal:has(.bb-sheet-box){padding:12px;align-items:flex-start;overflow:hidden}
 .modal>.box.bb-sheet-box{width:min(1220px,100%)!important;max-width:100%!important;min-width:0;max-height:calc(100dvh - 24px);margin:auto;padding:16px!important;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
 .bb-sheet-box,.bb-sheet-box *{box-sizing:border-box}
 .bb-sheet-box form,.bb-sheet-box form>*{min-width:0;max-width:100%}
 .bb-sheet-box .modalhead{position:sticky;top:-16px;z-index:3;background:white;padding:8px 0;flex-wrap:wrap}
 .bb-sheet-box .modalhead h2{min-width:0;overflow-wrap:anywhere}
 .bb-sheet-box .bb-sheet-parties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .bb-sheet-box .bb-sheet-party{width:100%;min-width:0;overflow:hidden}
 .bb-sheet-box .bb-sheet-party table{width:100%!important;min-width:0!important;max-width:100%;table-layout:fixed}
 .bb-sheet-box .bb-sheet-party th{width:68px!important;overflow-wrap:anywhere}
 .bb-sheet-box .bb-sheet-party td{min-width:0;overflow-wrap:anywhere}
 .bb-sheet-box .bb-sheet-party input{display:block;min-width:0;width:100%;max-width:100%;font-size:12px!important;min-height:32px;height:32px!important}
 .bb-sheet-box .bb-sheet-party td>.btn{margin:2px 0;white-space:normal}
 .bb-sheet-box .bb-sheet-meta{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr)}
 .bb-sheet-box .bb-sheet-meta label{min-width:0;white-space:normal}
 .bb-sheet-box .bb-sheet-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
 .bb-sheet-box .bb-sheet-summary div{min-width:0;overflow-wrap:anywhere}
 .bb-sheet-box .bb-sheet-lines-scroll{width:100%;min-width:0;max-width:100%;overflow-x:auto;scrollbar-gutter:stable;padding-bottom:8px}
 .bb-sheet-box .bb-sheet-lines{width:100%!important;min-width:1040px!important;table-layout:fixed}
 .bb-sheet-box .bb-sheet-lines input{min-width:0;width:100%;min-height:32px}
 .bb-sheet-box .bb-sheet-actions{position:static;display:flex;flex-wrap:wrap;gap:8px}
 @media(max-width:1000px){.bb-sheet-box .bb-sheet-parties{grid-template-columns:minmax(0,1fr)}.bb-sheet-box .bb-sheet-meta{grid-template-columns:minmax(0,1fr)}}
 @media(max-width:520px){.modal:has(.bb-sheet-box){padding:6px}.modal>.box.bb-sheet-box{max-height:calc(100dvh - 12px);padding:10px!important}.bb-sheet-box .modalhead{top:-10px}.bb-sheet-box .bb-sheet-party th{width:58px!important}.bb-sheet-box .bb-sheet-party th,.bb-sheet-box .bb-sheet-party td{padding:4px!important}.bb-sheet-box .bb-sheet-kind{align-items:flex-start;flex-direction:column}.bb-sheet-box .bb-sheet-summary{grid-template-columns:minmax(0,1fr)}.bb-sheet-box .bb-sheet-customer>input{min-width:0;flex-basis:100%;max-width:none}}
}

/* Place the synchronized scrollbar below its ledger, within reach while scrolling. */
@media screen{.view .erp-scroll-top{position:sticky;bottom:0;z-index:4;border:1px solid #d5dfeb;box-shadow:0 -2px 5px #17203312;margin:0 0 8px;height:18px;border-radius:0 0 5px 5px}}

/* Explicit sales columns keep selection and date close together. */
.sd-sales-table table{width:1558px!important;min-width:1558px!important}.sd-sales-table th:nth-child(-n+2),.sd-sales-table td:nth-child(-n+2){padding-left:3px!important;padding-right:3px!important;text-align:center}.sd-sales-table th:nth-child(3),.sd-sales-table td:nth-child(3){padding-left:5px!important;padding-right:5px!important;white-space:nowrap}.sd-sales-table input[type=checkbox]{width:16px;height:16px;min-height:16px;margin:0;vertical-align:middle}

.bb-live-banner{background:#eaf6ee;border-color:#99c9ab;color:#155d32}.bb-live-sheet>.note{border:1px solid #99c9ab;background:#eaf6ee;color:#155d32}.bb-live-confirm{padding:12px;margin:12px 0;background:#fff7e6;border:1px solid #e7c780;border-radius:6px;font-size:13px;line-height:1.6}.bb-live-confirm input{width:18px;min-height:18px;height:18px;vertical-align:middle;margin-right:6px}
.bb-live-author-header{padding:18px;border:1px solid #a8cbb5;background:#f4fbf6;border-radius:10px;margin-bottom:14px}.bb-live-author-header h2{font-size:24px;margin:8px 0}.bb-live-author-header p{margin:8px 0}.bb-live-tag{font-size:12px;font-weight:bold;color:#176839}.bb-live-author-header .primary{font-size:15px;padding:12px 18px}.bb-ready-status{padding:11px 13px;background:#eef2f7;border-radius:6px;font-size:13px;line-height:1.6}.bb-ready-status.ready{background:#dcfce7;color:#166534}.bb-ready-status.needs-action{background:#fff3dd;color:#884300}.bb-live-collection,.bb-practice-tools,.bb-sheet-advanced{margin:12px 0;padding:10px;border:1px solid #d9e3ed;border-radius:7px}.bb-practice-tools{font-size:12px;color:#65758b}.bb-live-collection summary,.bb-practice-tools summary,.bb-sheet-advanced summary{cursor:pointer;font-weight:600}.bb-live-sheet .bb-live-actions{position:sticky;bottom:-16px;background:white;z-index:3;padding:12px 0;margin-bottom:0;border-top:1px solid #cbd5e1}.bb-live-sheet #bbTaxIssue{background:#15703b;font-size:15px;padding:12px 18px}.bb-live-sheet #bbTaxIssue:disabled{background:#9da9a0;cursor:not-allowed}.bb-live-sheet .bb-ready-status{margin:10px 0}.bb-live-sheet .bb-sheet-advanced .bb-sheet-tools{padding-top:8px}@media(max-width:520px){.bb-live-sheet .bb-live-actions{bottom:-10px}.bb-live-author-header .toolbar .btn{flex:1 1 140px}}
