/*
 * Threat Intelligence — Kommandozentrale
 * Scoped entirely to .sf-intel-command so it never leaks into the rest of
 * wp-admin. No external fonts, no CDN, no remote assets — pure local CSS.
 */
.sf-intel-command {
    --surface: #fcfcfb;
    --page: #f9f9f7;
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --muted: #898781;
    --grid: #e1e0d9;
    --border: rgba(11, 11, 11, 0.10);
    --c-blue: #2a78d6;
    --c-orange: #eb6834;
    --c-aqua: #1baf7a;
    --c-yellow: #eda100;
    --c-magenta: #e87ba4;
    --c-green: #008300;
    --c-violet: #4a3aa7;
    --c-red: #e34948;
    --st-good: #0ca30c;
    --st-warn: #fab219;
    --st-serious: #ec835a;
    --st-critical: #d03b3b;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--page);
    color: var(--ink);
    padding: 4px 2px 24px;
}

.sf-intel-command * {
    box-sizing: border-box;
}

.sf-ic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    margin: 0 0 18px;
}

.sf-ic-card h2,
.sf-ic-card h3 {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--ink);
}

.sf-ic-card h2 { font-size: 15px; }
.sf-ic-card h3 { font-size: 13px; }

.sf-ic-card .sf-ic-sub {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Header ---------- */
.sf-ic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 22px;
}

.sf-ic-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}

.sf-ic-header .sf-ic-sub {
    margin: 3px 0 0;
}

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

.sf-ic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--page);
    color: var(--ink-2);
    white-space: nowrap;
}

.sf-ic-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex: none;
}

.sf-ic-chip.on .dot { background: var(--st-good); }
.sf-ic-chip.off .dot { background: var(--st-critical); }

.sf-ic-updated {
    font-size: 11px;
    color: var(--muted);
}

/* ---------- KPI tiles ---------- */
.sf-ic-kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin: 0 0 18px;
}

@media (max-width: 1200px) {
    .sf-ic-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .sf-ic-kpis { grid-template-columns: repeat(2, 1fr); }
}

.sf-ic-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}

.sf-ic-kpi .sf-ic-kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 8px;
}

.sf-ic-kpi .sf-ic-kpi-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}

.sf-ic-kpi .sf-ic-kpi-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
}

.sf-ic-kpi-badge.good { background: var(--st-good); }
.sf-ic-kpi-badge.warn { background: var(--st-warn); color: #3a2a00; }
.sf-ic-kpi-badge.serious { background: var(--st-serious); }
.sf-ic-kpi-badge.critical { background: var(--st-critical); }

/* ---------- Two-column row ---------- */
.sf-ic-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin: 0 0 18px;
}

@media (max-width: 960px) {
    .sf-ic-row { grid-template-columns: 1fr; }
}

.sf-ic-row .sf-ic-card { margin: 0; }

.sf-ic-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-ic-status-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--grid);
    font-size: 13px;
}

.sf-ic-status-list li:last-child { border-bottom: none; }
.sf-ic-status-list .k { color: var(--ink-2); }
.sf-ic-status-list .v { font-weight: 600; color: var(--ink); text-align: right; }

/* ---------- Timeline SVG ---------- */
.sf-ic-timeline-svg {
    width: 100%;
    height: 180px;
    display: block;
}

.sf-ic-timeline-svg .grid-line {
    stroke: var(--grid);
    stroke-width: 1;
}

.sf-ic-timeline-svg .area {
    fill: var(--c-blue);
    fill-opacity: 0.12;
}

.sf-ic-timeline-svg .line {
    fill: none;
    stroke: var(--c-blue);
    stroke-width: 2;
}

.sf-ic-timeline-svg text {
    font-size: 9px;
    fill: var(--muted);
    font-family: inherit;
}

/* ---------- Bars (attack types / countries / IPs / usernames) ---------- */
.sf-ic-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-ic-bar-row {
    display: grid;
    grid-template-columns: 130px 1fr 46px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.sf-ic-bar-row .lbl {
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-ic-bar-track {
    background: var(--grid);
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
}

.sf-ic-bar-fill {
    height: 100%;
    border-radius: 5px;
}

.sf-ic-bar-row .n {
    text-align: right;
    font-weight: 700;
    color: var(--ink);
}

.sf-ic-cols {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
}

@media (max-width: 960px) {
    .sf-ic-cols { grid-template-columns: 1fr; }
}

.sf-ic-cols .sf-ic-card { margin: 0; }

/* ---------- Threat map / chord ---------- */
.sf-ic-map-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.sf-ic-map-toggle a {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-2);
    background: var(--surface);
}

.sf-ic-map-toggle a.active {
    background: var(--c-blue);
    color: #fff;
}

.sf-chord-svg {
    width: 100%;
    height: auto;
    display: block;
}

.sf-chord-svg .sf-chord-label {
    font-size: 11px;
    fill: var(--ink-2);
    font-family: inherit;
}

.sf-ic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 14px;
}

.sf-ic-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: 10px;
    color: var(--muted);
    border-bottom: 2px solid var(--grid);
    padding: 6px 10px;
}

.sf-ic-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--grid);
    color: var(--ink);
}

.sf-ic-table tr:last-child td { border-bottom: none; }

.sf-ic-cve-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--st-critical);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

/* ---------- Explanation cards ---------- */
.sf-ic-explain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 960px) {
    .sf-ic-explain-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .sf-ic-explain-grid { grid-template-columns: 1fr; }
}

.sf-ic-explain {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--page);
}

.sf-ic-explain h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.sf-ic-explain p {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--ink-2);
    line-height: 1.45;
}

.sf-ic-explain .protect {
    font-size: 12px;
    color: var(--st-good);
    font-weight: 600;
}

.sf-ic-empty {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    padding: 6px 0;
}

/* ---------- Early-warning banner ---------- */
.sf-ic-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--st-warn);
    background: var(--surface);
    padding: 14px 18px;
    margin: 0 0 18px;
}

.sf-ic-alert .sf-ic-alert-body {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink);
}

.sf-ic-alert .sf-ic-alert-body strong {
    font-weight: 700;
}

.sf-ic-alert .sf-ic-alert-more {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--ink-2);
}

.sf-ic-alert.elevated { border-left-color: var(--st-warn); background: #fffaf0; }
.sf-ic-alert.high { border-left-color: var(--st-serious); background: #fef3ee; }
.sf-ic-alert.critical { border-left-color: var(--st-critical); background: #fdeeee; }

/* ---------- Frühwarnungen (Netz) panel ---------- */
.sf-ic-alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-ic-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--grid);
    font-size: 13px;
}

.sf-ic-alert-row:last-child { border-bottom: none; }

.sf-ic-alert-chip {
    flex: none;
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
}

.sf-ic-alert-chip.elevated { background: var(--st-warn); color: #3a2a00; }
.sf-ic-alert-chip.high { background: var(--st-serious); }
.sf-ic-alert-chip.critical { background: var(--st-critical); }

.sf-ic-alert-row .subject {
    flex: 1;
    color: var(--ink);
    font-weight: 600;
}

.sf-ic-alert-row .meta {
    flex: none;
    font-size: 11px;
    color: var(--muted);
}

/* ---------- Immunisierungen panel ---------- */
.sf-ic-alert.good { border-left-color: var(--st-good); background: #f2faf2; }

.sf-ic-immun-banner .sf-ic-alert-body { color: #0a5c0a; }

.sf-ic-immun-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
}

.sf-ic-immun-badge.neutral { background: var(--muted); }
.sf-ic-immun-badge.warn { background: var(--st-warn); color: #3a2a00; }
.sf-ic-immun-badge.good { background: var(--st-good); }

.sf-ic-immun-mono {
    display: inline-block;
    font-family: Menlo, Consolas, "SFMono-Regular", monospace;
    font-size: 11px;
    color: var(--ink-2);
    background: var(--page);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 7px;
    word-break: break-word;
}

.sf-ic-immun-counts {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
