* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Arial, sans-serif; color: #211a32; background: radial-gradient(ellipse at top left, #e7dcf3, transparent 55%), #f5f6fb; }
header { background: #fff; border-bottom: 1px solid #e3dcec; }
.header-inner { max-width: 1010px; margin: auto; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand img { object-fit: contain; }
.brand strong { display: block; font-size: 22px; line-height: 1.05; }
.brand small { display: block; font-size: 11px; margin-top: 2px; }
main { max-width: 1010px; margin: auto; padding: 30px 22px 60px; }
main.login { max-width: 510px; padding-top: 54px; }
h1, h2, p { margin: 0 0 12px; }
h1 { font-size: clamp(26px, 5vw, 37px); letter-spacing: -.035em; }
h2 { font-size: 20px; }
p { color: #64576f; }
.panel { background: #fff; border: 1px solid #e2daeb; border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 12px; }
input, select, textarea { width: 100%; display: block; margin-top: 5px; border: 1px solid #d9cee5; border-radius: 8px; background: #fff; color: inherit; padding: 10px; font: inherit; font-weight: 400; }
textarea { resize: vertical; }
button { border: 1px solid #36244c; color: #fff; background: #36244c; border-radius: 9px; padding: 10px 16px; min-height: 42px; font: inherit; font-weight: 700; cursor: pointer; }
button.quiet { background: #f9f5ff; border-color: #dfd4ea; color: #402e55; }
:focus-visible { outline: 3px solid #8c6db2; outline-offset: 3px; }
.hardware-row, .employee { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 0; border-top: 1px solid #ede8f3; margin: 0; }
.hardware-row input { width: 74px; flex: 0 0 74px; margin: 0; }
.hardware-row small, .employee small { display: block; color: #6b5b7b; overflow-wrap: anywhere; }
.message { border-radius: 10px; padding: 12px; color: #254d3d; background: #e4f3eb; }
.message.error { color: #8e2437; background: #fbe8ed; }
.total { color: #36244c; font-size: 29px; font-weight: 800; }
@media (max-width: 600px) { .fields { grid-template-columns: 1fr; gap: 0; } .panel { padding: 17px; } main { padding-inline: 14px; } }

.quote-hardware { display: grid; grid-template-columns: minmax(0, 1fr) minmax(95px, 150px) 68px minmax(110px, 135px); }
.quote-hardware label { margin: 0; }
.quote-hardware input { width: 100%; margin-top: 5px; }
.quote-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.quotation { background: #fff; border: 1px solid #e2daeb; border-radius: 12px; overflow: hidden; color: #172138; margin-bottom: 16px; }
.quotation-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(120deg, #191a2d 65%, #303451 65%); color: #fff; padding: 18px 22px; }
.quotation-brand { display: flex; align-items: center; gap: 10px; }
.quotation-brand img { width: 56px; height: 56px; flex: 0 0 56px; object-fit: contain; }
.quotation-brand strong { display: block; font-size: 23px; letter-spacing: .06em; line-height: 1.15; white-space: nowrap; }
.quotation-brand small { display: block; font-size: 9px; letter-spacing: .2em; }
.quotation-banner h2 { margin: 0; font-size: clamp(16px, 4vw, 25px); }
.quotation-content { padding: 18px 22px; }
.quotation-parties { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 24px; font-size: 12px; overflow-wrap: anywhere; }
.quotation-parties h3 { margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid #e5eaf4; color: #51627c; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.quotation-address { text-align: right; }
.quotation-section { margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid #5279ea; text-transform: uppercase; font-size: 13px; }
.quotation-table-wrap { overflow-x: auto; }
.quotation-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.quotation-table th { background: #192236; color: white; font-weight: 600; text-align: left; }
.quotation-table th, .quotation-table td { padding: 9px 8px; vertical-align: top; }
.quotation-table :is(th,td):nth-child(n+3) { text-align: right; white-space: nowrap; }
.quotation-table tbody tr:nth-child(even) { background: #f5f7fb; }
.quotation-table td small { display: block; color: #536380; }
.quotation-totals { width: min(100%, 300px); margin: 12px 0 12px auto; }
.quotation-totals > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; }
.quotation-totals dd { margin: 0; font-weight: 700; white-space: nowrap; }
.quotation-totals .quotation-final { background: #191a2d; color: #fff; border-radius: 5px; padding: 9px 10px; font-weight: 700; }
.quotation-terms p { font-size: 12px; margin: 3px 0; }
.quotation-footer { border-top: 1px solid #e5eaf4; color: #51627c; font-size: 10px; margin-top: 16px; padding-top: 8px; }
.quote-copy summary { cursor: pointer; }
@media screen and (max-width: 600px) {
    .quotation-table { min-width: 470px; }
    .quotation-banner, .quotation-content { padding: 12px; }
    .quotation-brand strong { font-size: 15px; }
    .quotation-brand img { width: 34px; height: 34px; flex-basis: 34px; }
    .quotation-brand small { letter-spacing: .08em; font-size: 7px; }
    .quote-hardware { grid-template-columns: minmax(0, 1fr) 60px; }
    .quote-hardware label:last-child { grid-column: 1 / -1; }
    .quote-hardware > span { grid-column: 1 / -1; }
}
@media print {
    body { background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    body > header, main > :not(.quote-result), .quote-actions, .quote-copy { display: none !important; }
    main { max-width: none; margin: 0; padding: 0; }
    .quotation { border: 0; border-radius: 0; overflow: visible; margin: 0; }
    .quotation-table-wrap { overflow: visible; }
    .quotation-table thead { display: table-header-group; }
    .quotation-table tr, .quotation-totals, .quotation-parties > div { break-inside: avoid; }
    .quotation-section { break-after: avoid; }
    .quotation-table th, .quotation-table td { padding-block: 6px; }
}
.quotation-table td:nth-child(-n+2) { overflow-wrap: anywhere; }

.quotation-page { position: relative; }
.quotation-page-two { border-top: 1px solid #e2daeb; }
.quotation-banner-art { display: block; width: 100%; height: auto; }
.quotation-footer { display: flex; justify-content: space-between; margin: 16px 22px 0; padding: 8px 0; }
.quotation-renewal { padding: 12px; border: 1px solid #f4dfbe; background: #fff9ef; border-radius: 6px; }
.quotation-renewal h3 { margin: 0 0 6px; color: #aa5c15; font-size: 13px; }
.quotation-renewal p { margin: 0 0 5px; font-size: 12px; color: #172138; }
.quotation-options th { background: #eff3f8; color: #172138; }
.quotation-signature { text-align: center; margin: 24px 0 0; color: #687e94; font-size: 10px; }
@page { size: A4; margin: 0; }
@media print {
    .quotation-page { min-height: 296mm; display: flex; flex-direction: column; }
    .quotation-page + .quotation-page { break-before: page; border-top: 0; }
    .quotation-content { padding: 3mm 9mm; }
    .quotation-page-two .quotation-content { padding-top: 11mm; }
    .quotation-footer { margin: auto 11mm 4mm; padding: 3mm 0 0; border-top: 0; }
    .quotation-banner-art { width: 100%; max-width: 100%; height: auto; }
    .quotation-table { table-layout: fixed; }
    .quotation-table th:first-child { width: 46%; }
    .quotation-table th:nth-child(2) { width: 15%; }
    .quotation-table th:nth-child(3) { width: 7%; }
    .quotation-table th:nth-child(4) { width: 16%; }
    .quotation-table th:nth-child(5) { width: 16%; }
}
@media print {
    .quotation-page { display: block; height: 296mm; }
    .quotation-footer { position: absolute; bottom: 4mm; left: 11mm; right: 11mm; margin: 0; }
    .quotation-content { padding-bottom: 15mm; }
    .quotation-table th { padding-block: 12px; }
    .quotation-table td { padding-block: 9px; }
}

.staff-signed-in { display: grid; grid-template-columns: 225px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.staff-signed-in > header { grid-column: 1 / -1; }
.staff-signed-in .header-inner { max-width: none; }
.staff-sidebar { padding: 24px 14px; background: #221934; }
.staff-sidebar nav { position: sticky; top: 20px; display: grid; gap: 8px; }
.staff-sidebar a { display: block; color: #eee6f8; text-decoration: none; padding: 12px 14px; border-radius: 9px; font-weight: 700; }
.staff-sidebar a:hover, .staff-sidebar a[aria-current="page"] { background: #503c6b; color: #fff; }
.staff-workspace { width: min(100%, 1200px); }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: 14px; }
.catalog-card { display: flex; flex-direction: column; padding: 16px; border: 1px solid #e8e0ef; border-radius: 12px; background: #fcfaff; min-width: 0; }
.catalog-card h3 { font-size: 14px; margin: 0 0 12px; }
.catalog-card button { align-self: start; margin-top: auto; }
.catalog-photo { width: 100%; height: 90px; object-fit: contain; background: white; border-radius: 8px; margin-bottom: 10px; }
@media screen and (max-width: 720px) {
    .staff-signed-in { display: block; }
    .staff-sidebar { padding: 10px; }
    .staff-sidebar nav { display: flex; flex-wrap: wrap; gap: 5px; }
    .staff-sidebar a { padding: 9px; font-size: 12px; }
}
@media print {
    .staff-signed-in { display: block; min-height: 0; }
    .staff-sidebar { display: none !important; }
    .staff-workspace { width: auto; }
}

.products-title h1 { margin-bottom: 4px; }
.products-title p { margin-bottom: 20px; }
.product-menu { display: flex; gap: 6px; width: fit-content; margin-bottom: 20px; padding: 5px; border: 1px solid #e3daed; border-radius: 12px; background: #eee8f6; }
.product-menu a { color: #574469; font-weight: 700; text-decoration: none; padding: 9px 16px; border-radius: 8px; }
.product-menu a[aria-current="page"] { color: #35224b; background: #fff; box-shadow: 0 2px 7px #26183816; }
.products-surface { overflow: clip; border: 1px solid #e3dcec; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px #33234a08; }
.product-add { padding: 24px; max-width: 830px; }
.product-add header, .products-toolbar { border: 0; }
.product-add header { margin-bottom: 16px; }
.products-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 20px 22px 12px; }
.products-toolbar h2, .product-add h2 { margin: 0 0 3px; }
.products-toolbar p { margin: 0; font-size: 13px; }
.product-add-link { padding: 8px 12px; background: #f1eaf9; border: 1px solid #e2d7ec; border-radius: 8px; color: #4b3463; text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 700; }
.product-filters { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; padding: 0 22px 14px; }
.product-filters label { margin: 0; }
.product-editor [hidden] { display: none !important; }
.product-add [hidden] { display: none !important; }
.product-group h3 { margin: 0; padding: 11px 22px; background: #f5f1fa; border-block: 1px solid #ece5f2; color: #443057; font-size: 13px; }
.product-group h3 span { margin-left: 7px; font-size: 11px; font-weight: 500; color: #665776; }
.product-row { display: grid; grid-template-columns: minmax(190px, 1.55fr) minmax(95px, .7fr) minmax(105px, .85fr) minmax(115px, .9fr); gap: 12px; align-items: center; padding: 13px 22px; border-bottom: 1px solid #eee9f3; }
.product-row:last-child { border-bottom: 0; }
.product-row-changed { background: #faf5ff; box-shadow: inset 3px 0 #8b64b7; }
.product-identity { min-width: 0; display: flex; align-items: center; gap: 11px; font-size: 13px; overflow-wrap: anywhere; }
.product-identity img, .product-placeholder { flex: 0 0 54px; height: 54px; border-radius: 9px; background: #f6f2fa; border: 1px solid #ece5f3; }
.product-identity img { object-fit: contain; }
.product-placeholder { display: grid; place-items: center; color: #674886; font-weight: 800; font-size: 18px; }
.product-row label { min-width: 0; margin: 0; font-size: 11px; color: #564762; }
.product-row input { padding: 8px; color: #211a32; font-size: 13px; }
.product-row input[type="file"] { font-size: 11px; padding: 6px; }
.product-row input[type="file"]::file-selector-button { border: 0; border-radius: 5px; background: #eee6f6; color: #4b3463; padding: 4px 7px; cursor: pointer; }
.product-renewal { grid-column: 2 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-empty { padding: 20px 22px; }
.product-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid #e8dfef; background: #faf7fef5; backdrop-filter: blur(10px); }
.product-savebar span { color: #51425f; font-size: 13px; }
.product-savebar button:disabled { opacity: .55; cursor: default; }
@media (max-width: 1100px) {
    .product-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); }
    .product-identity { grid-column: 1 / -1; }
    .product-renewal { grid-column: 1 / span 2; }
}
@media (max-width: 520px) {
    .products-toolbar, .product-filters, .product-row, .product-savebar, .product-group h3 { padding-inline: 13px; }
    .product-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-file, .product-renewal { grid-column: 1 / -1; }
    .product-savebar button { padding-inline: 10px; font-size: 13px; white-space: nowrap; }
}

.product-remove { grid-column: 1 / -1; justify-self: end; min-height: 32px; padding: 4px 10px; font-size: 11px; color: #9c3346; background: #fff4f5; border-color: #ecd1d7; }
.archived-products { margin-top: 16px; }
.history-link { color: #593d76; font-weight: 700; text-decoration: none; }
.history-link:hover { text-decoration: underline; }
.history-button { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border: 1px solid #dfd4ea; border-radius: 9px; background: #fff; color: #402e55; font-weight: 700; text-decoration: none; }
.quote-actions { gap: 9px; flex-wrap: wrap; }
.history-table-wrap { overflow-x: auto; }
.sales-history table { width: 100%; min-width: 480px; border-collapse: collapse; text-align: left; }
.sales-history th { background: #f4eef9; color: #4b385f; font-size: 12px; }
.sales-history td, .sales-history th { padding: 12px; border-bottom: 1px solid #eee8f4; }
.sales-history td:nth-child(4) { white-space: nowrap; }
.history-pagination { display: flex; gap: 15px; padding: 10px 0 0; }
.history-pagination a { color: #54386d; }
.history-empty { padding: 14px 12px 0; }

.invoice-number { margin-top: 5px; }
.quotation-banner-wrap { position: relative; }
.quotation-logo-cover { position: absolute; inset: 9% auto 9% 2.5%; width: 12.6%; display: grid; place-items: center; background: #1a1a2e; }
.quotation-logo-cover img { width: 90%; height: auto; display: block; }
.quotation-renewal { break-inside: avoid; }
.staff-review + .staff-review { margin-top: 14px; }
.staff-review blockquote { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.package-editor summary { cursor: pointer; font-weight: 700; }
.package-editor .fields { margin-top: 12px; }

.quotation-table .line-discount-note { display: block; font-size: 9px; color: #51627c; }

.customer-picker { margin: 0 0 18px; padding: 14px; border: 1px solid #e3daed; border-radius: 10px; background: #fcfaff; }
.customer-picker [role="status"] { margin: 0 0 10px; font-size: 13px; color: #6b5b7b; }
.customer-picker input[readonly] { background: #f2edf7; }
.customer-results { list-style: none; margin: 0 0 12px; padding: 0; max-height: 250px; overflow: auto; }
.customer-results li + li { margin-top: 6px; }
.customer-results button { width: 100%; text-align: left; overflow-wrap: anywhere; }
.customer-document-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.finance-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.finance-metrics .panel { padding: 17px; }
.finance-metrics h2 { font-size: 14px; }
.finance-metrics strong { font-size: 22px; }
.finance-totals { margin-left: 0; width: min(100%, 440px); }

.billing-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.billing-heading > span { color: #64576f; padding-top: 9px; white-space: nowrap; }
.billing-package, .billing-add { display: flex; gap: 12px; align-items: end; }
.billing-package label, .billing-add label { flex: 1; margin: 0; }
.billing-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.billing-items { min-width: 0; container-type: inline-size; }
.billing-table { border-collapse: collapse; width: 100%; min-width: 600px; }
.billing-table th { background: #234879; color: #fff; text-align: left; }
.billing-table th, .billing-table td { padding: 8px; border-bottom: 1px solid #e7eaf1; }
.billing-table td { background: #fbfcff; }
.billing-table input, .billing-table select { margin: 0; min-width: 64px; padding: 7px; }
.billing-table button { padding: 5px 8px; min-height: 34px; }
.billing-table [data-unit], .billing-table [data-line-total] { white-space: nowrap; }
.billing-table [data-empty-bill] td { padding: 28px; text-align: center; color: #64576f; }
.billing-add[hidden], .billing-table [hidden] { display: none; }
.billing-totals { display: grid; gap: 7px; margin: 16px 0; }
.billing-totals[hidden] { display: none; }
.billing-totals > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; background: #eff4fa; border-radius: 5px; }
.billing-totals > div:nth-last-child(-n+2) { background: #233c64; color: white; font-weight: 700; }
.billing-totals dd { margin: 0; white-space: nowrap; }
.billing-save { display: grid; gap: 8px; }

.staff-header-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.staff-menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; flex: none; }
.staff-menu-toggle[hidden], .staff-sidebar[hidden], .staff-menu-backdrop[hidden] { display: none; }
.staff-menu-closed, .staff-menu-drawer { grid-template-columns: minmax(0, 1fr); }
.staff-menu-drawer > header { position: sticky; top: 0; z-index: 30; }
.staff-menu-drawer .staff-sidebar { position: fixed; z-index: 25; inset: 0 auto 0 0; width: min(285px, 84vw); overflow-y: auto; padding: 92px 14px 24px; box-shadow: 10px 0 30px #22193438; }
.staff-menu-drawer .staff-sidebar nav { position: static; display: grid; gap: 6px; }
.staff-menu-drawer .staff-sidebar a { min-height: 44px; padding: 11px 13px; font-size: 14px; }
.staff-menu-backdrop { position: fixed; inset: 0; z-index: 20; background: #1c173566; }
.staff-billing .staff-workspace { width: 100%; max-width: none; min-width: 0; padding: clamp(14px, 2.5vw, 36px); }
.staff-billing .billing-heading { background: linear-gradient(118deg, #202b51, #315784); border-radius: 14px; padding: 17px 22px; margin-bottom: 16px; }
.billing-heading h1 { color: #fff; margin-bottom: 4px; }
.billing-heading p, .billing-heading > span { color: #e3ebff; }
.billing-heading p { margin-bottom: 0; }
.staff-billing .customer-picker { margin-bottom: 0; }
.billing-summary { position: sticky; top: 88px; }
@media screen and (max-width: 880px) {
    .billing-layout { grid-template-columns: minmax(0, 1fr); }
    .billing-summary { position: static; }
}
@media screen and (max-width: 780px) {
    .staff-billing .billing-heading { padding: 14px; }
    .billing-package, .billing-add { flex-wrap: wrap; }
    .billing-package label, .billing-add label { flex-basis: 100%; }
    .billing-package button, .billing-add button, .billing-save button, .billing-table button { min-height: 44px; }
    .staff-billing input, .staff-billing select { font-size: 16px; min-height: 44px; }
}
@media screen and (max-width: 780px) {
    .billing-table { display: block; min-width: 0; }
    .billing-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .billing-table tbody { display: grid; gap: 12px; }
    .billing-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px; border: 1px solid #e0e5ef; border-radius: 10px; background: #fbfcff; }
    .billing-table td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    .billing-table td:first-child, .billing-table td[data-label="Warranty"] { grid-column: 1 / -1; }
    .billing-table td:first-child { font-weight: 700; }
    .billing-table td[data-label]::before { display: block; content: attr(data-label); margin-bottom: 3px; color: #64576f; font-size: 12px; font-weight: 700; }
    .billing-table [data-unit], .billing-table [data-line-total] { white-space: normal; }
    .billing-table [data-line-total] { font-weight: 700; }
    .billing-table input, .billing-table select { min-width: 0; max-width: 100%; }
    .billing-table .bill-remove-cell { display: flex; justify-content: end; align-items: end; }
    .billing-table [data-empty-bill] td { grid-column: 1 / -1; padding: 16px 0; }
}
@media screen and (max-width: 430px) {
    .staff-signed-in .header-inner { padding-inline: 10px; gap: 8px; }
    .staff-header-start { gap: 7px; }
    .staff-header-start .brand img { width: 32px; height: 32px; }
    .staff-header-start .brand strong { font-size: 17px; }
    .staff-header-start .brand small { font-size: 9px; }
    .staff-signed-in .header-inner form button { padding-inline: 9px; white-space: nowrap; }
}
@media print {
    .staff-menu-backdrop, .staff-menu-toggle { display: none !important; }
}


.customer-search-row { display: flex; align-items: end; gap: 10px; }
.customer-search-row label { flex: 1; min-width: 0; margin: 0; }
.customer-add-button { flex: 0 0 44px; min-height: 44px; padding: 0; font-size: 24px; line-height: 1; }
.customer-picker [data-customer-status] { margin: 8px 0 0; }
.customer-picker [data-customer-status]:empty { display: none; }
.customer-picker .customer-results { margin-top: 10px; }
.billing-customer-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #e2daeb; border-radius: 14px; padding: clamp(16px, 4vw, 24px); color: inherit; background: #fff; }
.billing-customer-dialog::backdrop { background: #1c173580; }
.billing-customer-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }

.billing-product-search label { margin-bottom: 0; }
.billing-product-results { list-style: none; padding: 0; margin: 8px 0; max-height: 245px; overflow: auto; }
.billing-product-results li + li { margin-top: 5px; }
.billing-product-results button { width: 100%; text-align: left; overflow-wrap: anywhere; }
.billing-product-results span, .billing-table [data-catalog-price] { display: block; color: #64576f; font-size: 12px; font-weight: 400; }
.billing-table [data-unit-price] { min-width: 80px; }

@media print {
    .grn-document { margin: 12mm; padding: 0; border: 0; }
    .grn-document .history-table-wrap { overflow: visible; }
    .grn-document tr { break-inside: avoid; }
}


.billing-package > .product-search { flex: 1; }
@media screen and (max-width: 780px) {
    .billing-package > .product-search { flex-basis: 100%; }
}


.transaction-panel { padding: clamp(12px, 1.3vw, 19px); border-color: #dce3ee; }
.transaction-panel h2 { font-size: 17px; letter-spacing: -.015em; }
.transaction-panel label, .transaction-panel button { font-size: 12px; }
.transaction-panel input, .transaction-panel select { padding: 8px; }
.transaction-panel label { margin-bottom: 9px; }
.transaction-panel [role="status"]:empty { display: none; }
.transaction-status, .transaction-scroll-hint { color: #53637b; font-size: 12px; margin: 7px 0; }
.transaction-scroll { overflow: auto; max-height: min(60vh, 520px); border: 1px solid #dfe6ef; border-radius: 9px; scrollbar-width: auto; }
.transaction-scroll:focus-visible { outline-offset: 2px; }
.transaction-scroll table { font-size: 12px; }
.transaction-scroll th { position: sticky; top: 0; z-index: 1; }
.transaction-money, .billing-totals dd, .grn-cart-totals dd, .transaction-scroll [data-staff-number] { font-variant-numeric: tabular-nums; }
.transaction-money { white-space: nowrap; }
.billing-table { min-width: 790px; }
.billing-table th, .billing-table td { padding: 7px 8px; }
.billing-table td:first-child { min-width: 145px; }
.billing-table [data-catalog-price] { white-space: nowrap; }
.billing-table [data-discount], .billing-table [data-line-discount-mode] { min-width: 128px; }
.billing-table [data-quantity] { min-width: 64px; }
.billing-table [data-line-total] { min-width: 124px; }
.billing-summary .billing-totals dt { font-size: 12px; }
.billing-summary .billing-totals dd { font-size: 13px; }
.billing-save { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grn-entry { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(86px, .55fr) minmax(150px, 1fr) auto; align-items: start; gap: 10px; padding: 12px; background: #f2f6fb; border: 1px solid #dfe7f3; border-radius: 9px; }
.grn-entry label { margin: 0; }
.grn-entry-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.transaction-subheading { font-size: 14px; margin: 14px 0 7px; }
.grn-cart-table { border-collapse: collapse; width: 100%; min-width: 625px; }
.grn-cart-table th { background: #234879; color: white; font-weight: 650; text-align: left; }
.grn-cart-table th, .grn-cart-table td { padding: 8px 10px; border-bottom: 1px solid #e7eaf1; }
.grn-cart-table td:first-child { min-width: 170px; }
.grn-cart-table td small { display: block; color: #53637b; }
.grn-cart-table input { margin: 0; }
.grn-cart-table input[data-grn-quantity] { min-width: 82px; }
.grn-cart-table input[data-grn-cost] { min-width: 120px; }
.grn-cart-table .transaction-empty { padding: 25px; color: #53637b; text-align: center; }
.grn-cart-footer { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 14px; }
.grn-cart-totals { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.grn-cart-totals > div { padding: 8px 12px; background: #eff4fa; border-radius: 7px; }
.grn-cart-totals > div:last-child { background: #233c64; color: #fff; }
.grn-cart-totals dt { font-size: 11px; }
.grn-cart-totals dd { margin: 3px 0 0; font-weight: 700; }
.transaction-panel button:disabled { opacity: .55; cursor: default; }
.transaction-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media screen and (max-width: 780px) {
    .billing-table { min-width: 0; }
    .billing-table td:first-child, .billing-table [data-unit-price], .billing-table [data-discount], .billing-table [data-quantity], .billing-table [data-line-total] { min-width: 0; }
    .billing-table [data-line-total] { white-space: normal; overflow-wrap: anywhere; }
    .billing-table th, .billing-table td { padding: 0; }
    .billing-items .transaction-scroll { max-height: none; border: 0; overflow: visible; }
    .billing-items .transaction-scroll-hint { display: none; }
    .billing-summary .billing-totals dd { white-space: normal; overflow-wrap: anywhere; text-align: right; }
    .grn-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grn-entry > :first-child { grid-column: 1 / -1; }
    .grn-entry-actions { grid-column: 1 / -1; margin-top: 0; }
}

.billing-table [data-stock-batch] { margin-top: 6px; min-width: 175px; font-size: 12px; }

.product-barcode-field { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.product-barcode-field label { flex: 1; min-width: 120px; margin-bottom: 0; }

.billing-table [data-bill-purchase-cost] { display: block; font-size: 12px; color: #53637b; }

.billing-table [data-line-discount-mode] { margin-bottom: 0.3rem; }

.feature-picker { display: flex; align-items: center; gap: 8px; }
.feature-picker select { margin-top: 0; }
[data-feature-status]:empty { display: none; }

.invoice-receipt { display: none; }
@page receipt { size: 80mm 150mm; margin: 0; }
@media print {
    body.print-receipt .quote-result > .quotation { display: none; }
}
body.measure-receipt .invoice-receipt,
body.print-receipt .invoice-receipt {
    display: block;
    page: receipt;
    width: 72mm;
    margin: 0 auto;
    padding: 3mm 1mm;
    color: #000;
    font: 10pt/1.3 Arial, sans-serif;
    overflow-wrap: anywhere;
}
.receipt-heading, .receipt-footer { text-align: center; }
.receipt-heading { border: 0; }
.receipt-heading strong { font-size: 15pt; }
.receipt-heading h2 { font-size: 12pt; margin: 2mm 0; }
.receipt-details { margin-bottom: 2mm; }
.receipt-items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.receipt-items th { border-block: 1px dashed; text-align: left; }
.receipt-items :is(th, td) { padding: 0.7mm; }
.receipt-items :is(th, td):nth-child(n+2) { text-align: right; }
.receipt-items tbody { break-inside: avoid; }
.receipt-totals { border-top: 1px dashed; padding-top: 1mm; margin: 1mm 0; break-inside: avoid; }
.receipt-totals div { display: flex; justify-content: space-between; gap: 2mm; }
.receipt-totals dd { margin: 0; text-align: right; }
.receipt-footer, .receipt-renewal { border-top: 1px dashed; padding-top: 2mm; margin-top: 2mm; color: #000; }
body.measure-receipt .invoice-receipt {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
}
@media screen {
    body.print-receipt:not(.measure-receipt) .invoice-receipt { display: none; }
}

[data-pay-methods][hidden], [data-grn-payment][hidden] { display: none; }

[data-customer-payment-fields][hidden], [data-customer-transfer-only][hidden] { display: none; }
@media print { .customer-payment-panel { display: none !important; } }

.billing-table .billing-batch-parent td { background: #eef3fa; }
.billing-table .billing-batch-row td:first-child { padding-inline-start: 16px; }
.billing-batch-row small { display: block; color: #64576f; }
.billing-batch-row td[data-label="Warranty"]:empty { visibility: hidden; }
@media (max-width: 760px) {
    .billing-table .billing-batch-row td:first-child { padding-inline-start: 0; }
    .billing-batch-row td[data-label="Warranty"]:empty { display: none; }
}

.quotation-table.invoice-price-table th:first-child { width: 39%; }
.quotation-table.invoice-price-table th:nth-child(2),
.quotation-table.invoice-price-table th:nth-child(3),
.quotation-table.invoice-price-table th:nth-child(5) { width: 17%; }
.quotation-table.invoice-price-table th:nth-child(4) { width: 10%; }
.invoice-price-table :is(th, td):nth-child(n+2) { text-align: right; }

@page invoice-a4 {
    size: A4;
    margin: 0 0 14mm;
    @top-left { content: ""; }
    @top-center { content: ""; }
    @top-right { content: ""; }
    @bottom-left { content: "This is a computer-generated invoice."; padding-left: 9mm; font: 9pt Arial, sans-serif; }
    @bottom-center { content: ""; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); padding-right: 9mm; font: 9pt Arial, sans-serif; }
}
@media print {
    .invoice-document { page: invoice-a4; }
    .invoice-document .quotation-page { height: auto; min-height: 0; }
    .invoice-document .quotation-content { padding-bottom: 4mm; }
    .invoice-document .quotation-footer { display: none; }
    .invoice-document .quotation-renewal { break-inside: avoid; }
}

.billing-package-options { padding-block: 12px; }
.billing-package-options > summary, .billing-extra-options > summary, .billing-line-options > summary {
    cursor: pointer; color: #403054; font-weight: 650;
}
.billing-package-options[open] > summary, .billing-extra-options[open] > summary { margin-bottom: 12px; }
.billing-customer-panel { padding: 14px 18px; }
.billing-customer-panel h2 { margin-bottom: 6px; }
.billing-items .billing-table { min-width: 0; }
.billing-items .billing-table td { vertical-align: top; }
.billing-items .billing-table td:first-child { min-width: 0; width: 100%; overflow-wrap: anywhere; }
.billing-items .billing-table [data-stock-batch],
.billing-items .billing-table [data-discount],
.billing-items .billing-table [data-line-discount-mode] { min-width: 0; }
.billing-items .billing-table [data-quantity],
.billing-items .billing-table [data-batch-quantity] { width: 68px; min-width: 0; }
.billing-items .billing-table [data-line-total] { min-width: 0; }
.billing-items .billing-table .bill-remove-cell button { white-space: nowrap; }
.billing-items .billing-batch-parent [data-quantity][readonly] { background: #eef3fa; }
.billing-line-options { margin-top: 5px; font-size: 12px; }
.billing-line-options[open] { padding: 6px; border: 1px solid #dfe6ef; border-radius: 6px; }
.billing-line-options[open] > summary { margin-bottom: 6px; }
.billing-line-option-fields { display: grid; gap: 5px; }
.billing-total-card { margin: 0 0 14px; padding: 14px; color: #fff; background: #233c64; border-radius: 10px; }
.billing-total-card[hidden], [data-customer-required][hidden] { display: none; }
.billing-total-card > span { display: block; font-size: 13px; }
.billing-total-card > strong { display: block; font-size: clamp(21px, 3vw, 29px); overflow-wrap: anywhere; }
.billing-summary-breakdown { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 8px 0 0; font-size: 12px; }
.billing-summary-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.billing-payment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.billing-payment-row label { margin: 0; }
.billing-balance { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0; font-weight: 700; }
.billing-balance dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.billing-extra-options { margin: 10px 0; border-top: 1px solid #dfe6ef; padding-top: 10px; font-size: 13px; }
@media screen and (max-width: 780px) {
    .billing-items .billing-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .billing-items .billing-table td:first-child { width: auto; }
    .billing-items .billing-table :is([data-label="Line total"], [data-label="Item subtotal"]) { white-space: normal; overflow-wrap: anywhere; }
}

.billing-items [data-change-batch] { margin-top: 5px; font-size: 12px; min-width: 0; }

.billing-cart-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.billing-cart-heading h2 { margin: 0; }
.billing-cart-heading [data-cart-count] { color: #53637b; font-size: 12px; }
.billing-cart-list .billing-table { display: block; min-width: 0; }
.billing-cart-list .billing-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.billing-cart-list .billing-table tbody { display: block; }
.billing-cart-list .billing-cart-group:not(:has(> tr:not([hidden]))) { display: none; }
.billing-cart-list .billing-cart-group {
    margin-top: 10px; border: 1px solid #dce3ee; border-radius: 12px; overflow: hidden; background: #fff;
}
.billing-cart-list .billing-table tr:not([hidden]) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .66fr) minmax(42px, .4fr) minmax(0, .72fr) auto;
    align-items: start; gap: 8px 12px; padding: 12px; border: 0; border-radius: 0; background: #fff;
}
.billing-cart-list .billing-table tr + tr { border-top: 1px solid #e5ebf2; }
.billing-cart-list .billing-table tr.billing-batch-parent { background: #eef3fa; }
.billing-cart-list .billing-table td {
    min-width: 0; padding: 0; border: 0; background: transparent; white-space: normal;
    font-size: 13px; overflow-wrap: anywhere;
}
.billing-cart-list .billing-table td:first-child { grid-column: 1; width: auto; font-weight: 650; }
.billing-cart-list .billing-table td[data-label]::before {
    display: block; content: attr(data-label); margin-bottom: 3px; color: #53637b; font-size: 11px; font-weight: 600;
}
.billing-cart-list .billing-table td[data-label="Batch"]::before { display: none; }
.billing-cart-list .billing-table :is([data-line-total], .transaction-money) { font-weight: 700; }
.billing-cart-list .billing-table [data-catalog-price] { white-space: normal; }
.billing-cart-list .billing-table :is([data-quantity], [data-batch-quantity]) { width: 100%; max-width: 68px; }
.billing-cart-list .billing-table [data-stock-batch] { font-size: 12px; }
.billing-cart-list .billing-table .bill-remove-cell { justify-self: end; }
.billing-cart-list .billing-table .bill-remove-cell button { font-size: 12px; }
.billing-cart-list .billing-table .billing-batch-complete td:nth-child(2),
.billing-cart-list .billing-table .billing-batch-complete td:nth-child(3) { display: none; }
.billing-cart-list .billing-table .billing-batch-complete td:first-child { grid-column: 1 / 4; }
.billing-cart-list .billing-table .billing-batch-complete [data-remove-line] { font-size: 11px; }
.billing-cart-list .billing-table [data-empty-bill] td:first-child {
    grid-column: 1 / -1; padding: 18px 0; text-align: center;
}
.billing-cart-empty span { display: block; font-weight: 400; }
@container (max-width: 490px) {
    .billing-cart-list .billing-table tr:not([hidden]) {
        grid-template-columns: minmax(0, 1fr) minmax(42px, .65fr) minmax(0, 1fr);
    }
    .billing-cart-list .billing-table tr:not([hidden]) td:first-child { grid-column: 1 / -1; }
    .billing-cart-list .billing-table .billing-batch-complete td:nth-child(4) { grid-column: 1 / 3; }
    .billing-cart-list .billing-table .bill-remove-cell { grid-column: 3; }
}

.package-hardware-row { flex-wrap: wrap; gap: 8px 14px; }
.package-hardware-row > span { flex: 1 1 190px; }
.package-hardware-row input[name^="selling_price"] { width: 125px; }

.billing-cart-list .billing-table tr.billing-single-batch:not(:has(.billing-line-options[open])) { display: none; }
.billing-cart-list .billing-table tr.billing-single-batch:has(.billing-line-options[open]) td:first-child { grid-column: 1 / -1; }
.billing-cart-list .billing-table tr.billing-single-batch td:not(:first-child) { display: none; }
.billing-cart-list .billing-table tr.billing-single-batch + tr { border-top: 0; }
.billing-cart-list .billing-single-options:not([hidden]) { margin-top: 5px; font-size: 12px; }

.billing-entry-bar {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    align-items: start; gap: 16px; padding: 12px 16px; margin-bottom: 12px;
}
.billing-entry-bar .billing-product-search { position: relative; }
.billing-entry-bar .billing-product-results {
    position: absolute; inset: 100% 0 auto; z-index: 15; margin: 0;
    border: 1px solid #bdcee1; border-radius: 8px; background: #fff; box-shadow: 0 8px 18px #233c6426;
}
.billing-entry-bar .billing-product-results li + li { margin: 0; border-top: 1px solid #e5ebf2; }
.billing-entry-bar .billing-product-results button { border: 0; border-radius: 0; padding: 8px 10px; background: #fff; }
.billing-entry-bar .billing-product-results button:hover,
.billing-entry-bar .billing-product-results button:focus-visible { background: #e7effa; }
.billing-discount-hint { font-size: 12px; color: #53637b; margin: 0 0 9px; }
.billing-cart-list .billing-table tr:not([hidden]) {
    grid-template-columns: minmax(0, 1.6fr) minmax(58px, .8fr) minmax(36px, .42fr) minmax(64px, .78fr) minmax(60px, .85fr) auto;
    gap: 6px 8px; padding: 8px 10px;
}
.billing-cart-list .billing-cart-group { margin: 0; border: 0; border-radius: 0; }
.billing-cart-list .billing-table { border: 1px solid #dce3ee; border-radius: 8px; overflow: hidden; }
.billing-cart-list .billing-cart-group + .billing-cart-group { border-top: 1px solid #dce3ee; }
.billing-cart-list .billing-cart-group:not(:has(> tr:not([hidden]))) { display: none; }
.billing-cart-list .billing-table :is([data-inline-discount], td[data-label="Discount"] > input) { min-width: 0; width: 100%; padding: 5px 6px; }
.billing-cart-list .billing-table tr.billing-batch-complete td:first-child { grid-column: 1 / 4; }
.billing-cart-list .billing-table tr.billing-single-batch:has(.billing-line-options[open]) td:first-child { grid-column: 1 / -1; }
.billing-cart-list .billing-table tr.billing-single-batch:has(.billing-line-options[open]) td[data-label="Discount"] { display: block; grid-column: 1 / 3; }
.package-batch-prices { display: block; color: #53637b; font-size: 12px; }
.package-computer-batches { grid-column: 1 / -1; font-size: 13px; }
@media screen and (min-width: 1120px) {
    .billing-layout { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); gap: 12px; }
    .billing-cart-list .billing-table thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: block; }
    .billing-cart-list .billing-table thead tr { background: #234879; }
    .billing-cart-list .billing-table th { padding: 0; background: transparent; font-size: 12px; }
    .billing-cart-list .billing-table td[data-label]::before { display: none; }
}
@container (max-width: 550px) {
    .billing-cart-list .billing-table tr:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .billing-cart-list .billing-table tr:not([hidden]) td:first-child { grid-column: 1 / -1; }
    .billing-cart-list .billing-table td[data-label]::before { display: block; }
    .billing-cart-list .billing-table td[data-label="Batch"]::before { display: none; }
    .billing-cart-list .billing-table .billing-batch-complete td:nth-child(4) { grid-column: auto; }
    .billing-cart-list .billing-table .bill-remove-cell { grid-column: 2; }
    .billing-cart-list .billing-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media screen and (max-width: 700px) {
    .billing-entry-bar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

.billing-item-warranty { display: block; color: #53637b; font-size: 11px; font-weight: 400; }
.billing-discount-control { display: grid; gap: 4px; }
.billing-discount-modes { display: flex; flex-wrap: wrap; gap: 3px; }
.billing-discount-modes button,
.billing-cart-list .billing-table .billing-discount-modes button {
    min-height: 26px; padding: 2px 5px; border: 1px solid #cdd8e8;
    border-radius: 5px; background: #fff; color: #334967; font-size: 11px; line-height: 1.2;
}
.billing-discount-modes button[aria-pressed="true"],
.billing-cart-list .billing-table .billing-discount-modes button[aria-pressed="true"] {
    background: #234879; border-color: #234879; color: #fff;
}
.billing-cart-list .billing-table .billing-discount-control input { padding: 5px 6px; min-width: 0; }
@media screen and (max-width: 780px) {
    .billing-discount-modes button, .billing-cart-list .billing-table .billing-discount-modes button { min-height: 36px; min-width: 35px; }
}

.package-hardware-row[hidden], [data-package-hardware-empty][hidden] { display: none; }
.package-hardware-picker { margin-bottom: 14px; }
.package-hardware-search { max-width: 430px; }
.package-hardware-search label { margin-bottom: 0; }
.package-picker-status { font-size: 12px; margin: 6px 0; }
.package-picker-status:empty { display: none; }
[data-package-hardware-empty] { margin: 10px 0; font-size: 13px; }

/* Billing workstation */
.staff-billing .staff-workspace { padding: clamp(8px, 1.25vw, 20px); }
.staff-billing .billing-heading {
    background: linear-gradient(95deg, #1670dc, #a9caf4 72%, #eef5ff);
    border: 1px solid #247cec; border-radius: 6px 6px 0 0; padding: 7px 14px; margin: 0;
}
.staff-billing .billing-heading h1 { font-size: 22px; letter-spacing: 0; margin: 0; }
.billing-pos-toolbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px;
    border: 1px solid #8db8f2; border-top: 0; background: #e8eef9; margin-bottom: 9px;
}
.billing-pos-toolbar .history-button { border-radius: 18px; font-size: 13px; padding: 6px 13px; }
.billing-pos-toolbar .billing-new-link { background: #187cca; border-color: #1266a9; color: #fff; }
.billing-pos-toolbar .billing-package { margin: 0 0 0 auto; min-width: min(310px, 100%); }
.billing-pos-toolbar .billing-package label { font-size: 12px; }
.billing-pos-toolbar .billing-package :is(button, select, input) { min-height: 34px; padding-block: 5px; }
.staff-billing [data-billing] { border: 1px solid #78a9ee; border-radius: 6px; background: #f8faff; padding: 8px; }
.billing-pos-section-title {
    margin: 0; padding: 5px 10px; font-size: 15px; color: #152b4b;
    background: linear-gradient(90deg, #eff5ff, #8fbdf2 72%, #327ee4); border-bottom: 1px solid #7ba5dc;
}
.staff-billing .billing-entry-bar {
    grid-template-columns: minmax(150px, 1.2fr) minmax(105px, .62fr) minmax(160px, 1.5fr)
        minmax(82px, .55fr) minmax(85px, .62fr) minmax(66px, .38fr) auto;
    align-items: start; gap: 8px; padding: 10px; margin: 0;
    border: 0; border-radius: 0; border-bottom: 2px solid #4887cc;
}
.staff-billing .billing-entry-bar label { font-size: 12px; margin: 0; }
.staff-billing .billing-entry-bar input { padding: 6px 7px; margin-top: 4px; min-height: 32px; border-radius: 4px; }
.staff-billing .billing-entry-bar [readonly] { background: #f3f5f8; }
.billing-entry-actions { display: grid; gap: 4px; padding-top: 17px; }
.billing-entry-actions button { min-height: 29px; padding: 4px 8px; font-size: 12px; border-radius: 4px; white-space: nowrap; }
.billing-entry-actions [data-entry-add] { background: #2675b5; border-color: #2675b5; }
.billing-entry-actions [data-entry-add]:disabled { opacity: .55; cursor: default; }
.billing-entry-actions [data-entry-clear] { color: #852c33; }
.billing-pos-status { margin: 4px 8px; font-size: 12px; color: #334e78; }
.billing-pos-status:empty { display: none; }
.staff-billing .billing-layout { grid-template-columns: minmax(0, 1fr) minmax(210px, 19%); gap: 10px; margin-top: 7px; }
.staff-billing .billing-items, .staff-billing .billing-summary { padding: 8px; margin: 0; border-radius: 5px; }
.staff-billing .billing-summary { position: static; }
.staff-billing .billing-cart-list {
    min-height: clamp(230px, 40vh, 490px); border: 1px solid #9cb8da; border-radius: 4px;
    background: repeating-linear-gradient(#fafafa 0 26px, #e8edf4 26px 27px);
}
.staff-billing .billing-cart-list .billing-table { border: 0; border-radius: 0; }
.staff-billing .billing-cart-list .billing-table thead tr { background: #176bd5; }
.staff-billing .billing-cart-list .billing-table [data-empty-bill] {
    padding: clamp(50px, 13vh, 145px) 10px; background: transparent;
}
.staff-billing .billing-cart-list .billing-table [data-empty-bill] strong { font-size: 15px; }
.staff-billing .billing-summary .billing-save { grid-template-columns: minmax(0, 1fr); }
.staff-billing .billing-save [value="create_invoice"] { background: #258947; border-color: #227b41; }
.billing-pos-totals {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 9px 0 0;
    padding: 6px; border: 1px solid #b4c9e2; border-radius: 4px; background: #fff;
}
.billing-pos-totals[hidden] { display: none; }
.billing-pos-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 5px; min-width: 0; font-size: 12px; }
.billing-pos-totals dd {
    margin: 0; padding: 3px 6px; background: #ffeb69; color: #16243a; font-size: 15px;
    font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere;
}
@media screen and (max-width: 1240px) {
    .staff-billing .billing-entry-bar { grid-template-columns: minmax(145px, 1fr) minmax(95px, .55fr) minmax(155px, 1fr); }
    .billing-entry-actions { padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: 1 / -1; }
}
@media screen and (max-width: 830px) {
    .staff-billing .billing-layout { grid-template-columns: minmax(0, 1fr); }
    .staff-billing .billing-entry-bar, .billing-pos-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .staff-billing .billing-entry-bar .billing-product-search { grid-column: 1 / -1; }
    .billing-pos-toolbar .billing-package { flex: 1 1 100%; margin-left: 0; }
}

.billing-entry-batch { display: block; color: #455d78; font-size: 11px; margin-top: 4px; }
.billing-entry-batch:empty { display: none; }

.staff-billing .billing-discount-control { justify-items: start; align-content: start; gap: 3px; }
.staff-billing .billing-discount-control input { width: 100%; }
.staff-billing .billing-discount-modes { justify-content: flex-start; }
.staff-billing .billing-cart-list td { vertical-align: top; }
@media screen and (min-width: 1000px) and (min-height: 560px) {
    body.staff-billing { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
    .staff-billing .staff-workspace { display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 5px; font-size: 12px; }
    .staff-billing .billing-heading { flex: none; padding: 3px 8px; }
    .staff-billing .billing-heading h1 { font-size: 16px; }
    .staff-billing .billing-pos-toolbar { flex: none; padding: 4px 7px; gap: 4px; margin-bottom: 4px; }
    .staff-billing .billing-pos-toolbar .history-button { padding: 4px 7px; font-size: 11px; }
    .staff-billing .billing-pos-toolbar .billing-package { padding: 3px 6px; border-radius: 4px; }
    .staff-billing .billing-pos-toolbar .billing-package :is(button, select, input) { min-height: 26px; }
    .staff-billing [data-billing] { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 4px; }
    .staff-billing [data-billing] > :not(.billing-layout) { flex: 0 0 auto; }
    .staff-billing .billing-pos-section-title { padding: 3px 7px; font-size: 13px; }
    .staff-billing .billing-entry-bar {
        grid-template-columns: minmax(108px, 1.15fr) minmax(75px, .6fr) minmax(116px, 1.4fr)
            minmax(59px, .55fr) minmax(58px, .55fr) minmax(42px, .35fr) auto;
        gap: 5px; padding: 5px;
    }
    .staff-billing .billing-entry-actions { grid-column: auto; grid-template-columns: 1fr; padding-top: 15px; }
    .staff-billing .billing-entry-bar :is(input, label, button),
    .staff-billing .transaction-panel :is(input, select, label, button) { font-size: 11px; }
    .staff-billing .billing-entry-bar input, .staff-billing .transaction-panel :is(input, select) {
        min-height: 24px; padding: 3px 5px; margin-top: 2px;
    }
    .staff-billing .billing-entry-actions button,
    .staff-billing .transaction-panel button { min-height: 24px; padding: 3px 6px; }
    .staff-billing .billing-entry-bar .customer-add-button { min-width: 24px; width: 24px; }
    .staff-billing .billing-discount-modes button { min-height: 18px; padding: 1px 4px; font-size: 10px; }
    .staff-billing .billing-layout { flex: 1; min-height: 0; align-items: stretch; margin-top: 4px; gap: 5px; }
    .staff-billing .billing-items, .staff-billing .billing-summary { display: flex; flex-direction: column; min-height: 0; padding: 4px; }
    .staff-billing .billing-cart-heading { margin-bottom: 4px; }
    .staff-billing .transaction-panel h2 { font-size: 13px; margin-bottom: 4px; }
    .staff-billing .billing-cart-list { flex: 1; min-height: 0; overflow: auto; }
    .staff-billing .billing-cart-list .billing-table { overflow: visible; }
    .staff-billing .billing-cart-list .billing-table thead { position: sticky; top: 0; z-index: 2; }
    .staff-billing .billing-cart-list .billing-table tr:not([hidden]) { padding: 4px 5px; gap: 4px; }
    .staff-billing .billing-cart-list .billing-table td, .staff-billing .billing-cart-list .billing-table th { font-size: 11px; }
    .staff-billing .billing-cart-list .billing-table [data-empty-bill] { padding: clamp(18px, 8vh, 95px) 5px; }
    .staff-billing .billing-payment-fields { flex: 1; min-height: 0; overflow: auto; }
    .staff-billing .billing-payment-fields label { margin-bottom: 4px; }
    .staff-billing .billing-payment-row label { margin-bottom: 0; }
    .staff-billing .billing-balance, .staff-billing .billing-extra-options { margin: 5px 0; }
    .staff-billing .billing-extra-options { padding-top: 5px; }
    .staff-billing .billing-save { gap: 4px; margin-top: 5px; }
    .staff-billing .billing-pos-totals { margin-top: 4px; padding: 3px; }
    .staff-billing .billing-pos-totals dd { padding: 2px 4px; font-size: 13px; }
}

/* Keep lookup results out of the billing layout flow. */
.staff-billing .billing-pos-toolbar { position: relative; z-index: 5; }
.staff-billing .billing-entry-bar { position: relative; z-index: 4; }
.staff-billing .customer-search-row { position: relative; }
.staff-billing .customer-search-row .customer-results,
.staff-billing .billing-pos-toolbar .product-search-results {
    position: absolute; inset: calc(100% + 3px) 0 auto; z-index: 20;
    margin: 0; padding: 4px; max-height: min(220px, 34dvh); overflow: auto;
    border: 1px solid #bdcee1; border-radius: 7px; background: #fff;
    box-shadow: 0 8px 18px #233c6426;
}
.staff-billing .billing-entry-bar .billing-product-results { max-height: min(220px, 34dvh); }
.staff-billing .customer-selection-line {
    display: flex; align-items: center; gap: 5px; min-width: 0;
    height: 24px; margin-top: 3px;
}
.staff-billing .customer-selection-line [data-customer-status] {
    flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 11px;
}
.staff-billing .customer-selection-line [data-customer-clear] {
    flex: none; min-height: 20px; padding: 1px 4px; font-size: 10px; line-height: 1.3;
}
.staff-billing .customer-selection-line [hidden] { display: none; }
.staff-billing .billing-entry-batch,
.staff-billing .billing-entry-batch:empty {
    display: block; height: 16px; line-height: 16px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.staff-billing .billing-pos-status,
.staff-billing .billing-pos-status:empty {
    display: block; height: 17px; line-height: 17px; margin-block: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media screen {
    .staff-signed-in { grid-template-columns: minmax(0, 1fr); }
    .staff-menu-drawer .staff-sidebar {
        max-height: 100dvh; overflow-y: auto; overflow-x: hidden;
        overscroll-behavior: contain; scrollbar-gutter: stable;
    }
    .staff-menu-backdrop { touch-action: none; overscroll-behavior: none; }
}

/* Shared section pages: one task at a time, with compact mobile tabs. */
.workspace-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; padding: 6px; border: 1px solid #e2dcec; border-radius: 14px; background: #fff; }
.workspace-tabs [role="tab"] { margin: 0; padding: 10px 15px; border: 0; border-radius: 9px; background: transparent; color: #635570; font-size: 13px; font-weight: 700; box-shadow: none; }
.workspace-tabs [role="tab"][aria-selected="true"] { color: #fff; background: #38264f; }
.workspace-tabs [role="tab"]:focus-visible { outline: 3px solid #a28acc; outline-offset: 2px; }
[data-workspace-tab][hidden] { display: none !important; }
.customer-document-actions [aria-current="page"] { background: #38264f; color: #fff; }
@media (max-width: 600px) { .workspace-tabs { gap: 4px; padding: 4px; } .workspace-tabs [role="tab"] { flex: 1 1 auto; padding: 9px 10px; font-size: 12px; } }
@media print { .workspace-tabs { display: none !important; } [data-workspace-tab="Invoice"][hidden] { display: block !important; } }

/* Compact administration workspace. Screen-only: document printing keeps its dimensions. */
@media screen {
    .staff-signed-in .staff-workspace { width: 100%; max-width: none; min-width: 0; }
    .staff-signed-in:not(.staff-billing) .staff-workspace { margin: 0; padding: 16px clamp(12px, 1.5vw, 28px) 28px; font-size: 13px; line-height: 1.4; }
    .staff-signed-in:not(.staff-billing) .staff-workspace > h1 { font-size: clamp(23px, 2vw, 29px); margin-bottom: 7px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace .panel { padding: 14px; margin-bottom: 10px; border-radius: 11px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace .panel h2 { font-size: 16px; margin-bottom: 8px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace .panel p { margin-bottom: 8px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace label { font-size: 12px; margin-bottom: 8px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace :is(input, select, textarea) { padding: 7px 9px; margin-top: 4px; font-size: 13px; min-width: 0; }
    .staff-signed-in:not(.staff-billing) .staff-workspace button { min-height: 34px; padding: 6px 11px; font-size: 12px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace .history-button { min-height: 34px; padding: 6px 11px; font-size: 12px; }
    .staff-signed-in:not(.staff-billing) .staff-workspace .fields { gap: 8px 12px; }
    .staff-signed-in .sales-history table { font-size: 12px; line-height: 1.4; }
    .staff-signed-in .sales-history :is(td, th) { padding: 7px 9px; vertical-align: top; }
    .staff-signed-in .sales-history th { font-size: 11px; }
    .staff-signed-in .sales-history td { font-variant-numeric: tabular-nums; }
    .staff-signed-in .sales-history td :is(strong, small, a) { overflow-wrap: anywhere; }
    .staff-signed-in .sales-history td :is(button, .history-button) { margin: 2px 3px 2px 0; }
    .staff-signed-in .workspace-tabs { gap: 4px; margin: 10px 0 12px; padding: 4px; border-radius: 10px; }
    .staff-signed-in .workspace-tabs [role="tab"] { min-height: 32px; padding: 6px 11px; font-size: 12px; }
    .staff-signed-in .customer-document-actions { gap: 6px; }
    .staff-signed-in .finance-metrics { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
    .staff-signed-in .finance-metrics .panel { padding: 12px; }
    .staff-signed-in .finance-metrics .panel h2 { font-size: 12px; }
    .staff-signed-in .finance-metrics strong { font-size: 21px; }
    .staff-signed-in .products-title p { margin-bottom: 10px; }
    .staff-signed-in .product-menu { margin-bottom: 12px; }
    .staff-signed-in :is(.products-toolbar, .product-filters, .product-savebar) { padding: 10px 14px; gap: 8px; }
    .staff-signed-in .product-group h3 { padding: 8px 14px; }
    .staff-signed-in .product-row { padding: 10px 14px; gap: 8px 12px; }
    .staff-signed-in .product-identity { font-size: 12px; gap: 8px; }
    .staff-signed-in :is(.product-identity img, .product-placeholder) { flex-basis: 42px; height: 42px; }
    .staff-signed-in .billing-customer-dialog { width: min(700px, calc(100% - 24px)); padding: 18px; }
    /* Wide screens use the spare horizontal space rather than taller two-column forms. */
    @media (min-width: 1200px) {
        .staff-signed-in:not(.staff-billing) .staff-workspace .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .staff-signed-in .billing-customer-dialog .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 600px) {
        .staff-signed-in:not(.staff-billing) .staff-workspace { padding: 12px 10px 24px; }
        .staff-signed-in:not(.staff-billing) .staff-workspace .panel { padding: 12px; }
        .staff-signed-in:not(.staff-billing) .staff-workspace :is(input, select, textarea) { font-size: 16px; }
        .staff-signed-in:not(.staff-billing) .staff-workspace :is(button, .history-button) { min-height: 40px; }
        .staff-signed-in .workspace-tabs [role="tab"] { min-height: 40px; }
        .staff-signed-in .sales-history :is(td, th) { padding: 7px; }
    }
}

/* Six-column invoice layout: keep warranty text separate from numeric values. */
.quotation-table.invoice-price-table th:nth-child(1) { width:32%; }
.quotation-table.invoice-price-table th:nth-child(2) { width:14%; }
.quotation-table.invoice-price-table th:nth-child(3) { width:15%; }
.quotation-table.invoice-price-table th:nth-child(4) { width:14%; }
.quotation-table.invoice-price-table th:nth-child(5) { width:7%; }
.quotation-table.invoice-price-table th:nth-child(6) { width:18%; }
.invoice-price-table :is(th,td):nth-child(2) { text-align:left; white-space:normal; }
