@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    --sidebar-width: 250px;
    --glass-blur: blur(12px);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    /* Animated subtle gradient background */
    background: radial-gradient(circle at top left, #1a1e36, #0b0f19 40%),
                radial-gradient(circle at bottom right, #1a1435, #0b0f19 40%);
    background-color: var(--bg-main);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    border-radius: 16px;
}

/* --- LOGIN PAGE --- */
.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Blurred decorative orbs for premium feel */
.login-orb-1, .login-orb-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.5;
}
.login-orb-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-purple);
    top: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite alternate;
}
.login-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    bottom: -100px;
    right: -100px;
    animation: float 10s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    z-index: 10;
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
}

.icon-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.error-message {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- DASHBOARD LAYOUT --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: var(--glass-blur);
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-link i {
    font-size: 18px;
}

.sidebar-footer {
    margin-top: auto;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.btn-secondary {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

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

.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 3px solid transparent;
}

.stat-card.blue { border-top-color: var(--accent-blue); }
.stat-card.purple { border-top-color: var(--accent-purple); }
.stat-card.green { border-top-color: #10b981; }
.stat-card.orange { border-top-color: #f59e0b; }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- CHARTS GRID --- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    padding: 24px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

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

.chart-title {
    font-size: 16px;
    font-weight: 600;
}

.chart-body {
    flex: 1;
    position: relative;
    width: 100%;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
}
.empty-state i {
    font-size: 32px;
    opacity: 0.5;
}

/* --- MOBILE RESPONSIVENESS --- */
.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    .mobile-toggle {
        display: block;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}
