/* Dashboard Command Center Styles - Premium Upgrade */
:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #06b6d4;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary);
}

/* Main Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Header */
.page-header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.page-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary), #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.kpi-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInUp 0.6s ease-out backwards;
}

.kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.2s;
}

.kpi-card:nth-child(3) {
    animation-delay: 0.3s;
}

.kpi-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0.3;
}

.kpi-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.kpi-change.positive {
    color: var(--success);
}

.kpi-change.negative {
    color: var(--danger);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.chart-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

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

.chart-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

/* Alerts Section */
.alerts-section {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.alert-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: rgba(239, 68, 68, 0.05);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    transition: all 0.3s;
}

.alert-item:hover {
    transform: translateX(10px);
    background: rgba(239, 68, 68, 0.1);
}

/* Hero Case Alert Styling */
.alert-item.hero-alert {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), transparent);
    border-left: 5px solid var(--danger);
    animation: pulse-danger 2s infinite;
    position: relative;
    overflow: hidden;
}

.alert-item.hero-alert::after {
    content: 'CRITICAL PRIORITY';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.alert-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-size: 1.25rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.alert-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.action-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.action-btn i {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-danger {
    0% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
    }

    100% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    }
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    text-align: center;
    padding: 3rem;
    color: var(--danger);
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

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

    .nav-links {
        display: none;
    }
}