/* ============================================
   SALES SECTION STYLES
   ============================================ */

/* ---- Sale List Page ---- */

.sale-list-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 1.25rem;
}
.sale-stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sale-stat-card:hover {
    border-color: #c7d2e0;
    background: #fafbfc;
}
.sale-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.sale-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.sale-stat-icon.green { background: #ecfdf5; color: #059669; }
.sale-stat-icon.orange { background: #fef3c7; color: #d97706; }
.sale-stat-icon.purple { background: #ede9fe; color: #7c3aed; }

.sale-stat-info { display: flex; flex-direction: column; gap: 1px; }
.sale-stat-number {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}
.sale-stat-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

/* Sale List Card */
.tag.is-client-badge {
    background: #e5e7eb;
    color: #4b5563;
    height: 20px;
    line-height: 18px;
    font-weight: 500;
    white-space: nowrap;
}
.sale-list-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.sale-list-card .table-container {
    margin: 0;
}
.sale-list-card table.table {
    margin-bottom: 0;
}
.sale-list-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.sale-list-header .sale-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
}

.sale-date-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafbfd;
}
.sale-date-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}
.sale-date-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-right: 0.25rem;
}
.sale-date-form input[type="date"] {
    padding: 0.4rem 0.6rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
.sale-date-form input[type="date"]:focus {
    border-color: #2563eb;
}
.sale-date-sep {
    font-size: 13px;
    color: #6b7280;
}

.sale-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}
.sale-search-wrapper .sale-search-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.95rem;
    z-index: 1;
}
.sale-search-wrapper input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
.sale-search-wrapper input:focus {
    border-color: #2563eb;
    box-shadow: none;
}
.sale-search-wrapper input::placeholder {
    color: #94a3b8;
}

.sale-list-card table.table thead tr {
    background: #f9fafb !important;
}
.sale-list-card table.table thead th {
    color: #9ca3af !important;
    font-weight: 600;
    padding: 12px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sale-list-card table.table tbody tr {
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}
.sale-list-card table.table tbody tr:hover {
    background-color: #fafafa !important;
}
.sale-list-card table.table tbody tr:nth-child(even) {
    background-color: transparent !important;
}
.sale-list-card table.table tbody tr:nth-child(even):hover {
    background-color: #fafafa !important;
}
.sale-list-card table.table td {
    padding: 14px 16px !important;
    vertical-align: middle !important;
    color: #374151 !important;
    font-size: 13px !important;
}

.btn-sale-options {
    transition: all 0.15s ease !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #9ca3af !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.btn-sale-options:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
    background: #fff !important;
}
.btn-sale-options.is-danger:hover {
    border-color: #dc2626 !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
}
.page-content a.button.is-link.is-rounded.is-small {
    transition: all 0.15s ease;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-content a.button.is-link.is-rounded.is-small:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #fff;
}

.sale-list-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #fff;
}
.sale-list-footer .pagination-info {
    font-size: 0.85rem;
    color: #64748b;
}
.sale-list-footer .pagination {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
.sale-list-footer .pagination a,
.sale-list-footer .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}
.sale-list-footer .pagination a:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.sale-list-footer .pagination .is-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.sale-list-notification {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

/* ---- New Sale Page ---- */

.sale-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}
.sale-main {
    min-width: 0;
}

.sale-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    position: relative;
}
.sale-search-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}
#sale-product-search-input {
    flex: 1;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
#sale-product-search-input:focus {
    border-color: #2563eb;
}
#sale-product-search-input::placeholder {
    color: #94a3b8;
}
#sale-product-search-input[data-loading="true"] {
    background-image: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.25));
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}
.sale-search-btn {
    padding: 0.75rem 1.25rem;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sale-search-btn:hover {
    background: #374151;
}

#sale-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 60px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 9999;
    display: none;
    margin-top: 4px !important;
    padding: 0 !important;
}
#sale-autocomplete-list .autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    transition: background 0.1s ease;
}
#sale-autocomplete-list .autocomplete-item:last-child {
    border-bottom: none;
}
#sale-autocomplete-list .autocomplete-item:hover,
#sale-autocomplete-list .autocomplete-item.is-active {
    background: #f0f7ff;
}
#sale-autocomplete-list .autocomplete-item .name {
    font-weight: 500;
    color: #1e293b;
}
#sale-autocomplete-list .autocomplete-item .meta {
    color: #64748b;
    font-size: 0.85rem;
}
#sale-autocomplete-list .autocomplete-empty {
    padding: 14px;
    text-align: center;
    color: #94a3b8;
}
#sale-autocomplete-list mark {
    background: rgba(255, 200, 50, 0.4);
    padding: 0 2px;
    border-radius: 2px;
}

/* ---- Product mini-cards (New Sale) ---- */
.sale-products {
    margin-bottom: 1.25rem;
}
.sale-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.sale-products-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0a1628;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sale-products-title i {
    color: #94a3b8;
}
.sale-products-count {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.sale-products-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
    max-height: 460px;
    overflow-y: auto;
    padding: 2px;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 1400px) {
    .sale-products-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 1150px) {
    .sale-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .sale-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .sale-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.product-mini-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    overflow: hidden;
    transition: all 0.15s ease;
}
.product-mini-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}
.product-mini-card:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.pmc-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pmc-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pmc-body {
    padding: 0 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.pmc-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}
.pmc-price-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    color: #0a1628;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    line-height: 1.3;
}
.pmc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.pmc-stock {
    font-size: 0.7rem;
    color: #64748b;
}
.pmc-unit {
    font-size: 0.68rem;
    font-weight: 600;
    color: #0a1628;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 0.05rem 0.4rem;
    border-radius: 5px;
    white-space: nowrap;
    text-transform: uppercase;
}

.sale-cart {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.sale-cart table {
    width: 100%;
    border-collapse: collapse;
}
.sale-cart table thead tr {
    background: #f9fafb;
}
.sale-cart table thead th {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.sale-cart table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}
.sale-cart table tbody tr:last-child {
    border-bottom: none;
}
.sale-cart table tbody tr:hover {
    background: #fafafa;
}
.sale-cart table td {
    padding: 8px 12px;
    vertical-align: middle;
    color: #374151;
    font-size: 13px;
}
.sale-cart .col-num {
    width: 40px;
    text-align: center;
    color: #94a3b8;
}
.sale-cart .col-product {
    min-width: 160px;
}
.sale-cart .col-qty {
    width: 140px;
}
.sale-cart .col-price {
    width: 110px;
    text-align: right;
    font-weight: 600;
}
.sale-cart .col-subtotal {
    width: 120px;
    text-align: right;
    font-weight: 600;
    color: #0066ff;
}
.sale-cart .col-action {
    width: 44px;
    text-align: center;
}
.sale-cart .product-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.82rem;
}
.sale-cart .product-code {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
}
.product-price-edit {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
    padding: 0 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.product-price-edit:focus-within {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.product-price-edit .price-currency {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
}
.product-price-edit .price-input {
    width: 62px;
    border: none;
    background: transparent;
    padding: 2px 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    outline: none;
}
.product-price-edit .price-input.is-loading {
    opacity: 0.55;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
}
.qty-btn:hover {
    background: #f1f5f9;
    color: #0066ff;
}
.qty-btn:active {
    background: #e2e8f0;
}
.qty-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: none;
    border-left: 1.5px solid #e2e8f0;
    border-right: 1.5px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0a1628;
    background: #ffffff;
    outline: none;
    font-family: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    padding: 0 6px;
    white-space: nowrap;
}
.qty-pesable .qty-input {
    width: 52px;
}

.btn-remove {
    width: 28px;
    height: 28px;
    border: 1.5px solid transparent;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 7px;
    cursor: pointer;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.btn-remove:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.sale-cart .total-row td {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    font-weight: 700;
}
.sale-cart .total-label {
    text-align: right;
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sale-cart .total-value {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.sale-cart .empty-cart {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-cart-content i {
    font-size: 3rem;
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.75rem;
}
.empty-cart-content p {
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}
.empty-cart-content span {
    color: #94a3b8;
    font-size: 0.85rem;
}

.sale-sidebar .sidebar-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}
.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-field {
    margin-bottom: 1rem;
}
.sidebar-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sidebar-field input[type="date"],
.sidebar-field input[type="text"],
.sidebar-field input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
    color: #374151;
    box-sizing: border-box;
}
.sidebar-field input:focus {
    border-color: #2563eb;
    background: #fff;
}
.sidebar-field input[readonly] {
    background: #fff;
    color: #6b7280;
    cursor: default;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
}
.sidebar-grid .sidebar-field {
    margin-bottom: 0;
}
.sidebar-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sidebar-field-full {
    grid-column: 1 / -1;
}

.sidebar-select {
    position: relative;
}
.sidebar-select select {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
    color: #374151;
    box-sizing: border-box;
}
.sidebar-select select:focus {
    border-color: #2563eb;
}
.sidebar-select .select-arrow {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.75rem;
}

.sidebar-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.sidebar-input-group .input-prefix {
    position: absolute;
    left: 0.85rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}
.sidebar-input-group input {
    padding-left: 2rem !important;
}

.client-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.client-display input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    outline: none;
    font-family: inherit;
    color: #374151;
    box-sizing: border-box;
}
.client-display .client-address {
    flex: 1.1;
    color: #6b7280;
}
.client-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.client-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.client-btn.client-remove:hover {
    border-color: #dc2626 !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

.sidebar-total {
    padding: 1rem;
    margin-top: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
}
.sidebar-total span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.sidebar-total strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.sidebar-submit {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}
.sidebar-submit:hover {
    background: #374151;
}
.sidebar-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-warning {
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    font-size: 0.8rem;
    color: #92400e;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-warning i {
    color: #f59e0b;
    font-size: 1rem;
}

.sidebar-info {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.75rem;
    text-align: center;
}

/* ---- Compact cart (right panel) ---- */
.sale-cart-panel {
    padding: 1rem;
}
.sale-cart--compact {
    border: none;
    border-radius: 0;
}
.sale-cart--compact thead {
    display: none;
}
.sale-cart--compact table td {
    padding: 7px 4px;
    vertical-align: middle;
    font-size: 12px;
}
.sale-cart--compact .col-product {
    min-width: 0;
}
.sale-cart--compact .product-name {
    font-size: 0.75rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sale-cart--compact .product-code {
    font-size: 0.66rem;
    color: #94a3b8;
    margin-top: 1px;
}
.sale-cart--compact .col-qty {
    white-space: nowrap;
}
.sale-cart--compact .col-subtotal {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0066ff;
    white-space: nowrap;
}
.sale-cart--compact .qty-btn {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}
.sale-cart--compact .qty-input {
    width: 32px;
    height: 24px;
    font-size: 0.75rem;
}
.sale-cart--compact .qty-pesable .qty-input {
    width: 42px;
}
.sale-cart--compact .qty-unit {
    font-size: 0.62rem;
    padding: 0 4px;
}
.sale-cart--compact .btn-remove {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    border-radius: 6px;
}
.sale-cart--compact .total-row td {
    padding: 10px 4px 2px;
    border-top: 1px solid #e5e7eb;
}
.sale-cart--compact .total-value {
    font-size: 1rem;
}
.sale-cart--compact .empty-cart {
    padding: 1.5rem 0.5rem;
}
.sale-cart--compact .empty-cart-content i {
    font-size: 2rem;
}

.sale-sidebar-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}
.sale-sidebar-actions .sidebar-submit,
.sale-sidebar-actions .sidebar-submit--ghost {
    flex: 0 1 auto;
    width: 130px;
    margin-top: 0;
    padding: 0.55rem;
    font-size: 12px;
    justify-content: center;
}
.sale-sidebar-actions .sidebar-submit--ghost {
    background: rgba(254, 226, 226, 0.9);
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 7px;
    gap: 0.35rem;
}
.sale-sidebar-actions .sidebar-submit--ghost:hover {
    background: rgba(252, 165, 165, 0.45);
    color: #991b1b;
}

.sale-cart-panel .sidebar-title {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
}

/* ---- Payment modal ---- */
.modal-sale-payment .modal-card {
    display: flex;
    flex-direction: column;
    width: 740px;
    max-width: 95vw;
    max-height: 92vh;
}
.modal-sale-payment .modal-card-head {
    flex: 0 0 auto;
}
.modal-sale-payment .modal-card-head {
    padding: 0.75rem 1.2rem;
}
.modal-sale-payment .modal-card > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.modal-sale-payment .modal-card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0.8rem 1rem;
}
.modal-sale-payment .sidebar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem 0.55rem;
}
.modal-sale-payment .sidebar-field {
    margin-bottom: 0.4rem;
}
.modal-sale-payment .sidebar-field label {
    font-size: 0.68rem;
    margin-bottom: 0.2rem;
    letter-spacing: 0.2px;
}
.modal-sale-payment .sidebar-field input[type="text"],
.modal-sale-payment .sidebar-field input[type="date"],
.modal-sale-payment .sidebar-field input[type="number"],
.modal-sale-payment .sidebar-select select {
    padding: 0.45rem 0.6rem;
    font-size: 12px;
    border-radius: 7px;
}
.modal-sale-payment .sidebar-select select {
    padding-right: 1.9rem;
}
.modal-sale-payment .sidebar-select .select-arrow {
    font-size: 0.65rem;
    right: 0.6rem;
}
.modal-sale-payment .sidebar-input-group input {
    padding-left: 1.45rem !important;
}
.modal-sale-payment .sidebar-input-group .input-prefix {
    font-size: 0.75rem;
    left: 0.6rem;
}
.modal-sale-payment .client-display input {
    padding: 0.45rem 0.6rem;
    font-size: 12px;
}
.modal-sale-payment .client-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.8rem;
}
.modal-sale-payment .sidebar-total {
    padding: 0.7rem;
    margin-top: 0.6rem;
    border-radius: 8px;
}
.modal-sale-payment .sidebar-total strong {
    font-size: 1.2rem;
}
.modal-sale-payment .sidebar-submit {
    padding: 0.65rem;
    margin-top: 0.6rem;
}
.modal-sale-payment .modal-card-foot {
    flex: 0 0 auto;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 0.9rem 1.5rem;
}
.modal-sale-payment .pay-total-final {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.55rem;
    padding: 0.6rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 -4px 14px -6px rgba(0, 0, 0, 0.15);
}
.modal-sale-payment .footer-total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    margin-right: auto;
}
.modal-sale-payment .footer-total span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.modal-sale-payment .footer-total strong {
    font-size: 1.5rem;
    line-height: 1.1;
    font-weight: 800;
    color: #0a1628;
    letter-spacing: -0.5px;
}
.modal-sale-payment .footer-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.modal-sale-payment .btn-guardar-footer {
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.1rem;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.modal-sale-payment .btn-guardar-footer:hover {
    background: #15803d;
}
.modal-sale-payment .btn-guardar-footer:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.modal-sale-payment .button.btn-volver {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}
.modal-sale-payment .button.btn-volver:hover {
    background: #d1d5db;
    color: #1f2937;
}
.modal-sale-payment .sidebar-warning {
    font-size: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin-top: 0.6rem;
}
.pay-section {
    margin-bottom: 0.65rem;
}
.pay-section + .pay-section {
    padding-top: 0.65rem;
    border-top: 1px solid #e5e7eb;
}
.pay-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0a1628;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.45rem;
}
.pay-section-title i {
    color: #94a3b8;
}

/* ---- Payment option cards (condición de venta / método de pago) ---- */
.modal-sale-payment .pay-grid-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.modal-sale-payment .pay-grid-money {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.5rem;
}
.pay-opt-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin: 0.45rem 0 0.25rem;
}
.pay-opt-grid {
    display: grid;
    gap: 0.35rem;
}
.pay-opt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pay-opt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-opt-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    padding: 0.32rem 0.45rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}
.pay-opt-card:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}
.pay-opt-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pay-opt-icon {
    font-size: 0.85rem;
    color: #64748b;
    transition: color 0.15s ease;
}
.pay-opt-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #374151;
}
.pay-opt-desc {
    display: none;
}
.pay-opt-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.pay-opt-card:has(input:checked) .pay-opt-icon { color: #2563eb; }
.pay-opt-card:has(input:checked) .pay-opt-name { color: #1d4ed8; }

/* ---- Recargo / pago dividido ---- */
.modal-sale-payment [hidden] { display: none !important; }

.pay-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    padding: 0.38rem 0.55rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    user-select: none;
}
.pay-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}
.pay-toggle-text { line-height: 1.2; }

.split-payments {
    margin-top: 0.4rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.split-payments-head,
.pago-row {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 28px;
    gap: 0.45rem;
    align-items: center;
}
.split-payments-head {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.4rem;
    padding: 0 2px;
}
.pago-row { margin-bottom: 0.3rem; }
.pago-metodo {
    width: 100%;
    padding: 0.42rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    color: #334155;
}
.pago-monto-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pago-monto-prefix {
    position: absolute;
    left: 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}
.pago-monto {
    width: 100%;
    padding: 0.42rem 0.5rem 0.42rem 1.15rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.pago-monto:focus,
.pago-metodo:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.pago-row-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.pago-row-remove:hover { background: #fecaca; }
.split-payments-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
}
.split-payments .btn-small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.split-payments .btn-small:hover { background: #dbeafe; }
.split-payments-total {
    font-size: 0.75rem;
    color: #475569;
}
.split-payments-total strong { color: #0f172a; }

/* ---- Money cards (Recibe / Vuelto / Deuda) ---- */
.pay-money-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.45rem 0.6rem 0.4rem;
    margin-bottom: 0 !important;
}
.pay-money-card label {
    font-size: 0.66rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pay-money-card .sidebar-input-group input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    padding: 0.4rem 0.5rem 0.4rem 1.35rem !important;
    height: auto;
}
.pay-money-card--change .sidebar-input-group input { color: #047857 !important; }
.pay-money-card--debt .sidebar-input-group input { color: #b91c1c !important; }

/* ---- Total detail (subtotal / recargo / total) ---- */
.modal-sale-payment .pay-total-final { flex-wrap: wrap; }
.modal-sale-payment .footer-total--detail {
    flex-direction: row;
    align-items: baseline;
    gap: 0.4rem;
    margin-right: 0;
}
.modal-sale-payment .footer-total--detail span {
    font-size: 0.66rem;
    letter-spacing: 0.03em;
}
.modal-sale-payment .footer-total--detail strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0;
}
.modal-sale-payment .footer-total--grand {
    margin-right: auto;
    padding-left: 0.6rem;
    border-left: 1px solid #e2e8f0;
}
.modal-sale-payment .footer-total--grand strong {
    font-size: 1.35rem;
    color: #0a1628;
}

/* ---- Compact client details ---- */
.client-extra {
    margin-top: 0.6rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
.client-extra .sidebar-field label { color: #94a3b8; }
.client-extra .sidebar-field input[readonly] { background: #fff; }
.client-extra-address {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
}
.client-extra-address i { color: #94a3b8; }

/* ---- Modals ---- */
.modal-card {
    border-radius: 16px !important;
    overflow: hidden;
}
.modal-card-head {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}
.modal-card-title {
    font-weight: 700 !important;
    color: #0a1628 !important;
    font-size: 1.1rem !important;
}
.modal-card-body {
    padding: 1.5rem;
}
.modal-card-body .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.4rem;
}
.modal-card-body .input {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.modal-card-body .input:focus {
    border-color: #0066ff;
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* ---- Sale Success Card ---- */
.sale-success-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}
.sale-success-icon {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 0.75rem;
}
.sale-success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0a1628;
    margin: 0 0 0.5rem;
}
.sale-success-text {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 1.5rem;
}
.sale-success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.sale-success-actions .btn {
    min-width: 180px;
    justify-content: center;
}

/* ---- Sale Toast ---- */
.sale-toast {
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}
.sale-toast-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}
.sale-toast-success i {
    color: #10b981;
    font-size: 1.1rem;
}

/* El aviso de error lo genera LectorBarras.toast(msg,'error') desde
   barcode.js. Sin esta regla la clase se referenciaba pero no existia: el
   "codigo no encontrado" salia con la clase base, que no define fondo ni
   color, o sea como texto pelado. Y es justo el aviso mas importante del
   escaneo: el que dice que el codigo no esta en la base.

   Se usa la misma paleta que el panel de error dentro de la camara
   (#fef2f2 / #fecaca / #991b1b, scannerCamara.js) para que el toast
   flotante y el panel del overlay se vean igual ante la misma falla. */
.sale-toast-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.sale-toast-error i {
    color: #dc2626;
    font-size: 1.1rem;
}

/* Los avisos del lector se apilan en #barcode-toast-cont, que ya separa con
   gap: 8px. La clase base trae margin-bottom: 1.25rem, asi que sin esto
   quedaban 28px entre avisos en vez de 8. */
#barcode-toast-cont .sale-toast {
    margin-bottom: 0;
}

/* ---- Sale Details (from old sales.css) ---- */
.sale-details {
    display: flex;
    justify-content: space-between;
    transition: all .3s ease-in-out;
    padding: 5px;
}
.sale-details:hover {
    background-color: rgba(0, 0, 0, 0.07);
}
.afip-copy {
    background: linear-gradient(90deg,#27ae60 0%, #2ecc71 100%);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(39,174,96,0.18);
}
.afip-copy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(39,174,96,0.2);
}
.afip-copy.is-small { padding-left:0.6rem; padding-right:0.6rem; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sale-layout {
        grid-template-columns: 1fr;
    }
    .sale-sidebar {
        order: -1;
    }
    .sale-list-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .sale-list-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .sale-list-header {
        flex-direction: column;
        align-items: stretch;
    }
    .sale-list-header .sale-search-form {
        max-width: 100%;
    }
    .sale-cart .col-price,
    .sale-cart .col-subtotal {
        display: none;
    }
    .sale-list-footer {
        flex-direction: column;
        text-align: center;
    }
    .sale-cart table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sale-list-card table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
.sale-new-page .sale-page-title {
    font-size: 1rem;
    margin: 0;
}
@media (max-width: 480px) {
    .sale-list-stats {
        grid-template-columns: 1fr;
    }
    .sidebar-grid,
    .sidebar-grid-3 {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .modal-sale-payment .pay-grid-top,
    .modal-sale-payment .pay-grid-money {
        grid-template-columns: 1fr;
    }
    .modal-sale-payment .footer-total strong { font-size: 1.4rem; }
    .modal-sale-payment .pay-total-final {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .modal-sale-payment .footer-actions {
        width: 100%;
    }
    .modal-sale-payment .btn-guardar-footer {
        flex: 1;
        justify-content: center;
    }
}
