/* Receipt workspace: neutral document surface, compact rows, a blue focus cue. */
.crm-receipt-form.is-document-receipt{--rd-line:#dce2ea;--rd-muted:#697586;--rd-ink:#202d40;--rd-blue:#1769cc;--rd-paper:#fff;--rd-soft:#f5f7fa;display:block;background:var(--rd-paper);color:var(--rd-ink);padding:24px;max-width:none}
.is-document-receipt>.crm-receipt-path,.is-document-receipt>[data-crm-receipt-stage-panel]:not([data-crm-receipt-stage-panel="supplier"]){display:none!important}
.is-document-receipt>[data-crm-receipt-stage-panel="supplier"]{display:block!important;padding:16px 0 24px;border:0;background:none;box-shadow:none}
.is-document-receipt>[data-crm-receipt-stage-panel="supplier"]>header,.is-document-receipt>[data-crm-receipt-stage-panel="supplier"]>footer{display:none}
.is-document-receipt .crm-receipt-command{padding:0 0 18px;border-bottom:1px solid var(--rd-line);background:none;box-shadow:none}
.is-document-receipt .crm-receipt-command h2{font-size:25px;letter-spacing:-.5px}
.is-document-receipt .crm-receipt-supplier-picker{max-width:540px}
.receipt-document button,.rd-drawer button{cursor:pointer;font:inherit}
.receipt-document button:focus-visible,.receipt-document input:focus-visible,.rd-drawer button:focus-visible,.rd-drawer input:focus-visible,.rd-drawer select:focus-visible{outline:2px solid #1769cc;outline-offset:2px}
.rd-heading{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid var(--rd-blue);padding:10px 0 14px}
.rd-heading b{font-size:17px}.rd-heading span{margin-left:16px;color:var(--rd-muted);font-size:12px}
.rd-heading button,.rd-footer>div>button{background:#fff;border:1px solid var(--rd-line);border-radius:5px;padding:9px 13px;color:var(--rd-blue)}
.rd-table-scroll{overflow-x:auto;min-height:110px}
.rd-table{width:100%;min-width:930px;border-collapse:collapse;table-layout:fixed;font-size:13px;font-variant-numeric:tabular-nums}
.rd-table th{padding:13px 8px;text-align:right;color:var(--rd-muted);font-weight:500;background:#fafbfd;border-bottom:1px solid var(--rd-line);font-size:11px;line-height:1.4}
.rd-table th:first-child{width:29%;text-align:left}.rd-table th:nth-child(2){width:9%}.rd-table th:nth-child(3){width:9%}.rd-table th:nth-child(4){width:12%}.rd-table th:nth-child(5),.rd-table th:nth-child(6){width:13%}.rd-table th:nth-child(7){width:9%}.rd-table th:last-child{width:6%}
.rd-table td{padding:14px 8px;border-bottom:1px solid var(--rd-line);text-align:right;vertical-align:middle}
.rd-table td:first-child{text-align:left}.rd-table td:first-child>button:first-child{border:0;background:none;padding:0;color:#234365;font-weight:600;text-align:left;font-size:14px;line-height:24px;min-height:36px;box-sizing:border-box;padding:6px 0}
.rd-table td:first-child>button:first-child:hover{text-decoration:underline}.rd-table small{display:block;color:var(--rd-muted);font-size:11px;margin:4px 0;line-height:1.5}.rd-table code{font-size:11px;color:var(--rd-muted)}
.rd-table td>input{width:100%;min-width:0!important;height:34px!important;border:1px solid transparent!important;border-radius:4px;background:transparent!important;padding:5px!important;text-align:right;font:inherit;color:var(--rd-ink)}
.rd-table td>input:hover{border-color:var(--rd-line)!important}.rd-table td>input:focus{border-color:var(--rd-blue)!important;background:#fff!important}
.rd-table td>input:invalid{border-color:#c52b32!important}.rd-table [data-rd-sum]{font-weight:600;padding-top:22px;white-space:nowrap}
.rd-table td:last-child button{border:0;background:none;padding:2px 5px;color:var(--rd-muted);font-size:18px}.rd-table .rd-identifiers{display:block;border:0;background:none;padding:5px 0 0;color:var(--rd-blue);font-size:11px}
.rd-table .rd-empty{text-align:center;padding:35px;color:var(--rd-muted)}
.rd-search{display:flex;align-items:flex-start;gap:12px;padding:14px 0;border-bottom:1px solid var(--rd-line)}.rd-search>span{font-size:25px;color:var(--rd-blue)}.rd-search>div{position:relative;flex:1;max-width:840px}.rd-search input{width:100%;border:1px solid var(--rd-line);border-radius:5px;padding:10px 12px;font:inherit;font-size:14px}
#rd-results{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:20;background:#fff;border:1px solid var(--rd-line);border-radius:6px;box-shadow:0 10px 28px #20344b20;max-height:350px;overflow:auto}
#rd-results button{display:flex;justify-content:space-between;gap:20px;width:100%;text-align:left;border:0;border-bottom:1px solid #edf0f4;background:#fff;padding:12px 14px;font-size:13px}#rd-results button[aria-selected="true"]{background:#edf5ff}#rd-results small{display:block;color:var(--rd-muted);margin-top:5px}#rd-results button>span:last-child{text-align:right;white-space:nowrap;color:var(--rd-muted);font-size:11px}#rd-results p{padding:12px}
.rd-keyboard{font-size:11px;color:var(--rd-muted);margin:8px 0 22px}.rd-bottom{display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,450px);gap:40px;margin-top:24px}.rd-bottom>label{display:grid;align-content:start;gap:8px;font-size:12px;color:var(--rd-muted)}.rd-bottom textarea{width:100%;min-height:100px;resize:vertical;border:1px solid var(--rd-line);border-radius:5px;padding:12px;font:inherit;color:var(--rd-ink)}
.rd-bottom .crm-receipt-settlement{margin:0;background:#fafbfd;border:1px solid var(--rd-line);padding:22px;border-radius:10px;gap:18px}.rd-bottom .crm-receipt-settlement h3{font-size:18px}.rd-bottom .crm-receipt-settlement-options{gap:6px}.rd-bottom .crm-receipt-settlement-options button{padding:9px;font-size:12px}
.rd-footer{display:flex;align-items:center;justify-content:space-between;gap:22px;position:sticky;bottom:0;z-index:10;background:#fff;border-top:1px solid var(--rd-line);padding:18px 0;margin-top:24px}.rd-footer small{display:block;color:var(--rd-muted);font-size:10px;margin-top:7px}.rd-total{margin-left:auto;text-align:right;display:grid;gap:6px;font-size:12px}.rd-total>span:first-child{color:var(--rd-muted)}.rd-total strong{font-size:26px;margin-left:20px;letter-spacing:-.6px;font-variant-numeric:tabular-nums}.rd-footer .button{white-space:nowrap}.rd-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[data-rd-error]{color:#b92332}
.rd-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(760px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;border:0;border-left:1px solid #dce2ea;padding:0;color:#202d40;background:#fff;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:-12px 0 40px #20344b20}.rd-drawer::backdrop{background:#172b4650}.rd-drawer>header{display:flex;gap:20px;justify-content:space-between;padding:22px 26px;border-bottom:1px solid #dce2ea;position:sticky;top:0;background:white;z-index:1}.rd-drawer h2{font-size:20px;line-height:1.4;margin:5px 0}.rd-drawer header small{color:#697586}.rd-drawer header button{border:0;background:none;font-size:27px;align-self:start}.rd-drawer-body{padding:24px 26px}.rd-drawer-body h3{font-size:15px;margin:24px 0 12px}.rd-product-intro{display:flex;align-items:center;gap:24px}.rd-product-intro img{width:95px;height:110px;object-fit:contain}.rd-stock{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0;padding:15px;background:#f5f7fa;border-radius:6px}.rd-stock>div{font-size:11px;color:#697586}.rd-stock b{display:block;font-size:19px;color:#202d40;margin-top:7px;font-variant-numeric:tabular-nums}.rd-card-tabs{display:flex;border-bottom:1px solid #dce2ea;gap:24px}.rd-card-tabs button{border:0;background:none;padding:10px 0;color:#697586}.rd-card-tabs button[aria-pressed="true"]{color:#1769cc;border-bottom:2px solid #1769cc}.rd-history article{padding:14px 0;border-bottom:1px solid #e6eaf0}.rd-history article>div{display:flex;justify-content:space-between;gap:15px}.rd-history time,.rd-history small{display:block;color:#697586;font-size:11px}.rd-history article>button{border:0;background:none;color:#1769cc;padding:0}.rd-history p{font-size:12px;margin:5px 0}.rd-description{white-space:pre-line}.rd-muted{color:#697586;font-size:11px}.rd-drawer select,.rd-drawer input{width:100%;padding:10px;border:1px solid #dce2ea;border-radius:5px;background:#fff;color:#202d40;font:inherit}.rd-drawer label{font-size:12px;color:#697586}.rd-code-fields label{display:flex;gap:12px;align-items:center;margin:10px 0}.rd-code-fields input{flex:1}.rd-drawer [data-rd-barcode-preview]{padding:22px 0;max-width:350px}.rd-drawer [data-rd-copy],.rd-drawer [data-rd-print]{background:white;border:1px solid #dce2ea;border-radius:5px;padding:8px 12px;color:#1769cc}.rd-print-frame{position:fixed;width:1px;height:1px;bottom:0;border:0}
@media(max-width:800px){.crm-receipt-form.is-document-receipt{padding:14px}.rd-bottom{grid-template-columns:1fr;gap:18px}.rd-footer{flex-wrap:wrap;gap:12px}.rd-total strong{font-size:22px}.rd-footer>.button{width:100%}.rd-heading span{display:block;margin:4px 0 0}.rd-drawer-body{padding:18px}.rd-stock{gap:8px;padding:10px}.rd-stock b{font-size:16px}}

/* Override the old wizard's tall stage and centered supplier block. */
.crm-module .is-document-receipt>[data-crm-receipt-stage-panel="supplier"]{min-height:0!important;height:auto;margin:0;padding:20px 0 24px!important;align-content:start}
.crm-module .is-document-receipt .crm-receipt-supplier-picker{max-width:540px;margin:0;padding:0;border:0;background:none}
.crm-module .is-document-receipt .crm-receipt-supplier-picker>label{font-size:12px}
.crm-module .is-document-receipt .rd-total strong{color:#202d40;font-size:26px;font-weight:750}

@media(max-width:600px){
 .crm-module .is-document-receipt .crm-receipt-command{display:block}
 .crm-module .is-document-receipt .crm-receipt-command-actions{margin-top:14px;justify-content:space-between}
 .rd-bottom .crm-receipt-settlement-options{grid-template-columns:repeat(2,minmax(0,1fr))}
 .rd-bottom .crm-receipt-settlement-options button{min-height:48px;font-size:11px;padding:9px 6px}
 .rd-bottom .crm-receipt-settlement-summary strong{white-space:nowrap}
 .rd-bottom .crm-receipt-settlement>header{align-items:start;gap:8px}
 .rd-bottom .crm-receipt-settlement>header small{font-size:10px}
}
/* Consistent numerical baseline and compact document controls. */
.crm-module .is-document-receipt .rd-table td{padding-top:14px;padding-bottom:14px;vertical-align:middle}
.crm-module .is-document-receipt .rd-table td>input,.crm-module .is-document-receipt .rd-number{font-family:inherit!important;font-size:14px!important;font-weight:500!important;font-variant-numeric:tabular-nums;line-height:24px!important;height:36px!important;min-height:36px!important;box-sizing:border-box;padding:6px 5px!important;color:#202d40;text-align:right}
.crm-module .is-document-receipt .rd-number{display:block;white-space:nowrap}
.rd-table input[type=number]{appearance:textfield;-moz-appearance:textfield}.rd-table input::-webkit-inner-spin-button,.rd-table input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.rd-bottom{display:block;margin-top:24px}.rd-bottom>[data-rd-settlement]{width:100%;min-width:0}
.is-document-receipt .crm-receipt-auto-number,.is-document-receipt #crm-receipt-command-total{display:none}
.rd-drawer{width:min(680px,calc(100vw / var(--crm-ui-scale,1)));max-width:calc(100vw / var(--crm-ui-scale,1));height:calc(100dvh / var(--crm-ui-scale,1));max-height:calc(100dvh / var(--crm-ui-scale,1));inset:0 0 0 auto;overflow-y:auto;box-sizing:border-box}
.rd-drawer>header{padding:18px 22px;align-items:flex-start}.rd-drawer h2{font-size:18px;margin:0}.rd-drawer header small{display:block;margin-top:7px;font-size:12px;line-height:1.5}.rd-drawer-body{padding:18px 22px}.rd-product-intro{gap:16px}.rd-product-intro img{width:64px;height:76px}.rd-product-intro p{margin:5px 0}.rd-stock{margin:16px 0;padding:12px}.rd-stock b{margin-top:4px}.rd-card-prices{display:flex;justify-content:space-between;gap:20px;margin:16px 0 22px;font-size:12px;color:#697586}.rd-card-prices b{display:block;margin-top:4px;font-size:17px;color:#202d40;font-variant-numeric:tabular-nums}.rd-drawer [data-rd-barcode-preview]{padding:16px 0;max-width:270px}.rd-drawer [data-rd-barcode-preview] svg{max-height:64px}.rd-code-fields label{margin:0 0 10px}.rd-code-fields input{font-variant-numeric:tabular-nums}.rd-drawer .rd-history article{padding:12px 0}
[data-receipt-product-error]{color:#b92332;margin:0;font-size:13px}
@media(max-width:600px){.rd-bottom{display:block}.rd-bottom>[data-rd-settlement]{width:100%}.rd-drawer{width:calc(100vw / var(--crm-ui-scale,1))}}
.rd-search input:focus,.rd-drawer input:focus{border-color:#1769cc!important;box-shadow:none!important}
.rd-bottom .crm-receipt-settlement>header>small,.rd-bottom .crm-receipt-settlement>header span{display:none}
.rd-bottom .crm-receipt-settlement-options button{min-height:44px}

/* Keep the document centered on wide screens and its actions on one baseline. */
.crm-module .crm-receipt-form.is-document-receipt{width:100%;max-width:1520px;margin-inline:auto;box-sizing:border-box}
.is-document-receipt .rd-footer{padding:18px 0!important;margin-inline:0;box-shadow:none;border-radius:0}
.is-document-receipt .crm-receipt-command-actions{padding:0;border:0;background:none}
.is-document-receipt .rd-table td:last-child{white-space:nowrap}
.is-document-receipt .rd-table td:last-child button{height:36px}
.rd-drawer [data-rd-code-error]{color:#b92332}
.rd-drawer .rd-history article>div{align-items:baseline}
.rd-drawer .rd-history code{overflow-wrap:anywhere}
.receipt-product-modal{box-sizing:border-box;width:min(1180px,calc(96vw / var(--crm-ui-scale,1)));max-width:calc(96vw / var(--crm-ui-scale,1));max-height:calc(94dvh / var(--crm-ui-scale,1));padding:0;border:1px solid #dce2ea;border-radius:14px;background:#fff;color:#202d40;overflow:auto}
.receipt-product-modal::backdrop{background:#172b4660}
.receipt-product-modal>header{display:flex;align-items:center;justify-content:space-between;padding:14px 22px;border-bottom:1px solid #dce2ea;background:#fff;position:sticky;top:0;z-index:3}
.receipt-product-modal>header button{border:0;background:none;font-size:26px;cursor:pointer}
.receipt-product-modal .pw-card{border:0;border-radius:0;box-shadow:none}
.receipt-product-modal .pw-overlay{position:fixed;height:calc(100dvh / var(--crm-ui-scale,1));box-sizing:border-box}
.pw-barcode-help{padding:0 24px;color:#697586;font-size:13px;line-height:1.5}
.is-document-receipt .rd-table-scroll{min-height:0}
.rd-article{font:inherit;color:#697586;font-weight:700;white-space:nowrap}
.rd-table [data-rd-open-codes]{cursor:pointer}
.rd-drawer.rd-code-dialog{inset:0;margin:auto;width:min(720px,calc(94vw / var(--crm-ui-scale,1)));height:fit-content;max-height:calc(90dvh / var(--crm-ui-scale,1));border:1px solid #dce2ea;border-radius:12px}
.rd-token-field{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:9px;border:1px solid #dce2ea;border-radius:6px}
.rd-token-field [data-rd-tokens]{display:contents}.rd-token{display:inline-flex;align-items:center;gap:6px;background:#edf2f8;padding:5px 8px;border-radius:5px}.rd-token button{border:0;background:none;color:#697586;padding:0 3px}.rd-token-field input{border:0!important;outline:0;flex:1;min-width:180px;width:auto;padding:6px}.rd-token code{font-size:14px}
.pw-code-row,.pw-imei-preview{display:block!important}.pw-code-row>.pw-stock-preview-label,.pw-imei-preview>.pw-stock-preview-label{display:block!important;margin-bottom:8px}.pw-identifier-codes{display:flex!important;gap:8px;flex-wrap:wrap}.pw-identifier-codes button{border:0;background:#f1f3f5;border-radius:7px;padding:7px 10px;font:inherit;cursor:pointer}.pw-identifier-codes code{padding:0;background:none}
.rd-article{margin-right:6px}

#crm-receipt-product-form .crm-receipt-tracking-choices>div { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(max-width:650px) { #crm-receipt-product-form .crm-receipt-tracking-choices>div { grid-template-columns:1fr; } }
.rd-purchase-cell { position:relative; }
.crm-module .is-document-receipt .rd-table td.rd-purchase-cell { padding-bottom:14px; }
.crm-module .is-document-receipt .rd-table .rd-average { position:static; margin:0 5px; line-height:16px; color:#7b8798; font-size:11px; white-space:nowrap; }
.crm-module .is-document-receipt .rd-table td .rd-average { font-size:14px; line-height:36px; color:#178653; font-weight:750; }
.crm-barcode-field { min-width:0; display:grid; gap:8px; align-content:start; }
.crm-barcode-field>span { font-weight:600; color:#68717e; }
[data-product-barcode-editor] { border:1px solid #d8dde3; border-radius:12px; padding:8px; min-width:0; }
.crm-barcode-chips { display:flex; flex-wrap:wrap; gap:6px; max-height:160px; overflow:auto; }
.crm-barcode-chip { display:inline-flex; gap:6px; align-items:center; max-width:100%; border-radius:7px; padding:5px 8px; background:#eef2f6; }
.crm-barcode-chip code { overflow-wrap:anywhere; font:inherit; font-variant-numeric:tabular-nums; }
#crm-receipt-product-form .crm-barcode-chip button { padding:0 3px; min-height:0; border:0; background:transparent; color:#7b8798; }
#crm-receipt-product-form [data-barcode-input] { border:0; box-shadow:none; min-height:38px; padding:7px; background:transparent; }
[data-barcode-error] { color:#e52032; }

#crm-receipt-product-form .field-row:has(.crm-barcode-field) { align-items:start; }

.is-staff-receipt .rd-table{min-width:650px}
.is-staff-receipt .rd-table th:first-child{width:52%}
.is-staff-receipt .rd-table th:nth-child(2),.is-staff-receipt .rd-table th:nth-child(3){width:12%}
.is-staff-receipt .rd-table th:nth-child(4){width:18%}
.is-staff-receipt .rd-table th:last-child{width:6%}
.is-staff-receipt [data-rd-field="sale"][readonly]{pointer-events:none}

.rd-code-note{margin:10px 0 16px;color:#7b8799;line-height:1.5}

.rd-bottom .crm-receipt-settlement-options button{height:56px;min-height:56px;align-items:center;justify-content:center;padding:10px 8px;text-align:center}.rd-bottom .crm-receipt-settlement-options button b{font-size:14px;line-height:1.3}@media(max-width:700px){.rd-bottom .crm-receipt-settlement-options button{height:48px;min-height:48px}}

#rd-results button[data-rd-option]{align-items:center;padding:9px 14px;gap:12px;font-size:14px;line-height:1.4}
#rd-results .rd-match-name{min-width:0;flex:1;text-align:left;color:var(--rd-ink);font-size:14px;white-space:normal}
#rd-results .rd-match-article{font-variant-numeric:tabular-nums;margin-right:5px}
#rd-results mark{background:none;color:#e66420;font-weight:600}
#rd-results .rd-match-stock{flex:none;min-width:28px;padding:2px 6px;border-radius:4px;text-align:center;font-size:13px;font-weight:600}
#rd-results .has-stock{background:#e4f8ee;color:#158654}#rd-results .no-stock{background:#ffe8eb;color:#d52b46}
#rd-results button[data-rd-create]{color:var(--rd-blue);padding:11px 14px}

/* Payment occupies the same width as the receipt positions above it. */
@container receipt-settlement (min-width:620px){
 .rd-bottom .crm-receipt-advance-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
 .rd-bottom .crm-receipt-advance-summary>span{display:grid;gap:8px;min-width:0}
 .rd-bottom .crm-receipt-remainder-options{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:600px){
 .rd-bottom .crm-receipt-settlement{padding:16px;gap:14px}
 .rd-bottom .crm-receipt-settlement h3{font-size:16px}
}

/* Serial tracking stays visible even after the number dialog is dismissed. */
.rd-table tr.rd-missing-serials > td { background: #fff1f2; }
.rd-table [data-rd-codes] { display: block; margin-top: 6px; padding: 4px 0; border: 0; background: transparent; color: #376449; font-size: 12px; text-align: left; cursor: pointer; }
.rd-table [data-rd-codes].is-missing { color: #b42318; font-weight: 600; }
.rd-table tr.rd-missing-serials [data-rd-field="quantity"] { border-color: #d92d20!important; color: #b42318!important; }
