:root {
    /* Rich, vibrant colors */
    --primary: #047857;
    --primary-light: #059669;
    --primary-dark: #065f46;
    --secondary: #4338ca;
    --secondary-light: #4f46e5;
    
    /* Backgrounds and Surfaces */
    --bg-color: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    --surface: rgba(255, 255, 255, 0.85);
    --surface-border: rgba(255, 255, 255, 0.4);
    --surface-solid: #ffffff;
    
    /* Text */
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* States */
    --danger: #b91c1c;
    --success: #047857;
    --warning: #92400e;
    
    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --sidebar-width: 260px;
}

* { 
    box-sizing: border-box; 
    font-family: 'Outfit', sans-serif; 
}

body { 
    margin: 0; 
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text); 
    min-height: 100vh;
    min-height: 100dvh;
}

:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

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

/* APP LAYOUT - Grid System */
.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--surface-solid);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--surface-border);
}

.mobile-menu-close, .mobile-menu-btn {
    display: none; /* hidden on desktop */
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover, .mobile-menu-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

[data-ksk-fallback-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    min-width: 1.2em;
    height: 1.2em;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

body.mobile-menu-open {
    overflow: hidden;
}

.sidebar-nav {
    padding: 20px 16px;
    overflow-y: auto;
    flex: 1;
}

.nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin: 12px 0 8px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-link:hover {
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary-dark);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-link i {
    width: 20px;
    height: 20px;
}

/* Main Content Area */
.app-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin 0.3s ease;
}

.app-header {
    height: 70px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}

.user-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.page-content {
    padding: 24px;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 100px;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        z-index: 1200;
    }
    .app-sidebar.active {
        transform: translateX(0);
    }
    .app-content-wrapper {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .mobile-menu-close {
        display: none !important;
    }
    .app-sidebar.active .mobile-menu-close {
        display: flex !important;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
        z-index: 1190;
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* SaaS Admin summary cards need enough room for currency figures. */
.saas-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.saas-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 24px;
    margin: 0;
    overflow: hidden;
}

.saas-stat-card .stat-icon {
    flex: 0 0 auto;
}

.saas-stat-content {
    flex: 1 1 auto;
    min-width: 0;
}

.saas-stat-content h3 {
    overflow-wrap: anywhere;
    line-height: 1.15;
}

.saas-stat-value {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
    line-height: 1.15;
    white-space: nowrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.network-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.network-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.network-status.offline { 
    background: rgba(239, 68, 68, 0.15); 
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.network-status.offline::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

section { 
    padding: 28px; 
    margin-bottom: 24px; 
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h1.page-title {
    margin: 0;
}

h2 { 
    margin-top: 0; 
    font-size: 1.35rem; 
    font-weight: 600; 
    margin-bottom: 1.75rem; 
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group { margin-bottom: 20px; }
.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 0.85rem; 
    font-weight: 500; 
    color: var(--text-muted); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select, .product-entry input {
    width: 100%; 
    padding: 14px 16px; 
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.8); 
    border-radius: 12px; 
    font-size: 1rem;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-group input:focus, .form-group select:focus, .product-entry input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), inset 0 1px 2px rgba(0,0,0,0.02);
    transform: translateY(-1px);
}

.product-entry { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 24px; 
    position: relative;
}

.btn-secondary {
    padding: 0 24px; 
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.15)); 
    color: var(--secondary);
    border: 1px solid rgba(99, 102, 241, 0.3); 
    border-radius: 12px; 
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(129, 140, 248, 0.25));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
}

.cart-table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 8px; 
    margin-bottom: 24px; 
}
.cart-table th { 
    text-align: left; 
    padding: 0 16px 8px 16px; 
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cart-table tbody tr {
    background: var(--surface-solid);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border-radius: 12px;
    transition: all 0.3s ease;
}

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

.cart-table tbody tr:hover {
    background: var(--surface-hover);
}
.cart-table td { 
    padding: 16px; 
    font-size: 1rem; 
    color: var(--text);
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}
.cart-table td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid transparent; }
.cart-table td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid transparent; }

.cart-table input[type="number"] {
    width: 60px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}
.cart-table input[type="number"]:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
}

.totals { 
    background: rgba(255,255,255,0.5);
    padding: 24px;
    border-radius: 16px;
    text-align: right; 
    border: 1px solid rgba(255,255,255,0.8);
}
.totals p { margin: 8px 0; color: var(--text-muted); font-size: 1.05rem; }
.totals h3 { 
    color: var(--text); 
    margin: 16px 0 0 0; 
    font-size: 2rem; 
    font-weight: 700; 
}
.totals h3 span { color: var(--primary); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none; 
    border-radius: 16px; 
    font-size: 1.15rem; 
    font-weight: 600;
    cursor: pointer; 
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-primary:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.45);
}
.btn-primary:active { 
    transform: translateY(0) scale(0.98);
}

.btn-sm {
    min-height: 32px !important;
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    gap: 4px !important;
    border-radius: 8px !important;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.btn-icon:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

/* Glassmorphism scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: rgba(16, 185, 129, 0.2); 
    border-radius: 10px; 
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(16, 185, 129, 0.4); }

/* Action Button Small */
.action-btn-sm {
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    border: none;
    cursor: pointer;
}
.action-btn-sm i {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* Mobile Bottom Navigation (Hidden by default) */
.mobile-bottom-nav {
    display: none;
}

/* ==========================================================================
   MOBILE PHONES - ANDROID NATIVE APP UX/UI ARCHITECTURE
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Global Zero Horizontal Overflow & Android Native Font Rendering */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        -webkit-tap-highlight-color: transparent;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

    .app-layout {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 2. Android Native Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(66px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(226, 232, 240, 0.9);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
        z-index: 1000;
        padding: 4px 8px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    }

    body.mobile-menu-open .mobile-bottom-nav {
        transform: translateY(110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .app-sidebar .sidebar-nav {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 500;
        padding: 6px 10px;
        border-radius: 14px;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        min-width: 58px;
        min-height: 48px;
        position: relative;
        user-select: none;
        -webkit-user-select: none;
        background: transparent;
        border: 0;
        font-family: inherit;
    }

    .mobile-bottom-nav .nav-item i {
        width: 22px;
        height: 22px;
        transition: transform 0.2s ease;
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--text);
        font-weight: 600;
    }

    .mobile-bottom-nav .nav-item.active i {
        fill: var(--primary);
        color: var(--primary);
        background: rgba(16, 185, 129, 0.15);
        border-radius: 16px;
        padding: 4px 14px;
        width: 48px;
        height: 28px;
        transform: translateY(0);
    }

    .mobile-bottom-nav .nav-item:active {
        transform: scale(0.90);
    }

    /* 3. Android Native Top Header */
    .app-header {
        padding: 0 16px;
        height: 60px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--surface-border);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
        position: sticky;
        top: 0;
        z-index: 900;
    }

    .page-title {
        font-size: 1.15rem !important;
        font-weight: 600;
        letter-spacing: -0.3px;
    }

    .user-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .btn-icon,
    .mobile-menu-btn,
    .mobile-menu-close,
    .user-avatar,
    #toggle-password {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        flex: 0 0 48px;
        padding: 0;
    }

    /* 4. Content Spacing & Bottom Nav Protection */
    .app-content-wrapper {
        margin-left: 0 !important;
        padding-bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content {
        padding: 14px;
        padding-bottom: calc(95px + env(safe-area-inset-bottom)) !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 5. Android Native Cards, Panels & Single-Column Grids */
    .glass-panel {
        padding: 16px !important;
        border-radius: 16px;
        margin-bottom: 16px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    section {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 16px;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .dashboard-grid.saas-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .saas-stat-card {
        padding: 16px !important;
        margin-bottom: 0;
        overflow: hidden;
    }

    .dashboard-grid .widget {
        padding: 12px !important;
    }
    
    .dashboard-grid .widget h3 {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    
    .dashboard-grid .widget h1 {
        font-size: 1.5rem !important;
        margin-bottom: 6px !important;
    }
    
    .dashboard-grid .widget p {
        font-size: 0.75rem !important;
    }

    /* 6. Android Native Form Controls (Strict 16px to prevent zoom) */
    .product-entry {
        flex-direction: column;
        gap: 12px;
    }

    input, select, textarea, .form-group input, .form-group select, .product-entry input {
        font-size: 16px !important;
        padding: 12px 16px;
        border-radius: 8px; /* MD3 Outline */
        border: 1px solid var(--surface-border);
        min-height: 48px;
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
    }
    
    .md3-search-bar {
        border-radius: 100px !important; /* MD3 Search bar is pill-shaped */
        background: var(--surface) !important;
        box-shadow: var(--shadow-sm);
        border: none !important;
        padding-left: 20px !important;
    }

    /* 7. Touch-Friendly Interactive Buttons (Min Tap Size 44px) */
    button, .btn-primary, .btn-secondary, .btn-danger, .btn-success {
        min-height: 48px;
        padding: 10px 24px;
        font-size: 0.95rem;
        border-radius: 100px; /* MD3 Buttons are pill shaped */
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    button:active, .btn-primary:active, .btn-secondary:active, .btn-danger:active {
        transform: scale(0.96);
    }

    /* 8. Responsive Data Tables with Touch Scrolling */
    .table-responsive, .glass-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }


    /* MD3 ListView for Cart */
    .md3-list-item {
        display: flex;
        flex-direction: column;
        background: var(--surface-solid);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    }
    
    .md3-list-item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
    }
    
    .md3-list-item-title {
        font-weight: 600;
        font-size: 1rem;
        color: var(--text);
        margin: 0;
    }
    
    .md3-list-item-subtitle {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin-top: 4px;
    }

    .md3-list-item-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .md3-stepper {
        display: flex;
        align-items: center;
        background: rgba(0,0,0,0.04);
        border-radius: 100px;
        padding: 2px;
    }

    .md3-stepper button {
        min-height: 44px;
        min-width: 44px;
        width: 44px;
        padding: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--text);
        box-shadow: none;
    }

    .md3-stepper input {
        width: 40px !important;
        min-height: 32px !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        text-align: center;
        font-weight: 600;
    }

    .totals h3 {
        font-size: 1.25rem;
    }

    /* 9. Android Native Bottom-Sheet Modals */
    .modal {
        padding: 10px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }
    .cart-table thead {
        display: none;
    }
    .cart-table tr {
        margin-bottom: 16px;
        background: var(--surface-solid);
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border: 1px solid rgba(0,0,0,0.05);
        display: flex;
        flex-direction: column;
    }
    .cart-table td {
        text-align: right;
        padding: 6px 0;
        position: relative;
        border-bottom: none; /* Removed border to look like MD3 card */
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border-radius: 0 !important;
        gap: 12px;
        font-size: 0.95rem;
    }
    .cart-table td:last-child {
        padding-bottom: 0;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid rgba(0,0,0,0.05); /* Separator for actions */
    }
    .cart-table td[data-label="Actions"],
    .cart-table td:last-child {
        justify-content: flex-end; 
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.85rem;
        flex-shrink: 0;
        margin-right: auto;
    }

    .action-btn-sm {
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 600;
        border-radius: 100px; /* Pill shape for MD3 */
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 44px;
    }

    .btn-sm {
        min-height: 44px !important;
        padding: 8px 14px !important;
    }
    .action-btn-sm i {
        width: 16px;
        height: 16px;
        margin-right: 0;
    }
    .action-btn-sm span {
        display: inline; /* Show text for actions on mobile if space permits */
    }

    .modal .glass-panel {
        width: 96% !important;
        max-width: 96% !important;
        max-height: 88vh;
        overflow-y: auto;
        border-radius: 20px !important;
        padding: 18px !important;
        margin: auto;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
        animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 0 12px;
    }
    .page-title {
        font-size: 1.05rem !important;
    }
    .glass-panel {
        padding: 14px !important;
    }
    .cart-table th, .cart-table td {
        padding: 8px 6px;
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   LOGIN SPLIT SCREEN LAYOUT
   ========================================================================== */
.login-split {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    background: var(--background);
    margin: 0;
    padding: 0;
}
.login-split-left {
    flex: 1;
    background: url('../images/login_bg.png') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
}
.login-split-left::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(6, 78, 59, 0.9) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.login-split-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}
.login-split-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}
.login-split-content p {
    font-size: 1.15rem;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.5;
}
.login-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.login-feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.login-feature-item i {
    width: 24px;
    height: 24px;
    color: #a7f3d0;
}
.login-feature-item span {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.login-split-right {
    flex: 0 0 480px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    z-index: 2;
}
.login-form-wrapper {
    width: 100%;
    max-width: 360px;
}
.login-logo {
    text-align: center;
    margin-bottom: 35px;
}
.login-logo h2 {
    font-size: 2rem;
    color: var(--primary);
    margin: 0;
}
.login-logo p {
    color: var(--text-muted);
    margin-top: 5px;
    font-size: 0.95rem;
}

@media (max-width: 992px) {
    .login-split {
        flex-direction: column;
    }
    .login-split-right {
        flex: 1;
        width: 100%;
        padding: 40px 20px;
    }
    .login-split-left {
        flex: none;
        padding: 40px 20px;
    }
    .login-split-content h1 {
        font-size: 2rem;
    }
    .login-feature-item {
        padding: 12px 15px;
    }
    .login-feature-item span {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .login-split-left {
        display: none;
    }
    .login-split-right {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    }
    .login-logo {
        margin-bottom: 24px;
    }
}

/* Print Styles */
@media print {
    body * { visibility: hidden; }
    #print_receipt, #print_receipt * { visibility: visible; color: black !important; }
    #print_receipt { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 10px; background: white; }
    @page { margin: 0; }
}
