:root{color-scheme:light;--qp-ink:#172c45;--qp-muted:#62738a;--qp-blue:#17488b;--qp-line:#dce5ef;--qp-red:#e41520}
*{box-sizing:border-box}body.qp-body{margin:0;background:#f3f6fa;color:var(--qp-ink);font:15px/1.55 "Segoe UI",Arial,sans-serif}a{color:var(--qp-blue);text-underline-offset:3px}button,input,textarea,select{font:inherit}button,a,input,textarea,select{touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid #4b9df1;outline-offset:3px}.qp-top{min-height:82px;padding:12px max(24px,calc((100vw - 1380px)/2));display:flex;align-items:center;justify-content:space-between;gap:24px;background:#fff;border-bottom:1px solid var(--qp-line)}.qp-brand{display:flex;align-items:center;gap:18px;text-decoration:none;font-size:23px;font-weight:750;color:var(--qp-ink)}.qp-brand img{width:112px;height:54px;object-fit:contain}.qp-brand small{display:block;font-size:10px;letter-spacing:1.5px;color:var(--qp-muted)}.qp-top nav{display:flex;flex-wrap:wrap;align-items:center;gap:20px;font-size:14px}.qp-top nav form{margin:0}.qp-top nav a{text-decoration:none}.qp-link{padding:0;border:0;color:var(--qp-blue);background:transparent;cursor:pointer}.qp-main{max-width:1380px;margin:0 auto;padding:30px 24px 50px}.qp-page-head,.qp-card-head{display:flex;justify-content:space-between;align-items:center;gap:18px}.qp-page-head{margin-bottom:22px}.qp-eyebrow{font-size:11px;font-weight:750;letter-spacing:1.8px;color:var(--qp-blue);margin:0 0 4px}h1{font-size:29px;line-height:1.3;margin:0;font-weight:700}h2{font-size:19px;line-height:1.4;margin:0 0 18px}.qp-card-head h2{margin:0}.qp-card-head{margin-bottom:20px}.qp-lead{margin:0 0 22px;color:var(--qp-muted)}.qp-card{padding:25px;margin:0 0 20px;background:#fff;border:1px solid var(--qp-line);border-radius:12px;box-shadow:0 3px 14px #16365105}.qp-soft{background:#eaf2ff}.qp-muted{color:var(--qp-muted)}.qp-notice{padding:14px 18px;border-radius:8px;border:1px solid #9ed0af;color:#14542d;background:#edf9f0}.qp-notice--error{background:#fff3f2;border-color:#edb1b1;color:#9b1724}.qp-btn{min-height:41px;display:inline-flex;justify-content:center;align-items:center;gap:6px;padding:8px 16px;border:1px solid #bdccde;border-radius:7px;text-decoration:none;background:#fff;color:var(--qp-ink);font-weight:650;white-space:nowrap;cursor:pointer}.qp-btn:hover{background:#eaf1f9}.qp-btn--primary{color:#fff;background:var(--qp-blue);border-color:var(--qp-blue)}.qp-btn--primary:hover{background:#103d78;color:#fff}.qp-btn--small{min-height:34px;padding:5px 11px;font-size:13px}.qp-btn:disabled{opacity:.5;cursor:default}.qp-form label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:650}.qp-form input,.qp-form textarea,.qp-form select,.qp-filter input{border:1px solid #c9d5e2;border-radius:6px;background:#fff;padding:9px 11px;color:var(--qp-ink);max-width:100%;width:100%;min-height:41px}.qp-form input:focus,.qp-form textarea:focus,.qp-form select:focus,.qp-filter input:focus{outline:2px solid #8fb7ea;outline-offset:1px}.qp-form textarea{resize:vertical;min-height:76px}.qp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px}.qp-grid--three{grid-template-columns:repeat(3,minmax(0,1fr))}.qp-full{grid-column:1/-1}.qp-actions{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-top:20px}.qp-actions form{margin:0}.qp-check.qp-check{display:flex;flex-direction:row;align-items:center;gap:8px;font-weight:500;white-space:nowrap}.qp-check input{width:18px;min-height:18px;height:18px;margin:0;accent-color:var(--qp-blue)}.qp-sender{display:flex;flex-wrap:wrap;gap:8px 24px;background:#f4f7fb;border-radius:8px;padding:15px 18px;margin-top:20px;font-size:14px}.qp-sender small{flex-basis:100%;color:var(--qp-muted)}.qp-tag{display:inline-block;background:#f0f3f8;color:#54677e;border-radius:20px;font-size:12px;font-weight:600;padding:4px 12px}.qp-tag--ok{color:#14653b;background:#e8f7ee}.qp-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.qp-table{border-collapse:collapse;width:100%;font-size:14px}.qp-table th{padding:11px 12px;background:#f4f7fb;text-align:left;border-bottom:1px solid var(--qp-line);font-size:12px;white-space:nowrap;color:#4c6079}.qp-table td{padding:14px 12px;vertical-align:top;border-bottom:1px solid #edf1f6}.qp-table small{display:block;color:var(--qp-muted);margin-top:3px}.qp-right.qp-right{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.qp-items{min-width:1320px}.qp-items th,.qp-items td{padding:9px 5px}.qp-items textarea{width:100%;min-height:72px;padding:7px;font-size:13px}.qp-items input{font-size:13px;padding:8px 6px}.qp-items th:nth-child(2){width:210px}.qp-items th:nth-child(3){width:175px}.qp-items th:nth-child(4){width:112px}.qp-items th:nth-child(5){width:65px}.qp-items th:nth-child(6){width:80px}.qp-items th:nth-child(7){width:124px}.qp-items th:nth-child(8){width:66px}.qp-items th:nth-child(9){width:140px}.qp-items td:nth-child(10){min-width:110px;padding-top:18px}.qp-remove{border:0;background:#fff0f0;color:#ac2432;font-size:22px;line-height:1;width:28px;height:30px;border-radius:5px;cursor:pointer}.qp-totals{max-width:410px;margin:22px 0 0 auto;display:grid;gap:9px}.qp-totals>div{display:flex;justify-content:space-between;gap:24px;font-variant-numeric:tabular-nums}.qp-total{border-top:1px solid var(--qp-line);padding-top:13px;font-size:18px;color:var(--qp-blue)}.qp-savebar{display:flex;justify-content:flex-end;gap:12px;position:sticky;bottom:0;padding:15px;background:#f3f6faf5;border-top:1px solid var(--qp-line);backdrop-filter:blur(5px);z-index:5}.qp-empty{padding:38px 18px;text-align:center;color:var(--qp-muted)}.qp-empty h2{color:var(--qp-ink)}.qp-filter form{display:flex;align-items:center;gap:16px}.qp-filter input:not([type=checkbox]){max-width:480px}.qp-pagination{display:flex;justify-content:center;gap:28px;margin-top:22px;font-size:13px}.qp-foot{text-align:center;color:var(--qp-muted);padding:22px;font-size:12px}.qp-auth{max-width:460px;margin:24px auto}.qp-auth .qp-form{display:grid;gap:18px}.qp-user{font-weight:650}.qp-document-actions{margin:0 0 22px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:760px){.qp-top{padding:12px 16px;align-items:flex-start;gap:12px;flex-direction:column}.qp-brand{font-size:21px}.qp-brand img{width:96px;height:45px}.qp-top nav{gap:12px 18px;font-size:13px}.qp-main{padding:22px 13px 30px}.qp-page-head{align-items:flex-start;flex-wrap:wrap;gap:14px}h1{font-size:24px}.qp-card{padding:18px 14px;border-radius:9px}.qp-grid,.qp-grid--three{grid-template-columns:minmax(0,1fr);gap:15px}.qp-full{grid-column:auto}.qp-filter form{flex-wrap:wrap}.qp-filter input:not([type=checkbox]){max-width:none;flex-basis:100%}.qp-card-head{flex-wrap:wrap;gap:10px}.qp-totals{max-width:none}.qp-table{min-width:700px}.qp-items{min-width:1320px}.qp-savebar{padding:10px 0}.qp-auth{margin-top:10px}.qp-sender{flex-direction:column;gap:6px}.qp-actions{gap:12px}.qp-btn{font-size:14px}}

/* Các trường của một dòng hàng hóa luôn chung chiều cao. */
.qp-items td { vertical-align: top; }
.qp-items :is(input, textarea) {
    box-sizing: border-box; height: var(--qp-item-height, 52px); min-height: 52px;
    margin: 0; padding: 8px; font-size: 13px; line-height: 1.4;
    border: 1px solid #c9d5e2; border-radius: 6px;
}
.qp-items textarea { resize: none; overflow-y: auto; }
.qp-items td:first-child, .qp-items td:last-child,
.qp-items td[data-row-amount] { vertical-align: middle; }
.qp-items td[data-row-amount] { padding-block: 9px; }

.qp-catalog-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.qp-catalog-stats .qp-card{display:flex;flex-direction:column;gap:2px}.qp-catalog-stats strong{font-size:30px;color:var(--qp-blue)}.qp-catalog-stats span{color:var(--qp-muted)}.qp-import-preview{margin-top:24px;padding:20px;border:1px solid #9dc2ed;background:#edf5ff;border-radius:9px}.qp-import-preview h3{margin-top:0}.qp-catalog-filter{display:flex;flex-wrap:wrap;align-items:end;gap:14px}.qp-catalog-filter label:first-of-type{flex:1;min-width:200px}.qp-catalog-filter .qp-check{padding:10px 0}.qp-row-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:7px}.qp-row-tools small{overflow-wrap:anywhere;line-height:1.35;margin:0}.qp-contact-choice{margin-bottom:18px}.qp-contact-choice[hidden],.qp-picker-filters[hidden]{display:none!important}.qp-picker{width:min(760px,calc(100vw - 28px));max-height:85dvh;margin:auto;padding:22px;border:1px solid var(--qp-line);border-radius:14px;color:var(--qp-ink);background:#fff;box-shadow:0 12px 60px #091d4655;font:15px/1.5 "Segoe UI",Arial,sans-serif}.qp-picker::backdrop{background:#0b203b88}.qp-picker-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.qp-picker-head h2{margin:0}.qp-picker label{font-size:14px;font-weight:600;display:flex;flex-direction:column;gap:5px}.qp-picker input:not([type=checkbox]),.qp-picker select{padding:10px;border:1px solid #becddd;border-radius:6px;width:100%;min-height:42px}.qp-picker-filters{display:flex;align-items:end;gap:18px;margin-top:14px}.qp-picker-filters label:first-child{flex:1}.qp-picker-filters .qp-check{padding-bottom:10px}.qp-picker-results{display:grid;gap:8px;max-height:46dvh;overflow-y:auto;overscroll-behavior:contain;padding:2px}.qp-picker-result{display:block;text-align:left;border:1px solid var(--qp-line);border-radius:8px;padding:12px;background:#f8faff;color:var(--qp-ink);width:100%;cursor:pointer;overflow-wrap:anywhere}.qp-picker-result:hover{background:#eaf2ff;border-color:#8bb2e5}.qp-picker-result small{display:block;font-size:12px;color:#536880;white-space:pre-line;margin-top:3px}.qp-picker-pages{display:flex;justify-content:space-between;gap:12px;margin-top:15px}
@media(max-width:600px){.qp-catalog-stats{gap:8px}.qp-catalog-stats .qp-card{padding:14px 10px}.qp-catalog-stats strong{font-size:25px}.qp-picker{padding:16px}.qp-picker-head h2{font-size:18px}.qp-picker-filters{flex-wrap:wrap;gap:10px}.qp-picker-filters label:first-child{min-width:100%}.qp-picker-results{max-height:40dvh}}

.qp-suggestions{position:fixed;z-index:2000;overflow-y:auto;overscroll-behavior:contain;background:#fff;color:#122b49;border:1px solid #8db5e5;border-radius:9px;box-shadow:0 7px 24px #173b6b26;font:14px/1.45 "Segoe UI",Arial,sans-serif;padding:4px}.qp-suggestions[hidden]{display:none}.qp-suggestions [role=option]{display:block;width:100%;padding:10px 12px;border:0;border-radius:5px;text-align:left;background:white;color:inherit;cursor:pointer}.qp-suggestions [role=option]:hover,.qp-suggestions [aria-selected=true]{background:#e9f2ff}.qp-suggestions strong,.qp-suggestions small{display:block;overflow-wrap:anywhere}.qp-suggestions small{font-size:12px;color:#526883;white-space:normal}.qp-suggest-hint{padding:8px 12px;border-top:1px solid #e3eaf3}.qp-storage-path{overflow-wrap:anywhere;font:13px/1.6 ui-monospace,monospace}.qp-danger{border:1px solid #e5a8ad;background:#fff5f5}.qp-btn--danger{background:#b9202c;color:#fff;border-color:#b9202c}.qp-storage-filter{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.qp-storage-filter label{min-width:130px}.qp-storage-summary{display:flex;gap:26px;flex-wrap:wrap;margin:18px 0}.qp-storage-summary strong{font-size:24px;display:block}.qp-storage-table td small{display:block;color:var(--qp-muted)}

.qp-delete-confirm{border:1px solid #e5a8ad;background:#fff5f5;padding:20px;border-radius:8px;margin-top:20px}.qp-delete-confirm label{display:block;max-width:330px}.qp-delete-confirm input{display:block;margin-top:7px;width:100%;border:1px solid #d28c94;padding:11px;border-radius:5px}.qp-card code{overflow-wrap:anywhere}

.qp-form [hidden]{display:none!important}

/* Imported cabinet packages keep included equipment separate from billable rows. */
.qp-row-kind{display:block;margin-top:6px;font-size:12px;color:var(--qp-muted)}.qp-items .qp-row-kind select{display:block;width:100%;max-width:200px;min-height:34px;height:34px;padding:5px;font-size:12px;border:1px solid var(--qp-line);border-radius:5px;background:#fff;color:var(--qp-ink)}
.qp-items tr[data-item-type=CABINET],.qp-excel-table tr[data-item-type=CABINET]{background:#eaf2ff;font-weight:700}.qp-items tr[data-item-type=SECTION]{background:#f4f6f9}.qp-items tr[data-item-type=SECTION] :is(input[aria-label="Số lượng"],input[aria-label="Đơn giá"],input[aria-label="VAT"]){visibility:hidden}.qp-excel-import{width:min(1080px,calc(100vw - 28px))}.qp-excel-import label{display:block;margin:12px 0}.qp-excel-import [hidden]{display:none!important}.qp-excel-import input[type=file]{display:block;max-width:100%;margin-top:8px}.qp-excel-table{max-height:38dvh;overflow:auto}.qp-excel-table .qp-table{min-width:850px}.qp-excel-table td{white-space:pre-wrap;overflow-wrap:anywhere;vertical-align:top}.qp-excel-table td:nth-child(3){min-width:240px}.qp-excel-table td:nth-child(4){min-width:240px}.qp-excel-import .qp-actions{margin:18px 0}.qp-excel-import [data-excel-status]{color:var(--qp-blue)}.qp-excel-import [data-excel-warnings]{color:#8a4b00}

/* Keep import actions visible even for lengthy previews or manual column selection. */
.qp-excel-import[open]{display:flex;flex-direction:column;max-height:90dvh;overflow:hidden}.qp-excel-import>.qp-picker-head{flex:0 0 auto;padding-bottom:12px}.qp-excel-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:5px}.qp-excel-footer{flex:0 0 auto;border-top:1px solid var(--qp-line);padding-top:12px;margin-top:12px;background:#fff}.qp-excel-footer p{margin:0;font-size:13px;color:var(--qp-muted)}.qp-excel-footer .qp-actions{margin:10px 0 0}.qp-excel-footer button:disabled{opacity:.5;cursor:not-allowed}.qp-excel-mapping{padding:16px;background:#f1f6fd;border:1px solid #c4d8ef;border-radius:8px;margin:12px 0}.qp-excel-mapping h3{margin:0}.qp-excel-mapping .qp-grid{gap:10px}.qp-excel-mapping label{margin:3px 0;font-size:13px}.qp-excel-mapping small{font-weight:400}.qp-excel-source{max-height:26dvh;overflow:auto;margin:14px 0}.qp-excel-source .qp-table{font-size:12px;table-layout:auto}.qp-excel-source th{position:sticky;top:0;background:#e7eef8}.qp-excel-source td{min-width:90px;max-width:230px;white-space:pre-wrap;overflow-wrap:anywhere;vertical-align:top}.qp-excel-source td:first-child{min-width:70px;color:var(--qp-blue)}
@media(max-width:600px){.qp-excel-import[open]{max-height:94dvh;padding:14px}.qp-excel-footer .qp-actions{gap:6px}.qp-excel-footer button{padding:9px 10px;font-size:13px}.qp-excel-footer p{font-size:12px}.qp-excel-mapping{padding:10px}.qp-excel-table{max-height:32dvh}}

/* Inventory import and continuously scrolling catalog. */
.qp-inventory-head {display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap}
.qp-inventory-head h2,.qp-inventory-clear h2,.qp-import-preview h2 {margin:0 0 6px;font-size:1.2rem}
.qp-inventory-head p {margin:0 0 8px}
.qp-form.qp-catalog-upload {display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin-top:12px}
.qp-catalog-upload label {flex:1 1 260px;min-width:0;max-width:540px}
.qp-inventory-desktop {margin-top:12px;padding-top:10px;border-top:1px solid #e1e8f2}
.qp-inventory-desktop summary {cursor:pointer;color:#245684;font-weight:650}
.qp-inventory-danger {border-color:#e3a6a2;background:#fff8f7;color:#8d2825}
.qp-inventory-danger:hover {background:#fae2df;border-color:#c87f79;color:#762323}
.qp-inventory-clear {border-color:#e4b4b1;background:#fff8f7}
.qp-inventory-clear input {max-width:260px}
.qp-inventory-clear .qp-actions {margin:0}
.qp-inventory-warnings {padding-left:20px;color:#775622}
.qp-inventory-warnings:empty {display:none}
.qp-inventory-preview-table {margin-block:12px}
.qp-inventory-list .qp-catalog-filter {margin-top:14px}
.qp-inventory-count {margin:8px 0}
.qp-table-wrap.qp-inventory-scroll {max-height:min(67vh,760px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid #d8e4ef;border-radius:10px}
.qp-inventory-scroll .qp-table {min-width:650px;margin:0}
.qp-inventory-scroll .qp-table thead th {position:sticky;top:0;z-index:1;background:#eaf1fa;color:#173b59;box-shadow:0 1px #d1deec}
.qp-inventory-scroll .qp-catalog-code {width:20%;min-width:135px;overflow-wrap:anywhere}
.qp-inventory-scroll .qp-catalog-quantity {min-width:96px;font-variant-numeric:tabular-nums}
.qp-inventory-empty,.qp-inventory-load {padding:12px 14px;margin:0}
.qp-inventory-load {display:flex;align-items:center;gap:10px}
.qp-inventory-load[hidden] {display:none}
@media(max-width:600px) {
    .qp-form.qp-catalog-upload label {flex-basis:100%}
    .qp-table-wrap.qp-inventory-scroll {max-height:70vh}
}
.qp-inventory-edit-grid {display:grid;grid-template-columns:minmax(130px,1fr) minmax(180px,2fr) minmax(100px,.8fr);gap:12px}
.qp-inventory-edit-grid label {min-width:0}
#inventory-entry .qp-form p {margin:0}
#inventory-entry {scroll-margin-top:16px}
@media(max-width:650px) {
    .qp-inventory-edit-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
    .qp-inventory-edit-grid label:has(input[name="product_name"]) {grid-column:1/-1;grid-row:1}
}

/* Compact quotation header and two-band item editor. */
.qp-card.qp-editor-meta {
    padding: 0;
    margin-bottom: 14px;
    container: qp-editor-meta / inline-size;
}
.qp-editor-meta-bar {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 11px;
    cursor: pointer;
    list-style: none;
}
.qp-editor-meta-bar::-webkit-details-marker { display: none; }
.qp-editor-meta-bar:hover { background: #f2f7fd; }
.qp-editor-meta-bar:focus-visible { outline: 2px solid #8fb7ea; outline-offset: 2px; }
.qp-editor-meta[open] > .qp-editor-meta-bar {
    border-bottom: 1px solid var(--qp-line);
    border-radius: 11px 11px 0 0;
    background: #f5f8fc;
}
.qp-editor-meta-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--qp-blue);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}
.qp-editor-meta-control::after {
    content: '';
    width: 6px;
    height: 6px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translateY(-2px);
}
.qp-editor-meta[open] .qp-editor-meta-control::after { transform: rotate(225deg) translateY(-2px); }
.qp-editor-meta:not([open]) .qp-editor-meta-close,
.qp-editor-meta[open] :is(.qp-editor-meta-open, .qp-editor-meta-overview) { display: none; }
.qp-editor-meta-overview {
    min-width: 0;
    overflow: hidden;
    color: var(--qp-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qp-editor-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
    gap: 16px;
    padding: 12px 16px 15px;
}
.qp-editor-meta-section { min-width: 0; }
.qp-editor-meta-customer { border-left: 1px solid var(--qp-line); padding-left: 16px; }
.qp-editor-meta-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    margin-bottom: 7px;
}
.qp-editor-meta-heading h2 { margin: 0; font-size: 16px; }
.qp-editor-meta-status { color: var(--qp-muted); font-size: 12px; }
.qp-editor-meta-heading .qp-btn { min-height: 32px; font-size: 12px; }
.qp-editor-quote-fields,
.qp-editor-customer-fields { display: grid; gap: 8px 10px; align-items: end; }
.qp-editor-quote-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); }
.qp-editor-customer-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qp-editor-meta-wide { grid-column: 1 / -1; }
.qp-editor-meta label { min-width: 0; gap: 3px; font-size: 13px; line-height: 1.3; }
.qp-editor-meta :is(input, select) {
    min-width: 0;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
}
.qp-editor-customer-company { display: flex; align-items: end; gap: 10px; }
.qp-editor-customer-company label { flex: 1 1 0; }
.qp-editor-customer-company label:first-child { flex-grow: 1.5; }
.qp-editor-meta-hint { margin: 0; color: var(--qp-muted); font-size: 12px; }
.qp-editor-sender { margin-top: 8px; font-size: 13px; color: var(--qp-muted); }
.qp-editor-sender summary { cursor: pointer; }
.qp-editor-sender strong { margin-right: 6px; color: var(--qp-ink); }
.qp-editor-sender-contacts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0 12px; }
.qp-editor-sender-contacts span { overflow-wrap: anywhere; }

.qp-card.qp-editor-products { padding: 14px 16px 18px; }
.qp-editor-products .qp-card-head { margin-bottom: 6px; }
.qp-editor-products .qp-card-head .qp-actions { gap: 8px; margin: 0; }
.qp-editor-products .qp-card-head .qp-btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.qp-editor-product-help { margin: 0 0 8px; font-size: 13px; }
.qp-editor-products .qp-items { min-width: 1024px; table-layout: fixed; }
.qp-editor-products .qp-items th:nth-child(1) { width: 4%; }
.qp-editor-products .qp-items th:nth-child(2) { width: 18%; }
.qp-editor-products .qp-items th:nth-child(3) { width: 14%; }
.qp-editor-products .qp-items th:nth-child(4) { width: 10%; }
.qp-editor-products .qp-items th:nth-child(5) { width: 5.2%; }
.qp-editor-products .qp-items th:nth-child(6) { width: 6.2%; }
.qp-editor-products .qp-items th:nth-child(7) { width: 10%; }
.qp-editor-products .qp-items th:nth-child(8) { width: 5%; }
.qp-editor-products .qp-items th:nth-child(9) { width: 12%; }
.qp-editor-products .qp-items th:nth-child(10) { width: 12%; text-align: right; }
.qp-editor-products .qp-items th:nth-child(11) { width: 3.6%; }
.qp-editor-products .qp-items th { padding: 7px 4px; }
.qp-editor-line { position: relative; }
.qp-editor-products .qp-editor-line td { padding: 6px 4px; vertical-align: top; }
.qp-editor-products .qp-editor-line td:nth-child(2) { padding-bottom: 43px; }
.qp-editor-products .qp-editor-line :is(input:not([type="hidden"]), textarea) {
    height: var(--qp-item-height, 44px);
    min-height: 44px;
    min-width: 0;
    padding: 5px;
    line-height: 1.35;
}
.qp-editor-products .qp-editor-line :is([data-row-number], [data-row-amount]) {
    padding-top: calc(6px + (var(--qp-item-height, 44px) - 20px) / 2);
    font-variant-numeric: tabular-nums;
}
.qp-editor-line [data-row-number] { text-align: center; color: var(--qp-muted); font-size: 13px; }
.qp-editor-line [data-row-amount] { font-weight: 700; }
.qp-editor-products .qp-editor-line td:last-child {
    padding-top: calc(6px + (var(--qp-item-height, 44px) - 30px) / 2);
    text-align: right;
}
.qp-editor-line-tools {
    position: absolute;
    right: 8px;
    bottom: 6px;
    left: calc(4% + 4px);
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    white-space: nowrap;
}
.qp-editor-line-tools .qp-btn { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.qp-form .qp-editor-line-kind { flex-direction: row; align-items: center; gap: 5px; color: var(--qp-muted); font-size: 12px; }
.qp-editor-line-kind select { width: 157px; min-height: 30px; padding: 4px 6px; font-size: 12px; }
.qp-form .qp-cabinet-base { flex-direction: row; align-items: center; gap: 5px; font-size: 12px; color: var(--qp-muted); }
.qp-form .qp-cabinet-base input { width: 136px; min-height: 30px; padding: 4px 6px; font-size: 12px; text-align: right; }
.qp-editor-line[data-item-type=CABINET] [name$="[price]"] { background: #f5f9ff; font-weight: 700; }
.qp-editor-line-tools [data-catalog-hint] { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; }

@container qp-editor-meta (max-width: 740px) {
    .qp-editor-meta-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .qp-editor-meta-customer { border: 0; border-top: 1px solid var(--qp-line); padding: 10px 0 0; }
}
@container qp-editor-meta (max-width: 470px) {
    .qp-editor-meta-grid, .qp-editor-meta-bar { padding-inline: 12px; }
    .qp-editor-quote-fields, .qp-editor-customer-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qp-editor-quote-fields label.qp-editor-meta-wide, .qp-editor-contact-address { grid-column: auto; }
    .qp-editor-customer-company { flex-direction: column; align-items: stretch; gap: 8px; }
    .qp-editor-meta-overview { flex: 1 1 100%; order: 1; }
    .qp-editor-meta-bar { flex-wrap: wrap; gap: 2px 8px; }
}
@media (max-width: 600px) {
    .qp-card.qp-editor-products { padding: 12px; }
    .qp-editor-products .qp-card-head { margin-bottom: 8px; }
}
.qp-top--admin {
    flex-direction: row;
    align-items: center;
    gap: clamp(12px, 2vw, 26px);
    padding: 10px clamp(14px, 3vw, 40px);
}
.qp-top--admin .qp-brand { flex: 0 0 auto; }
.qp-top--admin .qp-brand img { display: block; width: 104px; height: 48px; object-fit: contain; }
.qp-top--admin nav { min-width: 0; gap: 2px 5px; }
.qp-top--admin nav a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.qp-top--admin nav a:hover, .qp-top--admin nav a:focus-visible { background: #edf4fc; }
.qp-directory-person label[hidden] { display: none; }
.qp-directory-person label + label { margin-top: 7px; }
.qp-setup-receipt { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.qp-setup-receipt label { flex: 1 1 330px; min-width: 0; }
.qp-setup-receipt small:empty { display: none; }
@media (max-width: 640px) {
    .qp-top--admin { flex-direction: column; align-items: flex-start; gap: 6px; }
    .qp-top--admin .qp-brand img { width: 92px; height: 42px; }
}

/* Employee directory */
.qp-employee-list-head { flex-wrap: wrap; }
.qp-employee-list-head .qp-actions { margin: 0; }
.qp-employee-row { border: 1px solid var(--qp-line); border-radius: 8px; }
.qp-employee-row + .qp-employee-row { margin-top: 6px; }
.qp-employee-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto 12px;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 7px;
    cursor: pointer;
    list-style: none;
}
.qp-employee-summary::-webkit-details-marker,
.qp-employee-delete-button::-webkit-details-marker { display: none; }
.qp-employee-summary:hover,
.qp-employee-row[open] > .qp-employee-summary { background: #edf4fc; }
.qp-employee-summary:focus-visible,
.qp-employee-delete-button:focus-visible { outline: 2px solid var(--qp-blue); outline-offset: 2px; }
.qp-employee-summary strong,
.qp-employee-username { min-width: 0; overflow-wrap: anywhere; }
.qp-employee-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--qp-blue);
    border-bottom: 2px solid var(--qp-blue);
    transform: rotate(45deg);
}
.qp-employee-row[open] > .qp-employee-summary .qp-employee-chevron { transform: rotate(225deg); }
.qp-employee-body { border-top: 1px solid var(--qp-line); padding: 16px 14px; }
.qp-employee-permissions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 272px), 1fr));
    align-items: start;
    gap: 14px 20px;
    margin-top: 14px;
}
.qp-employee-permissions .qp-check {
    min-width: 0;
    align-items: flex-start;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.qp-employee-permissions .qp-check input[type=checkbox] {
    flex: 0 0 18px;
    margin-top: 2px;
}
.qp-employee-permissions .qp-warehouse-grants { min-inline-size: 0; }
.qp-employee-permissions > .qp-employee-quota {
    grid-column: 1 / -1;
    justify-self: start;
}
.qp-employee-quota input { max-width: 140px; }
.qp-employee-actions { margin-top: 14px; }
.qp-employee-delete { border-top: 1px solid var(--qp-line); margin-top: 14px; padding-top: 12px; }
.qp-employee-delete-button { color: #ad1d2c; list-style: none; cursor: pointer; }
.qp-employee-confirm {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #edc5ca;
    border-radius: 8px;
    background: #fff5f6;
}
.qp-employee-confirm p { margin: 0 0 10px; }
@media (max-width: 640px) {
    .qp-employee-summary { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 2px 8px; }
    .qp-employee-summary strong { grid-column: 1; grid-row: 1; }
    .qp-employee-username { grid-column: 1; grid-row: 2; font-size: .9em; }
    .qp-employee-summary .qp-tag { grid-column: 2; grid-row: 1 / 3; }
    .qp-employee-chevron { grid-column: 3; grid-row: 1 / 3; }
}

/* Reusable manufacturer names and readable quotation prices. */
.qp-brand-dialog textarea{display:block;width:100%;margin-top:6px;padding:10px;border:1px solid #becddd;border-radius:6px;font:inherit;resize:vertical}
.qp-brand-list{display:flex;flex-wrap:wrap;align-content:flex-start;gap:7px;max-height:22dvh;overflow-y:auto;margin:10px 0 18px;padding:3px}
.qp-brand-list span{padding:4px 10px;border:1px solid #d9e4f1;border-radius:6px;background:#f4f8fe;font-size:13px}
.qp-brand-count{margin:10px 0 0;color:var(--qp-muted);font-size:13px}
.qp-brand-dialog [data-brand-status]{margin-bottom:0;min-height:24px}
.qp-items [data-price-input]{text-align:right;font-variant-numeric:tabular-nums}

/* Cabinet headings and group titles share the same emphasis in the editor. */
.qp-editor-products .qp-editor-line[data-item-type=CABINET] :is(input,textarea),
.qp-editor-products .qp-editor-line[data-item-type=SECTION] textarea[name$="[name]"]{font-weight:700}
.qp-editor-line td[hidden],.qp-editor-line [data-pick-product][hidden]{display:none!important}
.qp-editor-line[data-item-type=SECTION] [data-item-cell=name]{width:auto}

.qp-cabinet-amount-caption{display:block;margin-top:3px;font-size:11px;line-height:1.4;font-weight:400;color:var(--qp-muted)}
.qp-quote-owner-filter{display:flex;align-items:center;gap:8px;font-size:14px;white-space:nowrap}
.qp-quote-owner-filter select{min-height:42px;max-width:260px;padding:9px 11px;border:1px solid #c9d5e2;border-radius:6px;background:#fff;color:var(--qp-ink)}
.qp-readonly-tag{font-size:12px;color:var(--qp-muted);white-space:nowrap}
@media(max-width:760px){.qp-quote-owner-filter{flex:1 1 100%}.qp-quote-owner-filter select{flex:1;max-width:none}}

/* Purchase prices are distinct from selling prices and aligned for easy comparison. */
.qp-table .qp-catalog-cost { min-width: 9rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qp-catalog-cost > div + div { margin-top: .5rem; }

.qp-warehouse-grants { grid-column: 1 / -1; padding: 12px 14px; margin: 6px 0; border: 1px solid var(--qp-line); border-radius: 8px; }
.qp-warehouse-grants legend { font-weight: 700; padding: 0 5px; }
.qp-warehouse-grants .qp-check { display: inline-flex; margin: 0 16px 6px 0; }
