:root {
    --primary-color: #25D366; /* WhatsApp Green */
    --secondary-color: #128C7E;
    --accent-color: #075E54;
    --gold-color: #FFD700;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
}

.login-tabs {
    display: flex;
    background: var(--accent-color);
}

.login-tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
}

.login-tab:hover {
    background: rgba(255,255,255,0.1);
}

.login-tab.active {
    background: white;
    color: var(--accent-color);
}

.login-content {
    padding: 40px;
}

.login-form .form-control {
    border-radius: 10px;
    padding: 12px 20px;
    border: 2px solid #eee;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: transform 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

/* Dashboard Cards */
.stats-card {
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.stats-card .card-body {
    padding: 25px;
}

.stats-card .icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 3rem;
    opacity: 0.2;
}

.card-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.card-success {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.card-warning {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    color: white;
}

.card-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.card-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.card-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #2c3e50, #34495e);
    color: white;
    overflow-y: auto;
    z-index: 1050;
    transition: all 0.3s;
    -webkit-overflow-scrolling: touch;
}

.sidebar-menu {
    position: relative;
    z-index: 1060;
}

.sidebar-header {
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h4 {
    font-size: 0.95rem;
    margin: 0;
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebarToggle {
    padding: 4px 8px;
    font-size: 0.85rem;
    margin-left: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    transition: all 0.3s;
    flex-shrink: 0;
}

#sidebarToggle:hover {
    background: rgba(255,255,255,0.2);
}

#sidebarToggle::after {
    display: none !important;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h4 span,
.sidebar.collapsed .sidebar-menu a span,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.collapsed .sidebar-menu a i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 10px;
    text-align: center;
}

.sidebar.collapsed .sidebar-footer a {
    display: block;
    margin-bottom: 10px;
}

.main-content.expanded {
    margin-left: 70px;
}

#closeSidebarBtn {
    opacity: 0.8;
    transition: all 0.3s ease;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 4px 8px;
}

#closeSidebarBtn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

#closeSidebarBtn i {
    font-size: 0.9rem;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.sidebar-menu a.active {
    background: var(--primary-color);
    border-left: 4px solid white;
}

.sidebar-menu a i {
    width: 25px;
    margin-right: 10px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: #f8f9fa;
    transition: all 0.3s;
}

.top-navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

#mobileSidebarToggle {
    display: none;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

#mobileSidebarToggle:hover {
    background: rgba(0,0,0,0.05);
    color: #667eea;
}

@media (max-width: 768px) {
    #mobileSidebarToggle {
        display: block !important;
    }
    
    .top-navbar {
        padding: 10px 15px;
    }
}

.content-wrapper {
    padding: 30px;
}

/* Tables */
.table-responsive {
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    background: white;
}

.table thead th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-sm {
    padding: 5px 15px;
    font-size: 0.875rem;
}

/* Modal */
.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Crown Icon for Top Shops */
.crown-badge {
    position: relative;
    display: inline-block;
}

.crown-badge::before {
    content: '👑';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) translateX(-50%); }
    50% { transform: translateY(-10px) translateX(-50%); }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px !important;
        z-index: 1050 !important;
        pointer-events: auto !important;
    }
    
    .sidebar.show {
        transform: translateX(0);
        pointer-events: auto !important;
    }
    
    .sidebar.collapsed {
        width: 280px !important;
    }
    
    /* Ensure all sidebar elements are clickable */
    .sidebar * {
        pointer-events: auto !important;
    }
    
    .sidebar-menu {
        pointer-events: auto !important;
        z-index: 1060 !important;
    }
    
    .sidebar-menu li {
        pointer-events: auto !important;
    }
    
    .sidebar-menu a {
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative;
        z-index: 1070 !important;
        display: flex !important;
        align-items: center;
        -webkit-tap-highlight-color: rgba(255,255,255,0.2);
    }
    
    .sidebar-menu a:active {
        background: rgba(255,255,255,0.2) !important;
    }
    
    .sidebar-footer {
        pointer-events: auto !important;
        z-index: 1060 !important;
    }
    
    .sidebar-footer a {
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative;
        z-index: 1070 !important;
        display: block !important;
        -webkit-tap-highlight-color: rgba(255,255,255,0.2);
    }
    
    .main-content {
        margin-left: 0;
        pointer-events: auto !important;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    /* Hide desktop toggle button on mobile */
    #sidebarToggle {
        display: none;
    }
    
    /* Ensure mobile toggle button works */
    #mobileSidebarToggle {
        display: block !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 1080 !important;
        position: relative;
    }
    
    .login-tabs {
        flex-direction: column;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 3px 6px;
    font-size: 0.7rem;
}
