@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');
:root{--bg:#f4f6fa;--panel:#fff;--ink:#172a43;--muted:#708098;--line:#e0e6ef;--accent:#2864db;--side:#14243a;--green:#168368}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px Inter,Arial,sans-serif}body[data-theme=dark]{--bg:#151b25;--panel:#202b39;--ink:#edf2fa;--muted:#aab9cc;--line:#394658;--side:#10151e}body[data-theme=emerald]{--accent:#087d64;--side:#103e35}body[data-theme=anthracite]{--accent:#586579;--side:#25292f}body[data-theme=light]{--side:#405879;--bg:#f8f9fc}a{color:var(--accent);text-decoration:none}h1,h2,h3{font-family:'Plus Jakarta Sans',Arial,sans-serif;margin:0 0 14px}h1{font-size:25px}h2{font-size:19px}h3{font-size:15px}p{line-height:1.55}button,.btnx{display:inline-block;border:0;border-radius:8px;background:var(--accent);color:#fff;padding:11px 15px;font:600 13px Inter,Arial;cursor:pointer;text-decoration:none}button.secondary,.btnx.secondary{background:var(--bg);color:var(--ink);border:1px solid var(--line)}button.green{background:var(--green)}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);padding:10px;font:inherit;min-width:0}label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin:10px 0}label input,label select,label textarea{margin-top:6px}input[type=checkbox]{width:auto}.auth{display:grid;place-items:center;min-height:100vh;background:radial-gradient(at top left,#d8e7fb,#f7f8fb 60%)}.login{width:min(440px,94vw);background:white;color:#14243a;border-radius:20px;padding:30px;box-shadow:0 20px 80px #213b6420}.login button{width:100%}.error{color:#be3245}.shell{display:grid;grid-template-columns:78px minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:var(--side);display:flex;align-items:center;flex-direction:column;padding:16px 6px;gap:8px;z-index:5}.sidebar a{color:#b9c7db;text-align:center;width:100%;padding:10px 2px;font-size:9px;border-radius:8px}.sidebar a i{font-size:19px;display:block;margin-bottom:6px}.sidebar a.active,.sidebar a:hover{background:#ffffff20;color:white}.brandmark{background:#ffffff12;color:#fff;border-radius:10px;font-size:26px;font-weight:800;padding:9px 13px;margin-bottom:14px}.top{background:var(--panel);border-bottom:1px solid var(--line);padding:15px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px}.top strong{letter-spacing:.06em}.main{padding:22px;max-width:1700px;margin:auto}.panel{background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:19px;margin-bottom:16px}.muted{color:var(--muted)}.flex{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.grid2{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.metric strong{display:block;font-size:24px;margin-top:12px}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{padding:12px 9px;text-align:left;border-bottom:1px solid var(--line)}th{font-size:10px;letter-spacing:.04em;color:var(--muted)}td input,td select{min-width:75px;padding:8px}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:17px}.tabs a,.tabs button{background:var(--panel);color:var(--ink);border:1px solid var(--line);padding:10px 14px;border-radius:8px}.tabs .active{background:var(--accent);color:white}.searchbox{position:relative;flex:1}.suggest{position:absolute;top:100%;left:0;right:0;background:var(--panel);border:1px solid var(--line);z-index:10;box-shadow:0 8px 22px #0002}.suggest:empty{display:none}.suggest button{display:block;width:100%;text-align:left;background:var(--panel);color:var(--ink);border-bottom:1px solid var(--line)}.summary{background:var(--bg);border-radius:10px;padding:14px;margin:18px 0}.summary div{display:flex;justify-content:space-between;margin:10px 0}.sticky{position:sticky;top:15px;align-self:start}.notice{padding:12px;border:1px solid var(--line);border-radius:8px;margin-bottom:15px}.hide{display:none!important}.line-name{min-width:180px}button:disabled{opacity:.5;cursor:not-allowed}@media(max-width:1000px){.grid2{grid-template-columns:1fr}.sticky{position:static}.metrics{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.shell{display:block}.sidebar{height:auto;position:fixed;bottom:0;top:auto;left:0;right:0;flex-direction:row;overflow:auto;justify-content:space-around;padding:6px;gap:0}.sidebar a{min-width:60px}.brandmark{display:none}.main{padding:12px 10px 100px}.top{padding:12px}.fields{grid-template-columns:1fr}.panel{padding:12px}.metric strong{font-size:18px}.top span{display:none}}@media print{.sidebar,.top,.noprint{display:none!important}.shell{display:block}.main{padding:0}.panel{border:0;box-shadow:none}body{background:white;color:black}}

/* v0.2 UI — layout only; existing theme tokens and form contracts retained */
:root{--bg:#F1F5F9;--line:#E2E8F0;--sidebar-width:72px;--layout-gap:20px}
html{scroll-padding-top:24px}body{min-width:0}.shell{display:block;min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);height:100vh;height:100dvh;overflow-y:auto;overflow-x:hidden;padding:14px 6px;gap:5px;z-index:50}.sidebar a{flex-shrink:0;line-height:1.25;font-size:9px;padding:11px 2px}.brandmark{flex-shrink:0}.workspace{margin-left:var(--sidebar-width);min-width:0;overflow-x:clip}.top{min-height:64px;padding:12px 24px}.top form{margin:0}.main{width:100%;max-width:none;margin:0;padding:24px;min-width:0;overflow-x:clip}.panel{min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px;margin:0 0 20px;box-shadow:0 1px 2px #0f172a08}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px;min-width:0}.page-heading h1,.page-heading p{margin:0}.page-heading p{margin-top:6px}.page-heading .btnx{flex-shrink:0;white-space:nowrap}.metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;align-items:stretch;margin-bottom:20px}.metrics .metric{margin:0;min-height:112px;display:flex;flex-direction:column;justify-content:space-between;color:var(--muted)}.metric strong{color:var(--ink);overflow-wrap:anywhere}.fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px}.fields>*{min-width:0}label{margin:0 0 12px}input,select,textarea{max-width:100%;min-height:40px}input[type=checkbox]{min-height:0}button,.btnx{white-space:nowrap;min-height:40px}.tablewrap{width:100%;max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:10px;scrollbar-width:thin}table{margin:0;white-space:nowrap;vertical-align:middle}th,td{white-space:nowrap;vertical-align:middle;padding:12px 14px}th{background:var(--bg);font-size:11px}tr:last-child td{border-bottom:0}td small{color:var(--muted)}td .flex{flex-wrap:nowrap}td form{margin:0}td input,td select{min-width:0}td button{padding:8px 12px}.tabs{gap:8px;margin-bottom:20px}.grid2{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:20px;align-items:start}.grid2>section,.grid2>aside{min-width:0}.sticky{position:sticky;top:20px;align-self:start}.quote-heading{align-items:flex-start;gap:16px}.quote-heading h1{margin-bottom:5px}.quote-heading>.flex{align-items:end;gap:8px}.quote-heading>.flex label{margin:0 0 5px}.quote-heading select{min-width:78px}.quote-search{display:flex;flex-wrap:nowrap;align-items:center;gap:10px;margin-bottom:8px}.quote-search .searchbox{min-width:0}.quote-search button{flex:none}.quote-main .panel>p{font-size:12px;margin:10px 0 14px}.suggest{max-height:280px;overflow:auto;border-radius:8px}.suggest button{white-space:normal;overflow-wrap:anywhere}.quote-table{table-layout:fixed;min-width:724px;width:100%}.quote-table th,.quote-table td{padding:10px 5px}.quote-table th{font-size:10px;letter-spacing:0}.quote-table input,.quote-table select{width:100%;min-width:0;max-width:100%;padding:7px 5px;font-size:13px}.quote-table .line-name{min-width:0}.quote-table td:nth-child(2) small{display:block;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.quote-table th:nth-child(7),.quote-table td:nth-child(7){text-align:right;font-variant-numeric:tabular-nums}.quote-table td:last-child button{width:32px;padding:4px;min-height:32px}.quote-table td:first-child{text-align:center;color:var(--muted)}.quote-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.quote-actions button{padding:10px 5px}.segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;background:var(--bg);border-radius:10px}.segmented button{border:0;background:transparent}.segmented button.active{background:var(--accent);color:white}.quote-controls .summary{padding:14px;margin:18px 0}.summary div{gap:10px;align-items:baseline}.summary div:last-child{border-top:1px solid var(--line);padding-top:12px;font-size:16px}.summary strong{text-align:right;overflow-wrap:anywhere}.quote-controls #message:empty{display:none}.quote-controls #message{margin:10px 0 0;overflow-wrap:anywhere}.quote-controls label{margin:12px 0 6px}.quote-controls label input{margin-top:6px}.entry-panel{scroll-margin-top:24px}body[data-page=products] td:nth-child(3) form{display:grid;grid-template-columns:100px 78px 100px 78px auto;gap:8px;align-items:center}body[data-page=products] td:nth-child(3) label{margin:0}body[data-page=products] td:nth-child(3) label select{margin:0}body[data-page=products] td:nth-child(4) form{display:flex;gap:8px;align-items:center}body[data-page=products] td:nth-child(4) input{width:100px}body[data-page=settings] .panel form:not(.flex){max-width:780px}body[data-page=settings] .panel form+ .tablewrap{margin-top:20px}details.panel summary{cursor:pointer;font-weight:600;margin-bottom:12px}
@media(max-width:1199px){.grid2{grid-template-columns:minmax(0,1fr) 380px}.quote-heading>.flex{flex-wrap:wrap}.metrics{gap:12px}}
@media(max-width:1050px){.grid2{grid-template-columns:minmax(0,1fr)}.sticky{position:static}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.sidebar{inset:auto 0 0;width:100%;height:auto;max-height:80px;flex-direction:row;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;padding:6px 6px calc(6px + env(safe-area-inset-bottom));gap:4px}.sidebar a{width:65px;min-width:65px;padding:8px 2px}.workspace{margin-left:0}.main{padding:16px 12px 100px}.top{padding:10px 12px;min-height:56px}.panel{padding:14px;margin-bottom:16px}.page-heading{gap:10px;margin-bottom:16px;flex-wrap:wrap}.page-heading h1{font-size:22px}.fields{grid-template-columns:minmax(0,1fr);gap:4px}.metrics{gap:10px}.metrics .metric{min-height:95px;padding:12px}.quote-heading h1{font-size:22px}.quote-heading>.flex{width:100%}.quote-actions button{font-size:12px}.tabs a{font-size:11px;padding:8px}.grid2{gap:12px}.quote-main .panel{margin-bottom:0}}
@media print{.workspace{margin:0;overflow:visible}.main{padding:0;overflow:visible}.panel{border:0;box-shadow:none}.tablewrap{overflow:visible;border:0}.page-heading .btnx{display:none}body{background:white;color:black}}

/* v0.3 — centralized ERP density rules */
:root{--control-height:38px;--control-font:13.5px;--content-max:1400px;--card-padding:16px;--row-height:48px}
body{font-size:13.5px}.main{max-width:var(--content-max);margin:0 auto;padding:20px 24px;overflow:visible}.workspace{overflow-x:clip}.panel{padding:var(--card-padding);margin-bottom:16px}.page-heading{margin-bottom:16px}.page-heading h1{font-size:24px;line-height:1.25}.page-heading p{font-size:13px}.panel h2{font-size:16px;margin-bottom:10px}button,.btnx{height:var(--control-height);min-height:var(--control-height);font-size:var(--control-font);padding:0 12px;display:inline-flex;align-items:center;justify-content:center;gap:7px}input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select{height:var(--control-height);min-height:var(--control-height);font-size:var(--control-font);padding:7px 10px}textarea{min-height:76px;font-size:var(--control-font)}label{font-size:12px;margin:0;min-width:0}label input,label select{margin-top:5px}.fields,.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:12px 16px;align-items:end}.fields+button{margin-top:14px}.login label{margin:12px 0}.login{padding:24px}.metrics{gap:16px;margin-bottom:16px}.metrics .metric{min-height:104px;padding:16px}.metric-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.metric-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:var(--bg);color:var(--accent);font-size:14px}.metric strong{font-size:26px;line-height:1.2;margin-top:5px}.metric-link{font-size:11px;margin-top:8px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.section-heading h2,.section-heading p{margin:0}.section-heading p{font-size:12px;margin-top:4px}.compact-table th,.compact-table td{height:48px;padding:8px 12px;line-height:1.25;vertical-align:middle;white-space:nowrap}.compact-table th{height:38px;font-size:11px;text-transform:uppercase}.compact-table tbody tr:hover{background:var(--bg)}.compact-table .numeric{text-align:right;font-variant-numeric:tabular-nums}.compact-table .product-name{max-width:280px;overflow:hidden;text-overflow:ellipsis;font-weight:600}.erp-badge{display:inline-flex;align-items:center;font-size:11px;font-weight:600;line-height:1.2;border-radius:6px;padding:4px 7px}.erp-badge.neutral{background:var(--bg);color:var(--muted)}.erp-badge.positive{background:#dcfce7;color:#166534}.erp-badge.negative{background:#fee2e2;color:#991b1b}.row-actions{display:flex;justify-content:flex-end;gap:6px;align-items:center}.icon-action{height:30px;min-height:30px;width:32px;padding:0;border:1px solid var(--line);background:var(--panel);color:var(--ink);font-size:13px;border-radius:7px}.icon-action:hover{color:var(--accent);border-color:var(--accent)}.empty-cell{text-align:center!important;color:var(--muted)}.filter-box{position:relative;width:min(100%,300px)}.filter-box i{position:absolute;left:11px;top:12px;color:var(--muted)}.filter-box input{padding-left:34px!important}.erp-dialog{width:min(620px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:auto;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:0;box-shadow:0 20px 70px #0004;margin:auto}.erp-dialog::backdrop{background:#0f172a80}.dialog-head,.dialog-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px}.dialog-head{border-bottom:1px solid var(--line)}.dialog-head h2,.dialog-head p{margin:0}.dialog-head h2{font-size:18px}.dialog-head p{margin-top:4px;font-size:12px}.dialog-body{padding:20px}.dialog-foot{border-top:1px solid var(--line);justify-content:flex-end}.erp-input-group{display:flex;margin-top:5px;align-items:stretch}.erp-input-group input{flex:1;min-width:0;width:0;margin:0;border-radius:8px 0 0 8px}.erp-input-group select{flex:0 0 88px;width:88px;margin:0;border-left:0;border-radius:0 8px 8px 0}.quote-table input,.quote-table select{padding:4px 5px!important}.quote-table td{padding:5px}.quote-controls label{margin-top:10px}.quote-controls .summary{margin:12px 0}.quote-controls .summary div{margin:6px 0}.quote-actions button{padding:0 5px}.segmented button{height:32px;min-height:32px}.quote-controls #save2{width:100%}.tabs a{display:inline-flex;align-items:center;min-height:38px;padding:7px 12px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}
@media(max-width:1050px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.main{padding:16px 12px 100px}.panel{padding:16px}.page-heading h1{font-size:21px}.metrics{gap:10px}.metrics .metric{padding:12px;min-height:88px}.metric strong{font-size:22px}.section-heading{flex-wrap:wrap}.filter-box{width:100%}.dialog-body{padding:16px}.dialog-head,.dialog-foot{padding:14px 16px}.form-grid{grid-template-columns:1fr}.form-grid>div:empty{display:none}.dialog-foot button{flex:1}.quote-heading>.flex{gap:6px}}
@media print{.main{max-width:none;padding:0}.erp-dialog,.noprint{display:none!important}}

/* Compact R2 — shared density and list toolbar */
:root{--row-height:46px;--card-padding:16px}
.main{width:100%;max-width:1400px;margin:0 auto;padding:20px;min-width:0}
.top{min-height:56px;padding:8px 20px}.top .flex{flex-wrap:nowrap}.top .flex>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .brandmark{width:44px;height:44px;display:grid;place-items:center;padding:0;font-size:24px;color:white;margin-bottom:8px}
.page-heading{margin-bottom:14px}.page-heading h1{font-size:22px}.page-heading p{margin-top:3px}
.metrics{gap:12px;margin-bottom:14px}.metrics .metric{min-height:78px;padding:12px 16px;gap:4px}.metric-top{font-size:12px}.metric strong{font-size:24px;margin:0}.metric-link{margin:0}.metric-icon{height:26px;width:26px;font-size:12px}
.list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.list-filters{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.list-filters .filter-box{flex:1;min-width:120px;max-width:320px}.list-filters select{width:auto;max-width:190px}.list-toolbar>button{flex:none}.list-meta{display:flex;align-items:center;gap:10px;margin:0 0 10px}.list-meta h2{margin:0;font-size:15px}.list-meta span{font-size:12px}
.compact-table{font-size:13px}.compact-table th,.compact-table td{height:46px;padding:0 10px;vertical-align:middle;line-height:18px;white-space:nowrap}.compact-table th{height:36px;font-size:10.5px}.compact-table .icon-action{height:28px;min-height:28px;width:30px;padding:0}.compact-table .erp-badge{padding:3px 6px;line-height:16px}.product-list{table-layout:auto;min-width:740px}.product-list .product-name{width:32%;max-width:260px}.product-identity{display:flex;align-items:center;gap:8px;min-width:0;max-width:260px}.product-thumb{width:26px;height:26px;flex:0 0 26px;display:grid;place-items:center;border-radius:5px;background:var(--bg);color:var(--muted);font-size:12px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.row-actions{gap:4px}.dialog-body.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.erp-input-group{width:100%}.erp-input-group input,.erp-input-group select{min-width:0}.dashboard-list .section-heading{margin-bottom:10px}
@media(max-width:900px){.list-toolbar{flex-wrap:wrap}.list-filters{flex-wrap:wrap}.list-filters .filter-box{max-width:none}.list-filters select{flex:1;max-width:none}}
@media(max-width:600px){.main{padding:14px 10px 96px}.sidebar .brandmark{display:none}.list-toolbar{align-items:stretch}.list-filters{flex-basis:100%}.list-filters .filter-box{flex-basis:100%}.list-toolbar>button{margin-left:auto}.metrics .metric{padding:10px;min-height:76px}.dialog-body.form-grid{grid-template-columns:minmax(0,1fr)}.product-list .product-name{max-width:190px}.product-identity{max-width:190px}}
@media print{.main{max-width:none;padding:0}.list-toolbar{display:none}}

/* R3 – Bootstrap 5.3 modal and fixed-width inventory table.
   Existing form names, routes and theme tokens stay unchanged. */
.main{max-width:1400px;width:100%;margin:0 auto;padding:20px;min-width:0}
body[data-page=products] .inventory-panel,body[data-page=dashboard] .dashboard-list{padding:16px}
.metrics .metric{min-height:82px;padding:12px 16px}
.list-toolbar{gap:10px}.list-filters{gap:8px}.list-filters .filter-box{max-width:310px}.filter-reset{flex:0 0 38px;width:38px;padding:0}
.product-list{table-layout:fixed;min-width:820px;width:100%}
.product-list .col-product{width:auto}.product-list .col-sku{width:114px}.product-list .col-kind{width:76px}.product-list .col-qty{width:86px}.product-list .col-price{width:125px}.product-list .col-actions{width:82px}
.product-list .product-name{width:auto;max-width:none}.product-identity{max-width:none;width:100%;height:28px}.product-list td,.dashboard-table td{height:46px;max-height:46px;line-height:18px;padding:0 9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.product-list th,.dashboard-table th{height:36px;padding:0 9px;overflow:hidden;text-overflow:ellipsis}.product-list .row-actions{height:30px;gap:4px}.product-list .icon-action{width:28px;height:28px;min-height:28px;flex:0 0 28px;margin:0;padding:0;background:var(--panel);color:var(--ink);border:1px solid var(--line)}
.erp-modal{--bs-modal-width:620px;--bs-modal-bg:var(--panel);--bs-modal-color:var(--ink);--bs-modal-border-color:var(--line);--bs-modal-border-radius:12px;--bs-modal-header-border-color:var(--line);--bs-modal-footer-border-color:var(--line)}
.erp-modal .modal-content{background:var(--panel);color:var(--ink);box-shadow:0 18px 55px #0f172a33}.erp-modal .modal-header,.erp-modal .modal-footer{padding:14px 16px}.erp-modal .modal-body{padding:16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;align-items:start}.erp-modal label{margin:0;min-width:0}.erp-modal .modal-footer>*{margin:0}.erp-modal .modal-footer{gap:8px}.erp-modal .input-group{display:flex;flex-wrap:nowrap;align-items:stretch;width:100%;margin-top:5px}.erp-modal .input-group input{flex:1 1 0;width:0;min-width:0;margin:0;border-radius:8px 0 0 8px}.erp-modal .input-group select{flex:0 0 92px;width:92px;margin:0;border-left:0;border-radius:0 8px 8px 0}.erp-modal .dialog-head .icon-action{flex:none;width:32px;height:32px;min-height:32px}.erp-modal .modal-body p{margin:0;align-self:center;font-size:12px}.erp-modal .modal-header h2{font-size:18px;margin:0}.erp-modal .modal-header p{margin:4px 0 0}
@media(max-width:900px){.list-filters .filter-box{max-width:none}.list-toolbar{flex-wrap:wrap}}
@media(max-width:600px){.main{padding:14px 10px 96px}.erp-modal .modal-body{grid-template-columns:minmax(0,1fr)}.metrics .metric{min-height:76px;padding:10px}.product-list{min-width:820px}.list-filters .filter-box{flex-basis:100%}.list-filters select{min-width:0}.erp-modal .modal-footer button{flex:1}}
@media print{.erp-modal{display:none!important}.main{max-width:none;padding:0}}
/* R4 — customer list and 360° details */
.customer-table{table-layout:fixed;min-width:810px;width:100%}.customer-table td,.customer-motion td{height:46px;max-height:46px;padding:0 9px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.customer-table th,.customer-motion th{height:36px;padding:0 9px}.customer-identity{display:flex;align-items:center;gap:8px;min-width:0;font-weight:600;text-decoration:none}.customer-action{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-height:28px;padding:0;text-decoration:none}.customer-full{grid-column:1/-1}.customer-full textarea{width:100%;min-height:64px;resize:vertical}.customer-profile{margin-bottom:14px}.customer-profile-title{display:flex;align-items:center;gap:12px;margin-bottom:14px}.customer-profile-title h2,.customer-profile-title p{margin:0}.customer-avatar{display:grid;place-items:center;flex:0 0 46px;height:46px;border-radius:9px;background:var(--bg);color:var(--accent);font-size:19px}.customer-info{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 20px;margin:0}.customer-info dt{font-size:11px;color:var(--muted);font-weight:500}.customer-info dd{margin:3px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.customer-balances strong{font-size:21px;overflow-wrap:anywhere}.customer-balances strong small{font-size:11px}.customer-balances .erp-badge{align-self:flex-start}.customer-tabs{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:12px;padding-bottom:7px}.customer-tabs .customer-tab{flex:0 0 auto;background:transparent;color:var(--muted);border:1px solid transparent;padding:0 12px;height:36px;min-height:36px;border-radius:7px;white-space:nowrap;font-weight:600}.customer-tabs .customer-tab.active{background:var(--bg);color:var(--accent);border-color:var(--line)}.customer-tab span{font-size:11px;margin-left:5px}.customer-motion{table-layout:fixed;min-width:560px;width:100%}.customer-history .tab-pane:not(.active){display:none}.customer-history .tab-pane.active{display:block}@media(max-width:600px){.customer-info{grid-template-columns:repeat(2,minmax(0,1fr))}.customer-balances strong{font-size:17px}.customer-tabs .customer-tab{padding:0 9px}}
/* R5 — quote editor and saved offers */
.quote-editor{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:20px;align-items:start}.quote-editor .quote-main,.quote-editor .panel{min-width:0}.quote-editor .panel{padding:16px}.quote-editor .quote-controls{position:sticky;top:20px;align-self:start;max-height:calc(100vh - 40px);overflow:auto}.quote-editor .quote-heading{gap:10px;align-items:flex-start}.quote-editor h1{font-size:21px;margin:0 0 4px}.quote-options{gap:8px;align-items:flex-end}.quote-options label{margin:0 0 4px}.quote-options select{width:90px;margin:0}.quote-options button{white-space:nowrap}.quote-search{display:flex;flex-wrap:nowrap;gap:8px}.quote-search .searchbox{min-width:0}.quote-search button#manual{flex:none;white-space:nowrap}.quote-hint,#rates{font-size:12px;margin:8px 0 12px}.quote-editor .quote-table{table-layout:fixed;width:100%;min-width:760px}.quote-editor .quote-table td{height:46px;padding:3px 4px;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quote-editor .quote-table th{height:36px;padding:0 4px;font-size:10px;white-space:nowrap}.quote-editor .quote-table input,.quote-editor .quote-table select{height:30px;min-height:30px;min-width:0;width:100%;padding:3px 5px;font-size:12px;margin:0}.quote-editor .quote-table small{display:block;line-height:10px;font-size:9px;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}.quote-editor .quote-table .line-name{height:25px;min-height:25px}.quote-editor .quote-table button{height:28px;min-height:28px;width:28px;padding:0}.quote-editor .quote-actions,.quote-editor .quote-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.quote-editor .quote-actions button,.quote-editor .quote-bottom button{padding:0 6px;white-space:nowrap}.quote-editor .quote-bottom{grid-template-columns:1fr 1fr}.quote-editor #save2{grid-column:1/-1}.quote-editor .segmented{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:var(--bg);padding:4px;border-radius:8px}.quote-editor .quote-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.quote-editor .quote-fields label{margin:0;min-width:0}.quote-editor #offer{grid-template-columns:1fr}.quote-editor #client>label:first-child,.quote-editor #client>#customer_id,.quote-editor #client>label:nth-child(3),.quote-editor #client>label:nth-child(6){grid-column:1/-1}.quote-editor .summary{padding:12px;margin:12px 0}.quote-editor .summary div{margin:6px 0;font-size:12px}.quote-editor .summary div:last-child{border-top:1px solid var(--line);padding-top:10px;font-size:15px}.quote-editor #message{margin:8px 0 0;font-size:12px}.saved-table{table-layout:fixed;min-width:680px}.saved-table th,.saved-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:46px;padding:0 9px}.saved-table th{height:36px}.saved-table th:last-child{width:126px}.saved-table .row-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px}.saved-table .row-actions form{margin:0}.saved-table .icon-action{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-height:28px;padding:0}.saved-table tr[hidden]{display:none!important}.quote-editor .suggest{max-height:260px;overflow:auto}.quote-editor .suggest button{height:auto;min-height:38px;white-space:normal}
@media(max-width:1050px){.quote-editor{grid-template-columns:minmax(0,1fr)}.quote-editor .quote-controls{position:static;max-height:none;overflow:visible}}@media(max-width:600px){.quote-editor{gap:12px}.quote-editor .panel{padding:12px}.quote-editor .quote-fields{grid-template-columns:minmax(0,1fr)}.quote-editor .quote-fields>*{grid-column:1!important}}
.quote-editor .quote-table td:nth-child(2) small{margin-top:1px;line-height:10px}.quote-editor .quote-table td:last-child button{width:28px;min-height:28px;height:28px}.quote-editor .quote-table .line-name{min-height:25px;height:25px}.saved-table .icon-action{background:var(--panel);color:var(--ink);border:1px solid var(--line)}.saved-panel .list-toolbar>.btnx{white-space:nowrap}.saved-table td:last-child{overflow:visible}.saved-table td:nth-child(4){font-variant-numeric:tabular-nums}.quote-editor .tablewrap{max-width:100%;overflow-x:auto}
