:root {
  color-scheme: dark;

  /* USU Brand Colors */
  --aggie-blue:   #0F2439;
  --white:        #FFFFFF;
  --usu-gray:     #A2AAAD;
  --electric:     #01ADD8;
  --sage:         #6B9E85;
  --red:          #F16278;

  /* Surface scale derived from Aggie Blue */
  --bg:           #070e17;
  --border:       #1d3a55;
  --raw-text:     #b8cfe8;
}

* { box-sizing: border-box; }

/* Scanline overlay for CRT/HUD texture */
html { min-height: 100%; }
html::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(1, 173, 216, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 173, 216, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, #0d1e30 0%, var(--bg) 60%);
  background-size: 60px 60px, 60px 60px, 100% 100%;
  color: var(--white);
}

/* ── Header ─────────────────────────────────────────────── */

header {
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 3px solid var(--electric);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 36, 57, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 1px 0 rgba(1, 173, 216, 0.2), 0 4px 24px rgba(1, 173, 216, 0.08);
}

h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--white);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.headerTitle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.headerTitle .logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--electric);
  text-shadow: 0 0 16px rgba(1, 173, 216, 0.6);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.headerTitle .logoSub {
  font-size: 10px;
  color: var(--usu-gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Nav ─────────────────────────────────────────────────── */

nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.navLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--usu-gray);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.navLink:hover {
  color: var(--electric);
  border-color: rgba(1, 173, 216, 0.3);
  background: rgba(1, 173, 216, 0.06);
}

.navLink.active {
  color: var(--electric);
  border-color: rgba(1, 173, 216, 0.45);
  background: rgba(1, 173, 216, 0.1);
  text-shadow: 0 0 10px rgba(1, 173, 216, 0.5);
}

.navLink svg { opacity: 0.7; }
.navLink.active svg { opacity: 1; }

/* ── Status ──────────────────────────────────────────────── */

.status {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

.muted { color: var(--usu-gray); }
.ok    { color: var(--sage); }
.err   { color: var(--red); }

/* ── Main ────────────────────────────────────────────────── */

main {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Page heading ────────────────────────────────────────── */

.pageHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pageHead h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 0 16px rgba(255,255,255,0.2);
}

.pageHead .sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--usu-gray);
}

.backLink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--usu-gray);
  text-decoration: none;
  transition: color 0.15s;
  margin-bottom: 8px;
}
.backLink:hover { color: var(--electric); }

/* ── Dashboard grid ──────────────────────────────────────── */

.dashGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
  position: relative;
  background: rgba(11, 28, 46, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(1, 173, 216, 0.04), inset 0 0 30px rgba(1, 173, 216, 0.02);
}

.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(1, 173, 216, 0.55);
  border-style: solid;
  pointer-events: none;
}
.card::before {
  top: 6px;
  left: 6px;
  border-width: 1.5px 0 0 1.5px;
}
.card::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 1.5px 1.5px 0;
}

.cardLabel {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--electric);
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(1, 173, 216, 0.5);
}

.cardValue {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heroValue {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.5px;
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.35), 0 0 48px rgba(1, 173, 216, 0.15);
}

.statValue {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.cardSub {
  font-size: 11px;
  color: var(--usu-gray);
}

.stat-crit   { color: var(--red); }
.stat-high   { color: #f4a261; }
.stat-ok     { color: var(--sage); }
.stat-neutral { color: var(--usu-gray); }

/* ── Panel ───────────────────────────────────────────────── */

.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(15, 36, 57, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-color: rgba(1, 173, 216, 0.55);
  border-style: solid;
  border-width: 1.5px 0 0 1.5px;
  pointer-events: none;
  z-index: 2;
}

.panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(15, 36, 57, 0), rgba(15, 36, 57, 0.45));
  border-radius: 0 0 3px 3px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}

.panel.at-bottom::after { opacity: 0; }

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 28, 46, 0.55);
}

.panelTitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--electric);
  text-shadow: 0 0 10px rgba(1, 173, 216, 0.5);
}

.panelMeta {
  font-size: 11px;
  color: var(--usu-gray);
}

.panelLink {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--electric);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.panelLink:hover { opacity: 1; }

/* ── Filter bar ──────────────────────────────────────────── */

.filterBar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filterInput {
  background: rgba(11, 28, 46, 0.6);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--white);
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
  min-width: 220px;
  transition: border-color 0.15s;
  font-family: inherit;
}
.filterInput::placeholder { color: var(--usu-gray); }
.filterInput:focus         { border-color: var(--electric); }

.filterSelect {
  background: rgba(11, 28, 46, 0.6);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--white);
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: inherit;
}
.filterSelect:focus { border-color: var(--electric); }

/* ── Table ───────────────────────────────────────────────── */

.tblWrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tbl th {
  padding: 8px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--electric);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tbl td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(29, 58, 85, 0.5);
  color: var(--raw-text);
  vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tbody tr {
  transition: background 0.1s;
}
.tbl tbody tr:hover { background: rgba(1, 173, 216, 0.04); }

.tbl a { text-decoration: none; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.dimText  { color: var(--usu-gray); }
.mutedText { color: rgba(162, 170, 173, 0.5); }

/* ── CVE / GHSA ID links ─────────────────────────────────── */

.cveId {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 11px;
  color: var(--red);
  text-decoration: none;
  transition: color 0.15s;
}
.cveId:hover { color: #f88b9b; }

.ghsaId {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 11px;
  color: #b79cf7;
  text-decoration: none;
  transition: color 0.15s;
}
.ghsaId:hover { color: #cdbaf9; }

.deviceLink {
  color: var(--electric);
  text-decoration: none;
  transition: color 0.15s;
}
.deviceLink:hover { color: #4fcde8; }

.appLink {
  color: var(--raw-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.appLink:hover { color: var(--white); }

/* ── Severity badges ─────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.badge-crit   { background: rgba(241,98,120,0.12); color: var(--red);    border-color: rgba(241,98,120,0.4); }
.badge-high   { background: rgba(244,162,97,0.12); color: #f4a261;       border-color: rgba(244,162,97,0.4); }
.badge-med    { background: rgba(234,179,8,0.12);  color: #e5c44a;       border-color: rgba(234,179,8,0.35); }
.badge-low    { background: rgba(107,158,133,0.12);color: var(--sage);   border-color: rgba(107,158,133,0.4); }
.badge-none   { background: rgba(162,170,173,0.08);color: var(--usu-gray);border-color: rgba(162,170,173,0.3); }

/* ── Status dot ──────────────────────────────────────────── */

.statusDot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.statusDot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.statusDot.online::before  { background: var(--sage);    box-shadow: 0 0 6px var(--sage); }
.statusDot.offline::before { background: var(--border);  }
.statusDot.unknown::before { background: #e5c44a;         box-shadow: 0 0 6px #e5c44a; }

.statusDot.online  { color: var(--sage); }
.statusDot.offline { color: var(--usu-gray); }
.statusDot.unknown { color: #e5c44a; }

/* ── Numeric highlights ──────────────────────────────────── */

.numCrit   { color: var(--red);    font-weight: 700; font-family: ui-monospace, monospace; }
.numHigh   { color: #f4a261;       font-weight: 700; font-family: ui-monospace, monospace; }
.numWarn   { color: #e5c44a;       font-weight: 700; font-family: ui-monospace, monospace; }
.numOk     { color: var(--sage);   font-family: ui-monospace, monospace; }
.numZero   { color: var(--border); font-family: ui-monospace, monospace; }

/* ── Detail grid (metadata cards) ───────────────────────── */

.metaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.metaCard {
  position: relative;
  background: rgba(11, 28, 46, 0.4);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px 14px;
}

.metaCard::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-color: rgba(1, 173, 216, 0.4);
  border-style: solid;
  border-width: 1px 0 0 1px;
  pointer-events: none;
}

.metaLabel {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--electric);
  margin-bottom: 5px;
  opacity: 0.7;
}

.metaValue {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.metaValue.mono {
  font-size: 12px;
}

/* ── Description block ───────────────────────────────────── */

.descBlock {
  background: rgba(11, 28, 46, 0.35);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(1, 173, 216, 0.4);
  border-radius: 2px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--raw-text);
}

/* ── Split panels ────────────────────────────────────────── */

.splitGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Panel rows (feed items) ─────────────────────────────── */

.feedRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(29, 58, 85, 0.45);
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}

.feedRow:last-child   { border-bottom: none; }
.feedRow:hover        { background: rgba(1, 173, 216, 0.04); }

.feedMain {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feedTitle {
  font-size: 12px;
  color: var(--raw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedDate {
  font-size: 11px;
  color: var(--usu-gray);
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────── */

.emptyState {
  padding: 32px 20px;
  text-align: center;
  color: var(--usu-gray);
  font-size: 12px;
}

.emptyState code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  color: var(--electric);
  font-size: 11px;
}

/* ── CVSS vector ─────────────────────────────────────────── */

.cvssVector {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 11px;
  color: var(--sage);
  letter-spacing: 0.02em;
}

/* ── Package table ───────────────────────────────────────── */

.pkgRange { color: var(--red);  font-family: ui-monospace, monospace; font-size: 11px; }
.pkgPatch { color: var(--sage); font-family: ui-monospace, monospace; font-size: 11px; }

/* ── Ref list ────────────────────────────────────────────── */

.refList {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.refList a {
  font-size: 11px;
  color: var(--electric);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: opacity 0.15s;
}
.refList a:hover { opacity: 1; }

/* ── Scrollbars ──────────────────────────────────────────── */

::-webkit-scrollbar         { width: 5px; height: 5px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--usu-gray); }

/* ── Loading pulse ───────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.heroValue.loading,
.statValue.loading {
  color: var(--border);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .splitGrid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  nav { display: none; }
  .metaGrid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .dashGrid { grid-template-columns: 1fr 1fr; }
  .metaGrid { grid-template-columns: 1fr; }
}

/* ── Sync trigger buttons ────────────────────────────────── */

.syncBtn {
  background: none;
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 2px;
  color: var(--electric);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.syncBtn:hover {
  background: rgba(0,229,255,0.08);
  border-color: var(--electric);
}
.syncBtn--all {
  border-color: rgba(110,207,128,0.4);
  color: var(--sage);
}
.syncBtn--all:hover {
  background: rgba(110,207,128,0.08);
  border-color: var(--sage);
}
.syncBtn--links {
  border-color: rgba(183,156,247,0.4);
  color: #b79cf7;
}
.syncBtn--links:hover {
  background: rgba(183,156,247,0.08);
  border-color: #b79cf7;
}
