/* RouterCVE — minimal dark-on-blue utility styles. No framework. */

:root {
    --bg:        #0a1320;
    --bg-alt:    #0f1a2b;
    --surface:   #142440;
    --surface-2: #1c3056;
    --border:    #24406b;
    --text:      #e8eef8;
    --muted:     #95a6c4;
    --accent:    #38d1b1;
    --accent-2:  #2aa589;
    --warn:      #ffb347;
    --crit:      #ff5a60;
    --high:      #ff8a4c;
    --med:       #ffd66b;
    --low:       #6bc9ff;
    --ok:        #53d28b;
    --radius:    10px;
    --shadow:    0 10px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
.site-header {
    background: rgba(10,19,32,.9);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex; align-items: center; gap: 24px;
    padding: 14px 24px;
}
.brand {
    font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em;
    color: var(--text); text-decoration: none;
}
.brand-mark { display: inline; }
.brand-accent { color: var(--accent); }
.main-nav { display: flex; gap: 18px; margin-left: 8px; }
.main-nav a { color: var(--muted); font-size: 0.95rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.header-search {
    margin-left: auto; display: flex; gap: 6px;
}
.header-search input {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 8px 12px; border-radius: var(--radius); width: 280px;
}
.header-search button {
    background: var(--accent); color: #042; border: none; padding: 0 14px;
    border-radius: var(--radius); font-weight: 700; cursor: pointer;
}
@media (max-width: 720px) {
    .header-search { display: none; }
}

/* --- Hero --- */
.hero {
    background: linear-gradient(160deg, #0d1b33 0%, #102948 100%);
    border-bottom: 1px solid var(--border);
    padding: 64px 0 48px;
    text-align: center;
}
.hero h1 { font-size: 2.6rem; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero-lede { color: var(--muted); font-size: 1.1rem; margin-bottom: 28px; }
.hero-search {
    display: flex; gap: 8px; max-width: 640px; margin: 0 auto 28px;
}
.hero-search input {
    flex: 1; padding: 14px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 1rem;
}
.hero-search button {
    padding: 14px 22px; background: var(--accent); color: #042; font-weight: 700;
    border: none; border-radius: var(--radius); cursor: pointer; font-size: 1rem;
}
.hero-stats {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 32px;
    list-style: none; padding: 0; margin: 0;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.4rem; color: var(--text); }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

/* --- Sections --- */
.section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section h1, .section h2 { letter-spacing: -0.01em; }
.section h2 { font-size: 1.35rem; margin: 28px 0 14px; }
.more-link { color: var(--accent); font-size: 0.9rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

/* --- Risk gauge --- */
.risk-gauge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 52px; height: 52px; border-radius: 10px;
    font-weight: 800; font-size: 1.15rem; color: #fff;
    background: #333;
    flex-direction: column;
}
.risk-gauge.risk-critical { background: linear-gradient(135deg, #ff5a60 0%, #c6283c 100%); }
.risk-gauge.risk-high     { background: linear-gradient(135deg, #ff8a4c 0%, #d35400 100%); }
.risk-gauge.risk-medium   { background: linear-gradient(135deg, #ffd66b 0%, #c68a00 100%); color: #1a1100; }
.risk-gauge.risk-low      { background: linear-gradient(135deg, #6bc9ff 0%, #2682b3 100%); }
.risk-gauge.risk-none     { background: #233457; color: var(--muted); }

.risk-large {
    min-width: 86px; height: 86px; font-size: 1.8rem;
}
.risk-large span {
    font-size: 0.7rem; font-weight: 500; opacity: 0.8;
}

/* --- Leaderboard --- */
.leaderboard-preview {
    list-style: none; padding: 0; margin: 0; display: grid; gap: 10px;
}
.lb-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
}
.lb-card:hover { text-decoration: none; border-color: var(--accent); }
.lb-title strong { display: block; }
.lb-title small { color: var(--muted); }

.leaderboard-full { list-style: none; padding: 0; counter-reset: rank; display: grid; gap: 10px; }
.lb-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
}
.lb-row:hover { text-decoration: none; border-color: var(--accent); }
.lb-rank { font-weight: 800; color: var(--muted); width: 40px; font-size: 0.95rem; }
.lb-body strong { display: block; }
.lb-body small { color: var(--muted); }
.eol { color: var(--warn); font-style: normal; font-weight: 600; }
.crit { color: var(--crit); font-style: normal; font-weight: 600; }

/* --- Tabs --- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 16px; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab-active { color: var(--text); border-bottom-color: var(--accent); }

/* --- Model grid --- */
.model-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.model-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
}
.model-card:hover { text-decoration: none; border-color: var(--accent); }
.card-body { display: flex; flex-direction: column; }
.card-body strong { font-size: 0.98rem; }
.card-body small { color: var(--muted); font-size: 0.82rem; }
.card-meta { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* --- Model header --- */
.model-header {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 16px 0 20px;
}
.model-header h1 { margin: 0 0 6px; font-size: 2rem; }

.stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; margin: 18px 0 28px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column;
}
.stat-card strong { font-size: 1.3rem; color: var(--text); }
.stat-card span { color: var(--muted); font-size: 0.82rem; }

/* --- Am I patched? --- */
.patch-check {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin: 24px 0 32px;
}
.patch-check h2 { margin: 0 0 6px; font-size: 1.2rem; }
.patch-form { display: flex; gap: 8px; margin-top: 10px; }
.patch-form input {
    flex: 1; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 12px 14px; border-radius: var(--radius);
}
.patch-form button {
    background: var(--accent); color: #042; border: none; padding: 0 22px;
    border-radius: var(--radius); font-weight: 700; cursor: pointer;
}
.patch-result { margin-top: 14px; }
.patch-result.ok {
    background: rgba(83,210,139,.12); border: 1px solid var(--ok);
    padding: 14px; border-radius: var(--radius); color: var(--ok);
}
.patch-result.bad {
    background: rgba(255,90,96,.1); border: 1px solid var(--crit);
    padding: 14px; border-radius: var(--radius);
}
.patch-result ul { margin: 8px 0 0 18px; padding: 0; }
.disclaimer { color: var(--muted); margin-top: 8px; }

/* --- CVE table --- */
.cve-table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border);
    font-size: 0.93rem;
}
.cve-table th, .cve-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.cve-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.cve-table tr:last-child td { border-bottom: none; }
.desc-cell { color: var(--muted); max-width: 360px; }

/* --- Severity pills --- */
.sev {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
}
.sev-critical { background: var(--crit); color: #fff; }
.sev-high     { background: var(--high); color: #1a0a00; }
.sev-medium   { background: var(--med);  color: #1a1100; }
.sev-low      { background: var(--low);  color: #071725; }
.sev-none     { background: #233457;     color: var(--muted); }

.tag {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
}
.tag-ok { background: rgba(83,210,139,.15); color: var(--ok); }
.tag-warn { background: rgba(255,179,71,.15); color: var(--warn); }

/* --- Pagination --- */
.pagination {
    display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 18px;
    color: var(--muted);
}

/* --- Misc --- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.grid-3 h3 { margin-top: 0; }
.crumbs { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.text-center { text-align: center; }
.btn {
    display: inline-block; padding: 10px 20px; background: var(--accent); color: #042;
    border-radius: var(--radius); font-weight: 700;
}
.btn:hover { text-decoration: none; background: var(--accent-2); color: #fff; }

.page-search {
    display: flex; gap: 8px; max-width: 560px; margin-bottom: 24px;
}
.page-search input {
    flex: 1; padding: 12px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.page-search button {
    background: var(--accent); color: #042; border: none; padding: 0 22px;
    border-radius: var(--radius); font-weight: 700; cursor: pointer;
}

.cve-desc { background: var(--surface); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.cve-header { display: flex; align-items: center; gap: 14px; }
.cve-header h1 { margin: 0; }

/* --- Clickable hero stats --- */
.stat-link {
    display: block; color: inherit; text-decoration: none;
    border-radius: var(--radius); padding: 4px 6px; transition: background .15s ease;
}
.stat-link:hover { background: rgba(56,209,177,.08); text-decoration: none; }
.stat-link strong { color: var(--accent); }

/* --- Vendors index grid --- */
.vendor-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    margin-top: 18px;
}
.vendor-card {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; color: var(--text);
    transition: transform .12s ease, border-color .12s ease;
}
.vendor-card:hover {
    text-decoration: none; transform: translateY(-2px);
    border-color: var(--accent);
}
.vendor-card strong { font-size: 1.05rem; }
.vendor-card .vendor-meta { color: var(--muted); font-size: 0.85rem; }

/* --- Routers index: vendor jump nav and grouped sections --- */
.vendor-jump {
    display: flex; flex-wrap: wrap; gap: 8px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px; margin: 18px 0 28px;
}
.vendor-jump a { color: var(--muted); font-size: 0.9rem; }
.vendor-jump a:hover { color: var(--accent); }

.vendor-group { margin-top: 36px; scroll-margin-top: 80px; }
.vendor-group h2 { margin-bottom: 14px; }
.vendor-group h2 a { color: var(--text); }
.vendor-group h2 a:hover { color: var(--accent); }

/* --- Pagination --- */
.pager {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin: 24px 0 8px; justify-content: center;
}
.pager a, .pager span {
    display: inline-block; padding: 8px 12px; min-width: 38px; text-align: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 0.9rem;
    text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .pager-current {
    background: var(--accent); color: #042; border-color: var(--accent); font-weight: 700;
}
.pager .pager-gap { background: transparent; border-color: transparent; color: var(--muted); }
.pager .disabled { color: var(--muted); opacity: .5; cursor: default; }
.pager-prev, .pager-next { font-weight: 600; }

.result-range { margin: 6px 0 14px; font-size: 0.85rem; }

/* --- EOL filter toggle --- */
.eol-toggle {
    float: right;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}
.eol-toggle a { color: var(--accent); }
.eol-toggle a:hover { text-decoration: underline; }
.list-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.list-head .eol-toggle { float: none; margin: 0; }

/* --- Sortable column headers --- */
.sortable {
    color: var(--muted); text-decoration: none; white-space: nowrap;
    cursor: pointer; transition: color .12s;
}
.sortable:hover { color: var(--accent); text-decoration: none; }
.sortable.active { color: var(--text); font-weight: 600; }
.sort-arrow { font-size: .85em; }

/* --- Report Card tables --- */
.rc-table {
    width: 100%; border-collapse: collapse; margin: 12px 0 28px;
}
.rc-table th, .rc-table td {
    padding: 10px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.rc-table thead th {
    background: var(--surface); font-weight: 700; font-size: 0.9rem;
    color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.rc-table td { font-size: 0.95rem; }
.rc-table tbody tr:hover { background: var(--surface); }

.rc-30d { text-align: center; }
.rc-12m { text-align: center; }
.rc-24m { text-align: center; }
.rc-total { text-align: center; }

/* Coloured header cells */
.rc-table th.rc-30d  { color: var(--crit); }
.rc-table th.rc-12m  { color: var(--warn); }

/* Coloured data cells */
.rc-table td.rc-30d a { color: var(--crit); font-weight: 700; text-decoration: underline; }
.rc-table td.rc-12m a { color: var(--warn); font-weight: 700; text-decoration: underline; }
.rc-table td.rc-24m a { color: var(--text); text-decoration: underline; }
.rc-table td.rc-total a { color: var(--text); font-weight: 700; text-decoration: underline; }

/* --- Period tabs on report card detail --- */
.period-tabs {
    display: flex; gap: 8px; margin: 18px 0 24px; flex-wrap: wrap;
}
.period-tabs .tab {
    padding: 8px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted); font-size: 0.9rem; text-decoration: none;
    transition: border-color .12s, color .12s;
}
.period-tabs .tab:hover { border-color: var(--accent); color: var(--text); }
.period-tabs .tab.active {
    background: var(--accent); color: #042; border-color: var(--accent); font-weight: 700;
}

/* --- Footer --- */
.site-footer {
    padding: 40px 0 60px; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 0.85rem; margin-top: 40px;
}
.site-footer a { color: var(--muted); text-decoration: underline; }
