.quote-editor{color:#173f60}.quote-title{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:18px}.quote-title h2{font-size:25px;margin:0}.quote-title p{color:#6b8195;font-size:13px}.quote-title>div:last-child{display:flex;align-items:center;gap:20px;border:1px solid #cddfee;border-radius:7px;padding:12px;background:#f5faff}.quote-title label{display:flex;align-items:center;gap:10px}.quote-title input{width:160px}.quote-card{border:1px solid #d5e2ee;border-radius:8px;padding:18px;margin:15px 0;background:white}.quote-card-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:12px}.quote-card h3{margin:0;font-size:17px}.quote-search-wrap{position:relative;margin:12px 0}.quote-results{position:absolute;top:100%;left:0;right:0;z-index:6;max-height:270px;overflow:auto;background:white;border:1px solid #afcbe3;box-shadow:0 7px 20px #193d6324;border-radius:5px}.quote-results[hidden]{display:none}.sales-app .quote-results button{display:flex;flex-direction:column;align-items:flex-start;text-align:left;border:0;border-bottom:1px solid #e4edf5;border-radius:0;width:100%;padding:10px 14px}.quote-results p{padding:12px}.quote-results small{font-size:12px;color:#647b90}.quote-customer-info{display:grid;grid-template-columns:1.3fr .7fr 1fr 1.6fr .5fr;gap:18px;background:#f1f7fd;padding:16px;border-radius:6px;font-size:13px;line-height:1.6}.quote-customer-info small{display:block;color:#637e96;margin-bottom:4px}.quote-table-wrap{overflow:auto;max-width:100%}.quote-table{width:100%;border-collapse:collapse;font:13px/1.5 Tahoma,Arial,sans-serif}.quote-table th{background:#eaf3fc;color:#1e4b73;text-align:left;padding:12px 9px;white-space:nowrap}.quote-table td{padding:8px;border-bottom:1px solid #dfebf4}.quote-editor .quote-table{min-width:960px}.quote-editor .quote-table td:first-child{width:130px}.quote-editor .quote-table td:nth-child(2){min-width:260px}.quote-editor .quote-table td:nth-child(3){width:90px}.quote-editor .quote-table td:nth-child(4),.quote-editor .quote-table td:nth-child(5){width:135px}.quote-table input[readonly]{background:#eef2f6;color:#677b8d}.quote-table input[type=number]{text-align:right;min-width:65px}.quote-table [data-line-total]{text-align:right;white-space:nowrap;font-weight:700;color:#0874d5}.sales-app .quote-table [data-q-remove]{border:0;color:#bc4545;font-size:20px;padding:5px}.quote-bottom{display:grid;grid-template-columns:1fr 280px;gap:22px;margin-top:20px;align-items:start}.quote-notes{display:grid;grid-template-columns:1fr 1fr;gap:18px}.quote-notes textarea{height:100px}.quote-total{background:#edf5ff;border-radius:6px;padding:20px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.quote-total strong{font-size:26px;color:#0874d5}.quote-footer{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding-top:10px}.quote-footer>div{display:flex;gap:10px;flex-wrap:wrap;margin-left:auto}.quote-manager-filters{display:flex;gap:14px;flex-wrap:wrap;align-items:end;padding:18px;background:white;border:1px solid #d6e3ee;border-radius:8px}.quote-manager-filters>label:first-child{flex:1;min-width:240px}.quote-manager-filters label{font-size:13px;display:flex;flex-direction:column;gap:6px}.quote-manager-filters input[type=date]{width:160px}.quotation-manager .quote-table{background:white;min-width:1050px}.quote-row-actions{display:flex;gap:5px;flex-wrap:wrap;min-width:240px}.quote-row-actions button{font-size:12px;padding:6px 8px;min-height:32px}.quote-badge{display:inline-block;background:#e9f3fc;padding:5px 9px;border-radius:16px;white-space:nowrap}.quotation-dialog{width:min(1050px,95vw)}.quote-print-options{display:flex;gap:25px}.quote-print-options label{display:flex;align-items:center;gap:8px}.quote-print-options input{width:auto}.quote-paper{background:white;color:#111;padding:20px;font:13px/1.6 Tahoma,Arial,sans-serif}.paper-head{display:flex;justify-content:space-between;gap:25px;border-bottom:2px solid #163f68;margin-bottom:20px;padding-bottom:18px}.paper-head h2{font-size:20px}.paper-head h1{font-size:25px}.quote-paper p{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}.quote-paper table{width:100%;border-collapse:collapse;margin:20px 0}.quote-paper th,.quote-paper td{border:1px solid #cad4df;padding:9px;vertical-align:top}.quote-paper th{background:#edf3f9;text-align:left}.quote-paper td:nth-child(n+3){text-align:right;white-space:nowrap}.paper-total{text-align:right}.paper-notes{display:grid;grid-template-columns:1fr 1fr;gap:25px}.paper-sign{display:flex;justify-content:space-between;margin-top:60px}.paper-trial{text-align:center;color:#777}.quotation-print{margin:0}.quotation-print .quote-paper{max-width:210mm;margin:auto}.quote-table small{display:block;overflow-wrap:anywhere}
@media(max-width:900px){.quote-title,.quote-title>div:last-child{flex-wrap:wrap}.quote-customer-info{grid-template-columns:1fr 1fr}.quote-bottom{grid-template-columns:1fr}.quote-footer>div{margin-left:0}.quote-notes{grid-template-columns:1fr}.quote-card{padding:12px}.quote-title h2{font-size:21px}}
@media print{@page{size:A4;margin:12mm}.quote-paper{padding:0}.quote-paper thead{display:table-header-group}.quote-paper tr{break-inside:avoid}.paper-notes,.paper-sign{break-inside:avoid}.quotation-print .quote-paper{max-width:none}.quote-paper{font-size:11px}.quote-paper th,.quote-paper td{padding:6px}.paper-head h2{font-size:17px}}

/* Compact cart: keep customer, items and totals readable on a laptop. */
.quote-editor{font:13px/1.4 Tahoma,Arial,sans-serif;max-width:1440px;margin:auto}
.quote-editor .quote-title{margin-bottom:8px;gap:10px}.quote-editor .quote-title h2{font-size:18px}.quote-title p{margin:3px 0}
.quote-editor .quote-title>div:last-child{padding:6px 10px;gap:12px;font-size:12px}
.sales-app .quote-editor input,.sales-app .quote-editor button,.sales-app .quote-editor textarea{font-size:12px;min-height:30px;padding:5px 8px;line-height:1.4}
.quote-editor .quote-card{padding:12px 14px;margin:8px 0}.quote-editor .quote-card-title{margin-bottom:7px}.quote-editor .quote-card h3{font-size:15px}
.quote-inline-actions{display:flex;gap:6px}.quote-editor .quote-search-wrap{margin:5px 0 8px}.quote-customer-search-label{font-size:12px;font-weight:600}
.quote-customer-fields{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px 12px}.quote-customer-fields label{font-size:11px;color:#617a90;min-width:0}.quote-customer-fields input{display:block;width:100%;margin-top:3px;background:#f4f7fa;color:#234966;border:1px solid #dce5ec;box-sizing:border-box}.quote-customer-fields .span-2{grid-column:span 2}.quote-customer-fields .span-3{grid-column:span 3}.quote-customer-fields .span-4{grid-column:span 4}.quote-address-fallback{font-size:11px;margin:5px 0;color:#55758e}
.quote-editor label{margin:0;padding:0;display:block}.quote-editor .quote-customer-fields label{margin:0;padding:0;line-height:1.4}.quote-editor .quote-title label{display:flex}.sales-document:has(.quote-editor){padding:12px}.sales-app:has(.quote-editor)>.sales-heading{margin-bottom:10px}.sales-app:has(.quote-editor)>.sales-heading h1{font-size:23px}.quote-editor .quote-notes textarea{margin:4px 0 0}
.quote-customer-top{display:grid;grid-template-columns:2fr 1fr;gap:12px;align-items:start}.quote-customer-top>label{font-size:12px}.quote-customer-top>label input{margin-top:5px}.quote-editor .quote-card-title{margin-bottom:6px}.quote-editor .quote-title>div:last-child{padding:5px 8px}.quote-editor .quote-title p{font-size:11px}.quote-editor .quote-notes textarea{height:50px;min-height:50px}
@media(max-width:600px){.quote-customer-top{grid-template-columns:1fr;gap:3px;margin-bottom:7px}}
.quote-editor .quote-table{font-size:12px;min-width:850px;table-layout:fixed}.quote-editor .quote-table th{padding:7px 5px}.quote-editor .quote-table td{padding:4px 5px}.quote-editor .quote-table th:first-child{width:105px}.quote-editor .quote-table th:nth-child(2){width:auto}.quote-editor .quote-table th:nth-child(3){width:70px}.quote-editor .quote-table th:nth-child(4),.quote-editor .quote-table th:nth-child(5){width:105px}.quote-editor .quote-table th:nth-child(6){width:100px}.quote-editor .quote-table th:last-child{width:30px}
.quote-editor .quote-table td:nth-child(2){min-width:0}.quote-editor .quote-table input{width:100%;box-sizing:border-box;min-width:0}.quote-editor .quote-table tr[data-line] td{border-bottom:0}
.quote-editor .quote-details td{padding:0 5px 6px}.quote-detail-list>div{display:flex;align-items:center;gap:6px;margin:4px 0}.quote-detail-list span{color:#8195a5}.sales-app .quote-detail-list button{color:#ba4545;border:0;background:transparent;flex-shrink:0}
.sales-app .quote-editor [data-add-detail]{min-height:24px;padding:2px 6px;font-size:11px;border:1px dashed #c6d8e8;background:#f8fbfe;color:#587b97}.quote-editor .quote-bottom{margin-top:8px;gap:15px;grid-template-columns:minmax(0,1fr) 250px}.quote-editor .quote-notes{gap:12px}.quote-editor .quote-notes label{font-size:12px}.quote-editor .quote-notes textarea{height:54px;min-height:54px;resize:vertical;box-sizing:border-box}
.quote-tax-summary{border:1px solid #d4e2ee;border-radius:5px;overflow:hidden;font-size:12px}.quote-tax-summary>div{display:flex;justify-content:space-between;gap:15px;padding:6px 10px}.quote-tax-summary .quote-grand{background:#e9f3fc;color:#076faf;font-size:14px;border-top:1px solid #d4e2ee}
.quote-editor .quote-footer{position:sticky;bottom:0;z-index:5;background:#fff;border:1px solid #c9dcea;box-shadow:0 -3px 12px #163f6810;border-radius:7px;padding:8px 12px;gap:10px}.quote-editor .quote-footer .quote-footer-total{margin-left:auto;display:block;font-size:12px}.quote-footer-total strong{font-size:18px;color:#0874d5;margin:0 8px}.quote-editor [data-q-message]:empty{display:none}.quote-editor .sales-status{padding:6px 10px;margin:6px 0}
.quote-date-dialog{width:min(400px,92vw)}.quote-date-dialog h2{font-size:17px}.quote-date-dialog label{font-size:12px;color:#657f95}.quote-date-field{display:flex;gap:7px;margin-top:8px}.quote-date-field input{flex:1;min-width:0}.quote-date-dialog [data-date-hint]{font-size:12px;color:#75899a;min-height:18px;margin:8px 0 18px}.quote-date-dialog [data-date-hint].has-date{color:#218659}.quote-date-dialog .sales-actions{display:grid;grid-template-columns:1fr 1.6fr}.quote-preview-toolbar{display:flex;align-items:end;gap:10px;margin-bottom:12px;flex-wrap:wrap}.quote-preview-toolbar label{display:flex;flex-direction:column;gap:5px;font-size:12px}.quote-preview{overflow:auto;background:#e5eaf0;padding:16px}
/* A4 quotation uses its own print typography, independent of cart controls. */
.quote-paper{box-sizing:border-box;width:186mm;min-height:270mm;margin:0 auto;background:#fff;color:#151515;padding:0;font:11px/1.5 Tahoma,Arial,sans-serif;display:flex;flex-direction:column}
.quote-preview .quote-paper{box-shadow:0 2px 12px #152d4229;padding:12mm;width:210mm;min-height:297mm}
.quote-paper .paper-head{display:block;border-bottom:2px solid #243f5e;margin:0;padding:0 0 7px}.quote-paper .paper-head h2{font-size:16px;margin:0 0 2px}.quote-paper p{margin:2px 0}.quote-paper .paper-title{text-align:center;font-size:15px;margin:12px 0}.paper-customer-row{display:flex;justify-content:space-between;gap:15px;align-items:start;margin-bottom:10px}.paper-customer-row>section{flex:1;min-width:0}.quote-paper .paper-doc{width:205px;flex-shrink:0;margin:0;font-size:10px}.quote-paper .paper-doc th{width:57px;background:#f3f5f8;color:#222;text-align:left}.quote-paper .paper-doc th,.quote-paper .paper-doc td{padding:4px 6px;border:1px solid #d6dce2;height:18px;white-space:normal;text-align:left}.quote-paper .paper-items{margin:0 0 10px;table-layout:fixed}.quote-paper .paper-items th{background:#223f61;color:white;padding:6px 4px;border:0;font-size:10px}.quote-paper .paper-items th:first-child{width:28px}.quote-paper .paper-items th:nth-child(3){width:38px}.quote-paper .paper-items th:nth-child(4){width:68px}.quote-paper .paper-items th:nth-child(5){width:52px}.quote-paper .paper-items th:nth-child(6){width:74px}.quote-paper .paper-items td{padding:6px 4px;border:0;border-bottom:1px solid #e0e6ec;overflow-wrap:anywhere;font-size:10px}.quote-paper .paper-items tr:last-child td{border-bottom:2px solid #223f61}.quote-paper .paper-items td:first-child{text-align:center}.quote-paper .paper-items td:nth-child(n+3),.quote-paper .paper-items th:nth-child(n+3){text-align:right}.paper-code{display:block;color:#60768a;font-size:9px}.paper-detail{font-size:10px;color:#425260;white-space:pre-wrap;margin-top:2px}.paper-totals{width:235px;margin:0 0 10px auto;border:1px solid #dce3ea;border-radius:5px;overflow:hidden;break-inside:avoid}.paper-totals>div{display:flex;justify-content:space-between;padding:6px 10px;border-bottom:1px solid #eef0f3}.paper-totals .paper-grand{background:#223f61;color:#fff;border:0}.quote-paper .paper-notes{display:block;border:1px solid #e1e5eb;border-radius:4px;background:#f8f9fb;padding:8px 10px}.paper-notes>div+div{margin-top:6px}.quote-paper .paper-sign{display:flex;justify-content:space-between;gap:40px;margin-top:auto;padding:55px 45px 20px;break-inside:avoid;font-size:10px}.paper-sign>div{text-align:center;min-width:160px}.paper-sign span{display:block;border-top:1px solid #999;margin-bottom:6px}.paper-sign strong{font-weight:normal}.paper-trial{font-size:9px}
@media(max-width:700px){.quote-editor .quote-title>div:last-child{flex-wrap:wrap}.quote-customer-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.quote-customer-fields .span-3,.quote-customer-fields .span-4{grid-column:span 2}.quote-customer-fields .span-2{grid-column:span 1}.quote-editor .quote-bottom{grid-template-columns:1fr}.quote-editor .quote-notes{grid-template-columns:1fr 1fr}.quote-editor .quote-card{padding:10px}.quote-editor .quote-footer{flex-wrap:wrap}.quote-editor .quote-footer .quote-footer-total{margin-left:auto}.quote-inline-actions{flex-wrap:wrap;justify-content:end}}
@media print{@page{size:A4 portrait;margin:12mm}.quotation-print .quote-paper{width:auto;max-width:none;min-height:270mm;padding:0;box-shadow:none}.quote-paper{-webkit-print-color-adjust:exact;print-color-adjust:exact}.quote-paper .paper-items thead{display:table-header-group}.quote-paper .paper-items tr{break-inside:avoid}.quote-paper .paper-head h2{font-size:16px}.quote-paper .paper-sign{margin-top:auto}.quote-preview-toolbar{display:none}}

/* Isolate paper tables from the application's global table minimum width. */
.quote-paper table{min-width:0;max-width:100%;font:inherit}.quote-paper th,.quote-paper td{font-size:inherit}
.quote-paper .paper-customer-row{display:grid;grid-template-columns:minmax(0,1fr) 58mm;align-items:start;gap:5mm;margin-bottom:5mm}
.quote-paper .paper-customer-row>section{min-width:0;overflow-wrap:break-word;line-height:1.6}
.quote-paper .paper-doc{width:58mm;min-width:0;table-layout:fixed;font-size:9pt}.quote-paper .paper-doc th{width:18mm;white-space:nowrap}.quote-paper .paper-doc td{overflow-wrap:break-word}
.quote-paper .paper-head{background:#fff;box-shadow:none;border-radius:0;padding:0 0 3mm;color:#111}.quote-paper .paper-head h2{font-size:15pt;line-height:1.4}.quote-paper .paper-head p{font-size:9pt}
.quote-paper{font:10pt/1.5 Tahoma,Arial,sans-serif;width:180mm;min-height:267mm}.quote-preview .quote-paper{width:210mm;min-height:297mm;padding:15mm}
.quote-paper .paper-title{font-size:13pt;margin:4mm 0}.quote-paper .paper-items th,.quote-paper .paper-items td{font-size:9pt;padding:2mm 1.5mm}.quote-paper .paper-items th:first-child{width:9mm}.quote-paper .paper-items th:nth-child(3){width:12mm}.quote-paper .paper-items th:nth-child(4){width:21mm}.quote-paper .paper-items th:nth-child(5){width:17mm}.quote-paper .paper-items th:nth-child(6){width:24mm}
.quote-paper .paper-detail{font-size:8.5pt;line-height:1.6}.quote-paper .paper-items tbody tr:nth-child(even){background:#f6f8fb}.quote-paper .paper-totals{width:64mm;font-size:10pt}.quote-paper .paper-notes{font-size:9pt;padding:3mm}.quote-paper .paper-sign{font-size:9pt;padding-left:10mm;padding-right:10mm}.quote-paper .paper-trial{font-size:8pt}
.quotation-dialog .quote-paper .paper-head{display:block}.quotation-dialog .quote-paper .paper-title{color:#111}
.quotation-manager .sales-heading h1{font-size:24px}.quotation-manager .sales-heading p{margin-top:5px}.quotation-manager .quote-manager-filters{display:grid;grid-template-columns:minmax(240px,1fr) 150px 155px 155px auto;align-items:end;gap:12px;padding:16px}.quotation-manager .quote-manager-filters label{margin:0}.quotation-manager .quote-manager-filters>label:first-child{min-width:0}.quotation-manager .quote-manager-filters input[type=date]{width:100%}.quote-filter-actions{display:flex;gap:6px}.quote-filter-actions button{white-space:nowrap}.quote-list-caption{display:flex;justify-content:space-between;gap:12px;margin:18px 0 10px;font-size:12px;color:#5b768e}.quote-list-caption strong{color:#1f5278;font-size:13px}.quotation-manager>.quote-table-wrap{border:1px solid #d5e1ec;border-radius:7px;background:#fff}.quotation-manager .quote-table th{background:#174e78;color:#fff;font-size:12px;padding:12px 10px}.quotation-manager .quote-table td{padding:12px 10px;vertical-align:middle}.quotation-manager .quote-table tbody tr:nth-child(even){background:#f7fafc}.quotation-manager .quote-table tbody tr:hover{background:#edf6ff}.quotation-manager .quote-table td:nth-child(4){white-space:nowrap}.quotation-manager .quote-table td:nth-child(5){font-weight:700;text-align:right;white-space:nowrap}.quotation-manager .quote-row-actions{gap:5px;min-width:295px}.quotation-manager .quote-row-actions button{font-size:12px;min-height:30px;padding:5px 8px}.quotation-manager .quote-view-action{background:#e7f3ff;color:#0870bb;border-color:#8cbce0}.quotation-manager .quote-cancel-action{color:#a74747;border-color:transparent;background:transparent}.quotation-manager [data-send]{color:#217048;background:#edf8f1;border-color:#b3d5c0}.quote-badge.status-BK{background:#e7f2ff;color:#17669d}.quote-badge.status-CRT{background:#e6f5ed;color:#286849}.quote-badge.status-EDITING{background:#fff3da;color:#8d6618}.quote-badge.status-CANCELLED{background:#fceaea;color:#a34444}.quotation-dialog .quote-table small{display:block;margin-top:4px;color:#56748e}
@media(max-width:1100px){.quotation-manager .quote-manager-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.quotation-manager .quote-manager-filters>label:first-child{grid-column:span 2}.quote-filter-actions{align-self:end}.quote-list-caption{flex-wrap:wrap}}
@media(max-width:600px){.quotation-manager .quote-manager-filters{grid-template-columns:1fr 1fr}.quotation-manager .quote-manager-filters>label:first-child{grid-column:1/-1}.quote-filter-actions{grid-column:1/-1}.quotation-manager .sales-heading h1{font-size:20px}}
@media print{@page{size:A4 portrait;margin:15mm}.quotation-print .quote-paper{width:auto;min-height:266mm}.quote-paper .paper-head h2{font-size:15pt}}

/* Explicit measured sheets are shared by preview and print, including page numbers. */
.quote-pages .quote-sheet{position:relative;display:block;box-sizing:border-box;width:210mm;height:297mm;min-height:297mm;max-height:297mm;padding:15mm;margin:0 auto 18px;background:#fff;box-shadow:0 2px 12px #152d4229;break-after:page;page-break-after:always}
.quote-pages .quote-sheet:last-child{break-after:auto;page-break-after:auto;margin-bottom:0}
.quote-sheet .quote-page-body{height:259mm;display:flow-root;overflow:visible}
.quote-sheet .quote-page-footer{position:absolute;bottom:9mm;left:15mm;right:15mm;text-align:right;border-top:1px solid #d9e0e8;padding-top:2mm;color:#607080;font:8pt/1.4 Tahoma,Arial,sans-serif}
.quote-sheet .quote-page-ending{display:flex;flex-direction:column;box-sizing:border-box;gap:0}
.quote-sheet .paper-sign{margin-top:auto}.quote-sheet .paper-continuation{font-size:8.5pt;color:#51687b;font-weight:600}.quote-sheet .paper-items thead{display:table-header-group}.quote-sheet .paper-items tbody tr{break-inside:avoid}
.quote-sheet .paper-head{background:#fff}.quote-sheet .paper-trial{margin-bottom:0}
@media print{@page{size:A4 portrait;margin:0}.quotation-print{margin:0;padding:0}.quote-pages .quote-sheet{width:210mm;height:297mm;min-height:297mm;max-height:297mm;margin:0;padding:15mm;box-shadow:none}.quote-pages .quote-sheet:last-child{break-after:auto;page-break-after:auto}}

.quote-paper .paper-summary{display:flex;align-items:flex-end;gap:5mm;break-inside:avoid;margin-bottom:3mm}.quote-paper .paper-baht{flex:1;font-size:9pt;line-height:1.7;margin:0 0 2mm;overflow-wrap:anywhere}.quote-paper .paper-summary .paper-totals{flex:0 0 77mm;width:77mm;margin:0;font-size:9pt}.quote-paper .paper-totals>div{gap:3mm}.quote-paper .paper-totals>div>:last-child{white-space:nowrap}
