:root{
  --bg:#070b12;
  --panel:#0c1424;
  --panel2:#0b1220;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --text:#eaf0ff;
  --muted: rgba(234,240,255,.68);
  --shadow: 0 16px 50px rgba(0,0,0,.55);
  --radius: 16px;
  --accent:#f5b24a;
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --info:#60a5fa;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1100px 420px at 20% 0%, rgba(90,120,255,.18), transparent 60%),
    radial-gradient(900px 380px at 80% 0%, rgba(255,120,180,.12), transparent 60%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* ===== Header ===== */
header{
  position:sticky; top:0; z-index:30;
  background: linear-gradient(to bottom, rgba(7,11,18,.96), rgba(7,11,18,.72));
  border-bottom:1px solid var(--border);
}
.header-inner{
  max-width: 1400px;
  margin:0 auto;
  padding: 14px 18px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.h-left{display:flex; flex-direction:column; gap:6px; min-width: 0;}
.h-title{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  font-weight:900; letter-spacing:.2px; font-size:24px;
}
.h-sub{color:var(--muted); font-size:12px; display:flex; gap:12px; flex-wrap:wrap}
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.appTitle{
  font-size:26px;
  font-weight:1000;
  letter-spacing:.4px;
}

.btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(20,28,45,.95);
  color:var(--text);
  padding:9px 12px;
  border-radius:12px;
  cursor:pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  font-weight:900;
  user-select:none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.btn:hover{background: rgba(28,38,60,.98)}
.btnGhost{
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.14);
}
.btnGhost:hover{background: rgba(255,255,255,.06)}

input[type="file"]{display:none}

.chipbar{
  max-width: 1400px;
  margin:0 auto;
  padding: 0 18px 10px 18px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
  font-size:12px;
}
.dot{width:8px; height:8px; border-radius:50%}
.chip strong{color:var(--text)}
.chip.bad{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); color:#fecaca}
.chip.warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); color:#fde68a}
.chip.good{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); color:#bbf7d0}
.chip.info{border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.10); color:#bfdbfe}

.report-toolbar{
  max-width: 1400px;
  margin:0 auto;
  padding: 0 18px 8px 18px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
.report-toolbar[hidden]{display:none}
.export-menu{
  position:relative;
  display:inline-flex;
}
.exportBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width: 150px;
  justify-content:center;
  border-color: rgba(96,165,250,.28);
  background: linear-gradient(180deg, rgba(35,48,77,.98), rgba(20,28,45,.96));
}
.export-menu.open .exportBtn,
.exportBtn:hover{
  border-color: rgba(245,178,74,.45);
  background: rgba(35,48,77,.98);
}
.chev{
  font-size:11px;
  opacity:.78;
  transform: translateY(1px);
}
.export-dropdown{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:190px;
  padding:6px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  background:rgba(12,20,36,.98);
  box-shadow:0 18px 42px rgba(0,0,0,.45);
  display:none;
  z-index:60;
  backdrop-filter: blur(10px);
}
.export-menu.open .export-dropdown{display:block}
.export-dropdown button{
  display:flex;
  align-items:center;
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  text-align:left;
  padding:10px 11px;
  border-radius:8px;
  cursor:pointer;
  font-weight:800;
  font: inherit;
}
.export-dropdown button:hover,
.export-dropdown button:focus{
  outline:none;
  background:rgba(255,255,255,.07);
}
@media (max-width: 700px){
  .report-toolbar{
    justify-content:flex-start;
    padding-right:18px;
  }
  .export-menu, .exportBtn{width:100%}
  .export-dropdown{left:0; right:auto; width:100%}
}

/* ===== Tabs ===== */
.tabs{
  max-width: 1400px;
  margin:0 auto;
  padding: 0 18px 10px 18px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.tab{
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(20,28,45,.95);
  color: rgba(234,240,255,.80);
  cursor:pointer;
  font-weight:900;
  font-size:13px;
}
.tab:hover{background: rgba(28,38,60,.98)}
.tab.active{
  background: rgba(245,178,74,.22);
  border-color: rgba(245,178,74,.42);
  color: var(--text);
}

/* ===== Layout ===== */
main{max-width: 1400px; margin:0 auto; padding: 16px 18px 28px 18px;}
.grid2{display:grid; grid-template-columns: 1.25fr .75fr; gap:14px;}
@media (max-width: 1100px){ .grid2{grid-template-columns:1fr;} }

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel-title{font-size:14px; font-weight:900; margin:0 0 10px 0; letter-spacing:.2px;}
.muted{color:var(--muted); font-size:12px; line-height:1.45;}
.tipLine{margin-top:10px}

/* Charts */
.chartWrap{
  height: 270px;
  position: relative;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px;
  overflow:hidden;
}
canvas{display:block; width:100% !important; height:100% !important;}

/* Cards */
.kvgrid{display:grid; grid-template-columns: 1fr 1fr; gap:10px;}
@media (max-width: 700px){ .kvgrid{grid-template-columns:1fr;} }
.kv{
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
}
.kv .k{color:var(--muted); font-size:12px}
.kv .v{margin-top:6px; font-weight:900; font-size:13px}

/* Controls */
.controls{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px;}
input[type="text"], select{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(20,28,45,.90);
  color:var(--text);
  padding:9px 10px;
  border-radius:12px;
  outline:none;
}
input[type="text"]{min-width:280px}

/* Tables */
.tableWrap{
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  overflow:hidden;
  background: rgba(0,0,0,.12);
}
table{width:100%; border-collapse:collapse; font-size:13px}
thead{background: rgba(255,255,255,.05)}
th, td{padding:10px 10px; border-bottom:1px solid rgba(255,255,255,.07); vertical-align:top}
th{color:var(--muted); text-align:left; font-weight:900}
tr:hover{background: rgba(255,255,255,.04); cursor:pointer;}

.tableTight td{padding-top:10px; padding-bottom:10px}
.rowLink{cursor:pointer}

/* Clean Top-CVE / summary text */
.summaryClamp{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.4;
  max-height: 2.8em;
}

/* Severity badge */
.sevBadge{
  display:inline-flex; align-items:center; gap:7px;
  font-weight:900; font-size:12px;
  padding:4px 9px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
}
.sevBadge .dot{width:8px; height:8px; border-radius:50%}

/* Pages */
.page{display:none;}
.page.active{display:block;}

/* Package list */
.pkgList{display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px;}
@media (max-width: 1100px){ .pkgList{grid-template-columns:1fr;} }
.pkgCard{
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding:12px;
}
.pkgTop{display:flex; justify-content:space-between; align-items:flex-start; gap:10px;}
.pkgName{font-weight:900}
.pkgMeta{color:var(--muted); font-size:12px; margin-top:4px}
.miniRow{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;}
.miniPill{
  font-size:12px; padding:5px 9px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}

.link{color:#9ec1ff; text-decoration:none}
.link:hover{text-decoration:underline}

.linkLike{color:#cfe0ff}
.linkLike:hover{text-decoration:underline}

/* Developer tips list */
.tips{
  margin: 8px 0 0 18px;
  padding: 0;
}
.tips li{ margin: 6px 0; }

/* ===== CVSS (NVD-like color) ===== */
.cvss{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:900;
  font-size:12px;
  padding:4px 9px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
}
.cvssTxt{font-weight:800; opacity:.9}

.cvss.none{border-color:rgba(200,200,200,.25); color:#e5e7eb; background:rgba(200,200,200,.08)}
.cvss.low{border-color:rgba(34,197,94,.35); color:#bbf7d0; background:rgba(34,197,94,.10)}
.cvss.med{border-color:rgba(245,158,11,.35); color:#fde68a; background:rgba(245,158,11,.10)}
.cvss.high{border-color:rgba(255,170,80,.45); color:#ffe1b3; background:rgba(255,170,80,.12)}
.cvss.crit{border-color:rgba(239,68,68,.45); color:#fecaca; background:rgba(239,68,68,.12)}

/* ===== CVE full-page view ===== */
.cveTopbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.cveHead{flex:1; min-width:0;}
.cveTitleRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.cveId{
  font-size:22px;
  font-weight:1000;
  letter-spacing:.2px;
}
.cveMeta{margin-top:6px}
.cveActions{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}

.cveGrid{grid-template-columns: 1.25fr .75fr;}
@media (max-width: 1100px){ .cveGrid{grid-template-columns:1fr;} }

.riskGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 700px){ .riskGrid{grid-template-columns:1fr;} }

.riskCard, .epssCard{
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px;
}
.riskCard .k, .epssCard .k{
  color:var(--muted);
  font-size:12px;
}
.riskCard .v, .epssCard .v{
  margin-top:8px;
  font-weight:1000;
  font-size:16px;
}
.smallNote{margin-top:10px}

.epssGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 700px){ .epssGrid{grid-template-columns:1fr;} }

.cveWide{
  grid-column: 1 / -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(20,28,45,.95);
  border-radius: 20px;
  font-weight: bold;
  border: 1px solid #ddd;
  margin-right: 10px;
}
.badge img { margin-right: 8px; }

/* ===== SBOM ===== */
.sbomHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.sbomActions{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}

.sbomGrid{grid-template-columns: 1.25fr .75fr;}
@media (max-width: 1100px){ .sbomGrid{grid-template-columns:1fr;} }

.sbomPills{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;}
.sbomPill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}

.sbomMono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
.sbomLink{color:#9ec1ff; text-decoration:none;}
.sbomLink:hover{text-decoration:underline;}

.depList{
  margin:10px 0 0 18px;
}
.depList li{margin:6px 0;}
