* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2563eb;
}

.auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-form {
    display: flex;
    gap: 10px;
}

.login-form input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-form button, .user-info button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-form button:hover, .user-info button:hover {
    background: #1d4ed8;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 24px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #f9fafb;
}

.tab-button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.tab-content {
    display: none;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 20px;
    color: #1f2937;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.stat-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 28px;
    font-weight: bold;
    color: #1f2937;
}

.chart-container {
    margin-bottom: 40px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #374151;
}

.chart-container canvas {
    max-height: 400px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table thead {
    background: #f9fafb;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

table tbody tr:hover {
    background: #f9fafb;
}

.filters {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters input {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 80px;
}

.filters button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.filters button:hover {
    background: #1d4ed8;
}

.top-users {
    margin-top: 30px;
}

.top-users h3 {
    margin-bottom: 15px;
    color: #374151;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.notification-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.notification-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Status badges */
.status-active {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: #d1fae5;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
}

.status-inactive {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.status-blocked {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .auth-section {
        width: 100%;
    }
    
    .login-form {
        flex-direction: column;
        width: 100%;
    }
    
    .login-form input {
        width: 100%;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        white-space: nowrap;
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Improved hover effects */
.tab-button {
    transition: all 0.2s ease;
}

.tab-button:hover:not(.active) {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

table tbody tr {
    transition: background-color 0.15s ease;
}

/* Scrollbar styling */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    font-size: 24px;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Dark theme */
body.dark-theme {
    background-color: #1f2937;
    color: #f3f4f6;
}

body.dark-theme header,
body.dark-theme .tab-content,
body.dark-theme .stat-card,
body.dark-theme .chart-container,
body.dark-theme .filters {
    background: #374151;
    color: #f3f4f6;
}

body.dark-theme .tab-button {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

body.dark-theme .tab-button.active {
    background: #2563eb;
    color: white;
}

body.dark-theme .stat-card {
    border-left-color: #60a5fa;
}

body.dark-theme table thead {
    background: #4b5563;
}

body.dark-theme table tbody tr:hover {
    background: #4b5563;
}

body.dark-theme .notification-error {
    background: #7f1d1d;
    color: #fecaca;
}

body.dark-theme .notification-success {
    background: #064e3b;
    color: #a7f3d0;
}

body.dark-theme .notification-info {
    background: #1e3a8a;
    color: #bfdbfe;
}

/* Table sorting and pagination */
.table-wrapper {
    position: relative;
}

.table-sortable th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

.table-sortable th::after {
    content: ' ↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.table-sortable th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

.table-sortable th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 20px;
}

.pagination button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background: #1d4ed8;
}

.pagination span {
    color: #6b7280;
}

/* Search and filters */
.search-box {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

body.dark-theme .search-box {
    background: #374151;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

body.dark-theme .search-box input {
    background: #4b5563;
    border-color: #6b7280;
    color: #f3f4f6;
}

