/* ==========================================================================
   SecPulse console — advisory intelligence (emerald command-center theme)
   Extends branguard.css (shared dark console shell) with the emerald accent,
   date picker, advisory feed rows, source pills and bookmark chips.
   ========================================================================== */

body.secpulse-body {
  background:
    radial-gradient(1100px 500px at 85% -5%, rgba(16, 185, 129, 0.06), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(5, 150, 105, 0.07), transparent 55%),
    var(--bg0);
  color: #cbd5e1;
}

.secpulse-body * { scrollbar-width: thin; scrollbar-color: #1e293b transparent; }
.secpulse-body *::-webkit-scrollbar { width: 9px; height: 9px; }
.secpulse-body *::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 99px; border: 2px solid var(--bg0); }
.secpulse-body *::-webkit-scrollbar-thumb:hover { background: #334155; }
.secpulse-body ::selection { background: rgba(16, 185, 129, 0.28); color: #ecfdf5; }

.secpulse-body button:focus-visible,
.secpulse-body a:focus-visible,
.secpulse-body input:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.65);
  outline-offset: 2px;
  border-radius: 8px;
}

.secpulse-body .toast {
  background: rgba(12, 20, 36, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}
.secpulse-body .toast .t-msg { color: #e2e8f0; }

.secpulse-body .nav-dark .nav-links a:hover,
.secpulse-body .nav-dark .nav-links a.active { color: #34d399; background: rgba(16, 185, 129, 0.08); }
.secpulse-body .signin-link { color: #34d399; border-color: rgba(16, 185, 129, 0.35); }
.secpulse-body .bg-tag { color: #34d399; background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); }
.secpulse-body .bg-tag .dot { background: #34d399; box-shadow: 0 0 10px #34d399; }
.secpulse-body .btn-cyber.primary { background: linear-gradient(135deg, #059669, #10b981); color: #022c22; box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.6); }
.secpulse-body .btn-cyber.ghost:hover { border-color: rgba(16, 185, 129, 0.5); color: #34d399; }
.secpulse-body .fchip:hover { border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.secpulse-body .fchip.active { background: rgba(16, 185, 129, 0.14); border-color: #34d399; color: #34d399; }
.secpulse-body .field:focus { border-color: rgba(16, 185, 129, 0.55); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.07); }

/* -------- controls row -------- */
.sp-controls {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
}
.sp-date-field { display: flex; flex-direction: column; gap: 6px; }
.sp-date-field label { font-size: 12px; font-weight: 600; color: #94a3b8; }
.sp-date-field input[type="date"] {
  background: var(--bg2); border: 1px solid var(--line-d); border-radius: 10px;
  color: #e2e8f0; font-size: 14px; padding: 9px 12px; font-family: inherit;
  color-scheme: dark;
}
.sp-date-field input[type="date"]:focus { border-color: rgba(16, 185, 129, 0.55); outline: none; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.07); }

/* -------- advisory feed -------- */
.sp-feed { display: flex; flex-direction: column; gap: 8px; }
.sp-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel); border: 1px solid var(--line-d);
  border-radius: 12px; padding: 12px 16px; transition: border-color .15s;
}
.sp-row:hover { border-color: var(--line-strong); }
.sp-row.bm { border-left: 3px solid #34d399; }
.sp-row .sp-sev { flex: 0 0 auto; margin-top: 2px; }
.sp-row .sp-body { flex: 1; min-width: 0; }
.sp-row .sp-title {
  color: #e2e8f0; font-size: 13.5px; font-weight: 600; line-height: 1.45;
  word-break: break-word;
}
.sp-row .sp-title a { color: inherit; text-decoration: none; }
.sp-row .sp-title a:hover { color: #34d399; }
.sp-row .sp-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.sp-row .sp-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; color: #64748b;
}
.sp-row .sp-cvss {
  font-family: var(--font-head); font-weight: 700; font-size: 12px; color: #e2e8f0;
}
.sp-row .sp-bm-flag { font-size: 11px; color: #34d399; display: inline-flex; align-items: center; gap: 4px; }

/* severity badge */
.sp-sev {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-head); font-weight: 700; font-size: 10.5px;
  padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.sp-sev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sp-sev.critical { color: var(--rose-d); background: rgba(251, 113, 133, 0.12); }
.sp-sev.high { color: #fb923c; background: rgba(251, 146, 60, 0.12); }
.sp-sev.medium { color: var(--amber-d); background: rgba(251, 191, 36, 0.12); }
.sp-sev.low { color: var(--cyan-d); background: rgba(34, 211, 238, 0.12); }
.sp-sev.none { color: #64748b; background: rgba(100, 116, 139, 0.12); }

/* source pill */
.sp-src {
  font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 99px; text-transform: uppercase;
  background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.25);
}
.sp-src.kev { background: rgba(251, 113, 133, 0.1); color: #fda4af; border-color: rgba(251, 113, 133, 0.25); }
.sp-src.github { background: rgba(148, 163, 184, 0.1); color: #cbd5e1; border-color: var(--line-d); }
.sp-src.ubuntu { background: rgba(251, 191, 36, 0.1); color: #fcd34d; border-color: rgba(251, 191, 36, 0.25); }

/* bookmarks */
.sp-bookmarks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sp-bm-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7; font-size: 12.5px; font-weight: 500;
  padding: 5px 10px 5px 13px; border-radius: 999px;
}
.sp-bm-chip button {
  background: none; border: none; cursor: pointer; color: #6ee7b7;
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.sp-bm-chip button:hover { color: #fff; }
.sp-add-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sp-add-row .field { flex: 1; min-width: 180px; }

/* webhook status */
.sp-webhook {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #94a3b8;
  padding: 8px 0;
}
.sp-webhook .dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.sp-webhook .dot.on { background: var(--green-d); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }

/* empty state */
.sp-empty {
  text-align: center; padding: 40px 20px; color: #64748b; font-size: 14px;
  background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.sp-empty b { color: #94a3b8; }

/* info source cards (vendor sources section) */
.sp-layer {
  background: var(--panel); border: 1px solid var(--line-d);
  border-radius: var(--radius); padding: 18px 20px;
}
.sp-layer h4 { margin: 0 0 8px; font-family: var(--font-head); color: #e2e8f0; font-size: 14.5px; }
.sp-layer p { color: #94a3b8; font-size: 13px; line-height: 1.6; margin: 0; }

/* ==========================================================================
   Charts
   ========================================================================== */

.sp-charts {
  display: grid; grid-template-columns: 0.9fr 1fr 1.1fr; gap: 14px; margin-bottom: 6px;
}
.sp-chart-card { padding: 18px 20px; }
.sp-chart-card h4 {
  margin: 0 0 14px; font-family: var(--font-head); font-size: 13px;
  color: #94a3b8; letter-spacing: .02em;
}

/* donut */
.sp-donut-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto 12px; }
.sp-donut-wrap svg { transform: rotate(-90deg); }
.sp-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.sp-donut-center .n { font-family: var(--font-head); font-weight: 700; font-size: 30px; color: #f8fafc; }
.sp-donut-center .l { font-size: 10.5px; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.sp-legend { display: flex; flex-direction: column; gap: 6px; }
.sp-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
.sp-legend .lg i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.sp-legend .lg b { margin-left: auto; font-family: var(--font-head); color: #e2e8f0; }

/* source bars */
.sp-src-bar { margin-bottom: 10px; }
.sp-src-bar .lbl { display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; margin-bottom: 5px; }
.sp-src-bar .lbl b { color: #e2e8f0; font-family: var(--font-head); }
.sp-src-bar .track { height: 9px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.sp-src-bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #059669, #34d399); transition: width .6s ease; }

/* trend */
.sp-trend { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 6px; }
.sp-trend .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.sp-trend .bar .track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: transparent; }
.sp-trend .bar .col {
  width: 100%; border-radius: 5px 5px 0 0; min-height: 3px;
  background: linear-gradient(180deg, #34d399, #059669);
  transition: height .6s ease;
}
.sp-trend .bar .dt { font-size: 9.5px; color: #64748b; }

/* ==========================================================================
   Grouped feed (severity sections)
   ========================================================================== */

.sp-group { margin-bottom: 10px; }
.sp-group > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  background: var(--panel); border: 1px solid var(--line-d); border-radius: 12px;
  padding: 12px 16px; font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: #e2e8f0; user-select: none;
}
.sp-group > summary::-webkit-details-marker { display: none; }
.sp-group > summary::before { content: "▸"; color: #64748b; transition: transform .15s; }
.sp-group[open] > summary::before { content: "▾"; }
.sp-group > summary .g-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--bg2); border-radius: 99px; padding: 2px 10px;
}
.sp-group .sp-group-body { padding: 8px 0 0 0; }

/* ==========================================================================
   News
   ========================================================================== */

.sp-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sp-news-card {
  background: var(--bg2); border: 1px solid var(--line-d); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s;
}
.sp-news-card:hover { border-color: var(--line-strong); }
.sp-news-card .n-title { color: #e2e8f0; font-size: 13.5px; font-weight: 600; line-height: 1.45; flex: 1; }
.sp-news-card .n-title a { color: inherit; text-decoration: none; }
.sp-news-card .n-title a:hover { color: #34d399; }
.sp-news-card .n-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-news-card .n-src {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #6ee7b7; background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px; border-radius: 99px;
}
.sp-news-card .n-src.hn { color: #fb923c; background: rgba(251, 146, 60, 0.1); }
.sp-news-card .n-time { font-size: 11px; color: #64748b; }
.sp-news-card .n-pts { font-size: 11px; color: #fb923c; font-weight: 600; }

/* ==========================================================================
   SBOM / assets
   ========================================================================== */

.sp-drop {
  border: 2px dashed var(--line-strong); border-radius: 14px; padding: 26px 20px;
  text-align: center; cursor: pointer; transition: .2s; background: var(--bg2);
  font-size: 13px; color: #94a3b8;
}
.sp-drop:hover, .sp-drop.drag { border-color: #34d399; background: rgba(16, 185, 129, 0.04); }
.sp-drop b { color: #e2e8f0; font-family: var(--font-head); }
.sp-asset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sp-asset-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
  color: #a5f3fc; font-size: 12.5px; padding: 4px 9px 4px 12px; border-radius: 999px;
}
.sp-asset-chip button { background: none; border: none; cursor: pointer; color: #a5f3fc; font-size: 13px; line-height: 1; padding: 0 2px; }
.sp-asset-chip button:hover { color: #fff; }
.sp-asset-match-flag { font-size: 11px; color: #22d3ee; display: inline-flex; align-items: center; gap: 4px; }
.sp-hint { font-size: 12px; color: #475569; margin-top: 12px; line-height: 1.5; }
.sp-hint code { background: #0f1a30; color: #a5f3fc; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* -------- asset source cards (multiple lists) -------- */
.sp-sources { display: flex; flex-direction: column; gap: 10px; }
.sp-source {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--line-d); border-radius: 12px;
  padding: 12px 16px;
}
.sp-source .s-name { font-family: var(--font-head); font-weight: 600; color: #e2e8f0; font-size: 14px; }
.sp-source .s-type {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px;
  background: rgba(16, 185, 129, 0.1); color: #6ee7b7;
}
.sp-source .s-type.api { background: rgba(167, 139, 250, 0.1); color: #c4b5fd; }
.sp-source .s-type.manual { background: rgba(34, 211, 238, 0.1); color: #67e8f9; }
.sp-source .s-meta { font-size: 11.5px; color: #64748b; }
.sp-source .s-status { font-size: 11px; display: inline-flex; align-items: center; gap: 5px; }
.sp-source .s-status.ok { color: var(--green-d); }
.sp-source .s-status.error { color: var(--rose-d); }
.sp-source .s-status.pending { color: var(--amber-d); }
.sp-source .s-assets { margin-left: auto; display: flex; flex-wrap: wrap; gap: 5px; max-width: 46%; }
.sp-source .s-ver { font-size: 10.5px; color: #64748b; }
.sp-source .s-actions { display: flex; gap: 6px; }
.sp-source .s-btn {
  background: none; border: 1px solid var(--line-d); color: #94a3b8;
  font-size: 11.5px; padding: 4px 10px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.sp-source .s-btn:hover { color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.sp-source .s-btn.del:hover { color: var(--rose-d); border-color: rgba(251, 113, 133, 0.4); }

/* tabs for add modes */
.sp-tabs {
  display: inline-flex; gap: 3px; background: var(--bg2); border: 1px solid var(--line-d);
  border-radius: 12px; padding: 4px; margin-top: 14px;
}
.sp-tabs button {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 12.5px;
  color: #64748b; padding: 7px 14px; border-radius: 9px; transition: .16s;
}
.sp-tabs button.active { background: rgba(16, 185, 129, 0.14); color: #34d399; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.4); }
.sp-add-pane { margin-top: 12px; }
.sp-add-pane textarea {
  width: 100%; box-sizing: border-box; background: var(--bg2); border: 1px solid var(--line-d);
  border-radius: 10px; color: #e2e8f0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; padding: 10px 12px; resize: vertical; min-height: 90px; outline: none;
}
.sp-add-pane textarea:focus { border-color: rgba(16, 185, 129, 0.5); }
.sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-grid2 .field { width: 100%; box-sizing: border-box; }
.sp-grid2 label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: #94a3b8; }
.sp-grid2 label.full { grid-column: 1 / -1; }

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


@media (max-width: 720px) {
  .sp-controls { flex-direction: column; align-items: stretch; }
}
