/* -------------------- POS CHECKOUT INTERFACE -------------------- */
/* Customer Selection Panel (above the cart) */
.pos-right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pos-customer-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.pos-customer-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.pos-customer-panel-header svg {
    width: 18px;
    height: 18px;
    stroke: var(--brand-primary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.pos-customer-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.pos-customer-select-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-customer-select-row select {
    flex-grow: 1;
}

.pos-customer-select-input {
    padding: 9px 12px;
}

.btn-new-customer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-new-customer:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-new-customer svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* Points display */
.pos-points-display {
    display: none;
    margin-top: 10px;
}

/* Unpaid cart list tabs */
.pos-unpaid-carts-container {
    display: none;
}

.unpaid-carts-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.unpaid-carts-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
}

.cart-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: 1px solid var(--border-light);
    background-color: var(--bg-base);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.cart-tab:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

.cart-tab.active {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: var(--brand-light);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.cart-tab-close {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cart-tab-close:hover {
    opacity: 1;
}

.btn-add-cart-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px dashed var(--border-focus);
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: var(--transition-smooth);
    font-weight: 400;
}

.btn-add-cart-tab:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

.pos-no-customer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: #92400e;
    margin-top: 12px;
}

.pos-no-customer-hint svg {
    width: 16px;
    height: 16px;
    stroke: #d97706;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.pos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: flex-start;
}

@media (min-width: 992px) {
    .pos-grid {
        grid-template-columns: 1.3fr 1fr;
    }
}

.catalog-browser {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.pos-search-bar {
    margin-bottom: 16px;
}

.catalog-filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-tag {
    background-color: var(--bg-base);
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-tag:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.filter-tag.active {
    background-color: var(--brand-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
}

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.pos-item-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.pos-item-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pos-item-code {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 4px;
    font-family: monospace;
}

.pos-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
    line-height: 1.4;
}

.pos-item-price-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
}

.pos-item-original-price {
    font-size: 11px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.pos-item-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-error);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.checkout-cart {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 680px;
}

.pos-checkout-cart-hidden {
    display: none;
}

.cart-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 280px;
    margin-bottom: 16px;
    padding-right: 4px;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-light);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-item-unit-price {
    font-size: 11px;
    color: var(--text-tertiary);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background-color: var(--bg-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.qty-btn:hover {
    background-color: var(--border-light);
    color: var(--text-primary);
}

.qty-val {
    font-size: 13px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.cart-item-total {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    min-width: 60px;
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-tertiary);
    text-align: center;
}

.cart-empty-state svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    margin-bottom: 12px;
}

.cart-empty-title {
    font-size: 13px;
    font-weight: 600;
}

.cart-empty-subtitle {
    font-size: 11.5px;
    margin-top: 2px;
}

.cart-customer-selector {
    margin-bottom: 16px;
}

.block-label {
    margin-bottom: 4px;
    display: block;
}

.select-input-padding {
    padding: 8px 12px;
}

.cart-calculations {
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.num-input-sm {
    width: 70px;
    padding: 4px 8px;
    text-align: right;
    font-size: 12px;
}

.calc-row-total {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    font-size: 16px;
    font-weight: 800;
    color: var(--brand-primary);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

/* POS empty search result */
.pos-empty-search {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

/* POS points row (hidden by default, shown via JS) */
.pos-points-row-hidden {
    display: none;
}

.pos-points-group-compact {
    margin-top: 0;
}

.pos-points-input-sm {
    width: 60px;
}

.pos-apply-btn-sm {
    padding: 4px 8px;
}

.pos-points-discount-hidden {
    display: none;
}

/* Cart quantity input in template */
.cart-qty-input {
    width: 48px;
    text-align: center;
    padding: 2px;
    height: 28px;
}

/* -------------------- INVOICE MANAGEMENT -------------------- */
.pos-invoice-management-card {
    margin-top: 1rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.pos-invoice-header {
    align-items: flex-start;
    padding: 24px;
    background-color: transparent;
    border-bottom: 1px solid #f3f4f6;
}

.pos-invoice-filters {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.pos-invoice-filters-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pos-filter-date {
    width: 140px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    color: #374151;
    font-size: 13px;
}

.pos-filter-select {
    width: 150px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    color: #374151;
    font-size: 13px;
    background-color: #fff;
}

.pos-empty-search-td {
    padding: 2rem;
}

.pos-invoice-actions {
    gap: 3px;
    display: flex;
    justify-content: end;
}

/* Modern Table Styles for Invoice */
.custom-table.pos-invoice-table th {
    background-color: transparent;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    font-weight: 700;
    font-size: 13px;
    padding: 16px 20px;
}

.custom-table.pos-invoice-table td {
    padding: 16px 20px;
    border-bottom: none;
    color: #4b5563;
    font-size: 14px;
}

.pos-invoice-table tbody tr {
    background-color: transparent;
    transition: background-color 0.2s;
}
.pos-invoice-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges */
.pos-invoice-table .status-badge {
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pos-invoice-table .status-badge.badge-sale {
    background-color: #fef3c7;
    color: #d97706;
    border: none;
}

.pos-invoice-table .status-badge.badge-active {
    background-color: #d1fae5;
    color: #059669;
    border: none;
}

/* Action Icons */
.pos-invoice-table .btn-icon-edit {
    background-color: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.pos-invoice-table .btn-icon-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}
.pos-invoice-table .btn-icon-edit svg {
    stroke: #ffffff;
}

.pos-invoice-table .btn-icon-delete {
    background-color: #ffffff;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.pos-invoice-table .btn-icon-delete:hover {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}
.pos-invoice-table .btn-icon-delete svg {
    stroke: currentColor;
}

.pos-invoice-table .btn-icon-receipt {
    background-color: #eff6ff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.pos-invoice-table .btn-icon-receipt:hover {
    background-color: #dbeafe;
    color: #2563eb;
    border-color: #93c5fd;
}

/* Base styles for new pos-clear-btn */
.pos-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media (max-width: 768px) {
    .pos-grid {
        gap: 12px;
    }
    
    .catalog-browser,
    .pos-customer-panel,
    .checkout-cart {
        padding: 14px;
        overflow: hidden;
    }
    
    .catalog-filter-tags {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        gap: 6px;
    }
    .catalog-filter-tags::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tag {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .pos-items-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .cart-calculations {
        padding: 10px 12px;
    }
    
    .cart-item-row {
        gap: 8px;
        padding: 8px 0;
    }
    
    .cart-item-title {
        font-size: 12px;
    }
    
    .cart-qty-input {
        width: 40px;
    }
    
    .cart-item-total {
        font-size: 12.5px;
        min-width: 50px;
    }
}
