:root {
    --bg: #07111f;
    --bg-soft: #0e1b31;
    --surface: rgba(12, 22, 40, 0.84);
    --surface-strong: #12213a;
    --border: rgba(148, 163, 184, 0.18);
    --text: #edf5ff;
    --muted: #90a4c3;
    --accent: #f97316;
    --accent-soft: #fdba74;
    --success: #34d399;
    --danger: #fb7185;
    --shadow: 0 20px 55px rgba(3, 10, 22, 0.45);
    --radius: 18px;
    --radius-sm: 12px;
    --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.10), transparent 24%),
        linear-gradient(180deg, #07101d 0%, #091526 50%, #07111f 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(144, 164, 195, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(144, 164, 195, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
}

code {
    font-family: var(--font-mono);
}

.shell {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem 0 2rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-soft);
    font-size: 0.78rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.25rem, 4vw, 4.25rem);
    line-height: 0.95;
}

.subtitle {
    max-width: 52rem;
    margin: 1rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.live-panel {
    min-width: 18rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(7, 14, 27, 0.7);
    box-shadow: var(--shadow);
    display: grid;
    gap: 0.5rem;
}

.live-panel small {
    color: var(--muted);
}

.live-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 rgba(251, 113, 133, 0.5);
    animation: pulse 2s infinite;
    margin-right: 0.65rem;
}

.live-dot.is-live {
    background: var(--success);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(251, 113, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}

.panel,
.metric-card {
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.25rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.panel-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.filters {
    margin-bottom: 1.25rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.filter-grid label {
    display: grid;
    gap: 0.45rem;
}

.filter-grid span {
    color: var(--muted);
    font-size: 0.9rem;
}

.search-label {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

input,
select,
button {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(6, 12, 24, 0.78);
    color: var(--text);
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 0.9rem;
}

button {
    cursor: pointer;
}

.primary-button,
.secondary-button {
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
}

.primary-button {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #1b1008;
    border: none;
    font-weight: 700;
}

.secondary-button,
.sort-button {
    background: rgba(6, 12, 24, 0.78);
    color: var(--text);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    padding: 1.1rem 1.2rem;
}

.metric-card p {
    margin: 0 0 0.65rem;
    color: var(--muted);
}

.metric-card strong {
    display: block;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1;
}

.compact-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.compact-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.96rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-surface {
    min-height: 260px;
}

.empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.timeline-svg {
    width: 100%;
    height: 260px;
}

.timeline-grid {
    stroke: rgba(148, 163, 184, 0.18);
    stroke-width: 1;
}

.timeline-line {
    fill: none;
    stroke: #fb923c;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.timeline-fill {
    fill: rgba(249, 115, 22, 0.12);
}

.timeline-label {
    fill: var(--muted);
    font-size: 11px;
}

.bar-chart {
    display: grid;
    gap: 0.75rem;
}

.bar-row {
    display: grid;
    gap: 0.35rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
}

.bar-track {
    height: 0.8rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fb923c, #facc15);
}

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

.watch-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(6, 12, 24, 0.62);
}

.watch-card p,
.watch-card small {
    margin: 0;
}

.watch-card p {
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.watch-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.watch-card small {
    color: var(--muted);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

th,
td {
    text-align: left;
    padding: 0.8rem 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.92rem;
}

td {
    font-size: 0.94rem;
}

.sort-button {
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
}

.log-line {
    font-family: var(--font-mono);
    color: #d7e6fb;
    white-space: pre-wrap;
    word-break: break-word;
}

.event-type-badge,
.ip-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.event-type-badge {
    background: rgba(249, 115, 22, 0.14);
    color: #ffd7b2;
}

.event-type-badge.success {
    background: rgba(52, 211, 153, 0.14);
    color: #c8ffe8;
}

.ip-flag {
    margin-left: 0.45rem;
    background: rgba(251, 113, 133, 0.14);
    color: #ffd5de;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

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

    .filter-grid,
    .metrics-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .search-label {
        grid-column: auto;
    }

    .filter-actions {
        align-items: stretch;
    }

    .live-panel {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 1rem, 1200px);
        padding-top: 1rem;
    }

    .panel,
    .metric-card {
        padding: 1rem;
    }

    .hero h1 {
        line-height: 1;
    }
}

