* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fb;
    color: #1a1a2e;
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card, .register-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: #667eea;
    margin-bottom: 8px;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
}

.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-details strong {
    display: block;
    font-size: 14px;
}

.user-details small {
    display: block;
    font-size: 11px;
    opacity: 0.7;
}

.status-active {
    color: #4ade80;
    margin-top: 4px;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: white;
    text-decoration: none;
}

.sidebar-nav {
    padding: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    color: white;
}

.wallet-balance .wallet-label {
    font-size: 14px;
    opacity: 0.9;
    display: block;
}

.wallet-balance .wallet-amount {
    font-size: 36px;
    font-weight: bold;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.stat-sub {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* WhatsApp Channel */
.whatsapp-channel {
    background: #25D366;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Filters */
.filters-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 120px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* Orders Table */
.orders-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.orders-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-info {
    background: #dbeafe;
    color: #2563eb;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

/* Pagination */
.pagination {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.pagination-links {
    display: flex;
    gap: 8px;
}

.page-link {
    padding: 6px 12px;
    background: #f3f4f6;
    text-decoration: none;
    color: #374151;
    border-radius: 6px;
    font-size: 14px;
}

.page-link.active {
    background: #667eea;
    color: white;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
}

.form-group small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.bank-details {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.bank-details p {
    margin-bottom: 8px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1100;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .orders-table {
        font-size: 12px;
    }
    
    .orders-table th, .orders-table td {
        padding: 8px;
    }
}

/* Admin Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    position: fixed;
    height: 100vh;
    padding: 20px;
}

.admin-sidebar h2 {
    margin-bottom: 24px;
    font-size: 20px;
}

.admin-sidebar .nav-link {
    display: block;
    padding: 10px 14px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: #334155;
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* Inline editing styles */
.edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

.actions-cell {
    min-width: 280px;
}

.filters-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    color: #666;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.actions-cell {
    min-width: 320px;
}

.filters-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    color: #666;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.btn-warning { background: #f59e0b; color: white; }
.btn-success { background: #10b981; color: white; }
.btn-secondary { background: #6b7280; color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-info { background: #3b82f6; color: white; }
.btn-primary { background: #667eea; color: white; }

/* ============================================
   ADD THESE MOBILE RESPONSIVE STYLES TO YOUR EXISTING CSS
   ============================================ */

/* Mobile Menu Button - NEW */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mobile-menu-btn:hover {
    background: #5a67d8;
}

/* Sidebar Overlay - NEW */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* Enhanced Mobile Responsive - Add to existing media queries */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar,
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 999;
    }
    
    .sidebar.open,
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .main-content,
    .admin-main {
        margin-left: 0 !important;
        padding-top: 70px;
    }
    
    .action-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .bundle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .bundle-grid {
        grid-template-columns: 1fr;
    }
}

/* Make tables scrollable on mobile - NEW */
@media (max-width: 768px) {
    .orders-table-container,
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .orders-table,
    .data-table,
    .transactions-table {
        min-width: 650px;
    }
}

/* Vendor Balance Card - NEW */
.vendor-balance {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
}

.vendor-balance .stat-value {
    font-size: 24px;
}

.vendor-balance .stat-label {
    color: #6b21a5;
}

/* ============================================
   MAKE EXISTING SIDEBAR MOBILE FRIENDLY
   ============================================ */

/* Hide mobile menu toggle on desktop by default */
.mobile-menu-toggle {
    display: none;
}

/* Mobile styles - transforms existing sidebar into hamburger menu */
@media (max-width: 768px) {
    /* Make sidebar collapsible */
    .sidebar, .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    /* Show sidebar when open */
    .sidebar.open, .admin-sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content takes full width */
    .main-content, .admin-main {
        margin-left: 0 !important;
        width: 100%;
        padding: 60px 15px 20px 15px;
    }
    
    /* Show hamburger menu button on mobile only */
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #667eea;
        color: white;
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 8px;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        align-items: center;
        justify-content: center;
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    /* Adjust user info on mobile sidebar */
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .logout-btn {
        position: static;
        margin-top: 10px;
        display: inline-block;
    }
    
    /* Make stats grid responsive */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Make action buttons responsive */
    .action-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .action-buttons .btn {
        width: 100%;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Make bundle grid responsive */
    .bundle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Make wallet card responsive */
    .wallet-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Make filters responsive */
    .filters-section {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    /* Make tables scrollable */
    .orders-table-container, .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .orders-table, .data-table, .transactions-table {
        min-width: 600px;
    }
    
    /* Make WhatsApp channel responsive */
    .whatsapp-channel {
        flex-direction: column;
        text-align: center;
    }
    
    /* Make pagination responsive */
    .pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pagination-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Make modals responsive */
    .modal-content {
        width: 95%;
        margin: 10px auto;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .bundle-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .wallet-amount {
        font-size: 24px;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bundle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}