/* Ensure backward compatibility and better rendering */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Modern Color Palette - Organized by Category */
:root {
    /* Color System */
    --primary-color: #4361ee;
    --primary-color-rgb: 67, 97, 238;
    --primary-color-light: #5a75f3;
    --primary-color-dark: #3651d8;
    --secondary-color: #3f72af;
    --accent-color: #7209b7;
    --hover-color: #3b82f6;

    /* Severity Colors */
    --critical-color: #ff4757;
    --high-color: #ff7f50;
    --medium-color: #ffa502;
    --low-color: #2ed573;

    /* Status Colors */
    --success-color: #10b981;
    --info-color: #3b82f6;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* UI Colors */
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* Shadows and Effects */
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --btn-shadow: 0 4px 6px rgba(67, 97, 238, 0.25);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Layout and Sizing */
    --card-border-radius: 10px;
    --btn-border-radius: 6px;
    --header-height: 70px;
    --content-max-width: 1400px;
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;

    /* Animation */
    --transition-speed: 0.3s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);

    /* Statistics Layout Configuration */
    --gauge-size-desktop: 100px;
    --gauge-size-tablet: 90px;
    --gauge-size-mobile: 80px;
    --gauge-size-small: 60px;

    --radar-size-desktop: 300px;
    --radar-size-tablet: 270px;
    --radar-size-mobile: 220px;
    --radar-size-small: 180px;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: #121826;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --primary-color: #4f6af5;
    --primary-color-rgb: 79, 106, 245;
    --secondary-color: #60a5fa;
    --hover-color: #6481ff;

    /* Status colors for dark mode */
    --success-color: #22c55e;
    --info-color: #60a5fa;
    --warning-color: #fbbf24;
    --danger-color: #f87171;

    /* Dark mode shadows */
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --btn-shadow: 0 4px 6px rgba(67, 97, 238, 0.4);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);

    /* Set color scheme for OS-level support */
    color-scheme: dark;
}

/* ===== BASE STYLES ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 20px;
    width: calc(100% - 40px);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ===== ACCESSIBILITY ===== */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    z-index: 1001;
    font-weight: bold;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 2.2rem;
    background-image: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: -0.5px;
    animation: fadeInUp 1s ease;
}

.dashboard-header p {
    margin: 8px 0 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
    animation: fadeInUp 1.2s ease;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== CARD STYLES ===== */
.card {
    background-color: var(--card-bg);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    overflow: hidden;
    width: 100%;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.5s ease;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(to right, rgba(67, 97, 238, 0.05), rgba(114, 9, 183, 0.05));
}

.card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
}

.card-body {
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    contain: content;
}

/* ===== STATISTICS LAYOUT ===== */
/* Main statistics container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
}

/* Compact stats layout with improved flexibility */
.compact-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.stats-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.stats-column h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

/* Gauge container with optimized layout */
.compact-gauge-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
}

.gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    transition: transform var(--transition-speed) ease;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}

.gauge-card:hover {
    transform: translateY(-5px);
}

.gauge-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

/* Standardized gauge sizes */
.gauge-chart, .gauge-sm {
    width: var(--gauge-size-desktop);
    height: var(--gauge-size-desktop);
}

/* Simple gauge styling with conic gradient */
.simple-gauge {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.gauge-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: background 1s ease;
}

.gauge-center {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    background-color: var(--card-bg);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gauge-value {
    font-size: 24px;
    font-weight: bold;
}

.gauge-label {
    font-size: 10px;
    color: var(--secondary-color);
}

/* Radar visualization */
.radar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.radar-wrapper {
    position: relative;
    width: var(--radar-size-desktop);
    height: var(--radar-size-desktop);
    border-radius: 50%;
    background-color: rgba(16, 42, 67, 0.03);
    border: 1px solid rgba(67, 97, 238, 0.2);
    overflow: hidden;
    margin: 0 auto;
}

.radar-scanner {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 0;
    left: 0;
    border-radius: 100% 0 0 0;
    transform-origin: 100% 100%;
    background: linear-gradient(45deg, rgba(67, 97, 238, 0) 0%, rgba(67, 97, 238, 0.5) 100%);
    animation: radar-sweep 5s infinite linear;
    z-index: 2;
}

@keyframes radar-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: radar-point-blink 2s infinite;
    z-index: 3;
}

.radar-point.critical { background-color: var(--critical-color); }
.radar-point.high { background-color: var(--high-color); }
.radar-point.medium { background-color: var(--medium-color); }
.radar-point.low { background-color: var(--low-color); }

@keyframes radar-point-blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; transform: scale(1.2); }
}

.radar-legend {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
}

.radar-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.radar-dot.critical { background-color: var(--critical-color); }
.radar-dot.high { background-color: var(--high-color); }
.radar-dot.medium { background-color: var(--medium-color); }
.radar-dot.low { background-color: var(--low-color); }

/* Stats panel for sources and trends */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-panel {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-panel h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Horizontal stats container */
.horizontal-stats-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Stat cards - normal and small */
.stat-card {
    text-align: center;
    padding: 24px 15px;
    border-radius: 10px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transform: translateZ(0);
    will-change: transform;
}

.stat-card-sm {
    min-width: 120px;
    padding: 12px 10px;
    text-align: center;
    border-radius: 8px;
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed) ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 15px 0;
    transition: all var(--transition-speed) ease;
    background-clip: text;
    -webkit-background-clip: text;
}

.stat-card-sm .stat-number {
    font-size: 1.8rem;
    margin: 8px 0;
}

/* Severity colors for stats */
.stat-CRITICAL { color: var(--critical-color); }
.stat-HIGH { color: var(--high-color); }
.stat-MEDIUM { color: var(--medium-color); }
.stat-LOW { color: var(--low-color); }

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Chart container */
.compact-chart-container {
    height: 150px;
    overflow: hidden;
    width: 100%;
}

/* ===== SEVERITY BADGES & ROW HIGHLIGHTING ===== */
.severity-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    animation: pulse 2s infinite;
    white-space: nowrap;
    min-width: 55px;
}

.badge-CRITICAL {
    background-color: var(--critical-color);
    color: white;
}

.badge-HIGH {
    background-color: var(--high-color);
    color: white;
}

.badge-MEDIUM {
    background-color: var(--medium-color);
    color: black;
}

.badge-LOW {
    background-color: var(--low-color);
    color: white;
}

/* Row Highlighting */
.row-CRITICAL { border-left: 4px solid var(--critical-color); }
.row-HIGH { border-left: 4px solid var(--high-color); }
.row-MEDIUM { border-left: 4px solid var(--medium-color); }
.row-LOW { border-left: 4px solid var(--low-color); }

/* ===== TABLE STYLING ===== */
#desktop-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    table-layout: fixed;
}

table th {
    text-align: left;
    padding: 16px 12px;
    background-color: rgba(67, 97, 238, 0.05);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    color: var(--secondary-color);
    transition: background-color var(--transition-speed);
}

table th:first-child { border-top-left-radius: 8px; }
table th:last-child { border-top-right-radius: 8px; }

table tr {
    transition: background-color 0.2s, transform 0.2s;
}

table tr:hover td {
    background-color: rgba(67, 97, 238, 0.05);
}

table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
    transition: background-color var(--transition-speed) ease;
    vertical-align: middle;
}

/* Allow overflow on indicators and actions columns */
table td:nth-child(9),
table td:nth-child(10) {
    overflow: visible;
}

/* Truncate long text in ID, title, source columns */
table td:nth-child(1),
table td:nth-child(7) {
    overflow: hidden;
    text-overflow: ellipsis;
}

table tr:last-child td { border-bottom: none; }

/* Column widths for desktop table - 10 columns */
table th:nth-child(1), table td:nth-child(1) { width: 10%; } /* CVE ID + bookmark */
table th:nth-child(2), table td:nth-child(2) { width: 21%; } /* Title */
table th:nth-child(3), table td:nth-child(3) { width: 8%; min-width: 70px; }  /* Severity */
table th:nth-child(4), table td:nth-child(4) { width: 5%; }  /* CVSS */
table th:nth-child(5), table td:nth-child(5) { width: 6%; }  /* EPSS */
table th:nth-child(6), table td:nth-child(6) { width: 6%; }  /* Priority */
table th:nth-child(7), table td:nth-child(7) { width: 9%; }  /* Source */
table th:nth-child(8), table td:nth-child(8) { width: 9%; }  /* Date */
table th:nth-child(9), table td:nth-child(9) { width: 14%; } /* Indicators */
table th:nth-child(10), table td:nth-child(10) { width: 12%; } /* Actions */

/* Compact date cells */
.date-primary {
    font-size: 0.85rem;
    font-weight: 500;
}

.date-secondary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* For date cells with multiple dates */
td .date-cell-inner {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

/* Add a smaller font size for secondary dates */
td .date-secondary {
    font-size: 0.85em;
    color: var(--secondary-color);
}

/* ===== SOC RELEVANT STYLING ===== */
.row-soc-relevant {
    background-color: rgba(67, 97, 238, 0.1) !important;
    position: relative;
}

.row-soc-relevant::after {
    content: "SOC";
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    opacity: 0;
    transform: translateX(10px);
    animation: slideInRight 0.5s ease 0.2s forwards;
    z-index: 5;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* SOC indicator pulse */
@keyframes pulse-soc {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

.row-soc-relevant.pulse {
    animation: pulse-soc 2s infinite;
}

/* SOC severity note */
.soc-severity-note {
    font-size: 0.85rem;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--card-bg-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* ===== BUTTON STYLING ===== */
.btn {
    padding: 10px 20px;
    border-radius: var(--btn-border-radius);
    cursor: pointer;
    font-weight: 600;
    border: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    touch-action: manipulation;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

.btn:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background-color: #f8fafc;
    color: var(--secondary-color);
    border: 1px solid rgba(63, 114, 175, 0.2);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ===== FILTERS SECTION ===== */
.filters {
    display: flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.search-box {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all var(--transition-speed) ease;
    background-color: var(--card-bg);
    color: var(--text-color);
    min-height: 44px;
    padding-right: 35px; /* Space for clear button */
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Custom select styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233f72af'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding: 12px 40px 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    font-size: 0.95rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    min-height: 44px;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Improved search input with clear button */
.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--secondary-color);
    z-index: 5;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SOC FOCUS TOGGLE ===== */
.soc-focus-toggle {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}

.soc-focus-toggle.active {
    background-color: rgba(67, 97, 238, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-right: 15px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 600;
    margin-right: 10px;
    color: var(--secondary-color);
}

.toggle-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 200px;
}

/* ===== SORT CONTROLS ===== */
.sort-controls {
    margin-top: 20px;
}

.sort-controls label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--secondary-color);
}

.sort-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sort-button {
    padding: 10px 15px;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
    min-height: 44px;
}

.sort-button:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sort-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--btn-shadow);
}

/* ===== PAGINATION STYLING ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination button {
    margin: 0 5px;
    transition: all var(--transition-speed) ease;
}

.pagination span {
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #f8fafc;
    font-weight: 500;
}

/* ===== VULNERABILITY DETAILS ===== */
.vulnerability-details {
    margin-top: 10px;
    font-size: 0.9rem;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-label {
    font-weight: 600;
    width: 140px;
    min-width: 140px;
    color: var(--secondary-color);
}

/* ===== INDICATORS ===== */
.indicator {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-right: 4px;
    margin-bottom: 4px;
    font-weight: 600;
    gap: 3px;
    transition: all var(--transition-speed) ease;
    min-height: 24px;
    white-space: nowrap;
}

.indicator:hover {
    transform: translateY(-2px);
}

.indicator-patch {
    background-color: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.indicator-exploit {
    background-color: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.indicator-soc {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.indicator-kev {
    background-color: rgba(220, 38, 38, 0.2);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.4);
    font-weight: 600;
}

/* ===== INDICATORS CELL ===== */
.indicators-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

/* ===== BOOKMARK BUTTON ===== */
.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: 0 4px 0 0;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    vertical-align: middle;
}

.bookmark-btn:hover {
    transform: scale(1.2);
    color: #f59e0b;
}

.bookmark-btn.bookmarked {
    color: #f59e0b;
}

/* ===== EPSS SCORE ===== */
.epss-score {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.epss-high {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.epss-medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.epss-low {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--text-secondary);
}

/* ===== PRIORITY SCORE ===== */
.priority-score {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    min-width: 28px;
    text-align: center;
    white-space: nowrap;
}

.priority-critical {
    background-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.priority-high {
    background-color: rgba(249, 115, 22, 0.2);
    color: #ea580c;
}

.priority-medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.priority-low {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* ===== KEYBOARD HELP MODAL ===== */
.keyboard-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.keyboard-help-content {
    background: var(--card-bg);
    border-radius: var(--card-border-radius);
    padding: 24px 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--card-shadow);
    color: var(--text-color);
}

.keyboard-help-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.shortcut-grid {
    display: grid;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcut-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== LOADING INDICATOR ===== */
#loading-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 8px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== AUTO-REFRESH COUNTDOWN ===== */
.auto-refresh-countdown {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-left: 10px;
    background-color: rgba(67, 97, 238, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    gap: 6px;
}

#auto-refresh-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 10px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 20px;
    margin-left: 10px;
    font-weight: 500;
    color: var(--secondary-color);
}

/* Auto-refresh timer in vulnerabilities header */
.refresh-timer {
    display: inline-block;
    font-size: 0.8rem;
    margin-left: 10px;
    color: var(--secondary-color);
    opacity: 0.8;
    animation: pulse 1.5s infinite ease-in-out;
}

/* ===== MODAL STYLING ===== */
.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.4s forwards;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    max-width: 90%;
    word-break: break-word;
    color: var(--text-color);
}

.modal-body {
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.close {
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
}

.close:hover {
    color: var(--text-color);
    background-color: #f1f5f9;
}

/* Swipe indicator for mobile modals */
.swipe-indicator {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    opacity: 0.7;
}

.swipe-bar {
    width: 50px;
    height: 4px;
    background-color: rgba(127, 127, 127, 0.3);
    border-radius: 2px;
    margin: 0 auto 3px auto;
}

.swipe-text {
    font-size: 0.7rem;
    color: rgba(127, 127, 127, 0.5);
    margin-bottom: 5px;
}

/* ===== MOBILE CARD STYLING ===== */
.mobile-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: var(--card-bg);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.5s ease;
    transform: translateZ(0);
    will-change: transform;
    position: relative;
    contain: content;
}

.mobile-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.mobile-card:active {
    transform: scale(0.98);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-card-title {
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    font-size: 1rem;
    word-break: break-word;
}

.mobile-card-content {
    font-size: 0.95rem;
}

.mobile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.mobile-card.row-soc-relevant::after {
    top: auto;
    bottom: 12px;
    right: 8px;
    z-index: 5;
    font-size: 8px;
    padding: 2px 4px;
}

.mobile-card-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

/* ===== THEME TOGGLE SWITCH ===== */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-left: 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 26px;
    overflow: hidden;
}

.theme-slider:before {
    position: absolute;
    content: "☀️";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    font-size: 12px;
}

input:checked + .theme-slider {
    background-color: #1e293b;
}

input:checked + .theme-slider:before {
    transform: translateX(24px);
    content: "🌙";
}

/* ===== FOOTER STYLING ===== */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 5px 0;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 20px;
    font-weight: 500;
    color: var(--primary-color);
    margin-left: 5px;
}

/* ===== UTILITY CLASSES ===== */
.mx-3 {
    margin-left: 15px;
    margin-right: 15px;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 10px;
}

.mb-3 {
    margin-bottom: 15px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-4 {
    margin-top: 20px;
}

.ml-2 {
    margin-left: 10px;
}

.text-center {
    text-align: center;
}

/* ===== ANIMATIONS ===== */
.loading-dot-animation:after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Priority Visual Indicators */
.priority-3 {
    border-left: 5px solid #ff0000;
    background-color: rgba(255, 0, 0, 0.05);
}

.priority-2 {
    border-left: 5px solid #ff9900;
    background-color: rgba(255, 153, 0, 0.05);
}

.priority-1 {
    border-left: 5px solid #ffcc00;
    background-color: rgba(255, 204, 0, 0.03);
}

/* Pulse animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.2);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

.pulse-highlight {
    animation: pulse-highlight 1.5s ease-out;
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animated-gradient {
    background: linear-gradient(-45deg, var(--primary-color), var(--accent-color), var(--secondary-color), var(--primary-color));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Highlighted CVEs in description */
.highlighted-cve {
    background-color: rgba(67, 97, 238, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== DARK MODE SPECIFICS ===== */
.gauge-center {
    background-color: var(--card-bg);
}

body.dark-mode .card {
    background-color: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode table th {
    background-color: rgba(67, 97, 238, 0.15);
}

body.dark-mode .search-box,
body.dark-mode select,
body.dark-mode input {
    background-color: #1e293b;
    color: var(--text-color);
    border-color: #334155;
}

body.dark-mode .btn-secondary {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .btn-secondary:hover {
    background-color: #475569;
}

body.dark-mode .sort-button {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .sort-button:hover {
    background-color: #475569;
}

body.dark-mode .sort-button.active {
    background-color: var(--primary-color);
    color: white;
}

body.dark-mode .pagination span {
    background-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .stat-card,
body.dark-mode .stat-card-sm,
body.dark-mode .mobile-card,
body.dark-mode .gauge-card {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .stat-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .close:hover {
    background-color: #334155;
}

body.dark-mode .soc-focus-toggle {
    background-color: rgba(67, 97, 238, 0.15);
    border-color: var(--primary-color);
}

body.dark-mode .toggle-slider {
    background-color: #334155;
}

body.dark-mode .toggle-description {
    color: #94a3b8;
}

body.dark-mode .severity-badge {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.dark-mode tr:hover td {
    background-color: rgba(67, 97, 238, 0.1);
}

body.dark-mode .indicator {
    opacity: 0.95;
}

body.dark-mode .indicator-patch {
    background-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.5);
}

body.dark-mode .indicator-exploit {
    background-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.5);
}

body.dark-mode .indicator-soc {
    background-color: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.5);
}

body.dark-mode .indicator-kev {
    background-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.5);
}

body.dark-mode .bookmark-btn {
    color: #64748b;
}

body.dark-mode .bookmark-btn.bookmarked {
    color: #fbbf24;
}

body.dark-mode .epss-high {
    background-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

body.dark-mode .epss-medium {
    background-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

body.dark-mode .epss-low {
    color: #94a3b8;
}

body.dark-mode .priority-critical {
    background-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

body.dark-mode .priority-high {
    background-color: rgba(249, 115, 22, 0.3);
    color: #fb923c;
}

body.dark-mode .priority-medium {
    background-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

body.dark-mode .priority-low {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

body.dark-mode .keyboard-help-content {
    border: 1px solid var(--border-color);
}

body.dark-mode .shortcut-item kbd {
    border-color: #475569;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .footer {
    color: #94a3b8;
    border-color: #334155;
}

body.dark-mode .swipe-bar {
    background-color: rgba(200, 200, 200, 0.5);
}

body.dark-mode .swipe-text {
    color: rgba(200, 200, 200, 0.7);
}

body.dark-mode .highlighted-cve {
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--secondary-color);
}

body.dark-mode .radar-wrapper {
    background-color: rgba(16, 42, 67, 0.1);
    border-color: rgba(67, 97, 238, 0.3);
}

body.dark-mode .radar-scanner {
    background: linear-gradient(45deg, rgba(67, 97, 238, 0) 0%, rgba(67, 97, 238, 0.6) 100%);
}

/* ===== MEDIA QUERIES - RESPONSIVE LAYOUT ===== */
/* Larger desktop screens */
@media (min-width: 1400px) {
    .container {
        max-width: var(--content-max-width);
    }

    .compact-gauge-container {
        gap: 40px;
    }

    .gauge-sm {
        width: calc(var(--gauge-size-desktop) + 20px) !important;
        height: calc(var(--gauge-size-desktop) + 20px) !important;
    }
}

/* Medium desktop screens */
@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    /* Hide EPSS and Priority columns on smaller screens - data still in Detail modal */
    table th:nth-child(5), table td:nth-child(5),
    table th:nth-child(6), table td:nth-child(6) {
        display: none;
    }

    /* Redistribute widths without EPSS/Priority (8 visible columns) */
    table th:nth-child(1), table td:nth-child(1) { width: 12%; }
    table th:nth-child(2), table td:nth-child(2) { width: 28%; }
    table th:nth-child(7), table td:nth-child(7) { width: 10%; }
    table th:nth-child(8), table td:nth-child(8) { width: 10%; }
    table th:nth-child(9), table td:nth-child(9) { width: 14%; }
    table th:nth-child(10), table td:nth-child(10) { width: 13%; }
}

/* Small desktop and tablets */
@media (max-width: 992px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }

    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .compact-stats-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .compact-gauge-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gauge-sm {
        width: var(--gauge-size-tablet) !important;
        height: var(--gauge-size-tablet) !important;
    }

    .radar-wrapper {
        width: var(--radar-size-tablet);
        height: var(--radar-size-tablet);
    }

    .compact-radar {
        transform: scale(0.9);
        transform-origin: center;
        margin: -10px 0;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 992px) {
    .compact-gauge-container {
        display: flex;
        justify-content: space-evenly;
        gap: 20px;
    }

    .gauge-card {
        width: auto;
        margin: 0 10px;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 1.8rem;
    }

    .dashboard-header p {
        font-size: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header h2 {
        margin-bottom: 10px;
    }

    .soc-focus-toggle {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .toggle-switch {
        margin-bottom: 10px;
    }

    .toggle-description {
        margin-top: 5px;
        width: 100%;
    }

    .sort-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sort-button {
        padding: 12px;
        justify-content: center;
        font-size: 0.85rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Improved gauge layout */
    .compact-gauge-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        justify-items: center;
    }

    .gauge-sm {
        width: var(--gauge-size-mobile) !important;
        height: var(--gauge-size-mobile) !important;
        margin: 0 auto;
    }

    .gauge-card {
        padding: 10px 5px;
        width: 100%;
    }

    .gauge-card h4 {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }

    /* Radar size for phones */
    .radar-wrapper {
        width: var(--radar-size-mobile);
        height: var(--radar-size-mobile);
        margin: 0 auto;
    }

    .radar-scanner {
        width: 110px;
        height: 110px;
    }

    /* Mobile modal improvements */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        border-radius: 16px;
        max-height: 92vh;
    }

    .mobile-close-btn {
        min-height: 50px;
        min-width: 120px;
        font-size: 1rem;
        margin: 10px auto;
    }

    /* Better table layout for small screens */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .card-header h2 {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 15px;
    }

    .compact-gauge-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .gauge-sm {
        width: 75px !important;
        height: 75px !important;
    }

    .sort-buttons {
        grid-template-columns: 1fr;
    }

    .stat-card-sm {
        min-width: 100px;
    }

    .compact-chart-container {
        height: 130px;
    }

    .gauge-value {
        font-size: 20px;
    }

    .mobile-card {
        padding: 15px 12px;
    }

    .mobile-card-content {
        font-size: 0.9rem;
    }

    .mobile-card .indicator {
        font-size: 0.75rem;
    }
}

/* Small phones */
@media (max-width: 360px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 15px;
        width: calc(100% - 30px);
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .card {
        margin-bottom: 15px;
    }

    .card-header {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .mobile-card {
        padding: 12px 10px;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .mobile-card-title {
        font-size: 0.9rem !important;
        margin-bottom: 5px;
    }

    .mobile-card-content {
        font-size: 0.85rem;
    }

    .mobile-card .severity-badge {
        padding: 2px 6px;
        font-size: 0.7rem;
    }

    .mobile-card .indicator {
        padding: 2px 6px;
        font-size: 0.7rem;
        margin: 2px;
    }

    .mobile-card .btn {
        min-height: 36px;
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    /* Adjust header for tiny screens */
    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Smaller buttons for tiny screens */
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Fix gauge size for extra small screens */
    .compact-gauge-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gauge-sm {
        width: var(--gauge-size-small) !important;
        height: var(--gauge-size-small) !important;
    }

    .gauge-value {
        font-size: 16px;
    }

    .radar-wrapper {
        width: var(--radar-size-small);
        height: var(--radar-size-small);
    }

    .radar-scanner {
        width: 90px;
        height: 90px;
    }

    /* Modal adjustments for very small screens */
    .modal-content {
        padding: 15px;
        width: 95%;
        margin: 2% auto;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }
}

/* Foldable phones: Galaxy Fold 5 (344px), Galaxy Z Flip (360px folded cover) */
@media (max-width: 350px) {
    .stats-container {
        grid-template-columns: 1fr !important;
    }

    .compact-gauge-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .gauge-card h4 {
        font-size: 0.72rem;
    }

    .radar-wrapper {
        width: 140px;
        height: 140px;
    }

    .radar-scanner {
        width: 70px;
        height: 70px;
    }

    .dashboard-header h1 {
        font-size: 1.2rem;
    }

    .dashboard-header p {
        font-size: 0.75rem;
    }

    .card-header h2 {
        font-size: 0.95rem;
    }

    /* Shrink buttons to single column on foldables */
    .dashboard-controls {
        gap: 6px;
    }

    .dashboard-controls .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* SOC/KEV/Bookmark toggles stack vertically */
    .soc-focus-toggle {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    /* Quick sort buttons wrap */
    .quick-sort-container {
        gap: 4px;
    }

    .quick-sort-container .btn {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    /* Mobile cards tighter */
    .mobile-card {
        padding: 10px 8px;
    }

    .mobile-card-title {
        font-size: 0.82rem !important;
    }

    .mobile-card .severity-badge {
        padding: 1px 5px;
        font-size: 0.65rem;
    }

    /* Modal takes full screen on foldables */
    .modal-content {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
    }

    .modal-header h2 {
        font-size: 0.95rem;
    }

    /* Filter controls stack */
    .filter-row {
        flex-direction: column !important;
    }

    .filter-row > div {
        width: 100% !important;
    }

    .filter-row select,
    .filter-row input {
        width: 100% !important;
    }

    /* Source names truncate */
    .source-cell {
        max-width: 70px;
    }
}

/* Ultra-narrow: Galaxy Fold 4 and older (280px) */
@media (max-width: 290px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 8px;
        width: calc(100% - 16px);
    }

    .dashboard-header h1 {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
    }

    .radar-scanner {
        animation: none !important;
    }

    .radar-point {
        animation: none !important;
    }

    .pulse, .pulse-highlight, .pulse-soc {
        animation: none !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
        font-size: 12pt;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .dashboard-controls,
    .filters,
    .sort-controls,
    button:not(.severity-badge),
    .radar-container,
    .footer {
        display: none !important;
    }

    .table th, .table td {
        border: 1px solid #ddd;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }

    /* Ensure white background and black text for high contrast */
    * {
        background: transparent !important;
        color: #000 !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }

    /* Force page breaks where needed */
    h2, h3 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    /* Expand container width for print */
    .container {
        max-width: none;
        width: 100%;
    }
}

/* Touch device optimizations */
.touch-device button,
.touch-device .btn,
.touch-device input,
.touch-device select {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.touch-device .modal-content {
    -webkit-overflow-scrolling: touch;
}

/* Optimize rendering during scrolling */
.scrolling * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
}

/* Badge counter */
.badge-counter {
    position: relative;
}

.badge-counter::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--critical-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

/* HTML content in vulnerability descriptions */
.html-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 5px;
}

.html-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.html-content a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Make sure modal body can handle various content types */
.modal-body {
    max-width: 100%;
    overflow-x: hidden;
    word-break: break-word;
}

/* Fix embedded content alignment */
.html-content p {
    margin: 0.5em 0;
}

.html-content br {
    line-height: 1.6;
}

/* Dark mode adjustments for HTML content */
body.dark-mode .html-content a {
    color: var(--secondary-color);
}

body.dark-mode .html-content img {
    border: 1px solid var(--border-color);
}

/* Virtual placeholder for virtualized table */
.virtual-placeholder {
    border: none !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Load more trigger for mobile cards */
.load-more-trigger {
    width: 100%;
    text-align: center;
    opacity: 0;
}

/* Improved date display */
.date-cell {
    max-width: 200px;
}

.date-cell strong {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.date-section {
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
    margin: 8px 0;
}

/* For dark mode */
body.dark-mode .date-section {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}


/* Kiosk Mode Styles */
body.kiosk-mode {
    overflow-x: hidden;
    padding: 0;
}

.kiosk-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.kiosk-hidden {
    display: none !important;
}

.kiosk-focus {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transition: all 0.5s ease;
}

.kiosk-focus .card-body {
    padding: 20px 10px;
}

.kiosk-mode .dashboard-header {
    border-bottom: none;
    padding-bottom: 0;
}

.kiosk-minimal {
    border-bottom: none !important;
    padding: 10px 20px !important;
    margin-bottom: 0 !important;
}

.kiosk-minimal h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0 !important;
}

.kiosk-minimal p {
    display: none;
}

.kiosk-mode .card:has(#vulnerabilities-table-body) {
    border-radius: 0;
    margin-bottom: 0;
}

.kiosk-mode table {
    border-spacing: 0;
    border-collapse: separate;
}

.kiosk-mode table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.kiosk-mode table tr:hover td {
    transform: scale(1.01);
    transition: transform 0.2s ease;
}

/* Kiosk instructions */
.kiosk-instructions {
    position: absolute;
    right: 20px;
    bottom: 5px;
    font-size: 0.85rem;
    opacity: 0.7;
    padding: 5px 10px;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Floating control bar for kiosk mode */
.kiosk-control-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background-color: var(--card-bg);
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 15px;
    align-items: center;
    opacity: 0.2;
    transition: opacity 0.3s ease;
    border: 1px solid var(--border-color);
}

.kiosk-control-bar:hover {
    opacity: 1;
}

.kiosk-control-bar > button {
    padding: 8px 12px;
}

/* Full-screen table in kiosk mode */
.kiosk-mode #desktop-table-container {
    height: calc(100vh - 160px);
    overflow-y: auto;
}

.kiosk-mode .card-body {
    padding: 0;
}

.kiosk-mode #desktop-table-container table {
    width: 100%;
}

/* Animations in kiosk mode */
.kiosk-mode .severity-badge {
    animation: pulse 2s infinite;
}

.kiosk-mode .badge-CRITICAL {
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--critical-color), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--critical-color), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--critical-color), 0);
    }
}

/* Mobile kiosk mode adjustments */
@media (max-width: 768px) {
    .kiosk-minimal h1 {
        font-size: 1.2rem !important;
    }

    .kiosk-mode #mobile-vulnerabilities-container {
        height: calc(100vh - 120px);
        overflow-y: auto;
    }
}