.sales-module {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: "Segoe UI", Arial, sans-serif;	
}

.sales-module .module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sales-new-transaction {
    height: 28px;	
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.sales-new-transaction:hover {
    background: #1d4ed8;
}

.sales-controls {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 4px 0 8px;
}

.sales-controls-primary,
.sales-controls-secondary,
.sales-filter-menu,
.sales-filter-group,
.sales-filters,
.sales-status-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sales-controls-primary,
.sales-controls-secondary,
.sales-filter-menu {
    flex-wrap: wrap;
}

.sales-filter-menu {
    gap: 10px;
}

.sales-filter-group {
    padding: 2px 6px 2px 5px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

.sales-filter-group-label {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sales-controls-secondary {
    justify-content: flex-end;
}

.sales-date-separator {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.sales-filter,
.sales-status-filter {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;	
    font-size: 12px;
    transition: all 0.2s ease;
}

.sales-filter.is-active,
.sales-status-filter.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sales-search input {
    height: 28px;	
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 12px;
}

.sales-search input[type="search"] {
    min-width: 220px;
}

.sales-search input[type="date"] {
    min-width: 124px;
}

.sales-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 12px;	
}

.sales-pagination-controls button {
    width: 28px;
    height: 28px;	
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 7px;
    padding: 0;
    cursor: pointer;
}

.sales-table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: 0.005em;
    color: #111827;
}

.sales-table thead {
    background: #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.055em;
}

.sales-table th,
.sales-table td {
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;	
}

.sales-table th {
    padding: 8px 12px;
    color: #475569;
    font-weight: 700;	
}

.sales-table td {
    padding: 6px 12px;
    font-weight: 500;
}

.sales-table .sales-currency {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "kern" 1;
    white-space: nowrap;
}

.sales-table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.sales-table tbody tr:hover {
    background: #f8fafc;
}

.sales-transaction-label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
}

.sales-transaction-type {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2563eb;
}

.sales-transaction-sub {
    color: #6b7280;
    font-size: 12px;
}

.sales-customer-name {
    font-weight: 600;
}

.sales-status {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: capitalize;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.sales-status-draft {
    background: #e5e7eb;
}

.sales-status-sent {
    background: #fef3c7;
    color: #92400e;
}

.sales-status-approved {
    background: #d1fae5;
    color: #065f46;
}

.sales-status-posted {
    background: #dbeafe;
    color: #1d4ed8;
}

.sales-status-voided {
    background: #fee2e2;
    color: #b91c1c;
}

.sales-empty td {
    text-align: center;
    padding: 24px;
    color: #6b7280;
}

.sales-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    color: #6b7280;
}

.sales-back-button {
    border: none;
    background: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.sales-detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1.5fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: stretch;
    height: var(--sales-detail-layout-height, calc(100vh - 180px));	
}

.sales-detail-pane,
.sales-item-pane {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
}

.sales-detail-pane {
    overflow-y: auto;
}

.sales-item-pane {
    overflow: hidden;	
}

.sales-item-header {
    padding: 2px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;	
}

.sales-item-header h4 {
    margin: 0;
    font-size: 14px;
    color: #111827;
}

.sales-trade-button {
    flex: 0 0 auto;
}

.sales-trade-button.is-disabled,
.sales-trade-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.sales-detail-loading {
    color: #6b7280;
}

.sales-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.sales-preview-heading {
    flex: 1 1 240px;
    min-width: 0;
}

.sales-preview-header h3 {
    margin: 0;
}

.sales-preview-heading p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.sales-preview-dates {
    flex: 1 1 560px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: flex-start;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px 10px;
    background: #ffffff;
}

.sales-preview-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sales-preview-meta label,
.sales-preview-dates label,
.sales-preview-addresses label,
.sales-preview-totals label,
.sales-totals-fields label {
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sales-preview-dates label,
.sales-totals-fields label {
    display: block;
    gap: 0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.sales-preview-dates label {
    padding-left: 8px;
}

.sales-preview-dates .sales-inline-field {
    min-width: 0;
}

.sales-preview-dates .sales-salesperson-control {
    min-width: 0;
}

.sales-preview-dates .sales-salesperson-control select {
    min-width: 0;
}

.sales-preview-dates .sales-split-button {
    flex: 0 0 auto;
}

.sales-inline-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.sales-preview-dates input,
.sales-preview-dates select,
.sales-totals-fields input {
    min-width: 0;
    width: 100%;
    display: block;
    box-sizing: border-box;	
}

.sales-preview-meta input,
.sales-preview-meta select,
.sales-preview-dates input,
.sales-preview-dates select,
.sales-header-readonly,
.sales-preview-addresses input,
.sales-preview-totals input,
.sales-preview-totals textarea {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 13px;
}

.sales-preview-addresses {
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.sales-address-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sales-address-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
}

.sales-address-heading-button {
    min-height: 20px;
    border: 1px solid #cbd5e1;
    background: linear-gradient(#f8fafc, #e2e8f0);
    border-radius: 6px;
    padding: 1px 9px;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 16px;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.sales-address-heading-button:disabled {
    opacity: 1;
}

.sales-address-heading-action {
    cursor: pointer;
}

.sales-address-heading-action:hover:not(:disabled) {
    background: linear-gradient(#eff6ff, #dbeafe);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.sales-deliver-to-jiggle {
    animation: sales-deliver-to-jiggle 0.55s ease-in-out;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}

@keyframes sales-deliver-to-jiggle {
    0%,
    100% {
        transform: translateX(0);
    }

    15%,
    45%,
    75% {
        transform: translateX(-5px);
    }

    30%,
    60%,
    90% {
        transform: translateX(5px);
    }
}

.sales-address-heading-action:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.sales-address-lines {
    display: grid;
    gap: 2px;
    font-size: 13px;
    line-height: 1.35;
    color: #1f2937;
}

.sales-address-empty {
    color: #9ca3af;
    font-style: italic;	
}

.sales-shipto-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.sales-shipto-grid .sales-shipto-field {
    grid-column: span 3;
}

.sales-shipto-grid .sales-shipto-third {
    grid-column: span 2;
}

.sales-shipto-grid .sales-shipto-missing {
    background: #fef2f2;
    border-color: #fca5a5;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.22);
}

.sales-preview-items {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.sales-items-table {
    width: 100%;
    min-width: 720px;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
}

.sales-items-table th,
.sales-items-table td {
    padding: 6px 5px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.sales-items-table .sales-item-type-col {
    width: 36px;
    text-align: center;
}

.sales-items-table .sales-item-sku-col {
    width: 12%;
    overflow-wrap: anywhere;
}

.sales-items-table .sales-item-description-col {
    width: 30%;
    max-width: 260px;
    min-width: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.sales-items-table .sales-item-qty-col {
    width: 52px;
}

.sales-items-table .sales-item-money-col {
    width: 74px;
    text-align: right;
}

.sales-items-table .sales-item-tax-col {
    width: 38px;
    text-align: center;
}

.sales-items-table .sales-item-total-col {
    width: 78px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sales-items-table .sales-item-action-col {
    width: 32px;
    text-align: center;
}

.sales-item-type-icon {
    color: #2563eb;
    font-size: 13px;
}

.sales-section-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0 8px;
}

.sales-items-table input[type='number'] {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 12px;
}

.sales-items-table input[type='number']::-webkit-outer-spin-button,
.sales-items-table input[type='number']::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.sales-items-table input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;	
}

.sales-item-qty-input {
    text-align: center;
}

.sales-item-money-input {
    text-align: right;
    font-variant-numeric: tabular-nums;	
}

.sales-items-table input[type='checkbox'] {
    transform: scale(1.1);
}

.sales-item-remove {
    border: none;
    background: none;
    color: #ef4444;
    cursor: pointer;
}

.sales-preview-totals {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: 12px;
    align-items: end;
    margin-top: auto;	
}

.sales-notes-panel {
    min-width: 0;	
    display: grid;
    gap: 10px;
    align-content: end;
    height: 100%;
}

.sales-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.sales-notes-grid textarea {
    min-height: 36px;
    resize: vertical;
}

.sales-totals-panel {
    min-width: 0;	
    display: grid;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 12px;	
}

.sales-totals-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}


.sales-inline-field-readonly {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / -1;
    font-size: 14px;
}

.sales-inline-field-readonly span {
    color: #4b5563;
}

.sales-inline-field-readonly strong {
    font-size: 14px;
}

.sales-tax-suggestion-options {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sales-tax-suggestion-link {
    font-size: 0.78rem;
    color: #2f9e44;
    text-decoration: underline;
}

.sales-tax-suggestion-link:hover {
    color: #2b8a3e;
}

.sales-totals-summary {
    display: grid;
    gap: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
}

.sales-totals-row {	
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px 12px;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid #eef2f7;
}

.sales-totals-row:last-child {
    border-bottom: 0;
}

.sales-totals-row span {
    color: #4b5563;
}

.sales-totals-row strong {
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sales-grand-total {
    font-weight: 700;
    font-size: 13px;
}

@media (max-width: 900px) {
    .sales-preview-header {
        flex-wrap: wrap;
    }

    .sales-preview-dates {
        flex-basis: 100%;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .sales-preview-dates {
        grid-template-columns: 1fr;
    }
}

.sales-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sales-notes-actions {
    align-items: center;
    align-self: end;	
}

.sales-primary {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.sales-secondary {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

.sales-success {
    border: none;
    background: #16a34a;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.sales-success:hover:not(:disabled) {
    background: #15803d;
}

.sales-danger {
    border: none;
    background: #dc2626;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

.sales-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.sales-modal {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: min(420px, 92vw);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    display: grid;
    gap: 12px;
}

.sales-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sales-item-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;	
}

.sales-item-tab {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, gap 0.2s ease, padding 0.2s ease;
}

.sales-item-tab i {
    flex: 0 0 auto;	
    font-size: 14px;
}

.sales-item-tab-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-4px);
    transition: max-width 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}

.sales-item-tab.is-active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    gap: 6px;
}

.sales-item-tab.is-active .sales-item-tab-label {
    max-width: 160px;
    opacity: 1;
    transform: translateX(0);	
}

.sales-item-tab.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.sales-payment-tab {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.sales-payment-tab.is-active {
    background: #22c55e;
    border-color: #16a34a;
    color: #fff;
}

.sales-payment-tab-surplus {
    font-size: 11px;
    font-weight: 600;
}

.sales-payment-row.is-locked {
    opacity: 0.6;
    cursor: not-allowed;
}



.sales-payment-status-icon {
    margin-right: 6px;
}

.sales-payment-status-icon.is-applied-here {
    color: #16a34a;
}

.sales-payment-status-icon.is-applied-elsewhere {
    color: #f59e0b;
}

.sales-payment-status-icon.is-unapplied {
    color: #dc2626;
}

.sales-payment-status-icon.is-voided {
    color: #6b7280;
}

.sales-payment-invoice-link,
.sales-payment-edit-link {
    color: #2563eb;
    text-decoration: underline;
}

.sales-payment-invoice-link:hover,
.sales-payment-edit-link:hover {
    color: #1d4ed8;
}

.sales-payment-list-actions {
    display: flex;
    justify-content: flex-start;
}

.sales-item-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.sales-item-controls input {
    flex: 1 1 200px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
}

.sales-item-controls select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    min-width: 160px;
}

.sales-item-controls button {
    border: 1px solid #2563eb;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
}

.sales-item-controls button:hover {
    background: #1d4ed8;
}

.sales-item-catalog-only.is-hidden,
.sales-item-controls input.is-hidden {
    display: none;	
}

.sales-item-list {
    display: flex;
    flex: 1 1 auto;	
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}

.sales-item-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    background: #f9fafb;
}

.sales-catalog-stock-warning {
    flex: 1 0 100%;
    border-top: 1px solid #fbbf24;
    margin-top: 2px;
    padding-top: 8px;
    font-size: 12px;
    color: #92400e;
}

.sales-catalog-stock-warning span,
.sales-catalog-stock-warning a {
    display: block;
}

.sales-catalog-stock-warning a {
    color: #1d4ed8;
    font-weight: 700;
    margin-top: 4px;
    text-decoration: underline;
}

.sales-item-row.is-pulsing {
    animation: salesCatalogPulse 0.4s ease-in-out;
}

.sales-item-added {
    animation: salesInvoicePulse 0.6s ease-in-out;
}

.sales-item-summary {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 112px);
}

.sales-item-row strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.sales-item-row span {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
    color: #6b7280;
}

.sales-item-row .sales-remitted-star {
    color: #d97706;
    display: inline;
    font-size: 13px;
    margin-left: 2px;
}

.sales-item-meta {
    flex: 0 0 100px;
    max-width: 100px;
    text-align: right;
    font-size: 13px;
}

.sales-item-meta strong,
.sales-item-meta span {
    display: block;
}

.sales-item-meta strong {
    font-weight: 500;
    color: #111827;
}

.sales-item-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.sales-item-pagination button {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.sales-item-empty {
    color: #6b7280;
    text-align: center;
    padding: 16px;
}

@keyframes salesCatalogPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
}

@keyframes salesInvoicePulse {
    0% {
        background-color: rgba(34, 197, 94, 0.18);
    }
    100% {
        background-color: transparent;
    }
}

.sales-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: grid;
    place-items: center;
    z-index: 1000;
}

.sales-modal {
    background: #fff;
    border-radius: 16px;
    width: min(420px, 90vw);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.sales-create-modal {
    width: min(720px, 94vw);
}

.sales-create-modal .sales-modal-body label {
    max-width: none;
}

.sales-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sales-modal-body {
    display: grid;
    gap: 14px;
    padding: 16px 20px 20px;
}


.sales-payment-balance-due {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.sales-modal-body label {
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 360px;	
}

.sales-modal-body select,
.sales-modal-body input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    padding-right: 34px;
    width: 100%;
    box-sizing: border-box;
}

.sales-account-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sales-account-selected {
    font-size: 12px;
    color: #111827;
    text-transform: none;
}

.sales-account-results {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
    background: #f9fafb;
}

.sales-account-result {
    border: none;
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.15fr);
    gap: 12px;
    align-items: start;
    width: 100%;
    text-align: left;
    font-size: 12px;
}

.sales-account-result-main,
.sales-account-result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sales-account-result:hover {
    background: #e0ecff;
}

.sales-account-name {
    font-weight: 600;
    color: #111827;
    text-transform: none;
}

.sales-account-ref,
.sales-account-detail {
    color: #6b7280;
    text-transform: none;
}

.sales-account-detail {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .sales-account-result {
        grid-template-columns: 1fr;
    }
}

.sales-account-empty {
    font-size: 12px;
    color: #6b7280;
    padding: 8px 10px;
    text-transform: none;	
}

.sales-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.sales-modal-close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.sales-module .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .sales-controls {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .sales-controls-secondary {
        justify-content: flex-start;
    }

    .sales-detail-layout {
        grid-template-columns: 1fr;
    }
}
.sales-table,
.sales-items-table,
.sales-item-list,
.sales-account-results,
.sales-payment-list-actions {
    font-family: var(--app-list-font-family);
    font-size: var(--app-list-font-size);
    line-height: var(--app-list-line-height);
    letter-spacing: var(--app-list-letter-spacing);
    color: var(--app-list-color);
}
.sales-conversion-modal {
    box-sizing: border-box;
    gap: 10px;
    max-height: calc(100vh - 32px);
    max-width: min(760px, calc(100vw - 32px));
    overflow-y: auto;
    padding: 18px;
    width: min(760px, calc(100vw - 32px));
}

.sales-conversion-intro {
    color: #475569;
    line-height: 1.4;
    margin: 0 0 10px;
}

.sales-conversion-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.sales-conversion-summary div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
}

.sales-conversion-summary strong {
    display: block;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
}

.sales-conversion-summary span,
.sales-conversion-list span,
.sales-conversion-empty {
    color: #64748b;
    font-size: 12px;
}

.sales-conversion-option {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1e3a8a;
    display: flex;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 9px 12px;
}

.sales-conversion-modal h5 {
    color: #0f172a;
    font-size: 13px;
    letter-spacing: 0.04em;
    margin: 12px 0 6px;
    text-transform: uppercase;
}

.sales-conversion-list {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    list-style: none;
    margin: 0;
    max-height: min(180px, 24vh);
    overflow: auto;
    padding: 0;
}

.sales-conversion-list li {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 12px;
}

.sales-conversion-list li + li {
    border-top: 1px solid #e2e8f0;
}


@media (max-height: 720px) {
    .sales-conversion-modal {
        gap: 8px;
        max-height: calc(100vh - 20px);
        padding: 14px;
    }

    .sales-conversion-summary strong {
        font-size: 20px;
    }

    .sales-conversion-list {
        max-height: 18vh;
    }
}

@media (max-width: 640px) {
    .sales-conversion-summary {
        grid-template-columns: 1fr;
    }

    .sales-conversion-list li {
        align-items: flex-start;
        flex-direction: column;
    }
}

.sales-posting-modal {
    width: min(760px, calc(100vw - 32px));
}

.sales-posting-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sales-posting-list li {
    justify-content: flex-start;
}

.sales-posting-list .sales-posting-item {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sales-posting-notes {
    color: #475569;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    letter-spacing: 0.04em;
    margin-top: 12px;
    text-transform: uppercase;
}

.sales-posting-notes textarea {
    box-sizing: border-box;
    min-height: 76px;
    resize: vertical;
    width: 100%;
}

@media (max-width: 640px) {
    .sales-posting-summary {
        grid-template-columns: 1fr;
    }
}

.sales-print-spool {
    display: none;
}

.sales-print-sheet {
    width: 8.5in;
    min-height: 11in;
    margin: 0 auto;
    padding: 0.45in;
    background: #fff;
    color: #111827;
    font-family: "Segoe UI", Arial, sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sales-print-sheet *,
.sales-print-sheet *::before,
.sales-print-sheet *::after {
    box-sizing: border-box;
}

.sales-print-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-bottom: 3px solid #d1d5db;
    margin-left: -0.35in;
    margin-right: -0.35in;
    padding: 0 0.35in 18px;
    color: #111827;
}

.sales-print-header h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sales-print-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.sales-print-brand,
.sales-print-doc-meta,
.sales-print-summary div,
.sales-print-balance-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sales-print-brand {
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
}

.sales-print-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.sales-print-logo {
    display: block;
    max-width: 0.95in;
    max-height: 0.65in;
    object-fit: contain;
    flex: 0 0 auto;
    margin-right: 10px;
}

.sales-print-brand span,
.sales-print-doc-meta span,
.sales-print-summary span,
.sales-print-balance-row span,
.sales-print-footer {
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-print-header .sales-print-brand span,
.sales-print-header .sales-print-doc-meta span {
    color: #6b7280;
}

.sales-print-brand strong {
    font-size: 14px;
    letter-spacing: 0.01em;
}

.sales-print-doc-meta {
    align-items: flex-end;
    text-align: right;
}

.sales-print-doc-meta strong {
    font-size: 18px;
    letter-spacing: 0.01em;
}

.sales-print-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.sales-print-summary div,
.sales-print-card,
.sales-print-panel,
.sales-print-balance-block {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    padding: 14px 16px;
}

.sales-print-panel {
    min-width: 0;
    overflow: hidden;
}

.sales-print-summary strong {
    color: #111827;
    font-size: 14px;
}

.sales-print-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 8px 0 18px;
}

.sales-print-card h2,
.sales-print-panel h2 {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-print-card p,
.sales-print-notes p {
    margin: 3px 0;
    color: #374151;
    font-size: 12px;
    line-height: 1.45;
}

.sales-print-items-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 8.75px;
    line-height: 1.2;
    overflow: hidden;
}

.sales-print-items-table th,
.sales-print-items-table td {
    box-sizing: border-box;
    min-width: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 5px 2px;
    text-align: left;
    vertical-align: top;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sales-print-items-table th {
    background: #e2e8f0;
    color: #475569;
    font-size: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sales-print-col-type {
    width: 4%;
}

.sales-print-col-item {
    width: 12%;
}

.sales-print-col-description {
    width: 40%;
}

.sales-print-col-qty {
    width: 5%;
}

.sales-print-col-unit,
.sales-print-col-discount {
    width: 12%;
}

.sales-print-col-total {
    width: 15%;
}

.sales-print-items-table th:nth-child(1),
.sales-print-items-table td:nth-child(1) {
    text-align: center;
}

.sales-print-item-type i {
    font-size: 10px;
    color: #1f2937;
}

.sales-print-item-serial {
    margin-top: 2px;
    color: #6b7280;
    font-size: 9px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sales-print-number {
    text-align: right !important;
    white-space: normal;
    font-variant-numeric: tabular-nums;
}

.sales-print-notes-balances {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: start;
    margin-top: auto;
    padding-top: 18px;
}

.sales-print-balance-block {
    background: #111827;
    color: #fff;
}

.sales-print-balance-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding: 7px 0;
}

.sales-print-balance-row:last-child {
    border-bottom: 0;
}

.sales-print-balance-row span {
    color: #d1d5db;
}

.sales-print-balance-row strong {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.sales-print-balance-row.is-emphasized {
    padding-top: 10px;
}

.sales-print-balance-row.is-emphasized strong {
    font-size: 16px;
}

.sales-print-empty {
    color: #6b7280;
    font-style: italic;
}

.sales-print-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

@media print {
    body.sales-transaction-printing {
        margin: 0;
        background: #fff;
    }

    body.sales-transaction-printing > :not(.sales-print-spool) {
        display: none !important;
    }

    .sales-print-spool {
        display: block !important;
    }

    .sales-print-spool .sales-print-sheet {
        width: auto;
        min-height: calc(100vh - 0.7in);
        margin: 0;
        padding: 0.35in;
        box-shadow: none;
    }

    .sales-print-card,
    .sales-print-panel,
    .sales-print-balance-block,
    .sales-print-summary div {
        break-inside: avoid;
    }
}

.sales-salesperson-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sales-salesperson-control select {
    min-width: 150px;
}

.sales-split-button {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sales-split-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sales-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.sales-split-percent {
    display: block;
    margin-top: 6px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
}

.sales-split-slider-label {
    margin-top: 12px;
}

.sales-split-slider-label input[type="range"] {
    width: 100%;
}
