:root {
    --primary: #0066ff;
    --primary-dark: #0052d4;
    --secondary: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #1e293b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--darker);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Login Page */
.login-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(102,126,234,0.4);
}

.login-box h1 {
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 8px;
}

.subtitle {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-error {
    background: linear-gradient(135deg, #fee, #fcc);
    color: #dc2626;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 500;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #334155;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    color: #1e293b;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,102,255,0.3);
}

.info-box {
    margin-top: 25px;
    padding: 16px;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: #1e40af;
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--border);
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text small {
    font-size: 11px;
    color: var(--gray);
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--light);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0,102,255,0.1), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,102,255,0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    padding: 24px;
    overflow-y: auto;
    max-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header-title h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.header-title small {
    font-size: 14px;
    color: var(--gray);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stat-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--light), #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(0,102,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.stat-progress {
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 1s ease;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Tables */
.table-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--light);
}

.data-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.info-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--gray);
    font-size: 14px;
}

.info-value {
    color: var(--light);
    font-weight: 600;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        gap: 16px;
    }
}

/* Loading */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}
