:root {
  color-scheme: dark;
  --bg: #060606;
  --bg-accent: #141006;
  --panel: rgba(17, 17, 17, 0.94);
  --panel-strong: rgba(25, 21, 11, 0.96);
  --text: #f6e7a8;
  --muted: #c9b77a;
  --line: rgba(232, 196, 74, 0.18);
  --accent: #e0b429;
  --accent-strong: #f4cf57;
  --accent-deep: #8f6a09;
  --danger: #ff8c69;
  --warning: #f2c14f;
  --success: #c9f27b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(224, 180, 41, 0.14), transparent 26%),
    linear-gradient(180deg, #0b0b0b 0%, #050505 100%);
  color: var(--text);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.workbench {
  display: grid;
  gap: 18px;
}

.masthead,
.upload-panel,
.active-job,
.job-list,
.progress-board,
.help-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(30, 24, 12, 0.98), rgba(14, 14, 14, 0.96));
}

.brand-row,
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow,
.board-label,
.board-current-label {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

h2 {
  font-size: 1.05rem;
}

h3 {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill,
.logout-link,
.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(244, 207, 87, 0.28);
  border-radius: 999px;
  background: rgba(224, 180, 41, 0.10);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 800;
}

.help-button {
  width: 42px;
  padding: 0;
  font-size: 1.1rem;
}

.status-pill {
  min-width: 138px;
}

.progress-board,
.upload-panel,
.active-job,
.job-list,
.help-card {
  padding: 18px;
}

.progress-board {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(27, 22, 11, 0.98), rgba(10, 10, 10, 0.97));
}

.board-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.board-current {
  text-align: right;
}

.board-eta {
  text-align: right;
}

#currentCve,
#etaLabel,
#phaseLabel,
#processedCount,
#matchedCount,
#skippedCount,
#cisaCount,
#rhelCount,
#ransomwareCount,
#epssCount,
#pocCount,
#archiveCount,
#archiveAdded,
#archiveOldest,
#archiveNewest,
#pocArchiveCount,
#pocArchiveAdded,
#pocArchiveOldest,
#pocArchiveNewest {
  display: block;
  color: #fff3c3;
  font-weight: 800;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-track-large {
  height: 14px;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7c5b08 0%, #d9aa1b 48%, #ffe38d 100%);
  transition: width 200ms ease;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.counter-card {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(232, 196, 74, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.counter-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.counter-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.15rem;
}

.archive-metrics {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.archive-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.archive-log-link {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.archive-log-link:hover {
  color: var(--accent-strong);
}

.archive-run-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(244, 207, 87, 0.28);
  border-radius: 6px;
  background: rgba(224, 180, 41, 0.10);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.archive-run-button:hover:not(:disabled) {
  background: rgba(224, 180, 41, 0.18);
}

.archive-run-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.archive-updated {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.archive-run-status {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.archive-card {
  min-height: 82px;
  background: rgba(224, 180, 41, 0.045);
}

.archive-card strong {
  overflow-wrap: anywhere;
}

.board-status,
.job-meta,
.progress-head,
.login-copy,
.login-note {
  margin: 0;
  color: var(--muted);
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.file-drop {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 18px;
  border: 1px dashed rgba(244, 207, 87, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.file-drop:focus-within,
.file-drop.is-dragging {
  outline: 3px solid rgba(224, 180, 41, 0.14);
  border-color: var(--accent-strong);
}

.file-drop.is-dragging {
  background: rgba(224, 180, 41, 0.10);
  box-shadow: inset 0 0 0 1px rgba(244, 207, 87, 0.18);
}

.file-title,
.job-title {
  font-weight: 800;
}

.file-name,
.job-title {
  overflow-wrap: anywhere;
}

.file-drop input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.upload-panel button,
.section-head button,
.login-form button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f4cf57, #d9aa1b);
  color: #111;
  font-weight: 900;
  cursor: pointer;
}

.upload-panel button {
  min-width: 150px;
  padding: 0 20px;
}

.section-head button,
.login-form button {
  min-height: 42px;
  padding: 0 14px;
}

.active-job {
  background: var(--panel-strong);
}

.progress-head,
.section-head,
.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#activeTitle {
  color: #fff3c3;
  font-weight: 800;
}

#jobs {
  display: grid;
  gap: 10px;
}

.job-row {
  padding: 14px;
  border: 1px solid rgba(232, 196, 74, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.job-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.job-actions a,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(224, 180, 41, 0.10);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.badge.running,
.badge.queued {
  color: #18120a;
  background: linear-gradient(180deg, #f4cf57, #d9aa1b);
}

.badge.completed {
  color: #0e1604;
  background: #d6ef88;
}

.badge.failed {
  color: #260b06;
  background: #ffb39d;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(520px, 100%);
}

.login-card {
  padding: 28px;
  text-align: center;
}

.help-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4cf57, #d9aa1b);
  color: #111;
  font-size: 2rem;
  font-weight: 900;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(244, 207, 87, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.login-error {
  color: var(--danger);
  font-weight: 800;
}

.help-page {
  gap: 18px;
}

.credit-line {
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 980px) {
  .counter-grid,
  .archive-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .masthead,
  .board-head,
  .upload-panel,
  .progress-head,
  .job-row,
  .section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-actions,
  .brand-row,
  .job-actions {
    justify-content: flex-start;
  }

  .counter-grid,
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-panel button {
    min-height: 48px;
  }

  .board-current {
    text-align: left;
  }
}
