/* ==============================================
   KEMDATAPLUS - MAIN STYLESHEET
   Unified Design System with CSS Variables
   Mobile-first responsive design
   ============================================== */

/* ===== CSS VARIABLES - DESIGN SYSTEM ===== */
:root {
    /* Primary Colors */
    --primary: #024959;
    --primary-dark: #01363f;
    --primary-light: #036c7f;
    
    /* Accent Colors */
    --accent: #F2C12E;
    --accent-dark: #d4a520;
    --accent-light: #f5d060;
    
    /* Secondary */
    --secondary: #593E25;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--primary);
    font-family: var(--font-family);
    overflow-x: hidden;
    min-height: 100vh;
    max-width: 100vw;
    color: var(--gray-800);
    line-height: 1.5;
}

.background {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    min-height: 100vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

/* ===== HEADER & NAVIGATION ===== */
.header-container {
    display: flex;
    justify-content: center;
    background-color: var(--accent);
    box-shadow: var(--shadow-md);
    color: var(--primary);
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    width: 100%;
    max-width: 1200px;
}

header div img {
    height: 50px;
    cursor: pointer;
}

/* Checkbox - Always Hidden */
#check-box {
    display: none !important;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Nav Links Container */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Menu & Close Icons - Hidden on Desktop */
.menu-icon,
.close-icon {
    display: none;
    cursor: pointer;
    padding: var(--space-3);
    color: var(--primary);
    font-size: 1.5rem;
    z-index: 1002;
}

/* Nav Menu - Desktop */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu .links {
    display: flex;
    gap: var(--space-5);
    align-items: center;
}

.links a {
    text-decoration: none;
    color: var(--white);
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    transition: all var(--transition);
}

/* Hidden on desktop, shown only in mobile slide-out menu */
.links a.mobile-only {
    display: none;
}

.links a:hover {
    color: var(--accent);
    background: rgba(2, 73, 89, 0.1);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    margin-left: 15px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #024959;
    transition: transform 0.2s;
    object-fit: cover;
}

.profile-pic:hover {
    transform: scale(1.1);
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1100;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #024959;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.dropdown-menu a i {
    margin-right: 8px;
    color: #F2C12E;
}

.dropdown-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* ===== MOBILE NAVIGATION (max-width: 900px) ===== */
@media (max-width: 900px) {
    /* Show hamburger icon */
    .menu-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Close icon - hidden by default */
    .close-icon {
        display: none;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1003;
        background: #024959;
        color: #F2C12E;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
    }
    
    /* When checkbox is checked - show close icon */
    #check-box:checked ~ .nav-links .close-icon {
        display: flex;
    }
    
    /* When checkbox is checked - hide menu icon */
    #check-box:checked ~ .nav-links .menu-icon {
        display: none;
    }
    
    /* Mobile Nav Menu - Slide from left */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #024959;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        transition: left 0.3s ease;
        z-index: 1001;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }
    
    /* When checkbox is checked - slide menu in */
    #check-box:checked ~ .nav-links .nav-menu {
        left: 0;
    }
    
    .nav-menu .links {
        flex-direction: column;
        gap: 0;
        width: 100%;
        align-items: flex-start;
    }
    
    .nav-menu .links a {
        font-size: 1.1rem;
        padding: 15px 10px;
        width: 100%;
        border-bottom: 1px solid rgba(242, 193, 46, 0.2);
        color: white;
    }
    
    .nav-menu .links a:hover {
        background: rgba(242, 193, 46, 0.1);
        color: #F2C12E;
    }
    
    /* Mobile-only links (hidden on desktop, visible in slide-out menu) */
    .nav-menu .links a.mobile-only {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Mobile Logout Button Styling */
    .nav-menu .links a.mobile-logout {
        margin-top: 20px;
        background: rgba(239, 68, 68, 0.15);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-radius: 8px;
        color: #f87171;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .nav-menu .links a.mobile-logout:hover {
        background: rgba(239, 68, 68, 0.25);
        color: #fca5a5;
    }
    
    /* Hide profile dropdown on mobile nav */
    .profile-dropdown {
        display: none;
    }
    
    /* Overlay when menu is open */
    #check-box:checked ~ .nav-links::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }
}

/* ===== DASHBOARD CONTAINER (Greetings) - REDESIGNED ===== */
.dashboard-container {
    max-width: 95%;
    margin: 20px auto;
    padding: 0;
    background: linear-gradient(135deg, #024959 0%, #036c7f 100%);
    border-radius: 16px;
    color: white;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(2, 73, 89, 0.3);
}

.welcome-board {
    padding: 24px;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Avatar with Agent Badge */
.avatar-container {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 85px;
    height: 85px;
    border-radius: 16px;
    border: 3px solid rgba(242, 193, 46, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.agent-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #F2C12E 0%, #d4a520 100%);
    color: #024959;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Welcome Info Section */
.welcome-info {
    flex: 1;
    min-width: 0;
}

.greeting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.greeting-icon {
    color: #F2C12E;
}

.welcome-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.welcome-name span {
    color: #F2C12E;
}

/* User Meta Info */
.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.meta-item i {
    color: #F2C12E;
    font-size: 0.75rem;
}

.meta-item.rank {
    background: rgba(242, 193, 46, 0.2);
}

.meta-divider {
    opacity: 0.4;
}

/* Welcome Actions */
.welcome-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-between;
    align-items: center;
}

.welcome-actions .action-btn.secondary {
    margin-left: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.action-btn.primary {
    background: #F2C12E;
    color: #024959;
}

.action-btn.primary:hover {
    background: #d4a520;
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.action-btn.whatsapp {
    background: #25D366;
    color: white;
    text-decoration: none;
}

.action-btn.whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .welcome-board {
        padding: 14px 14px;
    }
    
    .welcome-header {
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
    
    .user-avatar {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        border-width: 2px;
    }

    .agent-badge {
        position: absolute;
        bottom: -6px;
        font-size: 0.55rem;
        padding: 2px 6px;
    }
    
    .welcome-name {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .greeting-row {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }
    
    .user-meta {
        justify-content: flex-start;
    }

    .meta-item {
        padding: 2px 8px;
        font-size: 0.72rem;
    }
    
    .meta-divider {
        display: none;
    }
    
    .welcome-actions {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .action-btn {
        justify-content: center;
        width: 100%;
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}

/* Legacy styles kept for compatibility */
.icons {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 5px;
    width: 100%;
    flex-wrap: wrap;
}

.icons h4:last-child {
    margin-left: auto;
}

/* ===== STATS SECTION - REDESIGNED FOR MOBILE ===== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f1f7 100%);
    border-radius: 12px;
    width: 95%;
}

/* First row: 3 main stats */
.stats-container .wallet-bal,
.stats-container .total-sales,
.stats-container .today-sales {
    grid-column: span 1;
}

/* Second row: 3 status stats */
.stats-container .complete,
.stats-container .pending,
.stats-container .processing {
    grid-column: span 1;
}

.wallet-bal,
.total-sales,
.today-sales,
.complete,
.pending,
.processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #024959;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    min-height: 140px;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient overlay for visual interest */
.wallet-bal::before,
.total-sales::before,
.today-sales::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(242, 193, 46, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stats-container > div:hover {
    background-color: #035970;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stats-container > div i {
    font-size: 1.75em;
    margin-bottom: 10px;
    color: #F2C12E;
}

.stats-container div h3 {
    margin: 5px 0;
    font-size: 0.85rem;
}

.stats-container div h2 {
    font-size: 1.5em;
    margin: 5px 0;
    color: #F2C12E;
}

.stats-container div p {
    font-size: 1.1rem;
    margin: 5px 0;
    font-weight: 700;
    color: #F2C12E;
}

.stats-container div h5 {
    font-size: 0.8rem;
    margin: 5px 0;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-container button {
    margin-top: auto;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: #F2C12E;
    color: #024959;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.stats-container button:hover {
    background-color: #F2AE30;
    transform: scale(1.05);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.action-card {
    background: white;
    padding: 24px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 160px;
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #F2C12E;
}

.action-card i {
    font-size: 2.5rem;
    color: #F2C12E;
    margin-bottom: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(242, 193, 46, 0.15) 0%, rgba(2, 73, 89, 0.1) 100%);
    border-radius: 50%;
}

.action-card h4 {
    color: #024959;
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
}

.action-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.action-card a,
.action-card .card-link {
    color: #F2C12E;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.action-card a:hover,
.action-card:hover .card-link {
    color: #F2AE30;
}

/* ===== BUY BUNDLES SECTION ===== */
.buy-bundles-section {
    margin: 40px auto;
    padding: 0 20px;
    max-width: 1100px;
    width: 100%;
}

.buy-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.buy-header h2 {
    color: #024959;
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.buy-header p {
    color: #666;
    margin: 0;
}

.buy-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.buy-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: #024959;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Network Tabs */
.network-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.network-tab {
    flex: 1;
    min-width: 80px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #024959;
    font-weight: 600;
    position: relative;
}

.network-tab:hover {
    border-color: #F2C12E;
}

.network-tab.active {
    background: #F2C12E;
    border-color: #F2C12E;
    color: #024959;
}

/* Inactive Network Tab */
.network-tab.network-inactive {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
    opacity: 0.8;
}

.network-tab.network-inactive::after {
    content: 'OFFLINE';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
}

.network-tab.network-inactive.active {
    background: #fecaca;
    border-color: #ef4444;
}

/* Network Status Indicator */
.network-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 500;
}

.network-status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse-red 1.5s infinite;
}

.network-status-indicator .status-dot.inactive {
    background: #ef4444;
}

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

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

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    color: #024959;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #F2C12E;
}

.mode-btn.active {
    background: #024959;
    border-color: #024959;
    color: white;
}

/* Form Groups */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #024959;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #F2C12E;
    box-shadow: 0 0 0 3px rgba(242, 193, 46, 0.1);
}

/* Out of Stock Bundle Options */
.form-group select option.out-of-stock,
.form-group select option:disabled {
    color: #ef4444;
    background: #fef2f2;
    font-style: italic;
}

.form-group select option:disabled {
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Price Display */
.price-display {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.price-display .label {
    color: #666;
    font-size: 0.9rem;
}

.price-display .amount {
    font-size: 1.8rem;
    color: #F2C12E;
    font-weight: bold;
    margin-top: 5px;
}

/* Buttons */
.btn-add-cart,
.btn-upload {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #024959 0%, #F2C12E 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart:hover,
.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 73, 89, 0.2);
}

.btn-preview {
    background: #024959;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-preview:hover {
    background: #F2C12E;
    color: #024959;
}

/* Cart Sidebar */
.cart-sidebar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
}

.cart-sidebar h3 {
    color: #024959;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

#cartItems {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 8px;
    max-height: 400px;
}

#cartItems::-webkit-scrollbar {
    width: 6px;
}

#cartItems::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#cartItems::-webkit-scrollbar-thumb {
    background: #F2C12E;
    border-radius: 10px;
}

.cart-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info {
    font-size: 0.85rem;
}

.cart-item-price {
    color: #F2C12E;
    font-weight: 600;
}

.cart-remove {
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.cart-remove:hover {
    background: #ff1744;
}

.cart-total {
    background: #024959;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
}

.cart-total .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.cart-total .amount {
    font-size: 1.5rem;
    color: #F2C12E;
    font-weight: bold;
    margin-top: 5px;
}

.btn-checkout {
    width: 100%;
    padding: 12px;
    background: #F2C12E;
    color: #024959;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: #F2AE30;
}

.btn-clear-cart {
    width: 100%;
    padding: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-clear-cart:hover {
    background: #d32f2f;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

/* ===== CONTAINER (Bundle Form) ===== */
.container {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    margin: 30px auto;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
    font-weight: 500;
}

.tab.active {
    border-bottom: 3px solid #F2C12E;
    color: #F2C12E;
}

.mode-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.mode {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.mode.active {
    background: #F2C12E;
    border-color: #F2C12E;
    color: #024959;
}

.price {
    color: #F2C12E;
    font-weight: 600;
    margin: 10px 0;
}

.container button {
    width: 100%;
    background: #F2C12E;
    border: none;
    color: #024959;
    font-weight: bold;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.container button:hover {
    background: #F2AE30;
}

/* ===== CART CONTAINER ===== */
.cart-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 90%;
    max-width: 650px;
    margin: 20px auto;
    padding: 20px;
    background-color: #024959;
    border-radius: 8px;
    color: white;
    min-height: 300px;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary i {
    margin-right: 5px;
    color: #F2C12E;
}

.cart-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    flex: 1;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

.payment {
    text-align: center;
    background-color: #F2C12E;
    border: none;
    color: #024959;
    font-weight: bold;
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 650px;
    margin: 20px auto;
    display: block;
}

/* ===== EXCEL UPLOAD ===== */
.excel-upload-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.excel-file-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.excel-file-input {
    display: none;
}

.excel-file-label {
    flex: 1;
    min-width: 200px;
    padding: 14px 16px;
    border: 2px dashed #F2C12E;
    border-radius: 8px;
    background: #fffbf0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #024959;
    font-weight: 500;
}

.excel-file-label:hover {
    background: #fff8e5;
    border-color: #F2AE30;
}

.excel-file-label i {
    font-size: 1.2rem;
    color: #F2C12E;
}

.excel-upload-button {
    padding: 14px 24px;
    background: #024959;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.excel-upload-button:hover:not(:disabled) {
    background: #F2C12E;
    color: #024959;
}

.excel-upload-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Spinner */
.excel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #F2C12E;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Excel Preview */
.excel-preview-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.excel-summary-stats,
.bulk-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f1f7 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #024959;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #024959;
    margin-bottom: 5px;
}

.stat-number.valid { color: #4caf50; }
.stat-number.invalid { color: #f44336; }

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.excel-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.excel-preview-table,
.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.excel-preview-table thead,
.preview-table thead {
    background: #024959;
    color: white;
}

.excel-preview-table th,
.preview-table th {
    padding: 14px;
    text-align: left;
    font-weight: 600;
}

.excel-preview-table td,
.preview-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.excel-preview-table tbody tr:nth-child(even),
.preview-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.excel-preview-table tbody tr:hover,
.preview-table tbody tr:hover {
    background: #f5f5f5;
}

.status-valid { color: #4caf50; font-weight: 600; }
.status-invalid { color: #f44336; font-weight: 600; }

.row-invalid {
    background-color: #ffebee !important;
}

.row-invalid td {
    color: #c62828;
}

.row-out-of-stock {
    background-color: #fff3e0 !important;
}

.row-out-of-stock td {
    color: #e65100;
}

/* ===== FOOTER ===== */
.footer {
    background: #024959;
    color: white;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.footer-section h5 {
    color: #F2C12E;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ddd;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #F2C12E;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(242, 193, 46, 0.2);
    border-radius: 50%;
    transition: background 0.2s;
}

.social-icons a:hover {
    background: #F2C12E;
    color: #024959;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    background: #013d4f;
    border-top: 1px solid rgba(242, 193, 46, 0.2);
    font-size: 0.9rem;
    color: #ddd;
}

.footer-bottom i {
    color: #F2AE30;
    margin: 0 3px;
}

/* ===== VALIDATION MESSAGES ===== */
.error-msg {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.error-msg.show {
    display: block;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets (max-width: 900px) - Mobile nav already handled above */
@media (max-width: 900px) {
    .buy-content {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        position: static;
        max-height: none;
    }
    
    .welcome-header {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium screens (max-width: 768px) */
@media (max-width: 768px) {
    header div img {
        height: 45px;
    }
    
    .dashboard-container {
        margin: 15px 10px;
        padding: 15px;
    }
    
    .welcome-text h2 {
        font-size: 1.4rem;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        padding: 15px;
        gap: 12px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
    
    .action-card {
        padding: 20px 15px;
        min-height: 140px;
    }
    
    .action-card i {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .action-card h4 {
        font-size: 1rem;
    }
    
    .action-card p {
        font-size: 0.8rem;
    }
    
    .buy-bundles-section {
        padding: 0 15px;
    }
    
    .buy-header,
    .buy-form {
        padding: 20px;
    }
    
    .buy-header h2 {
        font-size: 1.5rem;
    }
    
    .network-tab {
        padding: 8px;
        font-size: 0.85rem;
        min-width: 65px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        padding: 30px 15px;
    }
}

/* Mobile (max-width: 600px) */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }
    
    header {
        padding: 8px 10px;
    }
    
    header div img {
        height: 40px;
    }
    
    .dashboard-container {
        margin: 10px 8px;
        padding: 12px;
    }
    
    .welcome-text h2 {
        font-size: 1.2rem;
    }
    
    .welcome-text p {
        font-size: 0.85rem;
    }
    
    .icons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 10px;
    }
    
    /* Make wallet card span full width on mobile */
    .stats-container .wallet-bal {
        grid-column: span 2;
    }
    
    .wallet-bal,
    .total-sales,
    .today-sales,
    .complete,
    .pending,
    .processing {
        padding: 12px 10px;
        min-height: 110px;
    }
    
    .stats-container > div i {
        font-size: 1.5em;
        margin-bottom: 6px;
    }
    
    .stats-container div p {
        font-size: 1rem;
    }
    
    .stats-container div h5 {
        font-size: 0.7rem;
    }
    
    .stats-container button {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px;
    }
    
    .action-card {
        padding: 16px 12px;
        min-height: 130px;
        border-radius: 12px;
    }
    
    .action-card i {
        font-size: 1.75rem;
        width: 45px;
        height: 45px;
        margin-bottom: 8px;
    }
    
    .action-card h4 {
        font-size: 0.9rem;
        margin: 6px 0 4px 0;
    }
    
    .action-card p {
        font-size: 0.75rem;
        margin: 0;
        display: none;
    }
    
    .action-card .card-link {
        font-size: 0.75rem;
        margin-top: auto;
    }
    
    .buy-bundles-section {
        padding: 0 10px;
        margin: 20px auto;
    }
    
    .buy-header h2 {
        font-size: 1.3rem;
    }
    
    .container {
        width: 95%;
        padding: 15px;
    }
    
    .cart-container {
        width: 95%;
        padding: 15px;
    }
    
    .payment {
        width: 95%;
    }
    
    .excel-file-input-group {
        flex-direction: column;
    }
    
    .excel-file-label,
    .excel-upload-button {
        width: 100%;
        justify-content: center;
    }
    
    .footer-bottom {
        padding: 15px;
        font-size: 0.8rem;
    }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
    .profile-pic {
        width: 35px;
        height: 35px;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
    }
    
    .welcome-text {
        font-size: 0.9rem;
    }
    
    /* Stats redesign for very small screens */
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
        margin: 15px auto;
    }
    
    /* Wallet card spans full width */
    .stats-container .wallet-bal {
        grid-column: span 2;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
        min-height: 80px;
    }
    
    .stats-container .wallet-bal > * {
        margin: 0;
    }
    
    .stats-container .wallet-bal i {
        font-size: 2rem;
    }
    
    .stats-container .wallet-bal p {
        font-size: 1.25rem;
    }
    
    .stats-container .wallet-bal h5 {
        display: none;
    }
    
    /* Compact cards for other stats */
    .total-sales,
    .today-sales,
    .complete,
    .pending,
    .processing {
        padding: 10px 8px;
        min-height: 90px;
    }
    
    .stats-container > div i {
        font-size: 1.25em;
        margin-bottom: 4px;
    }
    
    .stats-container div p {
        font-size: 0.95rem;
        margin: 2px 0;
    }
    
    .stats-container div h5 {
        font-size: 0.65rem;
        margin: 2px 0;
    }
    
    .stats-container button {
        padding: 5px 10px;
        font-size: 0.65rem;
        margin-top: 5px;
    }
    
    .network-tabs {
        flex-direction: column;
    }
    
    .network-tab {
        width: 100%;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
}
