@import url('tokens.css');
/* ═══════════════════════════════════════════════════════
   ANALYTICS — CSURFACE
   Original styles (home page inline analytics) +
   New styles (dedicated /analytics dashboard page)
   ═══════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────
   SECTION 1: Original Analytics Styles (home page)
   ────────────────────────────────────────────────────── */

/* Analytics Section */
.analytics-section {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Unified Analytics Card */
.analytics-unified-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.analytics-unified-card .card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.analytics-unified-card .card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.analytics-unified-card .card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Compact Grid Layout */
.analytics-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Left: Metrics Section */
.analytics-metrics {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--darker-navy);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.metric-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #00D9FF;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.metric-change.positive {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.metric-change.negative {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Severity Mini Section */
.severity-mini {
    padding: 1rem;
    background: var(--darker-navy);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.severity-mini h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.severity-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.severity-bar-item {
    display: grid;
    grid-template-columns: 60px 1fr 40px;
    align-items: center;
    gap: 0.5rem;
}

.bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bar-wrapper {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bar.critical {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.bar.high {
    background: linear-gradient(90deg, #F97316, #EA580C);
}

.bar.medium {
    background: linear-gradient(90deg, #EAB308, #CA8A04);
}

.bar.low {
    background: linear-gradient(90deg, #10B981, #059669);
}

.bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Right: Products Section */
.analytics-products {
    padding: 1rem;
    background: var(--darker-navy);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.analytics-products h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.product-item:hover {
    border-color: #00D9FF;
    transform: translateX(4px);
}

.product-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.product-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: #00D9FF;
    background: rgba(0, 217, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive Design (original) */
@media (max-width: 768px) {
    .analytics-compact-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-unified-card {
        padding: 1.5rem;
    }
}


/* ──────────────────────────────────────────────────────
   SECTION 2: Analytics Dashboard Page (/analytics)
   ────────────────────────────────────────────────────── */

/* ── Hero ── */
.analytics-hero {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 2rem 2rem 0;
    text-align: center;
}

.analytics-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.analytics-subtitle {
    color: #94A3B8;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Container ── */
.analytics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
}

.analytics-row {
    margin-bottom: 1.5rem;
}

/* ── KPI Grid ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.kpi-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, transform 0.2s;
}

.kpi-card:hover {
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #F1F5F9;
    line-height: 1.1;
}

.kpi-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #94A3B8;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.kpi-trend.trend-up {
    color: #EF4444;
}

.kpi-trend.trend-down {
    color: #22C55E;
}

.trend-period {
    color: #64748B;
    font-weight: 400;
}

.kpi-subtitle {
    font-size: 0.7rem;
    color: #64748B;
    margin-top: 0.35rem;
}

/* ── Chart Grids ── */
.chart-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.chart-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

/* ── Chart Card ── */
.chart-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s;
}

.chart-card:hover {
    border-color: rgba(71, 85, 105, 0.5);
}

.chart-header {
    padding: 1.25rem 1.5rem 0;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: #F1F5F9;
    margin: 0;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 0.25rem;
    display: block;
}

.chart-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.table-body {
    padding: 0.75rem 0 0;
    overflow-x: auto;
}

/* ── Severity Legend (dashboard donut) ── */
.severity-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.8rem;
    color: #CBD5E1;
    flex: 1;
}

.legend-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #F1F5F9;
}

/* ── Funnel ── */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.funnel-bar {
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    min-width: 50px;
    transition: width 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.funnel-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.funnel-label {
    font-size: 0.75rem;
    color: #475569;
    white-space: nowrap;
}

/* ── Analytics Table ── */
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.analytics-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    background: rgba(15, 23, 42, 0.5);
}

.analytics-table tbody tr {
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
    transition: background 0.2s;
}

.analytics-table tbody tr:hover {
    background: rgba(71, 85, 105, 0.1);
}

.analytics-table tbody td {
    padding: 0.65rem 1rem;
    color: #334155;        /* readable dark slate on the light table */
    vertical-align: middle;
}

.clickable-row {
    cursor: pointer;
}

.table-cve-link {
    color: #60A5FA;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.table-cve-link:hover {
    color: #93C5FD;
}

.mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
}

.muted {
    color: #64748B;
}

.highlight {
    color: #1e40af;
    font-weight: 700;
}

/* ── Mini Badges ── */
.mini-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.mini-badge.kev {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mini-badge.exploit {
    background: rgba(249, 115, 22, 0.15);
    color: #F97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ── Severity Dot (dashboard tables) ── */
.severity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.severity-dot.critical { background: #EF4444; }
.severity-dot.high { background: #F97316; }
.severity-dot.medium { background: #EAB308; }
.severity-dot.low { background: #22C55E; }

/* ── Vendor / Product ── */
.vendor-name {
    font-weight: 600;
    color: #F1F5F9;
}

.product-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Exposure Bar ── */
.exposure-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exposure-bar {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #00d9ff, #60A5FA);
    min-width: 4px;
    transition: width 0.5s ease;
}

.exposure-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94A3B8;
    white-space: nowrap;
}

/* ── Trend indicators ── */
.trend-up {
    color: #22C55E;
}

.trend-down {
    color: #EF4444;
}

/* ── Info Button ── */
.info-btn {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.3rem;
    vertical-align: middle;
    transition: color 0.2s;
}
.info-btn:hover {
    color: #00d9ff;
}

/* ── Info Modal ── */
.info-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.info-modal {
    background: #1E293B;
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 12px;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}
.info-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #E2E8F0;
}
.info-modal-close {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.3rem;
}
.info-modal-close:hover {
    color: #ef4444;
}
.info-modal-body {
    padding: 1.5rem;
    color: #CBD5E1;
    font-size: 0.85rem;
    line-height: 1.6;
}
.info-modal-body p {
    margin: 0.5rem 0;
}
.info-modal-body ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}
.info-modal-body li {
    margin-bottom: 0.5rem;
}
.info-lang-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.info-lang-tab {
    background: rgba(71, 85, 105, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #94A3B8;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.info-lang-tab.active {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.4);
    color: #00d9ff;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    color: #64748B;
    padding: 2rem 1rem !important;
    font-style: italic;
}

/* ── Venn Diagram ── */
.venn-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.venn-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.venn-circle {
    cursor: pointer;
    transition: fill-opacity 0.3s, stroke-width 0.3s;
}

.venn-circle:hover {
    fill-opacity: 0.25;
    stroke-width: 3;
}

.venn-circle-link,
.venn-zone-link {
    cursor: pointer;
}

.venn-count {
    font-size: 18px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.venn-intersect {
    font-size: 16px;
    font-weight: 700;
}

.venn-center {
    font-size: 20px;
    font-weight: 900;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
}

.venn-label {
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    letter-spacing: 0.03em;
}

/* Venn center pulse animation */
.venn-center-pulse {
    animation: vennPulse 3s ease-in-out infinite;
}

@keyframes vennPulse {
    0%, 100% { fill-opacity: 0.08; stroke-opacity: 0.3; }
    50% { fill-opacity: 0.18; stroke-opacity: 0.6; }
}

/* ── Funnel Links ── */
.funnel-step-link {
    text-decoration: none;
    display: block;
    transition: transform 0.2s;
}

.funnel-step-link:hover {
    transform: translateX(4px);
}

.funnel-step-link:hover .funnel-bar {
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── Panoramic EPSS History Chart ── */
.panoramic-row {
    grid-column: 1 / -1;
}

.panoramic-card {
    min-height: 600px;
}

.panoramic-card .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
}

.chart-title-group {
    flex: 1;
}

.panoramic-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.year-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-filter label {
    color: #94A3B8;
    font-size: 0.85rem;
    font-weight: 500;
}

.year-filter select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #E2E8F0;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.year-filter select:hover,
.year-filter select:focus {
    border-color: #06B6D4;
}

.panoramic-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #94A3B8;
}

.legend-persistent { color: #EF4444; }
.legend-rising { color: #22C55E; }
.legend-stable { color: #94A3B8; }

.panoramic-chart-container {
    padding: 1rem 1.5rem;
    height: 400px;
    position: relative;
}

/* CVE Legend Grid below chart */
.panoramic-cve-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(71, 85, 105, 0.2);
}

.panoramic-cve-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.panoramic-cve-item:hover {
    background: rgba(30, 64, 175, 0.06);
    border-color: rgba(30, 64, 175, 0.35);
    transform: translateY(-1px);
}

.panoramic-cve-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.panoramic-cve-id {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
    font-family: 'JetBrains Mono', monospace;
}

.panoramic-cve-epss {
    font-size: 0.7rem;
    color: #06B6D4;
    font-weight: 500;
}

.panoramic-cve-growth {
    font-size: 0.7rem;
    color: #475569;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.panoramic-cve-growth i {
    font-size: 0.55rem;
    color: #22C55E;
    margin: 0 0.15rem;
}

.panoramic-cve-delta {
    font-size: 0.65rem;
    color: #22C55E;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
}

.panoramic-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.panoramic-badge.persistent {
    color: #EF4444;
}

.panoramic-badge.kev {
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.panoramic-badge.exploit {
    color: #F97316;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.panoramic-trend {
    font-size: 0.7rem;
}

.panoramic-trend.rising { color: #22C55E; }
.panoramic-trend.declining { color: #EF4444; }
.panoramic-trend.stable { color: #64748B; }

/* ── EPSS Movers badges ── */
.movers-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.movers-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.movers-badge-kev {
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.movers-badge-kev .fas {
    color: #22C55E;
    font-size: 0.65rem;
}

.movers-badge-exp {
    color: #F97316;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.movers-badge-exp .fas {
    color: #22C55E;
    font-size: 0.65rem;
}

.movers-badge-poc {
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.movers-badge-poc .fas {
    color: #22C55E;
    font-size: 0.65rem;
}

.movers-delta {
    display: inline-flex;
    align-items: center;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

.movers-delta .mono.trend-up {
    font-size: 0.75rem;
    color: #22C55E;
    font-weight: 700;
}

/* ── Severity Timing Grid ── */
.severity-timing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.severity-timing-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: border-color 0.3s;
}

.severity-timing-card:hover {
    border-color: rgba(100, 116, 139, 0.4);
}

.severity-timing-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
}

.severity-timing-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.severity-timing-count {
    font-size: 0.7rem;
    color: #64748B;
    margin-left: auto;
}

.severity-timing-metrics {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.severity-timing-metric {
    flex: 1;
    text-align: center;
}

.severity-metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #F1F5F9;
    line-height: 1.2;
}

.severity-metric-value small {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94A3B8;
}

.severity-metric-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

.severity-metric-value-lg {
    font-size: 2rem;
    font-weight: 800;
}

.severity-timing-divider {
    width: 1px;
    height: 36px;
    background: rgba(71, 85, 105, 0.25);
    flex-shrink: 0;
}

/* ── Responsive (dashboard page) ── */
@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .severity-timing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .severity-timing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-grid-3col {
        grid-template-columns: 1fr;
    }
    .chart-grid-2col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .severity-timing-grid {
        grid-template-columns: 1fr;
    }
    .severity-timing-metrics {
        flex-wrap: wrap;
    }
    .analytics-title {
        font-size: 1.5rem;
    }
    .analytics-container {
        padding: 1rem;
    }
    .chart-body {
        padding: 1rem;
    }
    .panoramic-card .chart-header {
        flex-direction: column;
    }
    .panoramic-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .panoramic-chart-container {
        height: 300px;
    }
    .panoramic-cve-legend {
        gap: 0.3rem;
    }
    .panoramic-cve-item {
        padding: 0.25rem 0.5rem;
    }
    .panoramic-cve-id {
        font-size: 0.65rem;
    }
}

/* =====================================================================
   LIGHT DESIGN SYSTEM OVERRIDES — analytics (csurface / ml-discovery)
   ===================================================================== */

/* Card surfaces: dark glass → white */
.kpi-card, .chart-card, .panoramic-card,
.severity-timing-card, .stat-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm);
    backdrop-filter: none !important;
    border-radius: var(--r-lg);
}
.kpi-card:hover, .chart-card:hover { border-color: var(--border-strong) !important; }

/* Titles / labels / values → dark text, Como display */
.analytics-title, .chart-title, .kpi-value, .severity-metric-value,
.severity-metric-value-lg, .panoramic-cve-id {
    color: var(--text-strong);
    font-family: var(--font-display);
}
.analytics-subtitle, .chart-subtitle, .kpi-label, .kpi-subtitle,
.severity-metric-label, .severity-timing-label, .funnel-label {
    color: var(--text-muted);
}
.kpi-value, .severity-metric-value { font-weight: 800; }

/* Hero */
.analytics-hero { background: transparent; border-bottom: 1px solid var(--border); }

/* Severity accent bars → monochrome (slate intensity + danger) */
.kpi-card.critical::before, .funnel-bar.critical,
.severity-timing-card.critical { background: var(--danger) !important; }
.kpi-card.high::before, .funnel-bar.high,
.severity-timing-card.high { background: var(--slate-600) !important; }
.kpi-card.medium::before, .funnel-bar.medium { background: var(--slate-400) !important; }
.kpi-card.low::before, .funnel-bar.low { background: var(--slate-300) !important; }

/* Tables → light zebra */
.analytics-table { color: var(--text); }
.analytics-table thead th { color: var(--text-muted); border-bottom: 1px solid var(--border); }
.analytics-table tbody tr { border-bottom: 1px solid var(--border); }
.analytics-table tbody tr:nth-child(even) { background: var(--bg-subtle); }
.analytics-table tbody tr:hover { background: var(--accent-soft); }

/* Modals / overlays → light */
.info-modal-overlay { background: rgba(15,23,42,0.35); backdrop-filter: none; }
.info-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}
.info-btn { color: var(--text-faint); }
.info-btn:hover { color: var(--accent); }

/* Year-filter select (Timing + Panoramic) → light control */
.year-filter select, #timingYearSelect, #panoramicYearSelect {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--r-md);
}
.year-filter label { color: var(--text-muted); }

/* Panoramic containers */
.panoramic-chart-container, .panoramic-cve-legend { background: transparent; border-color: var(--border); }
.panoramic-cve-item { border-bottom: 1px solid var(--border); }

/* Severity timing dividers / borders */
.severity-timing-divider { background: var(--border); }

/* ── Contrast fixes (WCAG AA sobre fundo branco) ──
   Tokens dark-theme herdados falhavam: #60A5FA 2.5:1, #22C55E 2.3:1,
   #EF4444 3.8:1. Ink tokens definidos em tokens.css. */
.table-cve-link { color: var(--accent-ink); }
.table-cve-link:hover { color: var(--accent-ink-hover); }
.trend-up, .movers-delta .mono.trend-up { color: var(--positive-ink); }
.trend-down { color: var(--danger); }
/* KPI trends têm semântica invertida (subir = risco = vermelho) */
.kpi-trend.trend-up { color: var(--danger); }
.kpi-trend.trend-down { color: var(--positive-ink); }
