/* Compact desktop ERP layout, based on the supplied entry-screen references. */
:root{
 --ink:#263447;--muted:#586778;--line:#c4cbd4;--surface:#fff;--canvas:#eef0f3;--sidebar:#f4f5f7;
 --accent:#49688a;--accent-hover:#354f6f;--accent-soft:#e5edf5;--blue:#49688a;--blue-soft:#e9eff6;
 --success:#3c6750;--success-soft:#eaf2eb;--warning:#806225;--warning-soft:#fff4d8;
 --danger:#994f45;--danger-soft:#f8ebe7;--red:var(--accent);--red-dark:var(--accent-hover);
 --erp-bar:#69758d;--erp-bar-dark:#4e6078;--erp-grid-head:#f3e2b8;--erp-grid-selected:#fff2bf;
 --erp-edit:#fff8e7;--erp-border:#aeb6c2;--radius:3px;--shadow:0 4px 16px #25344716;
 font-size:14px;line-height:1.35
}
body{background:var(--canvas)}
button,a,input,select,textarea{transition:background .12s,border-color .12s}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #365e91;outline-offset:2px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #365e91;outline-offset:1px}
.sidebar,body.orders-mode .sidebar{width:174px;padding:10px 7px 9px;background:#f4f5f7;border-right:2px solid var(--erp-bar);color:var(--ink)}
.app-shell,body.orders-mode .app-shell{margin-left:174px}
.brand{margin:0 5px}
.brand img,body.orders-mode .brand img{width:132px;border-radius:2px}
.brand>span{font-size:10px;letter-spacing:.8px;margin-top:5px;color:var(--muted)}
.workspace-label,body.orders-mode .workspace-label{font-size:10px;letter-spacing:.7px;margin:8px 0 12px;color:var(--muted)}
.nav-section,body.orders-mode .nav-section{background:var(--erp-bar);color:#fff;padding:5px 7px;margin:10px 0 4px;font-size:12px;letter-spacing:0;font-weight:600}
.nav-item,body.orders-mode .nav-item{border-radius:2px;min-height:33px;padding:6px 7px;gap:7px;margin:1px 0;font-size:13px;color:#394d65}
.nav-item:hover{background:#e7ebf0;color:var(--ink)}
.nav-item.active{background:#e2eaf4;color:#274b72;box-shadow:inset 3px 0 0 #49688a}
.nav-item>svg,.nav-item>span>svg{width:17px;height:17px;min-width:17px}
.nav-count,.nav-item.active .nav-count{font-size:10px;padding:2px 4px;border-radius:2px;background:#dde5ed;color:#415b79}
.nav-count.red{background:#f5e8c8;color:#806225}
.nav-divider{margin:11px 4px;height:1px;background:var(--line)}
.future-nav>summary{padding:6px;font-size:12px;border-radius:2px}
.nav-item.future{font-size:12px;min-height:30px}
.sidebar-bottom{padding:9px 3px 0;gap:6px}
.sidebar-bottom strong{font-size:12px;color:#425770}
.sidebar-bottom div>span{font-size:11px;color:var(--muted)}
.local-mark{padding:5px;background:#e5eaf1;border-radius:2px;color:var(--accent)}
.topbar,body.orders-mode .topbar{height:40px;padding:0 12px;gap:10px;background:#f8f9fa;border-bottom:1px solid var(--erp-border)}
.breadcrumb{font-size:12px;gap:8px}
.breadcrumb strong{font-size:13px;font-weight:600;color:#334b66}
.topbar-right{gap:9px;font-size:12px}
.fy-label{background:#e7ebf0;color:#41556d;border:1px solid var(--line);border-radius:2px;padding:3px 6px}
.session-user{font-size:12px;line-height:1.2;max-width:170px}
.company-avatar{width:26px;height:26px;border-radius:2px;background:#e5eaf1;color:#405d7c}
#main,body.orders-mode #main{max-width:none;padding:8px 10px;margin:0;min-width:0}
.page-heading{min-height:38px;margin:0 0 7px;gap:10px;background:#e3e7ed;border:1px solid var(--erp-border);border-left:4px solid var(--erp-bar);padding:5px 9px}
.page-heading h1{font-size:20px;letter-spacing:0;line-height:1.15;font-weight:600}
.page-heading .eyebrow{display:none}
.page-heading p{font-size:12px;line-height:1.2;margin:3px 0 0;max-width:none}
.heading-actions{gap:6px}
.button{min-height:30px;padding:5px 10px;border-radius:2px;font-size:13px;gap:6px;box-shadow:none}
.button.primary{background:var(--accent);border-color:#3f5b7c;box-shadow:none}
.button.primary:hover{background:var(--accent-hover)}
.button.secondary{background:#f8f9fb;border-color:var(--erp-border);color:#334d6d}
.button.secondary:hover{background:#e8edf3;border-color:#869ab2}
.button.compact{min-height:28px;padding:4px 8px}
.icon-button{min-height:28px;min-width:28px;padding:4px;border-radius:2px;border-color:var(--erp-border)}
.text-button{min-height:28px;font-size:12px;padding:4px 6px;border-radius:2px}
.stats-grid{gap:6px;margin:0 0 7px}
.stat-card{min-height:42px;padding:5px 9px;border:1px solid var(--erp-border);border-radius:2px;box-shadow:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
.stat-card .stat-top{display:contents}
.stat-label{font-size:12px;color:#4a5d75}
.stat-icon{display:none}
.stat-value{margin:0;font-size:22px;letter-spacing:0;grid-column:2;grid-row:1/3;line-height:1}
.stat-note{font-size:11px;margin:2px 0 0;line-height:1.1}
.register-panel{border:2px solid var(--erp-bar);border-radius:2px;box-shadow:none}
.panel-heading{padding:5px 9px;gap:8px;background:var(--erp-bar);color:#fff;min-height:29px}
.panel-heading>div{display:flex;align-items:center;gap:10px;min-width:0}
.panel-heading h2{font-size:14px;font-weight:600;white-space:nowrap}
.panel-caption{color:#eef1f7;font-size:11px;margin:0;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.record-pill{font-size:11px;color:#fff;background:#ffffff18;border:1px solid #ffffff50;padding:2px 6px;border-radius:2px}
.scope-tabs{padding:3px 7px;gap:5px;background:#f1f3f6;border-bottom:1px solid var(--line);min-height:29px}
.scope-tab{padding:3px 8px;min-height:23px;font-size:12px;border-radius:2px;color:#4b5f77;border:1px solid transparent}
.scope-tab.active{background:#e3eaf3;color:#2f537f;border-color:#acbfd5}
.scope-tab .tab-count{padding:1px 4px;margin-left:4px;border-radius:2px;font-size:10px;background:#e7ebf0}
.scope-tab.active .tab-count{background:#d1deed;color:#355478}
.filter-toolbar{padding:5px 7px;gap:7px;background:#f8f9fb;flex-wrap:nowrap;min-height:37px}
.search-box{height:28px;min-height:28px;min-width:160px;padding:0 8px;gap:6px;border-radius:2px;border-color:var(--erp-border);background:#fff}
.search-box input{font-size:13px;padding:4px 0}
.search-box kbd{font-size:11px;padding:0 4px;border-radius:2px}
.filter-hint{font-size:11px;white-space:nowrap}
.filter-toolbar .download-actions{margin-left:auto;gap:5px;flex-shrink:0}
.download-link{min-height:28px;padding:4px 8px;font-size:12px}
.download-link svg{width:14px;height:14px}
.register-downloads{min-height:21px;padding:2px 8px;gap:7px;justify-content:flex-end;background:#f4f5f7;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.register-downloads strong{display:none}
.register-downloads #download-status{font-size:11px;margin:0;line-height:1.3}
#table-wrap{min-height:0;max-height:none;scrollbar-color:#a9b5c5 #edf0f4;overflow:auto}
#register-table{width:100%;table-layout:fixed;border-collapse:collapse}
#register-table thead,#register-table th:first-child{background:var(--erp-grid-head)}
#register-table th{padding:5px 5px;font-size:12px;letter-spacing:0;color:#384961;line-height:1.25;vertical-align:top;text-transform:none;border-right:1px solid #c8bb9c;border-bottom:1px solid var(--erp-border);white-space:normal}
#register-table th:first-child,#register-table td:first-child{padding-left:7px;position:static;box-shadow:none}
#register-table th:last-child,#register-table td:last-child{padding-right:5px}
#register-table td{height:36px;padding:4px 5px;font-size:13px;color:#314358;border-right:1px solid #d8dce2;border-bottom:1px solid #d2d8e1;line-height:1.25;overflow:hidden}
#register-table tbody tr:nth-child(even) td{background:#f5f6f8}
#register-table tbody tr:hover td,#register-table tbody tr:focus-visible td,#register-table tbody tr.erp-selected td{background:var(--erp-grid-selected)}
#register-table tbody tr.erp-selected td:first-child{box-shadow:inset 3px 0 0 #49688a}
#register-table tbody tr:focus-visible{outline:2px solid #49688a;outline-offset:-2px}
#register-table .client-cell,#register-table .project-cell,#register-table .requirement-cell,#register-table .owner-cell,#register-table .customer-contact-cell,#register-table .master-name-cell,#register-table .master-text-cell{min-width:0;max-width:none}
#register-table .client-name{font-size:13px;line-height:1.25;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#register-table .secondary-line{font-size:11px;line-height:1.2;margin-top:2px;max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#register-table .project-cell>span:not(.secondary-line){display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#register-table .requirement{-webkit-line-clamp:1;font-size:13px}
#register-table .owner-cell{gap:4px}
#register-table .owner-name{font-size:12px;line-height:1.2;max-width:none;overflow:hidden}
#register-table .avatar{width:21px;height:21px;min-width:21px;font-size:9px;border-radius:2px;background:#e4eaf2;color:#3a5579}
#register-table .enq-id{font-size:12px;font-weight:600;color:#435e80;white-space:normal;overflow-wrap:anywhere}
#register-table .badge{font-size:11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;padding:3px 5px;border-radius:2px}
#register-table .priority-inline{font-size:10px;line-height:1.2;margin-top:2px}
#register-table .column-filters{min-width:0;margin-top:5px;gap:3px}
#register-table .column-filters input,#register-table .column-filters select,#register-table .master-column-filters input{width:100%;min-width:0;max-width:none;min-height:25px;height:25px;padding:3px 4px;font-size:12px;border:1px solid #b8b5a7;border-radius:1px;background:#fffcf4;color:#34485f}
#register-table .column-filters input:focus,#register-table .column-filters select:focus{outline:2px solid #49688a;outline-offset:0;border-color:#49688a}
#register-table .column-date{font-size:10px;gap:3px}
#register-table .column-date>span{width:24px}
#register-table .column-date input{min-width:0;max-width:none;padding-left:1px;padding-right:1px;font-size:11px}
#register-table .master-column-filters th{padding-top:2px;padding-bottom:5px}
#register-table .row-open{min-width:22px;min-height:25px;padding:1px;border-radius:1px}
#register-table .row-open svg{width:15px;height:15px}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(1){width:17%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(2){width:15%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(3){width:15%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(4){width:11%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(5){width:9%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(6){width:10%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(7){width:9%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(8){width:11%}
#register-table:has(thead[data-kind="enquiries"]) th:nth-child(9){width:3%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(1){width:21%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(2){width:12%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(3){width:18%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(4){width:10%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(5){width:11%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(6){width:12%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(7){width:9%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(8){width:4%}
#register-table:has(thead[data-kind="customer-directory"]) th:nth-child(9){width:3%}
#register-table[data-master-view] th:last-child{width:32px}
#register-table[data-master-view] th:nth-last-child(2){width:104px}
#register-table[data-master-view] .master-directory-contact{font-size:12px;line-height:1.25;max-height:30px;overflow:hidden;margin:0 0 2px}
#register-table[data-master-view] .master-directory-contact .secondary-line{display:inline;margin-left:5px}
#register-table .master-linked-count{min-width:23px;padding:3px 5px;font-size:12px;border-radius:2px}
.table-footer{min-height:33px;padding:3px 8px;gap:8px;background:#edf0f4;font-size:11px}
.pagination-controls{gap:7px}
.rows-label{margin-right:4px;gap:4px;font-size:11px}
.rows-label select{padding:3px 4px;border-radius:2px;font-size:12px}
.workspace-footer{padding:4px 0 0;font-size:10px;line-height:1.25;gap:9px;min-width:0}
.workspace-footer>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
dialog{border:2px solid var(--erp-bar);border-radius:2px;box-shadow:0 10px 36px #25344733}
dialog::backdrop{background:#26374b55;backdrop-filter:none}
#editor.editor-dialog{width:calc(100vw - 16px);max-width:none;height:calc(100dvh - 16px);max-height:none;margin:8px;inset:0;border-radius:2px}
#editor>.editor-content,#editor>#editor-content{height:100%;min-height:0;min-width:0}
.dialog-header{padding:6px 10px;gap:8px;min-height:43px;align-items:center;background:var(--erp-bar);border-bottom:1px solid #4e6078;color:#fff;flex-shrink:0}
.dialog-header h2{font-size:17px;letter-spacing:0;color:#fff}
.dialog-header p{font-size:12px;line-height:1.2;color:#f0f2f7;margin:3px 0 0}
.dialog-header .icon-button{border:1px solid #ffffff60;background:#ffffff14;color:#fff;border-radius:1px;min-height:26px;min-width:26px}
.editor-body{padding:8px;background:#f1f3f6;overscroll-behavior:contain;min-width:0}
.form-section{border:1px solid var(--erp-border);border-radius:1px;padding:7px;background:#fff;margin:0 0 7px}
.form-section-heading{font-size:13px;gap:5px;margin:-7px -7px 7px;padding:5px 7px;background:#e1e6ed;border-bottom:1px solid var(--erp-border);color:#344b67}
.section-number{border-radius:1px;font-size:10px;padding:1px 4px;color:#fff;background:var(--erp-bar)}
.form-grid{gap:5px 9px;grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-field{display:grid;grid-template-columns:minmax(80px,35%) minmax(0,1fr);align-items:center;gap:3px 6px;min-width:0;font-size:12px;color:#3c4c60;font-weight:500}
.form-field label{line-height:1.2}
.form-field input,.form-field select,.form-field textarea{min-height:29px;height:29px;padding:4px 5px;border-radius:1px;font-size:13px;line-height:1.25;border:1px solid #b6beca;color:#263447;background:var(--erp-edit)}
.form-field textarea{height:48px;min-height:48px;resize:vertical}
.form-field input:read-only,.master-fixed-value{background:#eef1f5;color:#56667c}
.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:#49688a;outline:2px solid #49688a;outline-offset:0}
.form-field>.field-help,.form-field>.field-error,.form-field>.customer-selected{grid-column:1/-1}
.field-help{font-size:11px;line-height:1.3}
.field-error{font-size:11px}
.form-alert{padding:7px 9px;border-radius:2px;font-size:12px;margin:0 0 7px}
.continuous-form-note{font-size:11px;line-height:1.25;margin:0 0 6px}
.identity-strip{padding:5px 9px;margin:0 0 7px;gap:12px;border-radius:1px;background:#f8f9fb;border-color:var(--erp-border)}
.identity-strip>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.identity-strip small{margin:0;font-size:11px;letter-spacing:0;color:#4b5d73}
.identity-strip strong{font-size:13px;color:#365780}
.identity-strip .auto-tag{margin:0;padding:1px 4px;border-radius:1px;font-size:9px;background:#e6edf5}
.identity-strip .field-help{font-size:10px;margin:0!important}
.editor-pane+.editor-pane{padding:0;border:0;margin:0}
.dialog-footer{padding:7px 9px;gap:8px;min-height:43px;background:#eef1f5;border-color:var(--erp-border)}
.dialog-footer>span{font-size:11px;line-height:1.35;max-width:none;color:#53667e}
.dialog-footer>div{gap:6px}
.dialog-footer .button{min-height:30px;font-size:13px;padding:5px 9px}
.suggestions,.master-suggestions{top:calc(100% + 1px);border-radius:1px;border-color:var(--erp-border);max-height:210px}
.suggestion{padding:6px 8px;font-size:13px}
.suggestion:hover,.suggestion:focus{background:var(--erp-grid-selected)}
.suggestion small{font-size:11px;margin-top:2px}
.customer-selected,.master-form-note,.master-assignment-note,.customer-booking-status,.customer-order-confirmed{border-radius:1px;padding:7px 9px;font-size:12px;line-height:1.35;margin:0 0 7px}
.master-form-note span,.master-summary-count,.master-section-help,.customer-provenance,.customer-shared-note{font-size:11px;line-height:1.3}
.master-fixed-value{min-height:29px;padding:5px 6px;font-size:13px;border-radius:1px}
.master-section-title{gap:7px;margin-bottom:7px}
.master-section-title .form-section-heading{margin:0}
.master-section-title+.field-help,.master-section-help{margin:0 0 7px}
.master-contact-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.master-contact-card{padding:7px;border-radius:1px;background:#f8f9fb}
.master-contact-card header{margin-bottom:7px}
.master-contact-card h4{font-size:13px}
.master-contact-card .form-grid{grid-template-columns:1fr}
.master-contact-card .form-field textarea{min-height:42px;height:42px}
.master-contact-empty,.master-related-empty{padding:10px;border-radius:1px;font-size:12px}
.master-related-wrap{border-radius:1px}
.master-related-table{min-width:0;table-layout:fixed}
.master-related-table th{background:var(--erp-grid-head);color:#384961;font-size:12px;padding:5px 7px;text-transform:none;letter-spacing:0}
.master-related-table td{font-size:13px;line-height:1.25;padding:5px 7px;vertical-align:middle;border-right:1px solid #d9dde4}
.master-related-table td:first-child{min-width:0}
.master-related-table .secondary-line{font-size:11px;margin-top:2px}
.master-status-row{padding:7px;gap:7px;border-radius:1px}
.master-new-status-form{padding-bottom:9px;margin-bottom:9px}
.master-status-body{padding:9px}
.master-active-check{padding-top:0}
.master-status-row [data-save-status]{margin-top:0}
.customer-profile-summary{margin-bottom:7px;gap:6px}
.customer-shared-note{margin:0 0 7px}
.customer-action-section{padding-top:10px}
.customer-director-review{margin-top:7px;padding:9px;border-radius:1px}
.customer-director-review>.field-help{margin:6px 0 8px}
.customer-decision-buttons{gap:6px}
.customer-approval-line{margin-bottom:7px;gap:6px}
.customer-order-declaration{margin:9px 0;line-height:1.3}
.customer-history-item{padding:7px 0;font-size:12px;line-height:1.3}
.customer-history-item strong{font-size:13px}
.customer-history-item span{font-size:11px}
.customer-profile-footer>span{max-width:none}
.quote-summary{margin-top:5px;padding:7px 9px;border-radius:1px;border:1px solid var(--erp-border);background:#e7edf5;font-size:12px}
.quote-summary strong{font-size:15px;color:#365780}
.import-warning{padding:7px 9px;font-size:12px;border-radius:1px;margin:0 0 7px;line-height:1.35}
.activity-card{padding:9px;border-radius:1px;margin-bottom:7px}
.activity-card p{font-size:13px;line-height:1.35}
.detail-field{padding:6px 0}
.detail-field div{font-size:13px;line-height:1.3}
.history-section>summary,.source-details summary{font-size:13px;margin-bottom:7px}
.small-dialog{border-radius:2px}
.report-grid{gap:9px}
.report-card{padding:12px;border-radius:2px;border-color:var(--erp-border)}
.report-card p{margin-bottom:12px}
.bar-row{margin-bottom:9px}
.toast{font-size:13px;padding:9px 11px;border-radius:2px}
.order-access-admin input[type=checkbox]{width:17px;height:17px;accent-color:var(--accent)}
/* Related record groups stay in a single continuous enquiry form. */
@media(min-width:1180px){
 .erp-enquiry-sections{display:grid;grid-template-columns:1.12fr 1fr 1fr;grid-template-areas:"identity identity identity" "warning warning warning" "customer requirement project" "customer status quotation" "customer values followup" "linked total total" "help help help" "conversation conversation conversation" "history history history";gap:6px;align-items:start}
 .erp-enquiry-sections>.editor-pane:not(.history-section){display:contents}
 .erp-enquiry-sections .form-section{margin:0;min-width:0}
 #pane-enquiry>.identity-strip{grid-area:identity;margin:0}
 #pane-enquiry>.import-warning{grid-area:warning;margin:0}
 #pane-enquiry>.form-section:nth-of-type(1){grid-area:customer}
 #pane-enquiry>.form-section:nth-of-type(2){grid-area:requirement}
 #selected-customer{grid-area:linked;margin:0;font-size:11px}
 #pane-project>.form-section:nth-of-type(1){grid-area:project}
 #pane-project>.form-section:nth-of-type(2){grid-area:status}
 #project-consultant-help{grid-area:help;margin:0;font-size:11px}
 #pane-quotation>.form-section:nth-of-type(1){grid-area:quotation}
 #pane-quotation>.form-section:nth-of-type(2){grid-area:values}
 .erp-quote-total{grid-area:total}
 .erp-quote-total .quote-summary{margin:0}
 .erp-quote-total>.field-help{margin:3px 0 0}
 #pane-followup>.form-section:first-of-type{grid-area:followup}
 #pane-followup>.form-section:nth-of-type(2),#pane-followup>.field-help{grid-area:conversation;margin:0}
 #pane-history{grid-area:history;margin:0}
 .erp-enquiry-sections .form-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
 .erp-enquiry-sections .form-field{grid-template-columns:minmax(66px,34%) minmax(0,1fr);font-size:12px}
}
@media(min-width:1440px){
 #editor>#editor-content{display:grid;grid-template-columns:minmax(0,1fr) 198px;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
 #editor-content>.dialog-header{grid-column:1/-1;grid-row:1}
 #editor-content>.editor-body{grid-column:1;grid-row:2;overflow:auto}
 #editor-content>.dialog-footer{grid-column:2;grid-row:2;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:0;border-top:0;border-left:2px solid var(--erp-bar);background:#f8f9fb;min-height:0;overflow:auto}
 #editor-content>.dialog-footer::before{content:"Options";display:block;background:var(--erp-bar);color:#fff;font-weight:600;font-size:13px;padding:7px 10px;margin-bottom:7px}
 #editor-content>.dialog-footer>div{display:flex;flex-direction:column;gap:7px;padding:0 9px;order:1}
 #editor-content>.dialog-footer>div>.button{width:100%;justify-content:flex-start;white-space:normal;text-align:left;min-height:33px}
 #editor-content>.dialog-footer>span{order:2;margin:12px 9px 9px;font-size:12px}
}
@media(min-width:961px) and (min-height:650px){
 body:not(.auth-locked){height:100dvh;overflow:hidden}
 .app-shell{height:100dvh;display:flex;flex-direction:column;min-width:0}
 .topbar{flex:0 0 40px}
 #main{flex:1;min-height:0;display:flex;flex-direction:column}
 #main>.page-heading,#main>.stats-grid,#main>.workspace-footer{flex-shrink:0}
 #register-panel{flex:1;min-height:0;display:flex;flex-direction:column}
 #register-panel>.panel-heading,#register-panel>.scope-tabs,#register-panel>.filter-toolbar,#register-panel>.register-downloads,#register-panel>.table-footer{flex-shrink:0}
 #register-panel>#table-wrap{flex:1;min-height:0;max-height:none}
 #reports-panel{min-height:0;overflow:auto}
}
@media(max-width:1179px){
 .filter-hint{display:none}
 .form-field{grid-template-columns:minmax(84px,35%) minmax(0,1fr)}
 .master-contact-list{grid-template-columns:1fr}
}
@media(max-width:960px){
 .sidebar,body.orders-mode .sidebar{width:206px}
 .app-shell,body.orders-mode .app-shell{margin-left:0}
 .topbar,body.orders-mode .topbar{height:40px;padding:0 9px}
 #main,body.orders-mode #main{padding:7px}
 .filter-toolbar{flex-wrap:wrap}
 .filter-toolbar .search-box{flex:1;flex-basis:190px}
 .filter-toolbar .download-actions{margin-left:0}
 #table-wrap{min-height:220px;max-height:62dvh}
 #register-table{min-width:860px}
 .page-heading h1{font-size:18px}
 .form-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
 .form-field{font-size:12px}
 #editor.editor-dialog{margin:4px;width:calc(100vw - 8px);height:calc(100dvh - 8px)}
 .breadcrumb>span:first-child,.crumb-separator{display:none}
}
@media(max-width:650px){
 .topbar-right{gap:5px}.session-user{max-width:110px;font-size:11px}.company-avatar{display:none}.fy-label{font-size:10px}
 .page-heading{align-items:center;flex-direction:row}.page-heading p{display:none}.heading-actions{width:auto}.heading-actions .button{font-size:12px;flex:none}
 .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 .stat-value{font-size:20px}.stat-note{font-size:10px}
 .panel-caption{display:none}.register-downloads{padding:3px 7px}
 .download-actions{width:auto}.download-link{flex:none;min-height:30px}
 .form-grid,.form-grid.three{grid-template-columns:1fr;gap:6px}.form-field.full{grid-column:auto}
 .form-field{grid-template-columns:minmax(105px,36%) minmax(0,1fr)}
 .form-field input,.form-field select{min-height:33px;height:33px}
 .dialog-footer>span{display:none}.dialog-footer>div{justify-content:flex-end;flex-wrap:wrap;width:100%}
 .dialog-footer .button{min-height:33px}.identity-strip{grid-template-columns:1fr;gap:4px}
 .customer-profile-footer .button{flex:1;padding:5px 7px;min-width:0}
 .workspace-footer{flex-direction:column;gap:3px}
}

#register-table .master-text-cell{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}

/* All matching register records remain in one accessible scroll area. */
.search-match{background:#e9dcaa;color:#493618;border-radius:1px;padding:0;font-weight:700}
#table-wrap:focus-visible{outline:2px solid #49688a;outline-offset:-2px}
.register-scroll-hint{font-size:11px;color:var(--muted);text-align:right}
@media(max-width:960px){.table-footer{gap:7px;flex-wrap:wrap}.register-scroll-hint{text-align:left}#table-wrap{max-height:70vh}}

#register-table tbody tr{scroll-margin-top:var(--register-header-height,120px)}

body.access-mode #main>.page-heading,body.access-mode #main>.workspace-footer{display:none}
.access-readonly-note{margin:0 12px;color:#526781;white-space:nowrap}
.module-view-only input[readonly],.module-view-only textarea[readonly]{background:#f4f6f9;color:#425069}

/* Change password: a small dialog with one column, header above and buttons below at every width. */
#editor.editor-dialog.compact-editor{width:min(480px,calc(100vw - 24px));height:fit-content;max-height:calc(100dvh - 24px);margin:auto;inset:0}
#editor.compact-editor>#editor-content{display:flex;flex-direction:column;height:auto;overflow:auto}
#editor.compact-editor #editor-content>.dialog-footer{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;border-left:0;border-top:1px solid var(--line,#d6dbe3);padding:9px 12px;background:#f8f9fb}
#editor.compact-editor #editor-content>.dialog-footer::before{content:none}
#editor.compact-editor #editor-content>.dialog-footer>div{flex-direction:row;padding:0}
#editor.compact-editor #editor-content>.dialog-footer>div>.button{width:auto;min-height:31px}
#editor.compact-editor #editor-content>.dialog-footer>span{display:none}
.password-form .form-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.password-form .form-field{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}
.password-form .form-field input{width:100%;box-sizing:border-box}

/* Side pane: Sales & Marketing folds; its sub-modules are indented under it. */
.nav-group{margin:6px 0 2px}
.nav-group-toggle{display:flex;align-items:center;gap:7px;width:100%;min-height:31px;padding:5px 7px;border:0;border-radius:2px;background:var(--erp-bar);color:#fff;font:inherit;font-size:12px;font-weight:600;text-align:left;cursor:pointer}
.nav-group-toggle svg{width:15px;height:15px}
.nav-group-toggle>span:nth-child(2){flex:1}
.nav-chevron{transition:transform .15s}
.nav-group.collapsed .nav-chevron{transform:rotate(-90deg)}
.nav-group.collapsed .nav-group-items{display:none}
.nav-group-items{padding:2px 0 0}
.nav-item.nav-sub{padding-left:28px;position:relative}
.nav-item.nav-sub::before{content:"";position:absolute;left:14px;top:50%;width:6px;height:1px;background:#9aa8bb}
.nav-item.nav-sub>.nav-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item.nav-sub>.nav-count{flex:0 0 auto}

/* Dashboard */
.dashboard-panel{display:grid;gap:12px}
.dash-group h2,.dash-list h2{margin:0 0 6px;font-size:13px;font-weight:600;color:#36465e}
.dash-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px}
.dash-card{display:grid;gap:3px;text-align:left;padding:10px 12px;border:1px solid var(--erp-border,#aeb6c2);border-radius:2px;background:#fff;cursor:pointer;font:inherit;color:inherit}
.dash-card:hover,.dash-card:focus-visible{border-color:#49688a;background:#f7f9fc}
.dash-card.attention{box-shadow:inset 3px 0 0 #c99a2e}
.dash-card.alert{box-shadow:inset 3px 0 0 #b4473a}
.dash-label{font-size:12px;color:#4a5d75}
.dash-value{font-size:24px;line-height:1.1;color:#22364f}
.dash-note{font-size:11px;color:#6b7788}
.dash-lists{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px}
.dash-list{background:#fff;border:1px solid var(--erp-border,#aeb6c2);border-radius:2px;padding:10px 12px}
.dash-list ul{list-style:none;margin:0;padding:0}
.dash-list li+li{border-top:1px solid #e3e7ed}
.dash-list li button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 10px;width:100%;padding:6px 2px;border:0;background:transparent;text-align:left;font:inherit;color:inherit;cursor:pointer}
.dash-list li button:hover{background:#f3f6fa}
.dash-list li strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-list li span{grid-column:1;font-size:11px;color:#6b7788}
.dash-list li em{grid-column:2;grid-row:1/3;align-self:center;font-style:normal;font-size:12px;color:#4a5d75}
.dash-list li em.overdue{color:#b4473a;font-weight:600}

/* Column widths: a grip on each heading's right edge. */
.col-resizer{position:absolute;top:0;right:-4px;width:9px;height:100%;cursor:col-resize;z-index:4;touch-action:none}
.col-resizer::after{content:"";position:absolute;top:18%;bottom:18%;left:4px;width:2px;border-radius:1px;background:transparent}
th:hover>.col-resizer::after{background:#9aa8bb}
.col-resizer:hover::after,body.col-resizing .col-resizer::after{background:#49688a}
body.col-resizing,body.col-resizing *{cursor:col-resize!important;user-select:none}
.cols-sized>tbody>tr>td,.cols-sized>thead>tr>th{overflow:hidden}
