﻿/* ===================== ENHANCED RESPONSIVE STYLES - RECEIPT MANAGEMENT SYSTEM ===================== */

/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E65A24;
    --primary-dark: #c94a1a;
    --primary-light: #F07030;
    --secondary-color: #16295A;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f9fafb;
    --dark-color: #1f2937;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 95px;
}

html {
    scroll-padding-top: var(--nav-height);
}

/* Global Button & Link Reset - Prevent underlines from theme CSS (fixes Astra theme underline issue) */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
a[role="button"],
.rs-btn,
.rs-primary-btn,
.rs-secondary-btn,
.rs-qty-btn,
.rs-cart-btn,
.rs-icon-btn,
.rs-print-btn,
.rs-action-btn,
.rs-logout-btn {
    text-decoration: none !important;
}

button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
a[role="button"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Table Scrollable Indicators */
.rs-table-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.rs-table-scroll-indicator {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(230, 90, 36, 0.1), transparent);
    pointer-events: none;
    z-index: 5;
    border-radius: 0 0 8px 8px;
}

.rs-table-scroll-hint {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 25px;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 6;
    animation: slide-hint 1.5s ease-in-out infinite;
}

@keyframes slide-hint {
    0%, 100% { transform: translateX(0); opacity: 0.8; }
    50% { transform: translateX(-5px); opacity: 1; }
}

@media (max-width: 768px) {
    .rs-table-scroll-indicator {
        display: block;
    }
    
    .rs-table-scroll-hint {
        display: block;
    }
}

/* Enhanced Table Container Styles */
.rs-products-table-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.rs-invoice-table-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Full Screen Container */
.rs-fullscreen-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

.rs-main-content {
    flex: 1;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background: var(--gray-50);
    padding-top: 80px;
    margin-top: 0;
}

/* Navigation Styles - Enhanced for Mobile */
.rs-navigation {
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-color);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 100%;
}

.rs-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.95) 100%);
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rs-nav-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rs-nav-actions {
    display: flex;
    gap: 0.75rem;
}

.rs-logout-btn {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
}

.rs-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rs-nav-links {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.97) 100%);
    width: 100%;
    box-shadow: inset 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.rs-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: auto;
}

.rs-nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.rs-nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(230, 90, 36, 0.3);
}

.rs-nav-icon {
    font-size: 1.15rem;
}

.rs-nav-text {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Page Container - Full Width Mobile */
.rs-page-container {
    padding: 1.5rem;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    box-sizing: border-box;
    background: var(--gray-50);
    padding-top: 1.5rem;
}

/* Card Styles - Full Width */
.rs-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
}

.rs-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Form Styles - Optimized for Mobile */
.rs-product-form {
    padding: 1.5rem !important;
}

.rs-form-group {
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.rs-form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    text-align: left;
    width: 100%;
}

.rs-form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-size: 0.85rem;
    line-height: 1.4;
    width: 100%;
    text-align: left;
}

.rs-form-group input,
.rs-form-group textarea,
.rs-form-group select {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark-color);
    box-sizing: border-box;
    font-family: inherit;
    min-height: 44px;
    overflow: visible;
    text-overflow: clip;
    text-align: left;
}

.rs-form-group input:focus,
.rs-form-group textarea:focus,
.rs-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 90, 36, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    color: var(--dark-color);
}

.rs-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.rs-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf-8,<svg fill="%23E65A24" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 20px;
    padding-right: 2.5rem;
    color-scheme: light dark;
}

.rs-form-group select option {
    background: var(--white);
    color: var(--dark-color);
    padding: 0.5rem;
    font-weight: normal;
}

.rs-form-group select option:checked {
    background: var(--primary-light);
    background-color: var(--primary-light);
    color: var(--white);
}

.rs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

.rs-form-row .rs-form-group {
    margin-bottom: 0;
}

/* Business Form Styles */
.rs-business-form {
    padding: 1.5rem;
}

.rs-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.rs-form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rs-logo-upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}

.rs-logo-input-wrapper {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.rs-logo-input-wrapper input {
    flex: 1;
}

.rs-upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.rs-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rs-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
    min-height: 200px;
}

.rs-logo-preview img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
}

.rs-logo-placeholder {
    color: var(--gray-400);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.rs-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
}

.rs-card-body {
    padding: 1.5rem;
}

.rs-primary-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.rs-primary-btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Message Styles */
.rs-success-message {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.rs-permission-warning {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.rs-error-message {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

/* Button Styles - Full Width Mobile */
.rs-primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.rs-pos-cart .rs-primary-btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.rs-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rs-primary-btn:active {
    transform: translateY(0);
}

.rs-secondary-btn {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.rs-secondary-btn:hover {
    background: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* POS System - Full Width Mobile */
.rs-pos-system {
    width: 100%;
    height: 100%;
    max-width: 100vw;
}

.rs-pos-container {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding-top: 0;
}

@media (max-width: 768px) {
    .rs-pos-container {
        padding-top: 40px;
    }
}

.rs-pos-section::-webkit-scrollbar {
    width: 6px;
}

.rs-pos-section::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.rs-pos-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
    border-radius: 6px;
}

.rs-pos-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 0.875rem 1rem;
    text-align: center;
    width: 100%;
}

.rs-pos-header h1 {
    margin: 0;
    font-size: 1.1rem;
}

.rs-pos-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.rs-pos-layout {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 1rem;
    min-height: 600px;
    width: 100%;
    padding: 1rem;
    background: var(--gray-50);
}

.rs-pos-section {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    background: var(--white);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 100%;
}

.rs-pos-section h3 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

/* Product Search Container */
.rs-search-container {
    margin-bottom: 1rem;
}

.rs-search-container input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rs-search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(230, 90, 36, 0.1), 0 4px 12px rgba(230, 90, 36, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

/* Products Grid - Responsive */
.rs-products-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    width: 100%;
    padding: 0;
}

.rs-product-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e0e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.rs-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.rs-product-card:hover::before {
    transform: scaleX(1);
}

.rs-product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(230, 90, 36, 0.15);
    transform: translateY(-4px);
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.rs-product-card.rs-out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.rs-product-name {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    word-break: break-word;
    line-height: 1.2;
}

.rs-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.4rem 0;
    font-family: 'Courier New', monospace;
}

/* Product Stock Indicator */
.rs-stock-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--success-color);
    color: var(--white);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Product Controls */
.rs-product-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #f0f4f8, #f8fafc);
    padding: 0.4rem;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rs-qty-btn {
    border: none;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 0.35rem;
    box-shadow: 0 2px 5px rgba(230, 90, 36, 0.2);
    text-decoration: none;
}

.rs-qty-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(230, 90, 36, 0.3);
}

/* Cart Section - Full Width */
.rs-pos-cart {
    padding: 1rem;
    background: var(--white);
    position: relative;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rs-pos-cart h3 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.rs-cart-list {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    width: 100%;
    background: var(--gray-50);
}

.rs-cart-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    font-size: 0.85rem;
}

.rs-cart-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.rs-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rs-cart-item-name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1rem;
}

.rs-cart-item-details {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.rs-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.rs-cart-btn {
    border: none;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 36px;
    padding: 0.4rem;
    text-decoration: none;
}

.rs-cart-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.08);
}

.rs-cart-qty {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 0.95rem;
    min-width: 40px;
    text-align: center;
}

/* Cart Totals */
.rs-cart-totals {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.rs-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
}

.rs-total-line.rs-grand-total {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-top: 0.4rem;
    border-bottom: none;
    font-size: 0.95rem;
    gap: 1rem;
}

.rs-total-line.rs-grand-total span {
    color: white;
}

/* Empty States */
.rs-empty-cart {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

/* Modal Styles */
.rs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.rs-modal.active {
    display: flex;
}

.rs-modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 95%;
    max-height: 95vh;
    overflow: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.rs-modal-large {
    max-width: 900px;
    width: 90%;
}

.rs-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--gray-500);
    z-index: 10;
}

.rs-modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.rs-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.rs-btn-primary {
    background: var(--primary-color);
    color: white;
}

.rs-btn-info {
    background: var(--info-color);
    color: white;
}

.rs-btn-success {
    background: var(--success-color);
    color: white;
}

.rs-btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.rs-btn:hover {
    transform: translateY(-2px);
}

/* Dashboard Styles */
.rs-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.rs-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.rs-stat-icon {
    font-size: 2.5rem;
}

.rs-stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.rs-stat-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.rs-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.rs-widget {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.rs-widget-header {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rs-widget-body {
    padding: 1.5rem;
}

/* Quick Actions */
.rs-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.rs-action-btn {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
}

.rs-action-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Products Table */
.rs-card-header {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    padding: 1.25rem;
    border-bottom: 2px solid var(--primary-dark);
}

.rs-card-header h2,
.rs-card-header h3 {
    color: white;
    margin: 0;
    font-size: 1.25rem;
}

.rs-card-header p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.rs-products-table-container {
    overflow-x: auto;
    width: 100%;
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) #e5e7eb;
}

.rs-products-table-container::-webkit-scrollbar {
    height: 6px;
}

.rs-products-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.rs-products-table-container::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.rs-products-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.rs-products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.rs-products-table th,
.rs-products-table td {
    padding: 1rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.rs-products-table th {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(230, 90, 36, 0.15);
}

.rs-products-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e5e7eb;
}

.rs-products-table tbody tr:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(230, 90, 36, 0.1);
}

.rs-products-table td {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 500;
}

.rs-product-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.rs-icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
    text-decoration: none;
}

.rs-icon-btn:hover {
    transform: scale(1.2);
}

/* Status Badges */
.rs-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rs-status-in {
    background: #d1fae5;
    color: #065f46;
}

.rs-status-low {
    background: #fef3c7;
    color: #78350f;
}

.rs-status-out {
    background: #fee2e2;
    color: #7f1d1d;
}

/* ===================== VERIFICATION PAGE STYLES ===================== */
.rs-verification-container {
    max-width: 700px;
    margin: 50px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.rs-verification-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.rs-verification-header {
    background: linear-gradient(135deg, #E65A24, #F07030);
    color: white;
    padding: 30px;
    text-align: center;
}

.rs-verification-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.rs-verification-header h2 {
    margin: 0;
    color: white;
}

.rs-verification-success {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    text-align: center;
    margin: 20px;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.rs-verification-error {
    background: #fee2e2;
    color: #7f1d1d;
    padding: 15px;
    text-align: center;
    margin: 20px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
}

.rs-verification-details {
    padding: 20px;
}

.rs-verification-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #E65A24;
}

.rs-verification-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rs-verification-table th,
.rs-verification-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rs-verification-table th {
    width: 35%;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.rs-verification-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.rs-print-btn {
    background: #E65A24;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    text-decoration: none;
}

.rs-print-btn:hover {
    background: #F07030;
    transform: translateY(-2px);
}

/* ===================== AUTHENTICATION STYLES ===================== */
.rs-fullscreen-auth {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
}

.rs-auth-container {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
}

.rs-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.rs-auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.rs-auth-header h2 {
    margin-bottom: 0.5rem;
}

.rs-auth-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.rs-auth-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.rs-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

/* ===================== RESPONSIVE BREAKPOINTS ===================== */
@media (max-width: 768px) {
    .rs-page-container {
        padding: 1rem;
        padding-top: 95px;
    }
    
    .rs-form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .rs-logo-upload-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rs-nav-links {
        gap: 0.5rem;
    }
    
    .rs-nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .rs-nav-text {
        display: inline;
    }
    
    .rs-pos-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rs-cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .rs-cart-item-controls {
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .rs-modal-actions {
        flex-direction: column;
    }
    
    .rs-btn {
        width: 100%;
    }
    
    .rs-dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .rs-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .rs-quick-actions {
        grid-template-columns: 1fr;
    }
    
    /* Products Grid - Mobile Responsive */
    .rs-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .rs-product-card {
        min-height: 160px;
        padding: 0.5rem;
    }
    
    .rs-product-name {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .rs-product-price {
        font-size: 0.9rem;
        margin: 0.3rem 0;
    }
    
    .rs-stock-indicator {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }
    
    .rs-invoices-table th,
    .rs-invoices-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .rs-products-table-container {
        padding: 1rem;
        border-radius: 8px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rs-products-table {
        min-width: 550px;
        scroll-snap-align: start;
    }
    
    .rs-products-table th,
    .rs-products-table td {
        padding: 11px 12px;
        font-size: 0.9rem;
    }
    
    .rs-products-table th {
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
    }
    
    .rs-products-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-products-table tbody tr {
        transition: background-color 0.2s ease;
    }
    
    .rs-products-table tbody tr:hover {
        background: #f0f9ff;
    }
    
    .rs-invoice-table-modern {
        min-width: 550px;
        scroll-snap-align: start;
    }
    
    .rs-invoice-table-modern th,
    .rs-invoice-table-modern td {
        padding: 11px 12px;
        font-size: 0.9rem;
    }
    
    .rs-invoice-table-modern th {
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
    }
    
    .rs-invoice-table-modern tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-invoice-table-modern tbody tr {
        transition: background-color 0.2s ease;
    }
    
    .rs-invoice-table-modern tbody tr:hover {
        background: #dbeafe;
    }
    
    /* Hide Scroll Indicators on Tablet and Above */
    .rs-sales-table-container::before,
    .rs-invoices-table-container::before,
    .rs-status-table-container::before {
        display: none !important;
    }
    
    /* Tablet: Sales Table */
    .rs-sales-table-container {
        padding: 1rem;
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    .rs-sales-table {
        min-width: 600px;
    }
    
    .rs-sales-table th,
    .rs-sales-table td {
        padding: 11px 12px;
        font-size: 0.9rem;
    }
    
    .rs-sales-table th {
        font-size: 0.8rem;
        font-weight: 700;
    }
    
    .rs-sales-table tbody tr:hover {
        background: #f0f9ff;
    }
    
    /* Tablet: Invoices Table */
    .rs-invoices-table-container {
        padding: 1rem;
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    .rs-invoices-table {
        min-width: 650px;
    }
    
    .rs-invoices-table th,
    .rs-invoices-table td {
        padding: 11px 12px;
        font-size: 0.9rem;
    }
    
    .rs-invoices-table th {
        font-size: 0.8rem;
        font-weight: 700;
        background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
        color: black;
    }
    
    .rs-invoices-table tbody tr:hover {
        background: #ede9fe;
    }
    
    /* Tablet: Status Table */
    .rs-status-table-container {
        padding: 1rem;
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    .rs-status-table {
        min-width: 620px;
    }
    
    .rs-status-table th,
    .rs-status-table td {
        padding: 11px 12px;
        font-size: 0.9rem;
    }
    
    .rs-status-table th {
        font-size: 0.8rem;
        font-weight: 700;
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    }
    
    .rs-status-table tbody tr:hover {
        background: #cffafe;
    }
    
    .rs-status-select {
        min-width: 100px;
        font-size: 0.7rem;
    }
    
    .rs-icon-btn {
        font-size: 1rem;
        padding: 0.25rem;
    }
    
    .rs-verification-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .rs-verification-table th,
    .rs-verification-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    .rs-verification-table th {
        font-size: 0.85rem;
    }
    
    .rs-verification-header {
        padding: 20px;
    }
    
    .rs-verification-icon {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .rs-page-container {
        padding-top: 95px;
    }
    
    .rs-nav-header h2 {
        font-size: 1rem;
    }
    
    .rs-logout-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Products Grid - Extra Small Mobile */
    .rs-products-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .rs-product-card {
        min-height: 150px;
        padding: 0.75rem;
    }
    
    .rs-product-name {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .rs-product-price {
        font-size: 0.9rem;
    }
    
    .rs-product-controls {
        padding: 0.3rem;
        gap: 0.25rem;
    }
    
    .rs-qty-btn {
        min-height: 28px;
        min-width: 28px;
        font-size: 0.8rem;
    }
    
    .rs-cart-totals {
        padding: 1rem;
    }
    
    .rs-total-line {
        font-size: 0.85rem;
    }
    
    .rs-modal-content {
        padding: 1rem;
    }
    
    .rs-auth-container {
        padding: 1.5rem;
    }
    
    .rs-business-form {
        padding: 1rem;
    }
    
    .rs-form-section {
        gap: 0.75rem;
    }
    
    .rs-logo-upload-container {
        gap: 0.75rem;
    }
    
    .rs-upload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .rs-logo-preview {
        min-height: 150px;
        padding: 1rem;
    }
    
    .rs-form-actions {
        flex-direction: column;
    }
    
    .rs-primary-btn,
    .rs-primary-btn-sm {
        width: 100%;
    }
    
    /* Mobile Table Styles */
    .rs-products-table-container {
        padding: 0.75rem;
        margin: 0 -1.5rem -1.5rem -1.5rem;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-radius: 0;
        position: relative;
        scroll-snap-type: x mandatory;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .rs-products-table {
        min-width: 500px;
        font-size: 0.85rem;
        scroll-snap-align: start;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    
    .rs-products-table th,
    .rs-products-table td {
        padding: 12px 14px;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .rs-products-table th {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
        z-index: 10;
        white-space: normal;
    }
    
    /* Zebra striping for better readability */
    .rs-products-table tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-products-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-products-table tbody tr {
        transition: all 0.2s ease;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-products-table tbody tr:active {
        background: #f0f9ff !important;
        box-shadow: inset 0 0 6px rgba(230, 90, 36, 0.15);
    }
    
    /* Table Scroll Indicators for Mobile */
    .rs-products-table-container::before {
        content: '👉 Swipe to Scroll';
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--primary-color);
        font-weight: 600;
        padding: 8px 0;
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        margin: -12px -12px 12px -12px;
        border-radius: 0;
        animation: slide-hint-mobile 2s ease-in-out infinite;
    }
    
    @keyframes slide-hint-mobile {
        0%, 100% { opacity: 0.8; transform: translateX(0); }
        50% { opacity: 1; transform: translateX(4px); }
    }
    
    /* Mobile Verification Table */
    .rs-verification-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        margin: 0 -1.5rem;
        padding: 0 1rem;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        scroll-snap-type: x mandatory;
    }
    
    .rs-verification-table {
        min-width: 420px;
        font-size: 0.85rem;
        scroll-snap-align: start;
    }
    
    .rs-verification-table th,
    .rs-verification-table td {
        padding: 10px 12px;
        text-align: left;
    }
    
    .rs-verification-table th {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .rs-verification-table tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-verification-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-verification-table tbody tr {
        transition: all 0.2s ease;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-verification-table tbody tr:active {
        background: #fef3c7 !important;
        box-shadow: inset 0 0 4px rgba(230, 90, 36, 0.15);
    }
    
    /* Mobile Invoice Table */
    .rs-invoice-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        margin: 0 -1.5rem;
        padding: 0 1rem;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-light) #f1f5f9;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        position: relative;
        scroll-snap-type: x mandatory;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .rs-invoice-table-container::-webkit-scrollbar {
        height: 5px;
    }
    
    .rs-invoice-table-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 3px;
    }
    
    .rs-invoice-table-container::-webkit-scrollbar-thumb {
        background: var(--primary-light);
        border-radius: 3px;
        box-shadow: inset 0 0 4px rgba(230, 90, 36, 0.3);
    }
    
    .rs-invoice-table-modern {
        min-width: 480px;
        scroll-snap-align: start;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    
    .rs-invoice-table-modern th,
    .rs-invoice-table-modern td {
        padding: 12px 14px;
        font-size: 0.85rem;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .rs-invoice-table-modern th {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
        z-index: 10;
        white-space: normal;
    }
    
    .rs-invoice-table-modern tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-invoice-table-modern tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-invoice-table-modern tbody tr {
        transition: all 0.2s ease;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-invoice-table-modern tbody tr:active {
        background: #dbeafe !important;
        box-shadow: inset 0 0 6px rgba(59, 130, 246, 0.15);
    }
    
    /* Table Scroll Indicators for Mobile */
    .rs-invoice-table-container::before {
        content: '👉 Swipe to View All';
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--primary-color);
        font-weight: 600;
        padding: 10px 0;
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        margin: -12px -12px 12px -12px;
        border-radius: 0;
        animation: slide-hint-mobile 2s ease-in-out infinite;
    }
    
    /* ===== ALL SALES TABLE ===== */
    .rs-sales-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        margin: 1.5rem -1.5rem;
        padding: 1rem;
        scroll-snap-type: x mandatory;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .rs-sales-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border-radius: 8px;
        scroll-snap-align: start;
        min-width: 600px;
    }
    
    .rs-sales-table th,
    .rs-sales-table td {
        padding: 1rem 0.875rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-sales-table th {
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
        position: sticky;
        top: 0;
        z-index: 10;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .rs-sales-table tbody tr {
        transition: all 0.2s ease;
    }
    
    .rs-sales-table tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-sales-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-sales-table tbody tr:hover {
        background: #f0f9ff;
        box-shadow: 0 2px 6px rgba(230, 90, 36, 0.1);
    }
    
    .rs-sales-table tbody tr:active {
        background: #fef3c7 !important;
        box-shadow: inset 0 0 6px rgba(230, 90, 36, 0.2);
    }
    
    /* ===== INVOICES TABLE ===== */
    .rs-invoices-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        margin: 1.5rem -1.5rem;
        padding: 1rem;
        scroll-snap-type: x mandatory;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .rs-invoices-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border-radius: 8px;
        scroll-snap-align: start;
        min-width: 650px;
    }
    
    .rs-invoices-table th,
    .rs-invoices-table td {
        padding: 1rem 0.875rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-invoices-table th {
        background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
        color: black;
        font-weight: 600;
        font-size: 0.9rem;
        position: sticky;
        top: 0;
        z-index: 10;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .rs-invoices-table tbody tr {
        transition: all 0.2s ease;
    }
    
    .rs-invoices-table tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-invoices-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-invoices-table tbody tr:hover {
        background: #ede9fe;
        box-shadow: 0 2px 6px rgba(124, 58, 237, 0.1);
    }
    
    .rs-invoices-table tbody tr:active {
        background: #e0e7ff !important;
        box-shadow: inset 0 0 6px rgba(124, 58, 237, 0.2);
    }
    
    /* ===== STATUS TABLE ===== */
    .rs-status-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        margin: 1.5rem -1.5rem;
        padding: 1rem;
        scroll-snap-type: x mandatory;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .rs-status-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border-radius: 8px;
        scroll-snap-align: start;
        min-width: 620px;
    }
    
    .rs-status-table th,
    .rs-status-table td {
        padding: 1rem 0.875rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .rs-status-table th {
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
        position: sticky;
        top: 0;
        z-index: 10;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .rs-status-table tbody tr {
        transition: all 0.2s ease;
    }
    
    .rs-status-table tbody tr:nth-child(odd) {
        background: #ffffff;
    }
    
    .rs-status-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }
    
    .rs-status-table tbody tr:hover {
        background: #cffafe;
        box-shadow: 0 2px 6px rgba(14, 165, 233, 0.1);
    }
    
    .rs-status-table tbody tr:active {
        background: #a5f3fc !important;
        box-shadow: inset 0 0 6px rgba(14, 165, 233, 0.2);
    }
    
    /* Scroll Indicators */
    .rs-sales-table-container::before {
        content: '👉 Swipe for More';
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--primary-color);
        font-weight: 600;
        padding: 8px 0;
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        margin: -12px -12px 12px -12px;
        border-radius: 0;
        animation: slide-hint-mobile 2s ease-in-out infinite;
    }
    
    .rs-invoices-table-container::before {
        content: '👉 Swipe for More';
        display: block;
        text-align: center;
        font-size: 11px;
        color: #7c3aed;
        font-weight: 600;
        padding: 8px 0;
        background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
        margin: -12px -12px 12px -12px;
        border-radius: 0;
        animation: slide-hint-mobile 2s ease-in-out infinite;
    }
    
    .rs-status-table-container::before {
        content: '👉 Swipe for More';
        display: block;
        text-align: center;
        font-size: 11px;
        color: #0ea5e9;
        font-weight: 600;
        padding: 8px 0;
        background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
        margin: -12px -12px 12px -12px;
        border-radius: 0;
        animation: slide-hint-mobile 2s ease-in-out infinite;
    }
    
    /* ===== MOBILE 480px: SALES TABLE REFINEMENTS ===== */
    .rs-sales-table-container {
        padding: 0.75rem;
        margin: 0 -1.5rem;
        border-radius: 0;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }
    
    .rs-sales-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .rs-sales-table th,
    .rs-sales-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .rs-sales-table th {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.2px;
    }
    
    /* ===== MOBILE 480px: INVOICES TABLE REFINEMENTS ===== */
    .rs-invoices-table-container {
        padding: 0.75rem;
        margin: 0 -1.5rem;
        border-radius: 0;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }
    
    .rs-invoices-table {
        min-width: 540px;
        font-size: 0.8rem;
    }
    
    .rs-invoices-table th,
    .rs-invoices-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .rs-invoices-table th {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.2px;
    }
    
    /* ===== MOBILE 480px: STATUS TABLE REFINEMENTS ===== */
    .rs-status-table-container {
        padding: 0.75rem;
        margin: 0 -1.5rem;
        border-radius: 0;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }
    
    .rs-status-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .rs-status-table th,
    .rs-status-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .rs-status-table th {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.2px;
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
        color: rgb(22, 19, 19);
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .rs-products-grid {
        grid-template-columns: 1fr 2fr;
    }
    
    .rs-pos-layout {
        grid-template-columns: 300px 1fr 300px;
        gap: 1.5rem;
        min-height: 700px;
    }
    
    .rs-pos-section {
        padding: 1.25rem;
    }
    
    .rs-page-container {
        max-width: 1400px;
        padding: 2rem;
    }
}

/* ============================================
   MODERN PREMIUM INVOICE DESIGN - SCREEN & PRINT
   ============================================ */

.rs-invoice-modern {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER - Diagonal Professional Design */
.rs-header-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 75px;
    position: relative;
    overflow: hidden;
    background: white;
    margin: 0;
}

/* Orange Left Section */
.rs-header-orange-section {
    background: white;
    background-color: white;
    color: #333;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    border-right: 1px solid #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Navy Right Section */
.rs-header-navy-section {
    background: #1a2d5c;
    background-color: #1a2d5c;
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Diagonal Divider Effect */
.rs-header-divider {
    display: none;
}

.rs-doc-title {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 2px 0;
    letter-spacing: -1px;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-doc-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rs-meta-item {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #333;
    margin: 0;
    font-weight: 500;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-meta-item strong {
    min-width: 70px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Company Branding */
.rs-company-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rs-company-logo {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #E65A24;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rs-company-logo img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.rs-company-text h2 {
    font-size: 18px;
    font-weight: 800;
    color: white;
    margin: 0 0 2px 0;
    letter-spacing: -0.5px;
}

.rs-company-tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-style: italic;
    font-weight: 500;
}

/* INVOICE BODY */
.rs-invoice-modern-body {
    padding: 10px 15px;
    flex: 1;
}

/* INFO SECTION - Customer & Payment Details */
.rs-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

.rs-invoice-to {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rs-invoice-to h4,
.rs-payment-section h4 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: #E86A1F;
    letter-spacing: 0.5px;
    margin: 0 0 3px 0;
    text-align: left;
}

.rs-payment-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rs-customer-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    text-align: left;
}

.rs-customer-detail {
    font-size: 14px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 1px;
    text-align: left;
}

.rs-payment-detail {
    font-size: 14px;
    color: #666;
    line-height: 1.3;
    text-align: left;
}

.rs-payment-section p {
    font-size: 14px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 1px;
    text-align: left;
}

/* BUSINESS INFORMATION SECTION (FROM) */
.rs-business-info-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 18px 16px;
    margin: 16px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #E5E7EB;
    border-left: 5px solid #E65A24;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rs-business-info-section h4 {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: #E65A24;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    text-align: left;
    display: flex;
    align-items: center;
}

.rs-business-info-section h4::before {
    content: "📦";
    margin-right: 6px;
    font-size: 14px;
}

.rs-from-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rs-business-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.3px;
    text-align: left;
    line-height: 1.3;
}

.rs-business-address {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    text-align: left;
    margin: 2px 0;
    padding-left: 0;
    display: flex;
    align-items: flex-start;
}

.rs-business-address::before {
    content: "📍";
    margin-right: 6px;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rs-business-contact {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    text-align: left;
    margin: 0;
    display: flex;
    align-items: center;
}

.rs-business-contact::before {
    content: "☎";
    margin-right: 6px;
    font-size: 13px;
    font-weight: 600;
}

.rs-business-reg,
.rs-business-tax {
    font-size: 12px;
    color: #64748B;
    line-height: 1.3;
    text-align: left;
    margin: 0;
    padding: 3px 0;
}

.rs-business-reg::before {
    content: "🏢 ";
    margin-right: 4px;
}

.rs-business-tax::before {
    content: "🛂 ";
    margin-right: 4px;
}

/* PROFESSIONAL TABLE */
.rs-invoice-table-modern {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
    background: white;
    border-spacing: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.rs-invoice-table-modern thead {
    background: #E65A24;
    background-color: #E65A24;
    color: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-invoice-table-modern th {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    color: white;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(230, 90, 36, 0.15);
}

/* Header alignment */
.rs-invoice-table-modern th:nth-child(1) {
    text-align: center;
    width: 6%;
}

.rs-invoice-table-modern th:nth-child(2) {
    text-align: left;
    width: 44%;
}

.rs-invoice-table-modern th:nth-child(3) {
    text-align: right;
    width: 12%;
}

.rs-invoice-table-modern th:nth-child(4) {
    text-align: right;
    width: 19%;
}

.rs-invoice-table-modern th:nth-child(5) {
    text-align: right;
    width: 19%;
}

.rs-invoice-table-modern tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.rs-invoice-table-modern tbody tr:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: scale(1.01);
    box-shadow: inset 0 0 8px rgba(230, 90, 36, 0.08);
}

.rs-invoice-table-modern tbody tr:nth-child(even) {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.rs-invoice-table-modern td {
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    border: none;
    text-align: center;
    font-weight: 500;
}

/* Body cell alignment to match headers */
.rs-col-no,
.rs-invoice-table-modern tbody tr td:nth-child(1) {
    text-align: center;
    font-weight: 700;
    color: #E86A1F;
    width: 6%;
}

.rs-col-desc,
.rs-invoice-table-modern tbody tr td:nth-child(2) {
    text-align: left;
    font-weight: 500;
    width: 44%;
}

.rs-col-qty,
.rs-invoice-table-modern tbody tr td:nth-child(3) {
    text-align: right;
    font-weight: 600;
    width: 12%;
}

.rs-col-price,
.rs-invoice-table-modern tbody tr td:nth-child(4) {
    text-align: right;
    font-weight: 600;
    width: 19%;
}

.rs-col-total,
.rs-invoice-table-modern tbody tr td:nth-child(5) {
    text-align: right;
    font-weight: 700;
    color: #E86A1F;
    width: 19%;
}

/* BOTTOM SECTION */
.rs-bottom-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    margin-top: 5px;
    align-items: start;
}

/* TERMS */
.rs-terms-section h4 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: #E86A1F;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.rs-terms-section p {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 2px;
}

.rs-contact-info {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid #e8e8e8;
}

.rs-contact-item {
    font-size: 13px;
    color: #555;
    margin-bottom: 1px;
    font-weight: 500;
}

/* SIGNATURE AREA */
.rs-signature-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 50px;
}

.rs-signature-space {
    height: 20px;
    width: 100px;
    margin-bottom: 2px;
    border-bottom: 1px solid #333;
}

.rs-signature-dotted-line {
    width: 180px;
    height: 2px;
    background-image: repeating-linear-gradient(90deg, #333 0px, #333 8px, transparent 8px, transparent 12px);
    margin-bottom: 4px;
}

.rs-signature-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    letter-spacing: 0.5px;
    margin: 0;
}

/* TOTALS SECTION */
.rs-totals-modern {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
    border: 1px solid #ececec;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.rs-total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.rs-total-item:last-child {
    border-bottom: none;
}

.rs-total-label {
    font-weight: 600;
    color: #555;
    text-align: left;
    flex: 1;
}

.rs-total-value {
    font-weight: 700;
    color: #333;
    text-align: right;
    min-width: 100px;
}

.rs-grand-total-modern {
    background: linear-gradient(135deg, #E65A24 0%, #d94a1a 100%);
    background-color: #E65A24;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 6px;
    margin-top: 2px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-grand-total-modern .rs-total-label {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: white !important;
    letter-spacing: 0.5px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-grand-total-modern .rs-total-value {
    font-size: 16px;
    font-weight: 800;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rs-total-value {
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
    min-width: 80px;
}

.rs-grand-total-modern {
    background: linear-gradient(135deg, #E86A1F 0%, #d95528 100%);
    color: white !important;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(232, 106, 31, 0.15);
}

.rs-grand-total-modern .rs-total-label,
.rs-grand-total-modern .rs-total-value {
    color: white !important;
    font-weight: 800;
    flex-shrink: 0;
}

/* FOOTER */
.rs-footer-modern {
    background: #1a2d5c;
    background-color: #1a2d5c;
    color: white;
    padding: 4px 8px;
    text-align: center;
    position: relative;
    border-top: 2px solid #E65A24;
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    margin-top: auto;
}

.rs-footer-modern p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    line-height: 1.2;
    margin: 0;
    font-weight: 500;
}

.rs-footer-accent {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(to left, #E65A24 0%, transparent 100%);
    opacity: 0.08;
    z-index: 0;
}

/* RESPONSIVE - Invoice Styles */
@media (max-width: 768px) {
    .rs-header-modern {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .rs-header-orange-section {
        padding: 30px 25px;
        border-right: 2px solid #333;
    }

    .rs-header-navy-section {
        padding: 25px;
        justify-content: flex-start;
    }

    .rs-header-divider {
        display: none;
    }

    .rs-doc-title {
        font-size: 42px;
    }

    .rs-company-logo {
        width: 60px;
        height: 60px;
    }

    .rs-company-text h2 {
        font-size: 24px;
    }

    .rs-invoice-modern-body {
        padding: 20px;
    }

    .rs-info-section {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 30px;
        padding-bottom: 25px;
    }

    .rs-invoice-table-modern {
        margin: 25px 0;
    }

    .rs-invoice-table-modern th {
        padding: 14px 10px;
        font-size: 13px;
    }

    .rs-invoice-table-modern td {
        padding: 12px 10px;
        font-size: 14px;
    }

    .rs-bottom-section {
        grid-template-columns: 1.5fr 1fr;
        gap: 30px;
    }

    .rs-footer-modern {
        padding: 20px;
    }

    .rs-customer-name {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rs-header-modern {
        min-height: auto;
    }

    .rs-header-orange-section {
        padding: 20px 15px;
    }

    .rs-header-navy-section {
        padding: 15px;
    }

    .rs-doc-title {
        font-size: 32px;
    }

    .rs-meta-item {
        font-size: 12px;
        gap: 10px;
    }

    .rs-company-branding {
        gap: 12px;
    }

    .rs-company-logo {
        width: 50px;
        height: 50px;
    }

    .rs-company-text h2 {
        font-size: 20px;
    }

    .rs-invoice-modern-body {
        padding: 15px;
    }

    .rs-info-section {
        gap: 15px;
    }

    .rs-invoice-table-modern th,
    .rs-invoice-table-modern td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .rs-col-no { width: 8%; }
    .rs-col-desc { width: 40%; }
    .rs-col-qty { width: 13%; }
    .rs-col-price { width: 19%; }
    .rs-col-total { width: 20%; }

    .rs-totals-modern {
        padding: 15px;
    }

    .rs-total-item {
        padding: 12px 0;
        font-size: 13px;
    }

    .rs-footer-modern {
        padding: 15px;
    }
}

/* Print Styles - Enhanced for Perfect Color Communication */
/* Print Styles - Compact Single Page */
@media print {
    /* Hide navigation and UI elements */
    .rs-navigation,
    .rs-modal-actions,
    .rs-btn,
    .rs-primary-btn,
    .rs-secondary-btn,
    .rs-icon-btn,
    .rs-status-select,
    .rs-modal-close,
    .no-print,
    button:not(.no-print),
    .print-toolbar,
    .rs-modal {
        display: none !important;
    }
    
    /* Page setup - Reduced margins */
    @page {
        margin: 0.25in 0.35in;
        size: A4;
    }
    
    /* Reset body for print */
    body, html {
        margin: 0;
        padding: 0;
        background: white !important;
        font-size: 12px !important;
    }
    
    /* Ensure invoice content is visible */
    .rs-invoice-modern,
    #invoice-content,
    #rs_invoice_view_content,
    .rs-document-wrapper {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        max-width: 100% !important;
        min-height: 100vh !important;
    }
    
    /* COMPACT HEADER - Reduced height and padding */
    .rs-header-modern {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        min-height: 100px !important;
        page-break-inside: avoid !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .rs-header-orange-section {
        background: white !important;
        padding: 12px 20px !important;
        border-right: 2px solid #333 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    .rs-header-navy-section {
        background: #1a2d5c !important;
        padding: 12px 15px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }
    
    /* Compact title and metadata */
    .rs-doc-title {
        font-size: 32px !important;
        font-weight: 900 !important;
        color: #1a1a1a !important;
        margin: 0 0 2px 0 !important;
        line-height: 1 !important;
    }
    
    .rs-doc-meta {
        margin: 0 !important;
    }
    
    .rs-meta-item {
        margin: 1px 0 !important;
        font-size: 11px !important;
        color: #333 !important;
    }
    
    .rs-company-logo {
        width: 50px !important;
        height: 50px !important;
        margin-right: 8px !important;
    }
    
    .rs-company-logo img {
        width: 100% !important;
        height: 100% !important;
    }
    
    .rs-company-branding {
        display: flex !important;
        align-items: center !important;
    }
    
    .rs-company-text h2 {
        color: white !important;
        font-size: 18px !important;
        margin: 0 !important;
    }
    
    .rs-company-tagline {
        color: rgba(255,255,255,0.8) !important;
        font-size: 10px !important;
        margin: 1px 0 0 0 !important;
    }
    
    /* Business Info Section (FROM) - Print Styles */
    .rs-business-info-section {
        background: #f9fafb !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border-left: 4px solid #E65A24 !important;
        padding: 6px 8px !important;
        margin: 2px 0 4px 0 !important;
        page-break-inside: avoid !important;
    }
    
    .rs-business-info-section h4 {
        font-size: 12px !important;
        color: #E86A1F !important;
        margin: 0 0 3px 0 !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.2px !important;
    }
    
    .rs-from-details {
        gap: 2px !important;
    }
    
    .rs-business-name {
        font-size: 13px !important;
        font-weight: 700 !important;
        margin: 0 0 1px 0 !important;
    }
    
    .rs-business-address {
        font-size: 11px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }
    
    .rs-business-contact {
        font-size: 11px !important;
        margin: 1px 0 0 0 !important;
    }
    
    .rs-business-reg,
    .rs-business-tax {
        font-size: 10px !important;
        margin: 1px 0 0 0 !important;
    }
    
    /* Body section - compact */
    .rs-invoice-modern-body {
        padding: 8px 15px !important;
        page-break-inside: avoid !important;
        flex: 1 !important;
    }
    
    /* Info sections - compact */
    .rs-info-section {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        page-break-inside: avoid !important;
        margin-bottom: 4px !important;
        padding-bottom: 3px !important;
    }
    
    .rs-invoice-to h4,
    .rs-payment-section h4 {
        color: #E86A1F !important;
        font-size: 13px !important;
        margin: 3px 0 2px 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        font-weight: 700 !important;
    }
    
    .rs-invoice-to p,
    .rs-payment-section p {
        font-size: 14px !important;
        margin: 1px 0 !important;
    }
    
    /* Compact table */
    .rs-invoice-table-modern {
        width: 100%;
        page-break-inside: avoid;
        margin: 4px 0;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 10px !important;
    }
    
    .rs-invoice-table-modern thead {
        background: #E65A24 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .rs-invoice-table-modern th {
        background: #E65A24 !important;
        color: white !important;
        padding: 7px 10px !important;
        font-size: 13px !important;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .rs-invoice-table-modern td {
        padding: 7px 10px !important;
        font-size: 14px !important;
        page-break-inside: avoid;
    }
}

/* ===================== PAYMENT STATUS & HISTORY STYLES ===================== */

/* Payment Status Section */
.rs-status-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 4px;
    padding: 8px 10px;
    margin: 4px 0;
    box-shadow: 0 1px 2px rgba(14, 165, 233, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rs-status-section h4 {
    color: #0369a1;
    font-weight: 700;
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.rs-status-badge-inline {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.rs-status-badge-inline.rs-status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.rs-status-badge-inline.rs-status-partially_paid {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #0369a1;
    border: 1px solid #0ea5e9;
}

.rs-status-badge-inline.rs-status-paid {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border: 1px solid #22c55e;
}

/* Payment Progress Section */
.rs-payment-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.rs-progress-bar-container {
    background: #e5e7eb;
    border-radius: 4px;
    height: 16px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
    flex: 0 0 100px;
    flex-shrink: 0;
}

.rs-progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
    min-width: 2%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.rs-progress-text {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
    margin: 0;
    padding: 4px 8px;
    background: white;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
    flex-shrink: 0;
}

.rs-progress-text strong {
    color: #10b981;
    font-weight: 700;
}

.rs-remaining-text {
    font-size: 13px;
    color: #d97706;
    font-weight: 600;
    margin: 0;
    padding: 4px 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef08a 100%);
    border-radius: 3px;
    border-left: 1px solid #f59e0b;
    white-space: nowrap;
    flex-shrink: 0;
}

.rs-remaining-text strong {
    color: #b45309;
    font-weight: 700;
}

/* Payment History Section */
.rs-payment-history-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
    border: 1px solid #6b7280;
    border-radius: 4px;
    padding: 4px 6px;
    margin: 3px 0;
    page-break-inside: avoid;
}

.rs-payment-history-section h4 {
    color: #374151;
    font-weight: 700;
    margin: 0 0 2px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 2px;
}

/* Payment History Table */
.rs-payment-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.rs-payment-history-table thead {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: white;
}

.rs-payment-history-table th {
    padding: 3px 4px;
    text-align: left;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1px;
    border-bottom: 1px solid #4b5563;
}

.rs-payment-history-table td {
    padding: 3px 4px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
}

.rs-payment-history-table tbody tr:last-child td {
    border-bottom: none;
}

.rs-payment-history-table tbody tr:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.rs-payment-date {
    font-weight: 600;
    color: #374151;
    min-width: 90px;
}

.rs-payment-amount {
    font-weight: 700;
    color: #10b981;
    min-width: 80px;
}

.rs-payment-amount strong {
    font-size: 9px;
}

.rs-payment-method {
    color: #6b7280;
    font-weight: 500;
    min-width: 70px;
}

.rs-payment-ref {
    color: #9ca3af;
    font-family: 'Courier New', monospace;
    font-size: 8px;
    min-width: 80px;
}

.rs-payment-notes {
    color: #6b7280;
    font-size: 8px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive Payment Sections */
@media print {
    .rs-status-section {
        padding: 5px 8px !important;
        margin: 3px 0 !important;
        border: 1px solid #0ea5e9 !important;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rs-status-section h4 {
        font-size: 9px !important;
        margin: 0 !important;
    }

    .rs-status-badge-inline {
        padding: 3px 8px !important;
        font-size: 9px !important;
    }

    .rs-progress-bar-container {
        height: 10px !important;
        margin: 0 !important;
    }

    .rs-progress-text {
        font-size: 9px !important;
        padding: 2px 4px !important;
    }

    .rs-remaining-text {
        font-size: 9px !important;
        padding: 2px 4px !important;
    }

    .rs-payment-history-section {
        display: block !important;
        visibility: visible !important;
        padding: 4px 6px !important;
        margin: 4px 0 !important;
        page-break-inside: avoid;
        background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%) !important;
        border: 1px solid #6b7280 !important;
        border-radius: 4px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .rs-payment-history-section h4 {
        font-size: 11px !important;
        margin: 0 0 2px 0 !important;
        color: #374151 !important;
        display: block !important;
    }

    .rs-payment-history-table {
        display: table !important;
        width: 100% !important;
        font-size: 11px !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
        border-collapse: collapse !important;
        background: white !important;
        border: 1px solid #e5e7eb !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .rs-payment-history-table th {
        display: table-cell !important;
        padding: 2px 4px !important;
        font-size: 10px !important;
        background: #374151 !important;
        color: white !important;
        font-weight: 700 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .rs-payment-history-table td {
        display: table-cell !important;
        padding: 2px 4px !important;
        font-size: 11px !important;
        border-bottom: 1px solid #e5e7eb !important;
        visibility: visible !important;
    }

    .rs-payment-history-table tbody tr {
        display: table-row !important;
        page-break-inside: avoid !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rs-status-section {
        padding: 8px 10px;
        margin: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rs-status-section h4 {
        font-size: 10px;
        width: 100%;
    }

    .rs-payment-progress {
        width: 100%;
        min-width: auto;
        margin-top: 0;
    }

    .rs-progress-bar-container {
        margin-bottom: 6px;
    }

    .rs-progress-text {
        font-size: 9px;
        padding: 3px 6px;
        min-width: auto;
    }

    .rs-payment-history-section {
        padding: 6px 8px;
        margin: 6px 0;
    }

    .rs-payment-history-section h4 {
        font-size: 9px;
        margin-bottom: 4px;
        padding-bottom: 2px;
    }

    .rs-payment-history-table {
        font-size: 8px;
    }

    .rs-payment-history-table th,
    .rs-payment-history-table td {
        padding: 3px 4px;
    }

    .rs-payment-date,
    .rs-payment-method,
    .rs-payment-ref {
        min-width: auto;
    }
}

@media print {
    /* Compact totals section */
    .rs-bottom-section {
        page-break-inside: avoid;
        margin-top: 4px;
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 12px;
    }
    
    .rs-terms-section h4 {
        color: #E86A1F !important;
        font-size: 11px !important;
        margin: 0 0 2px 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }
    
    .rs-terms-section p {
        font-size: 11px !important;
        margin: 1px 0 !important;
        line-height: 1.2 !important;
    }
    
    .rs-totals-modern {
        page-break-inside: avoid;
        background: #f9f9f9 !important;
        border: 1px solid #e0e0e0 !important;
        padding: 6px 8px !important;
        border-radius: 4px !important;
    }
    
    .rs-total-item {
        display: flex;
        justify-content: space-between;
        page-break-inside: avoid;
        font-size: 9px !important;
        margin: 2px 0 !important;
        padding: 0 !important;
    }
    
    .rs-total-label,
    .rs-total-value {
        font-size: 12px !important;
    }
    
    .rs-grand-total-modern {
        background: #E65A24 !important;
        color: white !important;
        padding: 6px 8px !important;
        margin-top: 2px;
        font-weight: 800;
        display: flex;
        justify-content: space-between;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-size: 14px !important;
        border-radius: 4px;
    }
    
    .rs-grand-total-modern .rs-total-label,
    .rs-grand-total-modern .rs-total-value {
        color: white !important;
        font-size: 11px !important;
    }
    
    /* Signature section - compact */
    .rs-signature-section {
        page-break-inside: avoid;
        margin-top: 50px !important;
    }
    
    .rs-signature-space {
        border-bottom: 1px solid #333;
        height: 25px;
        width: 100px;
        margin: 8px 0 0 0;
        text-align: center;
        padding-top: 2px;
        font-size: 7px !important;
    }
    
    /* Compact footer */
    .rs-footer-modern {
        background: #1a2d5c !important;
        color: white !important;
        padding: 4px 8px !important;
        text-align: center;
        margin-top: auto !important;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-size: 8px !important;
    }
    
    .rs-footer-modern p {
        color: white !important;
        margin: 0 !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }
    
    /* Images - smaller */
    img {
        max-width: 100%;
        height: auto;
        display: inline-block;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Force background colors to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ===================== PAYMENT MODAL STYLES ===================== */

.rs-payment-modal-content {
    max-width: 500px;
}

.rs-payment-form-group {
    margin-bottom: 1.5rem;
}

.rs-payment-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.rs-payment-form-group input,
.rs-payment-form-group select,
.rs-payment-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
}

.rs-payment-form-group input:focus,
.rs-payment-form-group select:focus,
.rs-payment-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 90, 36, 0.1);
}

.rs-payment-summary {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
}

.rs-payment-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.rs-payment-summary-item:last-child {
    margin-bottom: 0;
}

.rs-payment-summary-item strong {
    color: var(--dark-color);
}

.rs-payment-summary-item.highlight {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--success-color);
}

.rs-payment-history {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.rs-payment-history-item {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.rs-payment-history-item-date {
    font-weight: 600;
    color: var(--dark-color);
}

.rs-payment-history-item-amount {
    color: var(--success-color);
    font-weight: 600;
}

/* ===== INVOICE STATUS BADGE COLORS ===== */

.rs-status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-width: 100px;
    white-space: nowrap;
}

.rs-status-pending {
    background-color: #fed7aa;
    color: #92400e;
}

.rs-status-partially_paid {
    background-color: #bfdbfe;
    color: #1e40af;
}

.rs-status-paid {
    background-color: #bbf7d0;
    color: #065f46;
}

.rs-status-partial {
    background-color: #bfdbfe;
    color: #1e40af;
}

.rs-status-draft {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.rs-status-sent {
    background-color: #dbeafe;
    color: #0c4a6e;
}

.rs-status-overdue {
    background-color: #fee2e2;
    color: #7f1d1d;
}

.rs-status-cancelled {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

/* Icon Button Enhancements */

.rs-icon-btn.rs-primary {
    background-color: var(--info-color);
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.rs-icon-btn.rs-primary:hover {
    background-color: #2563eb;
    transform: scale(1.1);
}

.rs-icon-btn.rs-success {
    background-color: var(--success-color);
    color: white;
}

.rs-icon-btn.rs-success:hover {
    background-color: #059669;
}

.rs-icon-btn.rs-info {
    background-color: var(--info-color);
    color: white;
}

.rs-icon-btn.rs-info:hover {
    background-color: #2563eb;
}
