@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #171720 100%);
    --glass-bg: rgba(30, 41, 59, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --font-family: 'Inter', sans-serif;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Global Premium Scrollbar (Slider) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utility layout */
.d-flex {
    display: flex;
}
.align-items-center {
    align-items: center;
}
.justify-content-center {
    justify-content: center;
}
.justify-content-between {
    justify-content: space-between;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }

/* Login Container */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 10vh auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Base Layout (Sidebar & Main content) */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    transition: var(--transition);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    gap: 1rem;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.topbar {
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Light Mode Theme Overrides */
[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --glass-bg: #ffffff;
    --glass-border: rgba(148, 163, 184, 0.4);
    --text-main: #0f172a;
    --text-muted: #334155;
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Light Theme Sidebar & Topbar Customization (Dark Contrast) */
[data-theme="light"] .sidebar {
    background: #1e293b !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .sidebar-brand {
    color: #ffffff !important;
}
[data-theme="light"] .sidebar-link {
    color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .sidebar-link:hover, 
[data-theme="light"] .sidebar-link.active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}
[data-theme="light"] .topbar,
[data-theme="light"] .pos-header {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .topbar h2,
[data-theme="light"] .pos-header h3 {
    color: #ffffff !important;
}
[data-theme="light"] .barcode-status-text {
    color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .user-profile div > div {
    color: #ffffff !important;
}
[data-theme="light"] .user-profile div > div:last-child {
    color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="light"] .form-control {
    background: rgba(248, 250, 252, 0.8);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .payment-btn {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
}

[data-theme="light"] .payment-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .cart-item {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
}

[data-theme="light"] .cart-summary {
    background: #ffffff !important;
    border-top: 2px solid rgba(148, 163, 184, 0.3) !important;
}

[data-theme="light"] .summary-total {
    color: var(--text-main);
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .product-img-placeholder {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Stat Cards Colored Overrides for Light Mode */
[data-theme="light"] .stat-card.card-purple {
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08) !important;
}
[data-theme="light"] .stat-card.card-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08) !important;
}
[data-theme="light"] .stat-card.card-red {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08) !important;
}
[data-theme="light"] .stat-card.card-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08) !important;
}
[data-theme="light"] .stat-card h3,
[data-theme="light"] .stat-card h4 {
    color: var(--text-main) !important;
}

/* Product Cards Override for Light Mode */
[data-theme="light"] .product-card {
    background: #ffffff !important;
    border-color: var(--glass-border) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}
[data-theme="light"] .product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    border-color: var(--primary) !important;
}

/* Fix pale red badges (low stock) in light mode */
[data-theme="light"] span[style*="color: #fca5a5"],
[data-theme="light"] td[style*="color: #fca5a5"] {
    color: #b91c1c !important; /* Readble red 700 */
    background: rgba(239, 68, 68, 0.15) !important;
}

[data-theme="light"] tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

[data-theme="light"] .modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
/* Vibrant Colorful Theme */
[data-theme="vibrant"] {
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4c1d95 60%, #581c87 100%);
    --primary: #fbbf24; /* Amber */
    --primary-hover: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
}

[data-theme="vibrant"] .sidebar {
    background: linear-gradient(to bottom, rgba(76, 29, 149, 0.3), rgba(30, 27, 75, 0.5));
    border-right: 1px solid rgba(251, 191, 36, 0.2);
}

[data-theme="vibrant"] .topbar {
    background: rgba(30, 27, 75, 0.4);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

[data-theme="vibrant"] .btn-primary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e1b4b;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

[data-theme="vibrant"] .btn-primary:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

[data-theme="vibrant"] .sidebar-link:hover, 
[data-theme="vibrant"] .sidebar-link.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-right: 3px solid #fbbf24;
}

[data-theme="vibrant"] .glass-panel {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

[data-theme="vibrant"] .form-control {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.1);
}

[data-theme="vibrant"] .form-control:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

/* Decorative Stat Cards (Soft Glowing Elements) */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.stat-card:hover { transform: translateY(-3px); }

/* Dark Mode Glowing Gradients */
.stat-card.card-purple {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.08);    
}
.stat-card.card-blue {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);   
}
.stat-card.card-red {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.08);
}
.stat-card.card-green {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.08);
}

/* Modal System */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.modal.active { display: flex; }
.modal-content { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--border-radius); padding: 2rem; width: 100%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); max-height: 90vh; overflow-y: auto; }

/* Mobile Responsiveness Rules */
@media (max-width: 900px) {
    /* Dashboard Layout */
    body { overflow: auto !important; overflow-x: hidden !important; }
    .layout-wrapper { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        position: relative; 
        height: auto; 
        padding: 1.5rem 1rem; 
        overflow: visible;
        background: transparent;
        border-right: none;
        border-bottom: 0px solid var(--glass-border);
    }
    .sidebar-header { 
        margin-bottom: 2rem; 
        padding: 0 0.5rem; 
        border-bottom: none; 
        text-align: left;
    }
    .sidebar-brand {
        font-size: 1.8rem;
    }
    .sidebar-menu { 
        display: grid; 
        grid-template-columns: repeat(3, 1fr); 
        gap: 1rem; 
        padding: 0.5rem;
    }
    .sidebar-link { 
        aspect-ratio: 1/1;
        padding: 1.2rem 0.5rem; 
        justify-content: center; 
        font-size: 0.8rem; 
        flex-direction: column; 
        gap: 0.8rem; 
        text-align: center; 
        border-radius: 20px; 
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05) !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        color: rgba(255, 255, 255, 0.8) !important;
        transition: var(--transition);
    }
    .sidebar-link i {
        font-size: 2rem;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.03);
        border-radius: 14px;
        margin-bottom: 2px;
        transition: var(--transition);
        color: var(--primary);
    }
    .sidebar-link:hover, .sidebar-link.active { 
        background: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.4);
        color: var(--primary);
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
    }
    .sidebar-link:hover i, .sidebar-link.active i {
        background: var(--primary);
        color: white;
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    }
    .sidebar-link.active {
        border-bottom: 1px solid rgba(99, 102, 241, 0.5);
    }
    /* Specific Icon Colors for Premium Feel */
    .sidebar-link[href*="pos.php"] i { color: #fbbf24; } /* Amber for POS */
    .sidebar-link[href*="categories.php"] i { color: #f472b6; } /* Pink */
    .sidebar-link[href*="products.php"] i { color: #34d399; } /* Emerald */
    .sidebar-link[href*="stock.php"] i { color: #60a5fa; } /* Blue */
    .sidebar-link[href*="customers.php"] i { color: #a78bfa; } /* Violet */
    .sidebar-link[href*="distributors.php"] i { color: #fb7185; } /* Rose */
    .sidebar-link[href*="reports.php"] i { color: #2dd4bf; } /* Teal */
    .sidebar-link[href*="employees.php"] i { color: #f87171; } /* Red */
    .sidebar-link[href*="settings.php"] i { color: #94a3b8; } /* Slate */

    .sidebar-link:hover[href*="pos.php"] i, .sidebar-link.active[href*="pos.php"] i { background: #fbbf24; color: #1e1b4b; }
    .sidebar-link:hover[href*="categories.php"] i, .sidebar-link.active[href*="categories.php"] i { background: #f472b6; }
    .sidebar-link:hover[href*="products.php"] i, .sidebar-link.active[href*="products.php"] i { background: #34d399; }
    .sidebar-link:hover[href*="stock.php"] i, .sidebar-link.active[href*="stock.php"] i { background: #60a5fa; }
    .sidebar-link:hover[href*="customers.php"] i, .sidebar-link.active[href*="customers.php"] i { background: #a78bfa; }
    .sidebar-link:hover[href*="distributors.php"] i, .sidebar-link.active[href*="distributors.php"] i { background: #fb7185; }
    .sidebar-link:hover[href*="reports.php"] i, .sidebar-link.active[href*="reports.php"] i { background: #2dd4bf; }
    .sidebar-link:hover[href*="employees.php"] i, .sidebar-link.active[href*="employees.php"] i { background: #f87171; }
    .sidebar-link:hover[href*="settings.php"] i, .sidebar-link.active[href*="settings.php"] i { background: #94a3b8; }
    .topbar { padding: 1rem; justify-content: center; flex-wrap: wrap; gap: 1rem; height: auto; text-align: center; }
    .topbar-right { justify-content: center; width: 100%; }
    .page-content { padding: 1rem; }
    table { display: block; overflow-x: auto; white-space: nowrap; width: 100%; }

    /* POS Mobile Priority Order: Search -> Cart -> Products */
    .pos-layout { flex-direction: column !important; height: auto !important; min-height: 100vh !important; overflow: visible !important; }
    .pos-header { height: auto !important; padding: 0.8rem; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; flex-shrink: 0; }
    .pos-header h3 { font-size: 1.1rem; margin: 0; }
    .pos-header .user-profile { display: none; }
    
    .pos-body { display: flex !important; flex-direction: column !important; flex: none !important; overflow-y: visible !important; overflow-x: hidden !important; width: 100% !important; }
    .pos-main, .pos-content, .product-section { display: contents !important; }
    
    .filter-bar { 
        order: 1 !important; 
        flex-direction: column !important; 
        padding: 0.8rem !important; 
        margin: 0 !important; 
        gap: 0.5rem !important; 
        background: var(--glass-bg) !important; 
        backdrop-filter: blur(16px) !important; 
        -webkit-backdrop-filter: blur(16px) !important; 
        position: sticky !important; 
        top: 0 !important; 
        z-index: 20 !important; 
        border-bottom: 1px solid var(--glass-border) !important; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important; 
    }
    .filter-bar select { width: 100% !important; }
    
    .cart-section { 
        order: 2 !important; 
        width: 100% !important; 
        flex: none !important; 
        height: 55vh !important; 
        border-left: none !important; 
        border-bottom: 4px solid var(--primary) !important; 
        display: flex !important; 
        flex-direction: column !important; 
    }
    .cart-header { padding: 0.8rem !important; }
    .cart-items { padding: 0.8rem !important; gap: 0.5rem !important; flex: 1 !important; overflow-y: auto !important; }
    .cart-summary { padding: 0.8rem !important; }
    .btn-pay { padding: 0.8rem !important; font-size: 1.1rem !important; margin-top: 0.5rem !important; }
    
    .product-grid { 
        order: 3 !important; 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 0.8rem !important; 
        padding: 1rem !important; 
        overflow: visible !important; 
        height: auto !important; 
    }
    .product-card { padding: 0.6rem !important; }
    
    /* Fix checkout modal full size */
    .modal-content { max-width: 95% !important; padding: 1.5rem !important; }
    .payment-methods { grid-template-columns: 1fr !important; }

    /* Dashboard Mobile Icons grid */
    .dashboard-cards-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    .stat-card {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 1.5rem 0.5rem !important;
        min-width: 0 !important;
        gap: 0.8rem !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2) !important;
    }
    .stat-card .icon-wrapper {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto !important;
        font-size: 1.8rem !important;
        box-shadow: inset 0 0 10px rgba(255,255,255,0.1);
    }
    .stat-card h3, .stat-card h4 {
        font-size: 1.15rem !important;
        margin-top: 0 !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }
    .stat-card p {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        white-space: normal !important;
    }
    
    .desktop-only-pos { display: none !important; }
    .mobile-only-pos { display: flex !important; width: 100%; }
    
    /* Global form squashing fix */
    .mobile-stack {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    .mobile-stack > div {
        width: 100% !important;
        flex: none !important;
    }
}

/* Global visibility classes */
.mobile-only-pos { display: none; }

