* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #0f0f1e;
    --surface: #1a1a2e;
    --surface-light: #252541;
    --text-primary: #ffffff;
    --text-secondary: #a3a3b3;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #2d2d4a;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item .icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.admin-details {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--background);
}

/* Header */
.header {
    background: var(--surface);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    min-height: 73px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--surface-light);
    font-size: 0.9rem;
}

.server-status.online {
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-light);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.header-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.85rem;
    display: inline-block;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }
.stat-change.neutral { color: var(--text-secondary); }

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.chart-placeholder {
    height: 300px;
    background: var(--surface-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.recent-activity {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.recent-activity h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--border);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-icon.blue { background: rgba(59, 130, 246, 0.2); }
.activity-icon.red { background: rgba(239, 68, 68, 0.2); }
.activity-icon.green { background: rgba(16, 185, 129, 0.2); }
.activity-icon.orange { background: rgba(245, 158, 11, 0.2); }

.activity-details {
    flex: 1;
}

.activity-details p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.content-header h2 {
    font-size: 1.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    max-width: 400px;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.search-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.primary-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: var(--border);
    border-color: var(--primary-color);
}

/* Table Styles */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--surface-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--surface-light);
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge.offline {
    background: rgba(163, 163, 179, 0.2);
    color: var(--text-secondary);
}

.badge.banned {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.action-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.25rem;
}

.action-btn:hover {
    background: var(--surface-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Logs Container */
.logs-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--surface-light);
    border-radius: 8px;
    border-left: 3px solid transparent;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry.info { border-left-color: #3b82f6; }
.log-entry.success { border-left-color: var(--success); }
.log-entry.warning { border-left-color: var(--warning); }
.log-entry.error { border-left-color: var(--error); }

.log-time {
    color: var(--text-secondary);
    min-width: 80px;
}

.log-type {
    min-width: 80px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-entry.info .log-type { color: #3b82f6; }
.log-entry.success .log-type { color: var(--success); }
.log-entry.warning .log-type { color: var(--warning); }
.log-entry.error .log-type { color: var(--error); }

.log-message {
    flex: 1;
    color: var(--text-primary);
}

/* Vehicles Grid */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.vehicle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--primary-color);
}

.vehicle-image {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.vehicle-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.vehicle-owner, .vehicle-plate {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.vehicle-status {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 1rem 0;
}

.vehicle-status.parked {
    background: rgba(163, 163, 179, 0.2);
    color: var(--text-secondary);
}

.vehicle-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Factions List */
.factions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faction-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.faction-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px var(--shadow);
}

.faction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.faction-header h3 {
    font-size: 1.2rem;
}

.member-count {
    padding: 0.35rem 0.75rem;
    background: var(--surface-light);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.faction-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.faction-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Settings Container */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    color: var(--text-primary);
    font-weight: 500;
}

.setting-input {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
    width: 250px;
}

.setting-input:focus {
    border-color: var(--primary-color);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .nav-item span:not(.icon) {
        display: none;
    }

    .logo h2,
    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        max-width: 100%;
    }
}
