/**
 * PRISM - Common Dashboard Styles
 * Extracted from inline <style> blocks for better cacheability
 * File size: ~15KB (cacheable across all pages)
 */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    line-height: 1.6;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    padding: 30px 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-bottom: none;
    position: relative;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #06b6d4);
    opacity: 0.6;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

.header-logo {
    height: 60px;
}

.header-text {
    flex: 1;
}

.dashboard-header h1 {
    color: #1e40af;
    font-weight: 800;
    margin-bottom: 5px;
    font-size: 24px;
}

.dashboard-header p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

/* Container */
.container-custom {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Cards */
.card-custom {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: box-shadow 0.4s cubic-bezier(.22,1,.36,1), transform 0.4s cubic-bezier(.22,1,.36,1);
}

.card-custom:hover {
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: #3b82f6;
    font-size: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    border-left: none;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #1e40af, #3b82f6) 1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: all 0.35s cubic-bezier(.22,1,.36,1);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
}

canvas {
    max-width: 100%;
}

/* Tables */
.data-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

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

.data-table th {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 1rem;
    border: none;
    text-align: left;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.03);
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    margin: 0.5rem 0;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    border-radius: 16px;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.spinner {
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Severity Badges */
.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-catastrophic {
    background: #dc2626;
    color: white;
}

.severity-critical {
    background: #f59e0b;
    color: white;
}

.severity-high {
    background: #eab308;
    color: #000;
}

.severity-moderate {
    background: #06b6d4;
    color: white;
}

.severity-low {
    background: #10b981;
    color: white;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(.22,1,.36,1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 8px 24px rgba(59, 130, 246, 0.25);
}

/* Search/Filter */
.search-container {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(.22,1,.36,1);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px 15px;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .container-custom {
        padding: 0 15px 30px;
    }

    .card-custom {
        padding: 15px;
        margin-bottom: 15px;
    }

    .chart-container {
        height: 300px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }

    .dashboard-header {
        padding: 15px 10px;
    }

    .dashboard-header h1 {
        font-size: 1.25rem;
    }

    .card-custom {
        padding: 12px;
        border-radius: 8px;
    }

    .chart-container {
        height: 250px;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .loading-content {
        padding: 1.5rem 1.25rem;
    }
}
