/* POS Compact Design - Excel-like Interface with WhatsApp-Style Font */

body {
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #3B4A54;
    letter-spacing: 0.2px;
}

/* Compact Header Styling */
.pos-header-compact {
    background: #ffffff;
    color: #3B4A54;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #25D366;
}

.compact-select {
    font-size: 0.8rem;
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

/* Header Styling */
.pos-header {
    background: #ffffff;
    color: #3B4A54;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #25D366;
}

.pos-logo-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pos-header-logo {
    max-height: 90px;
    width: auto;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px;
}

.shop-title {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.shop-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

.shop-contact {
    font-size: 0.75rem;
    opacity: 0.85;
}

.pos-header h4 {
    color: white;
    font-weight: 600;
}

.pos-header .form-control {
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.95);
}

/* Main Container */
.pos-container {
    padding: 15px;
    max-width: 100%;
}

/* Compact Container */
.pos-container-compact {
    padding: 8px;
    max-width: 100%;
    background: #f4f6f9;
}

/* Product Entry Card Header - Clean White */
.card-header.bg-primary {
    background: #ffffff !important;
    border: none !important;
    border-bottom: 3px solid #25D366 !important;
}

.card-header.bg-primary h6,
.card-header.bg-primary .mb-0 {
    color: #3B4A54 !important;
    text-shadow: none;
    font-weight: 600;
}

.card-header.bg-primary i {
    color: #25D366 !important;
    text-shadow: none;
}

/* Fix card overflow to allow suggestions to show */
.card {
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

/* Compact Entry Form */
.entry-form-compact input,
.entry-form-compact select {
    font-size: 0.8rem;
    height: 32px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #E9EDEF;
    border-radius: 4px;
    font-family: inherit;
}

.entry-form-compact input:focus,
.entry-form-compact select:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

/* Quick Action Button Styling */
.quick-action-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
}

.quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-action-btn i {
    margin-right: 0.4rem;
    font-size: 0.9em;
}

/* General Typography - WhatsApp Style */
label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #3B4A54;
    margin-bottom: 0.25rem;
    letter-spacing: 0.2px;
}

h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3B4A54;
    letter-spacing: 0.2px;
}

.form-control {
    font-size: 0.85rem;
    border: 1px solid #E9EDEF;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: #3B4A54;
    font-family: inherit;
}

.form-control:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Tables - WhatsApp Style */
.table {
    font-size: 0.85rem;
    color: #3B4A54;
}

.table thead th {
    background: #F0F2F5;
    border: none;
    color: #3B4A54;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 6px 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.table tbody td {
    padding: 4px 5px;
    border-bottom: 1px solid #f0f2f5;
    color: #3B4A54;
    vertical-align: middle;
    line-height: 1.3;
}

.table tbody tr:hover {
    background: #F7F8FA;
}

.entry-form-compact .btn {
    height: 32px;
    padding: 0.25rem 0.75rem;
    font-size: 13px;
}

.product-info-compact {
    background: #f8f9fa;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #e9ecef;
}

.product-info-compact small {
    font-size: 10px;
    color: #6c757d;
}

.product-info-compact strong {
    font-size: 12px;
}

.item-total-compact {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #c3e6cb;
}

.item-total-compact small {
    display: block;
    font-size: 10px;
    color: #155724;
}

.item-total-compact strong {
    display: block;
    font-size: 14px;
    color: #155724;
    font-weight: 700;
}

.customer-balance-compact {
    background: #fff3cd;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ffc107;
    margin-top: 8px;
    font-size: 12px;
}

.customer-balance-compact small {
    font-size: 11px;
    display: block;
    color: #856404;
}

.customer-balance-compact strong {
    font-size: 13px;
    display: block;
    font-weight: 700;
}

/* Compact Cart Table */
.cart-table-compact {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.cart-table-compact table {
    font-size: 12px;
}

.cart-table-compact thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    font-weight: 700;
    font-size: 11px;
    padding: 6px 4px;
    border-bottom: 2px solid #dee2e6;
}

.cart-table-compact tbody td {
    padding: 6px 4px;
    vertical-align: middle;
    font-size: 12px;
}

/* Compact Payment Section */
.payment-compact .input-group-text {
    font-size: 11px;
    padding: 0.25rem 0.5rem;
    min-width: 70px;
}

.compact-label {
    font-size: 11px;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

/* Compact Totals */
.totals-compact table {
    font-size: 12px;
}

.totals-compact table td {
    padding: 4px 6px;
}

.compact-input {
    height: 28px;
    font-size: 12px;
    padding: 0.25rem 0.5rem;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 8px;
}

.card-body {
    padding: 10px 12px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    padding: 8px 12px;
}

.card-header h6 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

/* Entry Form */
.entry-form {
    background: #ffffff;
}

/* Price Type Selector */
#priceTypeSelector {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#priceTypeSelector button {
    font-size: 12px;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    border-width: 2px;
    transition: all 0.2s ease;
}

#priceTypeSelector button.active {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    font-weight: 700;
}

#priceTypeSelector button:hover:not(.active) {
    transform: translateY(-1px);
}

#priceTypeSelector button.btn-outline-info.active {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

#priceTypeSelector button.btn-outline-success.active {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

#priceTypeSelector button.btn-outline-warning.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

#priceTypeSelector button.btn-outline-danger.active {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.entry-form input:focus,
.entry-form select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.entry-form .form-control-lg {
    height: 36px;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
}

.entry-form .form-control-sm {
    height: 34px;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
}

.entry-form label {
    font-size: 11px;
    margin-bottom: 2px;
    font-weight: 600;
}

.entry-form #currentItemTotal {
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

/* Product Name Label */
.product-name-label {
    font-size: 13px;
    line-height: 1.4;
    padding: 6px 8px;
}

.product-name-label #productName {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

/* Compact layout for mobile */
@media (max-width: 768px) {
    .entry-form .form-control-sm {
        height: 34px;
        font-size: 14px;
        padding: 4px 6px;
    }
    
    .entry-form label {
        font-size: 10px;
        margin-bottom: 1px;
    }
    
    .entry-form #currentItemTotal {
        font-size: 18px;
    }
    
    .product-name-label {
        font-size: 13px;
    }
    
    .product-name-label #productName {
        font-size: 14px;
    }
}

/* Suggestions Box - Unified for Product and Customer */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #25D366;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    margin-top: 4px;
}

/* Product Suggestion Items */
.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #ffffff;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #E8F5E9;
    color: #1B5E20;
    transform: translateX(3px);
    border-left: 4px solid #25D366;
    padding-left: 8px;
}

.suggestion-code {
    font-weight: 700;
    color: #25D366;
    font-size: 13px;
    min-width: 60px;
    flex-shrink: 0;
}

.suggestion-item:hover .suggestion-code,
.suggestion-item.active .suggestion-code {
    color: #1B5E20;
}

.suggestion-name {
    font-size: 12px;
    color: #3B4A54;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item:hover .suggestion-name,
.suggestion-item.active .suggestion-name {
    color: #1B5E20;
    font-weight: 600;
}

.suggestion-stock {
    font-size: 11px;
    color: #25D366;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.suggestion-stock.low {
    color: #dc3545;
}

.suggestion-item:hover .suggestion-stock,
.suggestion-item.active .suggestion-stock {
    color: #2E7D32;
}

.suggestion-item:hover .suggestion-stock.low,
.suggestion-item.active .suggestion-stock.low {
    color: #c62828;
}

.suggestion-mrp {
    font-size: 11px;
    color: #667781;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
    text-decoration: line-through;
}

.suggestion-item:hover .suggestion-mrp,
.suggestion-item.active .suggestion-mrp {
    color: #558B2F;
}

.suggestion-rate {
    font-weight: 700;
    color: #25D366;
    font-size: 14px;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.suggestion-item:hover .suggestion-rate,
.suggestion-item.active .suggestion-rate {
    color: #1B5E20;
    font-size: 15px;
}

/* Customer Suggestion Items */
.customer-suggestion-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    background: #ffffff;
    transition: background 0.2s ease, color 0.2s ease;
}

.customer-suggestion-item:last-child {
    border-bottom: none;
}

.customer-suggestion-item:hover,
.customer-suggestion-item.active {
    background: #ecf2ff;
    color: #1a237e;
}

/* Supplier Suggestion Items */
.supplier-suggestion-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    background: #ffffff;
    transition: background 0.2s ease, color 0.2s ease;
}

.supplier-suggestion-item:last-child {
    border-bottom: none;
}

.supplier-suggestion-item:hover,
.supplier-suggestion-item.active {
    background: #ecf2ff;
    color: #1a237e;
}

.customer-name-only {
    display: block;
}

/* Cart Table */
.cart-table-container {
    max-height: 500px;
    overflow-y: auto;
}

#cartTable {
    font-size: 12px;
    margin-bottom: 0;
}

#cartTable thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    padding: 6px 5px;
    border-bottom: 2px solid #dee2e6;
    vertical-align: middle;
    line-height: 1.2;
}

#cartTable tbody td {
    padding: 4px 5px;
    vertical-align: middle;
    line-height: 1.3;
    font-size: 12px;
}

#cartTable tbody tr {
    transition: all 0.2s;
    cursor: pointer;
}

#cartTable tbody tr:hover {
    background-color: #e3f2fd !important;
    transform: scale(1.005);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Selected row style */
#cartTable tbody tr.selected {
    background-color: #bbdefb !important;
    border-left: 4px solid #2196f3;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3);
    font-weight: 600;
}

/* Alternating row colors for better readability */
#cartTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#cartTable tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.cart-item-code {
    font-weight: 700;
    color: #667eea;
    font-size: 11px;
}

.cart-item-name {
    color: #333;
    font-size: 12px;
    line-height: 1.3;
}

.btn-delete-item {
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.2;
}

/* Editable Cart Inputs */
.cart-rate-input,
.cart-qty-input {
    border: 1px solid #e0e0e0;
    font-weight: 600;
    padding: 4px 6px;
    height: 28px;
    width: 100%;
    min-width: 80px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    text-align: right;
    font-size: 12px;
    line-height: 1.2;
}

.cart-qty-input {
    min-width: 70px;
}

.cart-rate-input:focus,
.cart-qty-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.15rem rgba(102, 126, 234, 0.25);
    background-color: #fffef5;
}

.cart-rate-input:hover,
.cart-qty-input:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* Input group for rate with currency symbol */
#cartTable .input-group {
    width: 100%;
}

#cartTable .input-group-text {
    padding: 4px 6px;
    font-size: 11px;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    font-weight: 600;
    min-width: 28px;
    line-height: 1.2;
}

#cartTable .input-group-prepend .input-group-text {
    border-right: none;
}

#cartTable .input-group .cart-rate-input {
    border-left: none;
}

/* Empty Cart */
.empty-cart i {
    color: #ccc;
}

/* Totals Section - Legacy (Keep for backwards compatibility) */
.total-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 8px;
}

.total-section-compact {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px solid #4e73df;
}

.total-section-compact table td {
    padding: 4px 8px;
    font-size: 14px;
}

.total-section-compact .bg-light-green {
    background-color: #d4edda;
}

.total-section-compact input#paymentAmount {
    height: 32px;
    font-size: 15px;
}

.total-section .h5,
.total-section .h3 {
    font-family: 'Courier New', monospace;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

#saveSale:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

#saveSale:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Keyboard Focus Indicators */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 3px solid #667eea !important;
    outline-offset: 2px;
}

/* Customer Balance Display */
#customerBalanceDisplay {
    animation: fadeIn 0.5s;
}

/* Payment Input Section */
.payment-input-section {
    animation: fadeIn 0.5s;
}

.payment-input-section .input-group-text {
    font-weight: bold;
    font-size: 16px;
}

.payment-input-section input[type="number"] {
    font-weight: bold;
    font-size: 18px;
}

.payment-input-section input[type="number"]:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

#remainingBalance {
    font-family: 'Courier New', monospace;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styling */
@media print {
    .pos-header,
    .card-header,
    button,
    .btn,
    .form-group {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    #cartTable {
        font-size: 12px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pos-container {
        padding: 10px;
    }

    .pos-header-logo {
        max-height: 60px;
    }
    
    .shop-title {
        font-size: 18px;
    }
    
    .shop-subtitle,
    .shop-contact {
        font-size: 11px;
    }
    
    .cart-table-container {
        max-height: 300px;
    }
    
    .entry-form .form-control-lg {
        height: 42px;
        font-size: 14px;
    }
    
    /* Mobile Cart Table - Stacked Layout */
    #cartTable thead {
        display: none;
    }
    
    #cartTable tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        padding: 8px;
        background: #fff;
    }
    
    #cartTable tbody td {
        display: block;
        text-align: left !important;
        padding: 4px 6px;
        border: none;
    }
    
    /* Row 1: Serial + Product Name + Delete */
    #cartTable tbody td:nth-child(1) {
        display: inline-block;
        width: 10%;
        font-weight: bold;
        font-size: 18px;
        color: #667eea;
        vertical-align: top;
    }
    
    #cartTable tbody td:nth-child(2),
    #cartTable tbody td:nth-child(3) {
        display: none; /* Hide product code, show only name */
    }
    
    #cartTable tbody td:nth-child(3) {
        display: inline-block !important;
        width: 70%;
        font-size: 14px;
        font-weight: bold;
        padding-left: 0;
        vertical-align: top;
    }
    
    #cartTable tbody td:nth-child(7) {
        display: block;
        width: 18%;
        text-align: right !important;
        float: right;
        margin-top: -26px;
    }
    
    #cartTable tbody td:nth-child(7) .btn-delete-item {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Row 2: Rate, Qty, Amount in 3 columns */
    #cartTable tbody td:nth-child(4),
    #cartTable tbody td:nth-child(5),
    #cartTable tbody td:nth-child(6) {
        display: inline-block;
        width: 33.33%;
        text-align: center !important;
        padding: 8px 4px 4px 4px;
        margin-top: 5px;
        border-top: 1px solid #f0f0f0;
    }
    
    #cartTable tbody td:nth-child(4):before {
        content: 'விலை';
        display: block;
        font-size: 10px;
        color: #999;
        margin-bottom: 4px;
        font-weight: normal;
    }
    
    #cartTable tbody td:nth-child(5):before {
        content: 'அளவு';
        display: block;
        font-size: 10px;
        color: #999;
        margin-bottom: 4px;
        font-weight: normal;
    }
    
    #cartTable tbody td:nth-child(6):before {
        content: 'மொத்தம்';
        display: block;
        font-size: 10px;
        color: #999;
        margin-bottom: 4px;
        font-weight: normal;
    }
    
    #cartTable tbody td:nth-child(4) .input-group {
        font-size: 13px;
    }
    
    #cartTable tbody td:nth-child(4) .input-group-text {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    #cartTable tbody td:nth-child(4) .cart-rate-input,
    #cartTable tbody td:nth-child(5) .cart-qty-input {
        font-size: 13px;
        padding: 4px;
        height: 30px;
    }
    
    #cartTable tbody td:nth-child(6) {
        font-weight: bold;
        font-size: 14px;
        color: #28a745;
    }
    
    /* Hide empty cart message column span issue */
    #cartTable tbody tr.empty-cart {
        padding: 20px;
    }
    
    #cartTable tbody tr.empty-cart td {
        display: table-cell !important;
        text-align: center !important;
        width: 100%;
    }
    
    #cartTable tbody tr.empty-cart td:before {
        display: none;
    }
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: successPulse 0.3s ease-in-out;
}

/* Scrollbar Styling */
.cart-table-container::-webkit-scrollbar,
.suggestions-box::-webkit-scrollbar {
    width: 8px;
}

.cart-table-container::-webkit-scrollbar-track,
.suggestions-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-table-container::-webkit-scrollbar-thumb,
.suggestions-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.cart-table-container::-webkit-scrollbar-thumb:hover,
.suggestions-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Notification Toast Animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Payment Methods Styling */
.payment-methods-container {
    position: relative;
}

.payment-method-row {
    transition: all 0.2s ease;
}

.payment-method-row:hover {
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.payment-method-row input[type="number"] {
    font-size: 14px;
    font-weight: 700;
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
}

.payment-method-row input[type="number"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.15rem rgba(102, 126, 234, 0.25);
    background-color: #fffef5;
}

.payment-method-row input[type="number"]:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.payment-method-select,
.payment-method-amount {
    font-size: 13px;
}

.btn-remove-payment {
    padding: 2px 6px;
    font-size: 12px;
}

.payment-methods-container::-webkit-scrollbar {
    width: 6px;
}

.payment-methods-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.payment-methods-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.payment-methods-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================= */
/* ULTRA COMPACT TOTALS - SINGLE LINE DESIGN */
/* ============================================= */

.ultra-compact-totals {
    background: #fff;
    border: 1px solid #d1d3e2;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Single Line Rows - Enhanced Padding */
.uc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    min-height: 30px;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.15s;
}

.uc-row:hover {
    background: #f8f9fc;
}

.uc-row:last-of-type {
    border-bottom: none;
}

/* Labels - Enhanced Readability */
.uc-label {
    font-size: 13px;
    color: #5a5c69;
    font-weight: 600;
    flex-shrink: 0;
}

.uc-label-bold {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 700;
    flex-shrink: 0;
}

/* Values - Enhanced Readability */
.uc-value {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    text-align: right;
}

.uc-value-large {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* Colored Rows */
.uc-gst {
    background: linear-gradient(90deg, #e7f3ff 0%, #f8fbff 100%);
    border-left: 3px solid #4e73df;
}

.uc-discount {
    background: linear-gradient(90deg, #fff9e6 0%, #fffef8 100%);
    border-left: 3px solid #ffc107;
}

.uc-major {
    background: linear-gradient(90deg, #d4edda 0%, #f0f8f1 100%);
    border-left: 3px solid #28a745;
    border-top: 1px solid #c3e6cb;
    border-bottom: 1px solid #c3e6cb;
}

.uc-major .uc-value-large {
    color: #28a745;
}

.uc-outstanding {
    background: linear-gradient(90deg, #f8d7da 0%, #fef5f6 100%);
    border-left: 3px solid #dc3545;
    border-top: 1px solid #f5c6cb;
    border-bottom: 1px solid #f5c6cb;
}

.uc-outstanding .uc-value-large {
    color: #dc3545;
}

.uc-payment {
    background: linear-gradient(90deg, #d1ecf1 0%, #f0f9fb 100%);
    border-left: 3px solid #17a2b8;
    padding: 5px 10px;
}

.uc-remaining {
    background: linear-gradient(90deg, #fff3cd 0%, #fffef0 100%);
    border-left: 3px solid #ff9800;
    border-top: 2px solid #ffc107;
    padding: 5px 10px;
}

/* Inline Groups (for buttons + inputs on same line) */
.uc-inline-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.uc-hint {
    font-size: 11px;
    color: #858796;
    font-style: italic;
    white-space: nowrap;
}

/* Toggle Buttons */
.uc-toggle .uc-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #d1d3e2;
    background: #fff;
    color: #5a5c69;
    transition: all 0.2s;
}

.uc-toggle .uc-btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.uc-toggle .uc-btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.uc-toggle .uc-btn.active {
    background: #25D366;
    border-color: #25D366;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 211, 102, 0.3);
}

.uc-toggle .uc-btn:hover:not(.active) {
    background: #f8f9fc;
    border-color: #25D366;
}

/* Mini Toggle Buttons */
.uc-toggle-mini .uc-btn-xs {
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e3e6f0;
    background: #fff;
    color: #5a5c69;
    transition: all 0.2s;
}

.uc-toggle-mini .uc-btn-xs:not(:last-child) {
    border-right-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.uc-toggle-mini .uc-btn-xs:not(:first-child) {
    border-left-width: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.uc-toggle-mini .uc-btn-xs.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
    z-index: 1;
    border-width: 1px;
}

.uc-toggle-mini .uc-btn-xs:hover:not(.active) {
    background: #fff3cd;
    border-color: #ffc107;
    z-index: 1;
    border-width: 1px;
}

/* Inputs */
.uc-input {
    width: 80px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    border: 1px solid #ffc107;
    border-radius: 3px;
    background: #fff;
    color: #2c3e50;
    height: 28px;
}

.uc-input:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.15);
    background: #fffef5;
}

.uc-disc-val {
    font-size: 12px;
    font-weight: 700;
    color: #28a745;
    white-space: nowrap;
}

.uc-input-pay {
    width: 120px;
    padding: 5px 10px;
    font-size: 16px;
    font-weight: 800;
    text-align: right;
    border: 2px solid #17a2b8;
    border-radius: 4px;
    background: #fff;
    color: #155724;
    font-family: 'Courier New', monospace;
    height: 32px;
}

.uc-input-pay:focus {
    outline: none;
    border-color: #138496;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.15);
    background: #f0feff;
}

/* Save Button */
.uc-btn-save {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border: none;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uc-btn-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #2e59d9 0%, #1a3fa1 100%);
    box-shadow: 0 3px 8px rgba(78, 115, 223, 0.3);
}

.uc-btn-save:active:not(:disabled) {
    transform: translateY(1px);
}

.uc-btn-save:disabled {
    background: linear-gradient(135deg, #b0b0b0 0%, #9a9a9a 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.uc-btn-save i {
    margin-right: 6px;
    font-size: 14px;
}

/* Mobile Toggle Button */
.mobile-details-toggle {
    display: none;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.mobile-details-toggle i {
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.mobile-details-toggle.active i {
    transform: rotate(180deg);
}

.mobile-details-toggle:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7430 100%);
}

/* Mobile Totals Container */
.mobile-totals-wrapper {
    position: relative;
}

.mobile-totals-content {
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

/* Desktop - Always show all content */
@media (min-width: 769px) {
    .mobile-details-toggle {
        display: none !important;
    }
    
    .mobile-totals-content {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Move summary below cart on mobile - Use flexbox ordering */
    .pos-container .row {
        display: flex;
        flex-direction: column;
    }
    
    .pos-summary-section {
        order: 2;
    }
    
    .pos-cart-section {
        order: 1;
    }
    
    /* Show mobile toggle button */
    .mobile-details-toggle {
        display: block;
    }
    
    /* Hide details by default on mobile */
    .mobile-totals-content {
        max-height: 0;
        opacity: 0;
    }
    
    /* Show details when expanded */
    .mobile-totals-content.expanded {
        max-height: 1500px;
        opacity: 1;
    }
    
    /* Keep save button visible */
    .uc-btn-save {
        display: block !important;
        border-radius: 0 0 5px 5px;
    }
    
    .uc-row {
        padding: 3px 8px;
        min-height: 26px;
    }
    
    .uc-label,
    .uc-label-bold {
        font-size: 11px;
    }
    
    .uc-value {
        font-size: 12px;
    }
    
    .uc-value-large {
        font-size: 15px;
    }
    
    .uc-input {
        width: 60px;
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .uc-input-pay {
        width: 90px;
        font-size: 14px;
        padding: 4px 6px;
    }
    
    .uc-btn-save {
        padding: 6px;
        font-size: 11px;
    }
    
    .uc-toggle .uc-btn,
    .uc-toggle-mini .uc-btn-xs {
        padding: 1px 4px;
        font-size: 8px;
    }
    
    .uc-hint {
        font-size: 7px;
    }
    
    .uc-disc-val {
        font-size: 8px;
    }
    
    /* Mobile Bill Amount Card - More Prominent */
    .pos-summary-section > .card:last-child {
        margin-top: 15px;
        position: sticky;
        top: 10px;
        z-index: 100;
    }
    
    .pos-summary-section > .card:last-child .card-body {
        padding: 12px !important;
    }
    
    .pos-summary-section > .card:last-child .uc-major {
        padding: 12px !important;
    }
    
    .pos-summary-section > .card:last-child .uc-label-bold {
        font-size: 15px !important;
    }
    
    .pos-summary-section > .card:last-child .uc-value-large {
        font-size: 20px !important;
    }
    
    /* Mobile Save Button Enhancement */
    .uc-btn-save {
        padding: 14px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
    }
    
    /* Mobile Details Toggle Enhancement */
    .mobile-details-toggle {
        margin-bottom: 0;
        box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    }
    
    .mobile-details-toggle:active {
        transform: scale(0.98);
    }
}

/* ============================================= */
/* Sales Enhancements: Discounts & Loyalty */
/* ============================================= */

/* Bill Discount Section - Legacy Styles */
.bg-light-yellow {
    background-color: #fff9e6 !important;
}

/* Points Discount Star Button */
#billDiscPoints {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Points Redemption Modal */
#pointsRedemptionModal .modal-content {
    border: 3px solid #ffc107;
}

#pointsRedemptionModal .alert-warning {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe8a1 100%);
    border: 2px solid #ffc107;
}

#redeemPointsInput {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #ffc107;
}

#redeemPointsInput:focus {
    border-color: #ff9800;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

#redeemDiscountAmount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #28a745;
}

#btnApplyPointsDiscount {
    font-weight: bold;
    padding: 0.5rem 1.5rem;
}

#btnApplyPointsDiscount:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Discount Styling */
#productDiscount,
#productDiscountType {
    border: 1px solid #17a2b8;
}

#productFinalRate {
    background-color: #e7f5ff;
    font-weight: bold;
    color: #0056b3;
}

/* Loyalty Points Badge */
#btnLoyaltyPoints {
    position: relative;
}

#btnLoyaltyPoints.has-points::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    border: 1px solid white;
}

/* Loyalty Modal Styling */
#loyaltyPointsModal .sticky-top {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

#loyaltyPointsModal .card {
    transition: all 0.2s;
}

#loyaltyPointsModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Sales Type Dropdown */
#salesType {
    font-weight: 600;
    border: 2px solid #667eea;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

#salesType:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Customer Info with Loyalty */
#customerBalanceDisplay .border-right {
    border-right: 2px solid rgba(0,0,0,0.1) !important;
}

#customerLoyalty i {
    color: #ffc107;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Discount Column in Cart */
#cartTable th:nth-child(5),
#cartTable td:nth-child(5) {
    color: #dc3545;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #billDiscount,
    #productDiscount {
        font-size: 0.875rem;
    }
    
    .btn-group .btn-outline-secondary {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* GST Type Toggle Styling - Legacy */
.bg-light-blue {
    background-color: #e7f3ff !important;
}

/* ============================================= */
/* Modal Z-Index Fix for Nested Modals */
/* ============================================= */

/* Transport GST Modal should appear in front of Shipping Modal */
#transportGSTModal {
    z-index: 1060 !important;
}

#transportGSTModal .modal-backdrop {
    z-index: 1055 !important;
}

/* Shipping Modal default z-index */
#shippingDetailsModal {
    z-index: 1050;
}

/* General fix for nested modals */
.modal.show ~ .modal-backdrop {
    z-index: 1040;
}

.modal.show ~ .modal.show {
    z-index: 1060;
}

.modal.show ~ .modal.show ~ .modal-backdrop {
    z-index: 1055;
}

/* ============================================= */
/* Modal Headers - WhatsApp Green Border */
/* ============================================= */

.modal-header {
    border-bottom: 3px solid #25D366 !important;
}

.modal-title {
    color: #3B4A54 !important;
}

.modal-title i {
    color: #25D366 !important;
}

/* ============================================= */
/* Section Headers - WhatsApp Green Accents */
/* ============================================= */

h6.mb-2 i,
h6.mb-0 i {
    color: #25D366 !important;
}

/* ============================================= */
/* Barcode Scan Mode Toggle Switch */
/* ============================================= */

.barcode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.barcode-toggle-wrapper label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
    margin-bottom: 0;
    white-space: nowrap;
}

.custom-control-switch .custom-control-label {
    font-size: 0.75rem;
    padding-left: 0.5rem;
    cursor: pointer;
}

.custom-control-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #28a745;
    border-color: #28a745;
}

.custom-control-switch .custom-control-label::before {
    background-color: #6c757d;
    border-radius: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.custom-control-switch .custom-control-label::after {
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}

