/* ========================================================
   Threat Intelligence Dashboard - Modern Cyber Dark Theme
   ======================================================== */

:root {
  --bg-main: #080d1a;
  --bg-card: #0e172a;
  --bg-card-hover: #121e38;
  --bg-input: #121c33;
  --border-subtle: #1a2744;
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #8092af;
  --text-dim: #7a89a6;   /* was #50617e (2.6-3.1:1); now >= 4.7:1 on every background, still dimmer than --text-muted */

  /* Severity colors */
  --color-critical: #ef4444;
  --color-critical-bg: rgba(239, 68, 68, 0.15);
  --color-high: #f97316;
  --color-high-bg: rgba(249, 115, 22, 0.15);
  --color-medium: #eab308;
  --color-medium-bg: rgba(234, 179, 8, 0.15);
  --color-low: #38bdf8;
  --color-low-bg: rgba(56, 189, 248, 0.15);

  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.dashboard-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 60px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ================= Top Header ================= */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Inner wrapper (icon + title) — always a flex row */
.header-left-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.header-icon {
  width: 30px;
  height: 30px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
  flex-shrink: 0;
}

.header-title-group {
  min-width: 0;
}

.header-title-group h1 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header-title-group h1 .accent-word {
  color: #60a5fa;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-refresh-inline {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-inline:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

.btn-refresh-inline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-refresh-inline.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box-wrapper {
  position: relative;
  min-width: 260px;
  max-width: 440px;
  flex: 1 1 auto;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.select-dropdown {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 28px 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238092af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  transition: border-color 0.15s;
}

.select-dropdown:focus {
  border-color: var(--border-focus);
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-header:hover {
  background-color: #1a284a;
  border-color: #2b3d6a;
  color: #ffffff;
}

.btn-header svg {
  width: 14px;
  height: 14px;
}

/* ================= KPI Metric Cards ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  min-width: 0;
  box-sizing: border-box;
}

.kpi-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
}

.kpi-card:active {
  transform: translateY(0);
}

.kpi-card.active {
  border-color: #38bdf8;
  background-color: #121e38;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.kpi-val {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-val.crit { color: var(--color-critical); }
.kpi-val.high { color: var(--color-high); }
.kpi-val.kev { color: #06b6d4; }
.kpi-val.stack { color: #f43f5e; }
.kpi-val.telegram { color: #94a3b8; }

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ================= Section Card Generic ================= */
.card-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ================= Middle Row 1: Severity, Last 14 Days, Top Sources ================= */
.charts-row-1 {
  display: grid;
  grid-template-columns: 290px minmax(340px, 1fr) 300px;
  gap: 14px;
  margin-bottom: 16px;
}

/* Donut Chart Container */
.donut-chart-container {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 6px auto 12px;
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-num {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.donut-center-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.donut-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.crit { background-color: var(--color-critical); }
.dot.high { background-color: var(--color-high); }
.dot.med { background-color: var(--color-medium); }
.dot.low { background-color: var(--color-low); }

/* Timeline Chart */
.bar-chart-container {
  height: 180px;
  position: relative;
  width: 100%;
}

.timeline-legend {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Top Sources Bar List */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.source-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  gap: 8px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.source-item:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

.source-item.active {
  background-color: rgba(59, 130, 246, 0.25);
  outline: 1px solid #3b82f6;
}

.source-name {
  width: 110px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.source-bar-wrapper {
  flex-grow: 1;
  background-color: #121c33;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.source-bar-fill {
  background-color: #4f46e5;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.source-count {
  width: 32px;
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* ================= Middle Row 2: Stack Hits, Trending Topics, Most Mentioned ================= */
.charts-row-2 {
  display: grid;
  grid-template-columns: 320px minmax(360px, 1fr) 280px;
  gap: 14px;
  margin-bottom: 20px;
}

/* Stack Hits List */
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.stack-item:hover {
  background-color: rgba(249, 115, 22, 0.15);
}

.stack-item.active {
  background-color: rgba(249, 115, 22, 0.25);
  outline: 1px solid #f97316;
}

.stack-name {
  width: 110px;
  color: #cbd5e1;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-bar-wrapper {
  flex-grow: 1;
  background-color: #121c33;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
}

.stack-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #f97316);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.stack-count {
  width: 24px;
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Trending Topics Badges */
.topics-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #132240;
  border: 1px solid #1e335f;
  color: #93c5fd;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  transition: all 0.15s;
}

.topic-badge:hover {
  background-color: #1c3364;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

.topic-badge.active {
  background-color: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

.topic-count {
  font-size: 11px;
  color: #94a3b8;
  background-color: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Most mentioned CVEs */
.most-mentioned-wrapper {
  width: 100%;
  display: block;
}

.empty-box-note {
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  font-style: italic;
}

.most-mentioned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-height: 205px;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 6px;
  box-sizing: border-box;
}

.mentioned-cve-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background-color: #121e38;
  border: 1px solid #1e335f;
  border-radius: 6px;
  cursor: pointer;
  font-style: normal;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.mentioned-cve-item:hover {
  background-color: #192d54;
  border-color: #38bdf8;
  transform: translateX(2px);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.mentioned-cve-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  font-style: normal;
}

.mentioned-cve-bar-wrap {
  flex-grow: 1;
  height: 6px;
  background-color: #0b1329;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 4px;
}

.mentioned-cve-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 3px;
}

.mentioned-cve-count {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  font-style: normal;
  background-color: #0d1527;
  border: 1px solid #1e293b;
  padding: 2px 7px;
  border-radius: 4px;
  text-align: center;
  min-width: 16px;
  flex-shrink: 0;
}

/* ================= Bottom Filter Bar ================= */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.type-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sev-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #121c33;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.sev-pill:hover {
  border-color: #2d416d;
  color: #ffffff;
}

.sev-pill.active {
  background-color: #172748;
  color: #ffffff;
}
.sev-pill.active.crit { border-color: var(--color-critical); }
.sev-pill.active.high { border-color: var(--color-high); }
.sev-pill.active.med { border-color: var(--color-medium); }
.sev-pill.active.low { border-color: var(--color-low); }

/* Threat Type Filter Pills */
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #121c33;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.type-pill:hover {
  border-color: #2d416d;
  color: #ffffff;
  transform: translateY(-1px);
}

.type-pill.active {
  background-color: #172748;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.type-pill.active.cve { border-color: #38bdf8; color: #38bdf8; }
.type-pill.active.news { border-color: #60a5fa; color: #93c5fd; }
.type-pill.active.ransom { border-color: #ef4444; color: #f87171; }
.type-pill.active.breach { border-color: #f59e0b; color: #fbbf24; }
.type-pill.active.malware { border-color: #a855f7; color: #c084fc; }

.dot.cve { background-color: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.dot.news { background-color: #60a5fa; box-shadow: 0 0 6px #60a5fa; }
.dot.ransom { background-color: #ef4444; box-shadow: 0 0 6px #ef4444; }
.dot.breach { background-color: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.dot.malware { background-color: #a855f7; box-shadow: 0 0 6px #a855f7; }
.dot.advisory { background-color: #2dd4bf; box-shadow: 0 0 6px #2dd4bf; }

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background-color: #121c33;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-toggle-btn:hover {
  border-color: #2d416d;
  color: #ffffff;
}

.filter-toggle-btn.active {
  background-color: #1e3a6a;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.results-count-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* ================= Threat Intelligence Feed List ================= */
.threat-feed-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 16px;
}

.threat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.2s;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  scroll-margin-top: 16px;
}

.threat-card:hover {
  background-color: var(--bg-card-hover);
  border-color: #273b64;
  transform: translateX(2px);
}

/* Left score badge */
.score-badge {
  width: 58px;
  height: 52px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.score-num {
  font-size: 20px;
  line-height: 1;
}

.score-sev {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 2px;
  text-transform: uppercase;
}

.score-badge.crit {
  background-color: #dc2626;
  color: #ffffff;
}
.score-badge.high {
  background-color: #ea580c;
  color: #ffffff;
}
.score-badge.med {
  background-color: #ca8a04;
  color: #ffffff;
}
.score-badge.low {
  background-color: #0284c7;
  color: #ffffff;
}

/* Non-CVE Type Badges (Replaces severity badge for news & non-CVE items) */
.score-badge.type-badge {
  padding: 4px;
  text-align: center;
  border-width: 1px;
  border-style: solid;
}
.score-badge.type-badge .type-icon {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-badge.type-badge .type-text {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-badge.type-badge-news {
  background-color: #0f1f38;
  border-color: #2563eb;
  color: #93c5fd;
}
.score-badge.type-badge-ransom {
  background-color: #2a0b12;
  border-color: #dc2626;
  color: #fca5a5;
}
.score-badge.type-badge-breach {
  background-color: #2a1506;
  border-color: #d97706;
  color: #fcd34d;
}
.score-badge.type-badge-malware {
  background-color: #220838;
  border-color: #9333ea;
  color: #d8b4fe;
}
.score-badge.type-badge-advisory {
  background-color: #042524;
  border-color: #0d9488;
  color: #5eead4;
}

/* Middle info group */
.threat-main-info {
  flex-grow: 1;
  min-width: 0;
}

.threat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.threat-title-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.threat-card:hover .threat-title-text {
  color: #60a5fa;
}

.threat-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.threat-meta-row .source-tag {
  color: #cbd5e1;
  font-weight: 500;
}

/* Threat Type Badges */
.threat-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.4;
}

.threat-type-badge.badge-ransom {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.threat-type-badge.badge-breach {
  color: #fbbf24;
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.threat-type-badge.badge-malware {
  color: #c084fc;
  background-color: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}

.threat-type-badge.badge-vuln {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.threat-type-badge.badge-advisory {
  color: #2dd4bf;
  background-color: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.35);
}

.threat-meta-row .kev-badge {
  color: #38bdf8;
  font-weight: 600;
  background-color: rgba(56, 189, 248, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
}

.threat-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.feed-tag {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 2px 7px;
  border-radius: 4px;
}

.feed-tag.stack-tag {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.feed-tag.cve-tag {
  background-color: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.feed-tag.topic-tag {
  background-color: #14233f;
  border: 1px solid #1e3868;
  color: #93c5fd;
}

.feed-tag.iocs-tag {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Action button on right of card */
.threat-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon-subtle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-subtle:hover {
  background-color: #15223c;
  border-color: #20355c;
  color: #ffffff;
}

.threat-sent-icon {
  color: #10b981;
}

/* Pagination container */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.btn-page {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-page:hover:not(:disabled) {
  background-color: #172748;
  border-color: #2b3e6c;
  color: #ffffff;
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= Detail Modal ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 9, 18, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: #0d172b;
  border: 1px solid #1e2f50;
  border-radius: 10px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #182645;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-group h2 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.modal-title-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-close-modal:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.modal-grid-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background-color: #121c33;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1a284a;
}

.metric-block {
  display: flex;
  flex-direction: column;
}
.metric-block .lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}
.metric-block .val {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #60a5fa;
  margin-bottom: 6px;
}

.iocs-box {
  background-color: #070d18;
  border: 1px solid #1a284a;
  border-radius: 6px;
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.ioc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ioc-type-pill {
  color: #38bdf8;
  font-weight: 600;
  font-size: 11px;
}

.ioc-val-text {
  color: #cbd5e1;
  word-break: break-all;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #182645;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: #0c1426;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  border: 1px solid #3b82f6;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= Active Filter Indicator Banner ================= */
.active-filter-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  background-color: #0c1830;
  border: 1px solid #1e3a68;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  gap: 10px;
}

.active-filter-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  min-width: 0;
}

.active-filter-text {
  color: #94a3b8;
}

.active-filter-badge {
  font-weight: 600;
  color: #38bdf8;
  background: #070e1e;
  border: 1px solid #0284c7;
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-filter-count {
  color: #94a3b8;  /* was #64748b (3.7:1 on the banner); now ~7:1 */
  font-size: 12px;
}

.btn-clear-filter {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-clear-filter:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* Mobile-only export strip — hidden on desktop */
.header-export-mobile {
  display: none;
}

/* ========================================================
   Responsive Breakpoints & Layout Resizing
   Desktop, Laptop, Tablet, and Mobile Phone
   ======================================================== */

/* 1. Large Desktop (>= 1400px) */
@media (min-width: 1400px) {
  .dashboard-container {
    max-width: 1600px;
    padding: 22px 28px 60px;
  }
  .charts-row-1 {
    grid-template-columns: 310px 1fr 320px;
    gap: 16px;
  }
  .charts-row-2 {
    grid-template-columns: 330px 1fr 300px;
    gap: 16px;
  }
}

/* 2. Laptop & Standard Desktop (1025px - 1399px) */
@media (max-width: 1399px) and (min-width: 1025px) {
  .dashboard-container {
    max-width: 1360px;
    padding: 18px 20px 50px;
  }
  .kpi-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
  .charts-row-1 {
    grid-template-columns: 270px 1fr 270px;
    gap: 12px;
  }
  .charts-row-2 {
    grid-template-columns: 290px 1fr 260px;
    gap: 12px;
  }
}

/* 3. Medium Screens & Tablet Landscape (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .dashboard-container {
    padding: 16px 16px 40px;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .charts-row-1 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .charts-row-1 > .card-section:nth-child(2) {
    grid-column: 1 / -1;
  }
  .charts-row-2 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .charts-row-2 > .card-section:nth-child(2) {
    grid-column: 1 / -1;
  }
  .search-box-wrapper {
    min-width: 200px;
  }
}

/* 4. Mobile Phone & Tablet Portrait (<= 768px) */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 12px 10px 40px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Header mobile layout */
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }

  /* Row 1: logo + title on the left, export buttons on the right */
  .header-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

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

  .header-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }

  .header-title-group h1 {
    font-size: 17px;
    line-height: 1.25;
    white-space: nowrap;
  }

  /* Export buttons pinned to top-right on mobile */
  .header-export-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .header-export-mobile .btn-header {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
  }

  /* Row 2: search full width */
  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box-wrapper {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .search-input {
    font-size: 13px;
    padding: 9px 12px 9px 34px;
  }

  /* Row 3: time range + hidden export (moved to top row) */
  .header-actions-group {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
    align-items: center;
  }

  .header-actions-group #time-range-select {
    flex: 1 1 auto;
    width: 100%;
    font-size: 12px;
    padding: 8px 24px 8px 10px;
    min-width: 0;
  }

  /* Hide CSV/IOCs from actions group on mobile (shown in top row instead) */
  .header-actions-group .btn-header {
    display: none;
  }

  /* Fallback if actions group not used */
  .dashboard-header .select-dropdown {
    width: 100%;
    font-size: 12px;
    padding: 8px 24px 8px 10px;
  }

  /* KPI metric cards (2 columns on mobile) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .kpi-card {
    padding: 12px 10px;
    border-radius: 6px;
    min-width: 0;
  }

  .kpi-val {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .kpi-label {
    font-size: 11px;
  }

  /* Charts row 1: Stack vertically */
  .charts-row-1 {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .card-section {
    padding: 14px 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .donut-chart-container {
    width: 150px;
    height: 150px;
    margin: 4px auto 10px;
  }

  .donut-center-num {
    font-size: 22px;
  }

  .bar-chart-container {
    height: 160px;
    width: 100%;
    min-width: 0;
  }

  .timeline-legend {
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 10px;
  }

  .source-list {
    max-height: 180px;
  }

  .source-name {
    width: 90px;
    font-size: 11px;
  }

  /* Charts row 2: Stack vertically */
  .charts-row-2 {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .stack-list {
    max-height: 180px;
  }

  .stack-name {
    width: 90px;
    font-size: 11px;
  }

  .topics-cloud {
    max-height: 180px;
    overflow-y: auto;
    gap: 6px;
    padding-right: 4px;
  }

  .topic-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .most-mentioned-list {
    max-height: 180px;
  }

  /* Bottom Filter Row */
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
    margin-bottom: 12px;
  }

  .filter-left-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .type-pills-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .type-pills-row::-webkit-scrollbar {
    height: 3px;
  }

  .type-pill {
    flex-shrink: 0;
    font-size: 11px;
    padding: 5px 10px;
  }

  .filter-controls-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  .filter-controls-row .select-dropdown {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 7px 20px 7px 8px;
  }

  .filter-controls-row .filter-toggle-btn {
    width: 100%;
    justify-content: center;
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Last odd control spans full width */
  .filter-controls-row > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .results-count-text {
    text-align: center;
    margin-left: 0;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
    width: 100%;
    font-size: 12px;
  }

  /* Active Filter Banner mobile */
  .active-filter-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .btn-clear-filter {
    text-align: center;
    width: 100%;
    padding: 6px 12px;
  }

  /* Threat Card mobile */
  .threat-feed-container {
    gap: 8px;
  }

  .threat-card {
    gap: 10px;
    padding: 10px;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
  }

  .score-badge {
    width: 44px;
    height: 42px;
    margin-top: 1px;
    border-radius: 5px;
    flex-shrink: 0;
  }

  .score-num {
    font-size: 17px;
  }

  .score-sev {
    font-size: 8px;
  }

  .score-badge.type-badge .type-text {
    font-size: 8px;
  }

  .threat-main-info {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .threat-title-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .threat-meta-row {
    font-size: 11px;
    gap: 3px 6px;
    margin-bottom: 4px;
    line-height: 1.4;
    flex-wrap: wrap;
    align-items: center;
  }

  .threat-badges-row {
    gap: 4px;
    flex-wrap: wrap;
  }

  .feed-tag {
    font-size: 10px;
    padding: 1px 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .threat-card-actions {
    align-self: flex-start;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* Detail modal mobile */
  .modal-overlay {
    padding: 6px;
  }

  .modal-content {
    width: 100%;
    max-height: 95vh;
    border-radius: 8px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-title-group h2 {
    font-size: 15px;
  }

  .modal-body {
    padding: 12px 14px;
    gap: 12px;
    font-size: 12px;
  }

  .modal-grid-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .metric-block .lbl {
    font-size: 10px;
  }

  .metric-block .val {
    font-size: 13px;
  }

  .source-intel-card {
    padding: 10px 12px !important;
    margin: 10px 0 !important;
  }

  .modal-footer {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .modal-footer .btn-header {
    width: 100%;
    justify-content: center;
  }

  /* Pagination mobile */
  .pagination-row {
    margin-top: 14px;
    gap: 6px;
  }

  .btn-page {
    padding: 6px 10px;
    font-size: 12px;
  }

  .page-info {
    font-size: 11px;
  }

  /* Toast notification mobile */
  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 10px 12px;
    font-size: 12px;
    justify-content: center;
  }
}

/* 5. Compact Phone (<= 480px) */
@media (max-width: 480px) {
  .header-title-group h1 {
    font-size: 15px;
  }
  .header-export-mobile .btn-header {
    font-size: 10px;
    padding: 5px 7px;
    gap: 3px;
  }
  .kpi-card {
    padding: 10px 8px;
  }
  .kpi-val {
    font-size: 20px;
  }
  .kpi-label {
    font-size: 10px;
  }
  .filter-controls-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .header-actions-group {
    gap: 4px;
  }
}

/* 6. Extra Small Phone (<= 360px) */
@media (max-width: 360px) {
  .dashboard-container {
    padding: 8px 6px 30px;
  }
  .kpi-grid {
    gap: 6px;
  }
  .kpi-card {
    padding: 8px 6px;
  }
  .kpi-val {
    font-size: 18px;
  }
  .score-badge {
    width: 40px;
    height: 38px;
  }
  .score-num {
    font-size: 15px;
  }
}

.threat-title-link { color: inherit; text-decoration: none; }
.threat-title-link:hover .threat-title-text { text-decoration: underline; }

/* ---- Indexable SEO pages (category listings) & homepage browse section ---- */
.seo-page { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; color: var(--text-main); line-height: 1.6; }
.seo-page a { color: #60a5fa; }
.seo-page h1 { font-size: 26px; margin: 8px 0; }
.seo-page .crumbs { font-size: 13px; color: var(--text-muted); }
.seo-intro { color: #cbd5e1; }
.seo-list { list-style: none; padding: 0; }
.seo-list li { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.seo-list li > a { font-weight: 600; font-size: 15px; }
.seo-list p { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.seo-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.seo-page .pill { padding: 1px 7px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border-subtle); }
.pager { display: flex; gap: 16px; justify-content: center; margin: 24px 0; color: var(--text-muted); }
.seo-page .cta { display: inline-block; margin-top: 24px; padding: 10px 16px; border-radius: 6px; background: #1d4ed8; color: #fff; text-decoration: none; }
.seo-foot { font-size: 13px; color: var(--text-muted); }

/* ---- Watchlist page ---- */
.watch-form { margin: 20px 0; padding: 16px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-subtle); }
.watch-form > label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.watch-form input[type="text"] { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 6px; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-main); font-size: 15px; }
.watch-form input[type="text"]:focus { outline: none; border-color: var(--border-focus); }
.watch-options { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 12px; font-size: 13px; color: #cbd5e1; }
.watch-options select { margin-left: 6px; padding: 4px 6px; background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-subtle); border-radius: 4px; }
.seo-page .watch-btn { margin-top: 0; border: 0; cursor: pointer; font-size: 14px; }
.watch-presets { font-size: 13px; color: var(--text-muted); margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.watch-presets a { padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border-subtle); text-decoration: none; }
.watch-feed-box { margin: 20px 0; padding: 16px; border-radius: 8px; border: 1px solid var(--border-focus); background: var(--bg-card); }
.watch-feed-box h2 { margin-top: 0; }
.watch-url { display: flex; gap: 8px; align-items: center; background: var(--bg-input); padding: 8px 10px; border-radius: 6px; overflow-x: auto; }
.watch-url code { flex: 1; white-space: nowrap; font-size: 13px; }
.btn-copy { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-main); cursor: pointer; }
.watch-feed-box details { margin-top: 12px; font-size: 14px; color: #cbd5e1; }
.watch-feed-box summary { cursor: pointer; color: #60a5fa; }
.watch-promo { margin-top: 28px; padding: 12px 14px; border-left: 3px solid var(--border-focus); background: var(--bg-card); border-radius: 4px; font-size: 14px; }

/* ---- IOC page (simple view) ---- */
.ioc-page { --t-ip: #38bdf8; --t-domain: #a78bfa; --t-url: #fb923c; --t-hash: #94a3b8;
  max-width: 1000px; margin: 0 auto; padding: 20px 16px 56px; color: var(--text-main); line-height: 1.55; }
.ioc-page a { color: #60a5fa; }
.ioc-page .crumbs { font-size: 13px; color: var(--text-muted); }
.ioc-page .crumbs a { color: var(--text-muted); }
.ioc-hero { padding: 18px 0 8px; }
.ioc-hero h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
.ioc-hero p { margin: 0 0 6px; color: #cbd5e1; font-size: 16px; }
.ioc-hero .ioc-updated { font-size: 13px; color: var(--text-muted); }
.ioc-updated .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 4px; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.ioc-empty { margin: 16px 0; padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--border-focus); background: var(--bg-card); color: #cbd5e1; }

.ioc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 8px; }
.ioc-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 10px; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-top: 3px solid var(--kc, var(--border-focus)); text-decoration: none; transition: background .15s, border-color .15s; }
.ioc-page a.ioc-kpi { color: var(--text-main); }
.ioc-kpi:hover, .ioc-kpi.active { background: var(--bg-card-hover); border-color: var(--kc); }
.ioc-kpi .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ioc-kpi .l { font-size: 13px; color: var(--text-muted); }
.t-ip-any { --kc: var(--t-ip); } .t-domain { --kc: var(--t-domain); } .t-url { --kc: var(--t-url); } .t-hash { --kc: var(--t-hash); }

.ioc-h2 { font-size: 18px; margin: 32px 0 4px; }
.ioc-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 12px; }
.ioc-lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ioc-list { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-subtle); }
.ioc-list-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ioc-list-name { font-weight: 600; }
.ioc-list-count { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ioc-list-hint { font-size: 12px; color: var(--text-dim); }
.ioc-list-actions { display: flex; gap: 8px; margin-top: 8px; }
.ioc-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-subtle); background: transparent; color: var(--text-main); cursor: pointer; text-decoration: none; font-family: inherit; }
.ioc-page a.ioc-btn { color: var(--text-main); }
.ioc-btn:hover { border-color: var(--border-focus); }
.ioc-btn.primary { background: #1d4ed8; border-color: #1d4ed8; }
.ioc-page a.ioc-btn.primary, .ioc-btn.primary { color: #fff; }
.ioc-btn.primary:hover { background: #2563eb; }
.ioc-btn.done { border-color: #22c55e; color: #86efac; }
.ioc-btn:focus-visible, .ioc-kpi:focus-visible, .ioc-tabs a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.ioc-search { display: flex; gap: 8px; margin: 8px 0 10px; }
.ioc-search input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-main); font-size: 15px; }
.ioc-search input:focus { outline: none; border-color: var(--border-focus); }
.ioc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ioc-tabs a { padding: 4px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; border: 1px solid var(--border-subtle); }
.ioc-page .ioc-tabs a { color: #cbd5e1; }
.ioc-page .ioc-tabs a[aria-current="page"] { background: var(--text-main); color: var(--bg-main); border-color: var(--text-main); }
.ioc-page .ioc-tabs a.clear { color: var(--text-muted); border-style: dashed; }
.ioc-trending { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.ioc-trending a { padding: 1px 8px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border-subtle); text-decoration: none; }

.ioc-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.ioc-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border-subtle); }
.ioc-row:first-child { border-top: 0; }
.ioc-row:hover { background: var(--bg-card-hover); }
.ioc-type { justify-self: start; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); }
.ioc-type.t-ip { --kc: var(--t-ip); }
.ioc-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ioc-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ioc-malware { padding: 1px 7px; border-radius: 4px; background: rgba(239,68,68,.12); text-decoration: none; }
.ioc-page a.ioc-malware { color: #fca5a5; }
.ioc-page a.ioc-src { color: var(--text-muted); }
.ioc-none { display: block; color: var(--text-muted); }

.ioc-help { margin-top: 28px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card); font-size: 14px; color: #cbd5e1; }
.ioc-help summary { cursor: pointer; font-weight: 600; color: var(--text-main); }
.ioc-foot { margin-top: 28px; font-size: 12px; color: var(--text-dim); }
.ioc-foot a { color: var(--text-muted); }

@media (max-width: 760px) {
  .ioc-hero h1 { font-size: 22px; }
  .ioc-kpis { grid-template-columns: repeat(2, 1fr); }
  .ioc-lists { grid-template-columns: 1fr 1fr; }
  .ioc-row { grid-template-columns: 64px minmax(0, 1fr); }
  .ioc-meta { grid-column: 2; flex-wrap: wrap; }
}
@media (max-width: 460px) { .ioc-lists { grid-template-columns: 1fr; } }

/* category nav on SEO pages */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.cat-nav a { font-size: 13px; padding: 4px 10px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border-subtle); color: #cbd5e1; text-decoration: none; }
.cat-nav a[aria-current="page"], .cat-nav a:hover { border-color: var(--border-focus); color: #fff; }

/* ---- Homepage navigation: plain, typographic ---- */
.site-nav { margin: 0 0 18px; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.site-nav-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.site-nav-tools li + li { border-left: 1px solid var(--border-subtle); }
.site-nav-tools a { display: block; height: 100%; box-sizing: border-box; padding: 12px 18px; text-decoration: none; color: inherit; }
.site-nav-tools li:first-child a { padding-left: 0; }
.site-nav-tools strong { display: block; color: var(--text-main); font-size: 15px; font-weight: 600; }
.site-nav-tools span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.site-nav-browse { margin: 0; padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; line-height: 1.9; color: var(--text-muted); }
.site-nav-label { color: var(--text-dim); margin-right: 4px; }
.site-nav-browse a { color: #cbd5e1; text-decoration: none; white-space: nowrap; }  /* never split a name from its count */
.site-nav-browse .nav-count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.site-nav-browse .sep { margin: 0 8px; color: var(--border-subtle); }
.site-nav-browse .nav-about { float: right; color: var(--text-muted); }
/* Hover styles only on devices that really hover (mouse), so taps on phones don't leave links underlined */
@media (hover: hover) {
  .site-nav-tools a:hover strong { color: #93c5fd; text-decoration: underline; text-underline-offset: 3px; }
  .site-nav-browse a:hover .nav-name, .site-nav-browse .nav-about:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
}
.site-nav a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 2px; }
.site-about { margin-top: 24px; padding: 0 4px; }
.site-about p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.site-about strong { color: var(--text-muted); }
.site-about a { color: var(--text-muted); }
@media (max-width: 900px) {
  .site-nav-tools { grid-template-columns: minmax(0, 1fr); }
  .site-nav-tools li + li { border-left: 0; border-top: 1px solid var(--border-subtle); }
  .site-nav-tools a, .site-nav-tools li:first-child a { position: relative; padding: 11px 28px 11px 0; }
  .site-nav-tools a::after { content: "\203A"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    font-size: 22px; line-height: 1; color: var(--text-dim); }
  .site-nav-tools a:active { background: var(--bg-card-hover); }
  /* Browse: two equal columns that can shrink; long names get "…" instead of pushing off-screen */
  .site-nav-browse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; padding: 4px 0 8px; line-height: 1.4; }
  .site-nav-browse .site-nav-label { grid-column: 1 / -1; margin: 0; padding: 8px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
  .site-nav-browse .sep { display: none; }
  .site-nav-browse a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0;
    padding: 11px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
  .site-nav-browse a:active { background: var(--bg-card-hover); }
  .site-nav-browse .nav-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .site-nav-browse .nav-count { flex: none; }
  .site-nav-browse .nav-about { grid-column: 1 / -1; float: none; display: block; padding: 12px 0 2px; border-bottom: 0; font-size: 13px; }
}
@media (max-width: 340px) { .site-nav-browse { grid-template-columns: minmax(0, 1fr); } }

/* ---- Shared site header (all pages except the dashboard's own header) ---- */
.site-header { border-bottom: 1px solid var(--border-subtle); background: var(--bg-main); }
.site-header-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; }
.site-brand { display: inline-flex; align-items: center; gap: 8px; flex: none; color: var(--text-main); font-size: 16px; font-weight: 700; text-decoration: none; }
.site-brand img { border-radius: 4px; }
.site-search { flex: 1; max-width: 340px; margin: 0; }
.site-search input { width: 100%; box-sizing: border-box; padding: 7px 11px; border-radius: 6px; border: 1px solid var(--border-subtle);
  background: var(--bg-input); color: var(--text-main); font-size: 14px; font-family: inherit; }
.site-search input:focus { outline: none; border-color: var(--border-focus); }
.site-menu { display: flex; gap: 20px; margin-left: auto; }
.site-menu a { padding: 6px 0; border-bottom: 2px solid transparent; color: #cbd5e1; font-size: 14px; text-decoration: none; white-space: nowrap; }
.site-menu a[aria-current="page"] { color: #fff; border-bottom-color: var(--border-focus); }
@media (hover: hover) { .site-menu a:hover, .site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; } }
.site-header a:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 760px) {
  .site-header-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px 0; }
  .site-search { max-width: none; }
  .site-menu { order: 3; flex-basis: 100%; margin-left: 0; gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .site-menu::-webkit-scrollbar { display: none; }
  .site-menu a { padding: 8px 0 10px; }
}

/* ---- Shared site footer ---- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--border-subtle); background: var(--bg-card); }
.site-footer-inner { max-width: 1200px; margin: 0 auto; padding: 28px 16px 20px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; }
.sf-about p { margin: 10px 0 0; max-width: 36ch; font-size: 13px; line-height: 1.55; color: #94a3b8; }
.site-footer h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 7px; }
.site-footer li a { color: #cbd5e1; font-size: 14px; text-decoration: none; }
.sf-bottom { margin: 0; padding: 14px 16px; border-top: 1px solid var(--border-subtle); text-align: center; font-size: 12px; line-height: 1.5; color: #94a3b8; }
@media (max-width: 760px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 22px 18px; }
  .sf-about { grid-column: 1 / -1; }
  .site-footer li a { display: inline-block; padding: 3px 0; }
}

/* ---- 404 page ---- */
.notfound-code { margin: 24px 0 0; font-size: 64px; font-weight: 800; line-height: 1; color: var(--border-focus); }
.notfound h1 { margin-top: 6px; }
.notfound-search { display: flex; gap: 8px; margin: 18px 0 30px; }
.notfound-search input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-subtle);
  background: var(--bg-input); color: var(--text-main); font-size: 15px; font-family: inherit; }
.notfound-search input:focus { outline: none; border-color: var(--border-focus); }
.notfound-links { list-style: none; margin: 0; padding: 0; }
.notfound-links li { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.notfound-links a { font-weight: 600; }
.notfound-links span { display: block; font-size: 13px; color: #94a3b8; }

/* Severity badges: the cards use "critical"/"medium" (from the severity name), the original rules only
   covered "crit"/"med", so CRITICAL and MEDIUM badges had no colour. */
.score-badge.critical { background-color: #dc2626; color: #ffffff; }
.score-badge.medium { background-color: #ca8a04; color: #ffffff; }

/* Estimated severity (NVD hasn't scored the CVE yet): outlined, dashed, not filled */
.score-badge.is-estimated { background-color: transparent; border: 1.5px dashed currentColor; }
.score-badge.critical.is-estimated, .score-badge.crit.is-estimated { color: #f87171; }
.score-badge.high.is-estimated { color: #fb923c; }
.score-badge.medium.is-estimated, .score-badge.med.is-estimated { color: #fbbf24; }
.score-badge.low.is-estimated { color: #38bdf8; }


/* ---- Keyboard focus & skip link (accessibility) ---- */
/* A visible outline whenever something is focused with the keyboard (mouse clicks don't show it) */
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
[role="button"][tabindex="0"]:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 8px 14px; border-radius: 6px;
  background: #1d4ed8; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; }

/* Popup: main action (open the threat's own page) */
.btn-header.btn-header-primary { background-color: #1d4ed8; border-color: #1d4ed8; color: #ffffff; font-weight: 600; }
.btn-header.btn-header-primary:hover { background-color: #2563eb; border-color: #2563eb; }

/* ---- Dashboard header on small phones: the title must never run into the CSV / IOCs buttons ---- */
@media (max-width: 768px) {
  .header-title-group { min-width: 0; }
  .header-title-group h1 { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 400px) {
  .header-title-group h1 .accent-word { display: none; }   /* "BimDefense" only */
}
@media (max-width: 340px) {
  /* Icon-only buttons; their title attributes still name them for screen readers and on hover */
  .header-export-mobile .btn-header { font-size: 0; gap: 0; padding: 6px 8px; }
}

/* ---- Phone polish ---- */
@media (max-width: 760px) {
  /* Soft fade on the right of the swipeable menu, so it's clear more links follow */
  .site-menu { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 28px; }
}
@media (max-width: 600px) {
  /* Watch page: wrap the long feed address so the Copy button stays visible */
  .watch-url { flex-wrap: wrap; overflow-x: visible; }
  .watch-url code { white-space: normal; overflow-wrap: anywhere; word-break: break-all; flex-basis: 100%; }
  .watch-url .btn-copy { margin-left: auto; }
}

/* ---- Search feedback line (under the dashboard header) ---- */
.search-hint { margin: -6px 0 14px; padding: 8px 12px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-focus);
  font-size: 13px; line-height: 1.5; color: #cbd5e1; }
.search-hint[hidden] { display: none; }
.search-hint strong { color: #fff; }
.search-hint a { color: #93c5fd; font-weight: 600; text-decoration: none; }
.search-hint button { padding: 0; border: 0; background: none; color: #94a3b8; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---- Phones: get visitors to the threat list quickly ---- */
@media (max-width: 760px) {
  /* Charts move below the list (they were ~775px above it); everything else keeps its order */
  .dashboard-container { display: flex; flex-direction: column; }
  .dashboard-container > .charts-row-1 { order: 5; margin-top: 18px; }
  .dashboard-container > .site-about { order: 6; }

  /* Tools: three compact links in one row, no descriptions */
  .site-nav-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-nav-tools li + li { border-top: 0; border-left: 1px solid var(--border-subtle); }
  .site-nav-tools a, .site-nav-tools li:first-child a { padding: 10px 6px; text-align: center; }
  .site-nav-tools a::after { display: none; }
  .site-nav-tools strong { font-size: 13px; line-height: 1.3; }
  .site-nav-tools span { display: none; }

  /* Browse: one swipeable line of categories */
  .site-nav-browse { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; overflow-x: auto; padding: 8px 0;
    scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .site-nav-browse::-webkit-scrollbar { display: none; }
  .site-nav-browse .site-nav-label { flex: none; padding: 0 2px 0 0; }
  .site-nav-browse a { flex: none; display: inline-flex; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 13px; }
  .site-nav-browse .nav-about { display: none; }   /* also in the footer */
}


/* ---- Severity badges: white text needs >= 4.5:1 (was HIGH 3.6, MEDIUM 2.9, LOW 4.1) ---- */
.score-badge.high { background-color: #c2410c; }                       /* 5.2:1 */
.score-badge.med, .score-badge.medium { background-color: #a16207; }   /* 4.9:1 */
.score-badge.low { background-color: #0369a1; }                        /* 5.9:1 */
/* Estimated badges stay outlined (no fill), whatever the severity colour above */
.score-badge.is-estimated.critical, .score-badge.is-estimated.crit, .score-badge.is-estimated.high,
.score-badge.is-estimated.medium, .score-badge.is-estimated.med, .score-badge.is-estimated.low { background-color: transparent; }
