/* CVE Intelligence — identidade visual dark */
:root, [data-bs-theme="dark"] {
    --bs-body-bg: #0b0f17;
    --bs-body-color: #d7dde8;
    --bs-secondary-bg: #121826;
    --bs-tertiary-bg: #161d2d;
    --bs-border-color: #263049;
    --bs-link-color: #6ea8fe;
    --bs-link-hover-color: #9ec5fe;
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --ci-accent: #22d3ee;
    --ci-card: #111827;
    --sev-critical: #dc2626;
    --sev-high: #ea580c;
    --sev-medium: #ca8a04;
    --sev-low: #16a34a;
    --sev-none: #64748b;
    --sev-unknown: #475569;
}

body { font-feature-settings: "tnum" 1; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #000; padding: .5rem 1rem; }
.site-nav { background: rgba(11, 15, 23, .92); backdrop-filter: blur(6px); }
.brand-mark { color: var(--ci-accent); }
.card { background: var(--ci-card); border-color: var(--bs-border-color); }
.table { --bs-table-bg: transparent; }
.font-mono, code, .cve-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--ci-accent); outline-offset: 2px; }

/* Severidade: cor + texto (nunca só cor, por acessibilidade) */
.sev { display: inline-block; padding: .2em .55em; border-radius: .35rem; font-size: .78rem; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: .02em; }
.sev-critical { background: var(--sev-critical); }
.sev-high { background: var(--sev-high); }
.sev-medium { background: var(--sev-medium); color: #111; }
.sev-low { background: var(--sev-low); }
.sev-none { background: var(--sev-none); }
.sev-unknown { background: var(--sev-unknown); }
.kev-badge { background: #7f1d1d; color: #fecaca; border: 1px solid #b91c1c; }
.status-badge { font-size: .75rem; }

.cve-row { border-left: 3px solid transparent; }
.cve-row.sev-border-critical { border-left-color: var(--sev-critical); }
.cve-row.sev-border-high { border-left-color: var(--sev-high); }
.cve-row.sev-border-medium { border-left-color: var(--sev-medium); }
.cve-row.sev-border-low { border-left-color: var(--sev-low); }

.hero { background: linear-gradient(135deg, #0f172a 0%, #0b0f17 60%); border: 1px solid var(--bs-border-color); border-radius: 1rem; }
.stat { font-size: 1.75rem; font-weight: 700; }
.prose { max-width: 75ch; line-height: 1.7; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; }
.dl-grid dt { color: #94a3b8; font-weight: 500; }
.dl-grid dd { margin: 0; }
.unknown { color: #94a3b8; font-style: italic; }
.comment { border-left: 2px solid var(--bs-border-color); padding-left: 1rem; }
.comment .comment { margin-left: .5rem; }
.ratio iframe { border: 0; }

/* Admin */
.admin-sidebar { min-height: calc(100vh - 56px); background: #0e1422; border-right: 1px solid var(--bs-border-color); }
.admin-sidebar .nav-link { color: #cbd5e1; padding: .35rem .75rem; border-radius: .35rem; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { background: #1e293b; color: #fff; }
.admin-sidebar .nav-section { font-size: .7rem; text-transform: uppercase; color: #64748b; margin: 1rem .75rem .25rem; letter-spacing: .06em; }
.kpi { background: var(--ci-card); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: 1rem; }
.kpi .value { font-size: 1.6rem; font-weight: 700; }
.kpi .label { color: #94a3b8; font-size: .8rem; }
.diff-old { background: rgba(220, 38, 38, .15); }
.diff-new { background: rgba(22, 163, 74, .15); }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.col-err { max-width: 280px; }

/* ===== Portal shell (topbar + sidebar de módulos) ===== */
.portal { --sidebar-w: 248px; --topbar-h: 56px; }
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1rem; background: rgba(9, 12, 19, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bs-border-color); }
.topbar .brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap; }
.topbar-search { position: relative; flex: 1; max-width: 520px; margin-left: 1rem; }
.topbar-search input { padding-left: 2rem; background: #0f1522; border-color: #232c42; }
.topbar-search .search-icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: #64748b; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.lang-switch { font-size: .8rem; font-weight: 600; padding: .2rem .5rem; border: 1px solid var(--bs-border-color); border-radius: .4rem; color: #cbd5e1; text-decoration: none; }
.portal-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.portal-sidebar { width: var(--sidebar-w); flex-shrink: 0; background: #0a0e17; border-right: 1px solid var(--bs-border-color); }
@media (min-width: 992px) { .portal-sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; } }
@media (max-width: 991.98px) { .portal-sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; background: #0a0e17; } }
.sidebar-nav { padding: 1rem .75rem; }
.sidebar-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 1rem .5rem .35rem; }
.sidebar-link { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: .5rem; color: #cbd5e1; text-decoration: none; font-size: .92rem; }
.sidebar-link:hover { background: #131b2b; color: #fff; }
.sidebar-link.active { background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(59, 130, 246, .06)); color: #fff; box-shadow: inset 2px 0 0 var(--ci-accent); }
.sidebar-icon { width: 1.25rem; text-align: center; color: var(--ci-accent); opacity: .9; }
.sidebar-cta { margin: 1.5rem .25rem 0; padding: .9rem; border: 1px solid #23304a; border-radius: .75rem; background: linear-gradient(160deg, #101a2e, #0b111d); }
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-content { flex: 1; padding: 1.5rem; max-width: 1400px; width: 100%; }
@media (max-width: 575.98px) { .portal-content { padding: 1rem; } .topbar .brand span:last-child { font-size: .95rem; } }
.site-footer { margin-top: 0 !important; }

/* ===== Home: hero + módulos ===== */
.hero-tools { position: relative; overflow: hidden; border: 1px solid #1f2a40; border-radius: 1rem; padding: 2.5rem 2rem; background: radial-gradient(1200px 300px at 0% 0%, rgba(34, 211, 238, .12), transparent 60%), radial-gradient(800px 300px at 100% 0%, rgba(59, 130, 246, .14), transparent 60%), #0c1220; }
.hero-tools h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.hero-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ci-accent); border: 1px solid rgba(34, 211, 238, .35); border-radius: 999px; padding: .2rem .65rem; }
.hero-search { max-width: 640px; }
.hero-search .form-control { height: 3rem; background: #0a0f1a; border-color: #2a3550; }
.chip { display: inline-block; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: #131b2c; border: 1px solid #243049; color: #cbd5e1; text-decoration: none; margin: 0 .25rem .35rem 0; }
.chip:hover { border-color: var(--ci-accent); color: #fff; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.stat-tile { background: #0e1422; border: 1px solid #1e2738; border-radius: .75rem; padding: .9rem 1rem; }
.stat-tile .num { font-size: 1.5rem; font-weight: 800; color: #fff; }
.stat-tile .lbl { font-size: .78rem; color: #94a3b8; }
.module-filters .btn { border-radius: 999px; font-size: .8rem; }
.module-filters .count { opacity: .6; margin-left: .25rem; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.module-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, #101726, #0c121e); border: 1px solid #1f2a3e; border-radius: 1rem; padding: 1.25rem; transition: border-color .15s, transform .15s; }
.module-card:hover { border-color: #2f4b6e; }
.module-card.featured { grid-column: span 2; }
@media (max-width: 767.98px) { .module-card.featured { grid-column: span 1; } }
.module-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; }
.module-card .module-desc { font-size: .85rem; color: #94a3b8; margin-bottom: 1rem; }
.module-card .module-tag { position: absolute; top: 1rem; right: 1rem; font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: var(--ci-accent); }
.module-card .module-foot { margin-top: auto; padding-top: .75rem; }
.live-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; margin-right: .35rem; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.feed-list { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.feed-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px dashed #1c2536; }
.feed-list li:last-child { border-bottom: 0; }
.feed-list .feed-id { font-family: ui-monospace, Menlo, Consolas, monospace; color: #e2e8f0; text-decoration: none; white-space: nowrap; }
.feed-list .feed-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; }
.feed-list .feed-time { color: #64748b; font-size: .75rem; white-space: nowrap; }
.sev-dot { width: .55rem; height: .55rem; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.sev-dot.sev-critical { background: var(--sev-critical); } .sev-dot.sev-high { background: var(--sev-high); } .sev-dot.sev-medium { background: var(--sev-medium); } .sev-dot.sev-low { background: var(--sev-low); } .sev-dot.sev-unknown, .sev-dot.sev-none { background: var(--sev-unknown); }

/* ===== Listagem ===== */
.cve-card { display: block; padding: .9rem 1rem; border: 1px solid #1e2738; border-left-width: 3px; border-radius: .6rem; background: #0e1422; text-decoration: none; color: inherit; margin-bottom: .6rem; }
.cve-card:hover { border-color: #2f4b6e; }
.cve-card.sev-border-critical { border-left-color: var(--sev-critical); } .cve-card.sev-border-high { border-left-color: var(--sev-high); } .cve-card.sev-border-medium { border-left-color: var(--sev-medium); } .cve-card.sev-border-low { border-left-color: var(--sev-low); }
.cve-card .cve-id { font-weight: 700; color: #fff; }
.cve-card .desc { color: #94a3b8; font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.filter-panel { background: #0e1422; border: 1px solid #1e2738; border-radius: .75rem; padding: 1rem; }

/* ===== Ficha da CVE ===== */
.crumbs { font-size: .8rem; color: #64748b; }
.crumbs a { color: #94a3b8; text-decoration: none; }
.cve-head h1 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -.01em; }
.cve-meta { font-size: .82rem; color: #94a3b8; }
.section-card { background: #0e1422; border: 1px solid #1e2738; border-radius: .9rem; padding: 1.25rem; margin-bottom: 1rem; }
.section-card > h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .2rem; }
.section-card > .section-sub { font-size: .8rem; color: #8391a7; margin-bottom: 1rem; }
.source-tag { font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7dd3fc; border: 1px solid #1e3a5f; border-radius: .3rem; padding: .05rem .4rem; }
.triage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.triage-tile { background: #0a101b; border: 1px solid #1c2638; border-radius: .7rem; padding: .85rem; }
.triage-tile .t-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8391a7; }
.triage-tile .t-value { font-size: 1.35rem; font-weight: 800; color: #fff; margin: .2rem 0; }
.triage-tile .t-note { font-size: .76rem; color: #94a3b8; }
.triage-tile.alert-tile { border-color: #7f1d1d; background: linear-gradient(180deg, rgba(127, 29, 29, .25), #0a101b); }
.vector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.vector-item { background: #0a101b; border: 1px solid #1c2638; border-radius: .5rem; padding: .5rem .65rem; }
.vector-item .v-label { font-size: .72rem; color: #8391a7; }
.vector-item .v-value { font-weight: 700; }
.steps-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps-list li { counter-increment: step; position: relative; padding: .4rem 0 .4rem 2.1rem; }
.steps-list li::before { content: counter(step); position: absolute; left: 0; top: .4rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #13223a; color: var(--ci-accent); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid #1e2a40; }
.timeline .year { font-weight: 800; color: #fff; margin: .75rem 0 .25rem -1px; padding-left: .75rem; }
.timeline li.ev { position: relative; padding: .3rem 0 .3rem 1rem; font-size: .88rem; }
.timeline li.ev::before { content: ""; position: absolute; left: -6px; top: .75rem; width: 10px; height: 10px; border-radius: 50%; background: #0e1422; border: 2px solid var(--ci-accent); }
.timeline .ev-meta { font-size: .75rem; color: #8391a7; }
.ref-list { list-style: none; padding: 0; margin: 0; }
.ref-list li { padding: .5rem 0; border-bottom: 1px solid #172033; }
.ref-list li:last-child { border-bottom: 0; }
.ref-list .ref-host { font-weight: 600; word-break: break-all; }
.ref-list .ref-tags { font-size: .75rem; color: #8391a7; }
.unknown-list li { color: #94a3b8; font-size: .88rem; margin-bottom: .25rem; }
.sparkline { width: 100%; height: 70px; }
.sparkline .line { fill: none; stroke: var(--ci-accent); stroke-width: 2; }
.sparkline .area { fill: rgba(34, 211, 238, .12); }
.telemetry-tag { display: inline-block; font-size: .75rem; padding: .15rem .5rem; border-radius: .35rem; background: #13223a; color: #bae6fd; margin: 0 .3rem .3rem 0; }
.toc { position: sticky; top: calc(var(--topbar-h) + 1rem); font-size: .85rem; }
.toc a { display: block; color: #94a3b8; text-decoration: none; padding: .2rem 0 .2rem .75rem; border-left: 2px solid #1e2738; }
.toc a:hover { color: #fff; border-left-color: var(--ci-accent); }
.topbar .btn-link { white-space: nowrap; }
.mfa-qr { background: #fff; padding: 8px; border-radius: 8px; }
.footer-credit { display: inline-block; margin-top: .35rem; color: #94a3b8; }
.ransomware-badge { background: #4c1d95; color: #ede9fe; border: 1px solid #7c3aed; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--bs-border-color); font-size: .875rem; }
.rank-list li:last-child { border-bottom: 0; }
.rank-bar { flex: 0 0 34%; height: .45rem; border: 0; border-radius: 1rem; overflow: hidden; background: var(--bs-tertiary-bg); appearance: none; -webkit-appearance: none; }
.rank-bar::-webkit-progress-bar { background: var(--bs-tertiary-bg); }
.rank-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--bs-primary), var(--ci-accent)); border-radius: 1rem; }
.rank-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--bs-primary), var(--ci-accent)); border-radius: 1rem; }
.lead-narrow { max-width: 70ch; }
.rank-list .rank-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .rank-n { font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); }
.exploit-badge { background: #78350f; color: #fde68a; border: 1px solid #b45309; }
.ad-slot { margin: 1.25rem 0; padding: .5rem; border: 1px dashed var(--bs-border-color); border-radius: .5rem; min-height: 100px; }
.ad-slot .ad-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); margin-bottom: .25rem; }
.adsbygoogle { display: block; }
.consent-banner { position: fixed; z-index: 1080; left: 1rem; right: 1rem; bottom: 1rem; max-width: 560px; margin-left: auto; padding: 1rem; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); border-radius: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.prio-urgent { background: #7f1d1d; color: #fecaca; } .prio-high { background: #7c2d12; color: #fed7aa; }
.prio-moderate { background: #713f12; color: #fef08a; } .prio-low { background: #1e293b; color: #cbd5e1; }
.prio-gauge { width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; border: 3px solid rgba(255,255,255,.15); }
.prio-gauge .prio-num { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.prio-gauge .prio-lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }
.priority-card.prio-border-urgent { border-left: 4px solid #dc2626; } .priority-card.prio-border-high { border-left: 4px solid #ea580c; }
.priority-card.prio-border-moderate { border-left: 4px solid #ca8a04; }
.priority-card { background: var(--ci-card); color: inherit; }
.topbar-search, .hero-search { position: relative; }
.suggest-list { position: absolute; z-index: 1050; top: 100%; left: 0; right: 0; margin: .25rem 0 0; padding: .25rem; list-style: none; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-height: 70vh; overflow-y: auto; }
.suggest-list a { display: flex; align-items: baseline; gap: .5rem; padding: .4rem .5rem; border-radius: .35rem; color: inherit; text-decoration: none; font-size: .875rem; }
.suggest-list li.active a, .suggest-list a:hover { background: var(--bs-tertiary-bg); }
.suggest-list .sg-icon { width: 1.1rem; text-align: center; color: var(--ci-accent); }
.suggest-list .sg-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-list .sg-sub { margin-left: auto; color: var(--bs-secondary-color); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pro-card { border: 1px solid var(--bs-primary); box-shadow: 0 0 0 1px rgba(59,130,246,.35), 0 10px 30px rgba(34,211,238,.08); }
.account-narrow { max-width: 520px; }
.account-tabs .nav-link { border-radius: .5rem; }
.metric-chart { width: 100%; height: auto; display: block; }
