:root {
    color-scheme: dark;

    --background: #0b1020;
    --panel: #121a2e;
    --panel-alt: #18233d;
    --border: #2b3859;
    --text: #ecf2ff;
    --muted: #9ba9c7;
    --accent: #5ea2ff;
    --green: #50d890;
    --yellow: #ffc857;
    --orange: #ff944d;
    --red: #ff5d73;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.dashboard-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:8px 0 20px}.dashboard-heading h1{margin:0;font-size:clamp(28px,4vw,46px);font-weight:750}.eyebrow{margin:0 0 6px;color:var(--accent);font-size:12px;font-weight:800;letter-spacing:.16em}.muted,.panel-title p{color:var(--muted)}
.filter-bar{display:flex;align-items:end;flex-wrap:wrap;gap:12px}.filter-bar label,.search-box{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:12px}.filter-bar input,.filter-bar select,.search-box input{min-height:40px;padding:8px 10px;color:var(--text);background:var(--panel-alt);border:1px solid var(--border);border-radius:8px;color-scheme:dark}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:20px}.chart-box{position:relative;height:310px}.panel-title{display:flex;justify-content:space-between}.panel-title h2,.ranking h2{margin-bottom:4px}.panel-title p{margin-top:0;font-size:13px}#attackMap{position:relative;height:430px;overflow:hidden;border:1px solid var(--border);border-radius:9px;background:#08101d;isolation:isolate}.leaflet-container{font-family:inherit}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:var(--text);background:var(--panel-alt)}
.four-lists{grid-template-columns:repeat(4,minmax(0,1fr))}.ranking ol{list-style:none;margin:14px 0 0;padding:0}.ranking li{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--border)}.ranking-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ranking strong{color:var(--accent)}.search-box input{width:min(360px,70vw)}.empty-state{padding:30px;text-align:center;color:var(--muted)}
.metric{position:relative;overflow:hidden}.metric::after{content:"";position:absolute;right:-20px;bottom:-30px;width:90px;height:90px;border-radius:50%;background:var(--accent);opacity:.06}.metric-danger::after{background:var(--red)}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 18px 28px;

    background: #0e1629;
    border-bottom: 1px solid var(--border);
}

.brand {
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
}

.subtitle {
    margin-left: 14px;
    color: var(--muted);
}

.container {
    width: min(1600px, calc(100% - 32px));
    margin: 24px auto 60px;
}

.metrics {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric {
    padding: 18px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.metric span {
    display: block;
    margin-bottom: 10px;

    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    font-size: 28px;
}

.metric .small-value {
    font-size: 16px;
    line-height: 1.4;
}

.panel {
    margin-bottom: 20px;
    padding: 20px;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.panel h1,
.panel h2 {
    margin-top: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.panel-header p {
    color: var(--muted);
}

.page-title {
    margin-bottom: 20px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 15px;

    color: #07101e;
    background: var(--accent);
    border: 0;
    border-radius: 8px;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.button:hover,
button:hover {
    text-decoration: none;
    filter: brightness(1.08);
}

.button.secondary {
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.columns {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 12px;
    vertical-align: top;

    border-bottom: 1px solid var(--border);

    text-align: left;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td small {
    display: block;
    max-width: 260px;
    margin-top: 4px;

    color: var(--muted);
}

.compact td {
    padding: 8px;
}

.mono,
pre {
    font-family:
        "Cascadia Code",
        "Fira Code",
        Consolas,
        monospace;
}

.score {
    display: inline-block;
    min-width: 72px;
    padding: 5px 8px;

    border-radius: 999px;

    text-align: center;
    font-weight: 700;
}

.score-low {
    color: var(--green);
}

.score-suspicious {
    color: var(--yellow);
}

.score-warning {
    color: var(--orange);
}

.score-danger,
.score-critical {
    color: var(--red);
}

.score.score-low {
    background: rgba(80, 216, 144, 0.12);
}

.score.score-suspicious {
    background: rgba(255, 200, 87, 0.12);
}

.score.score-warning {
    background: rgba(255, 148, 77, 0.12);
}

.score.score-danger,
.score.score-critical {
    background: rgba(255, 93, 115, 0.14);
}

.badge {
    display: inline-block;
    padding: 4px 8px;

    color: var(--muted);
    background: var(--panel-alt);
    border-radius: 999px;

    font-size: 12px;
}

.badge.danger {
    color: var(--red);
}

.details {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 9px 14px;
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.sensitive {
    color: #ffbfbd;
}

.command-block {
    margin-bottom: 16px;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 9px;
}

.command-meta {
    padding: 8px 12px;

    color: var(--muted);
    background: var(--panel-alt);

    font-size: 12px;
}

.command,
.response {
    margin: 0;
    padding: 13px;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.command {
    color: #a9d3ff;
    background: #0c1426;
}

.response {
    color: #d6deef;
    background: #0a101d;
    border-top: 1px solid var(--border);
}

.replay-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-bottom: 14px;
}

.replay-controls #replayStatus{color:var(--muted)}.replay-clock{margin-left:auto;padding:7px 10px;color:#a9d3ff;background:#0a101d;border:1px solid var(--border);border-radius:7px;font-family:monospace;font-weight:700}.replay-controls button.secondary{color:var(--text);background:var(--panel-alt);border:1px solid var(--border)}

.replay-controls label {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);
}

select {
    padding: 8px;

    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.timeline-wrap{position:relative;margin:4px 0 16px}#progressRange{position:relative;z-index:2;width:100%;margin:0;accent-color:var(--accent)}.timeline-markers{position:absolute;z-index:1;inset:7px 8px auto;height:5px}.timeline-markers i{position:absolute;width:2px;height:5px;background:rgba(255,255,255,.32)}

.terminal-frame{overflow:hidden;border:1px solid #25372a;border-radius:10px;box-shadow:0 18px 55px rgba(0,0,0,.35)}.terminal-titlebar{display:grid;grid-template-columns:100px 1fr 100px;align-items:center;padding:9px 13px;color:#84938a;background:#111a15;border-bottom:1px solid #25372a;text-align:center;font:12px system-ui}.terminal-dots{display:flex;gap:7px}.terminal-dots i{width:11px;height:11px;border-radius:50%;background:#ff5f57}.terminal-dots i:nth-child(2){background:#febc2e}.terminal-dots i:nth-child(3){background:#28c840}.live-indicator{justify-self:end;padding:3px 7px;color:#a7f3d0;border:1px solid #286341;border-radius:4px;font-size:10px;font-weight:800;letter-spacing:.08em}.live-indicator.active{color:#08120c;background:#50d890;box-shadow:0 0 14px rgba(80,216,144,.55)}

.terminal {
    min-height: 560px;
    max-height: 75vh;
    margin: 0;
    padding: 18px;
    overflow: auto;

    color: #c9f7d8;
    background: #030704;
    border: 0;
    border-radius: 0;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.terminal:focus{outline:1px solid var(--accent);outline-offset:-1px}.terminal::after{content:"";display:inline-block;width:.62em;height:1.1em;margin-left:2px;vertical-align:-.18em;background:#b7f7cb;animation:terminal-blink 1s steps(1) infinite}@keyframes terminal-blink{50%{opacity:0}}.terminal-frame:fullscreen{display:flex;flex-direction:column;width:100vw;height:100vh;background:#030704;border:0;border-radius:0}.terminal-frame:fullscreen .terminal{flex:1;max-height:none;font-size:18px}.replay-help{margin:12px 0 0;color:var(--muted);font-size:12px;text-align:center}

@media (max-width: 700px) {
    .topbar,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .container {
        width: min(100% - 18px, 1600px);
        margin-top: 12px;
    }

    .panel {
        padding: 14px;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .details dd {
        margin-bottom: 8px;
    }
}

@media(max-width:1100px){.four-lists{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.dashboard-grid,.four-lists{grid-template-columns:1fr}.dashboard-heading{align-items:flex-start;flex-direction:column}.filter-bar>*{flex:1 1 150px}.chart-box{height:260px}#attackMap{height:340px}}
