:root {
    --bg: #0f1117;
    --card: #171b24;
    --muted: #8f9bb3;
    --text: #edf2ff;
    --line: #283043;
    --accent: #4f8cff;
    --danger: #ff5d73;
    --warning: #ffb84d;
    --success: #3ddc97;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: linear-gradient(180deg, #0b0d12 0%, #121722 100%);
    color: var(--text);
}
.container {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: rgba(15, 17, 23, .85);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
}
.brand { font-size: 22px; font-weight: 800; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page { padding: 24px 0 40px; }
.card {
    background: rgba(23, 27, 36, .92);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.hero h1, .detail-header h1 { margin: 0 0 8px; font-size: 30px; }
.hero p, .muted { color: var(--muted); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}
.stat-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 18px;
    padding: 18px;
}
.stat-card span { display: block; color: var(--muted); margin-bottom: 6px; }
.stat-card strong { font-size: 30px; }
.stat-card.danger strong { color: var(--danger); }
.stat-card.warning strong { color: var(--warning); }
.stat-card.success strong { color: var(--success); }
.filters-card { margin-bottom: 18px; }
.filters {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 12px;
}
input, select, button {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #0f1420;
    color: var(--text);
    padding: 0 14px;
}
button, .ghost-btn, .link-btn {
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
}
button {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
}
button:hover, .link-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
.ghost-btn {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255,255,255,.03);
}
.table-card h2, .chart-card h2 { margin-top: 0; }
.table-wrap { overflow: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-align: left;
    vertical-align: middle;
}
thead th {
    position: sticky;
    top: 0;
    background: #151b28;
    z-index: 1;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #b8c4dd;
}
.status-pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.status-normal { background: rgba(61,220,151,.15); color: var(--success); }
.status-high { background: rgba(255,93,115,.15); color: var(--danger); }
.status-low { background: rgba(255,184,77,.15); color: var(--warning); }
.status-unknown, .status-no_data { background: rgba(255,255,255,.08); color: #d2d9ea; }
.text-status { font-weight: 800; }
.link-btn {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(79,140,255,.16);
    color: #a9c7ff;
}
.detail-header {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 18px;
}
.detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 520px;
}
.detail-meta div {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 14px;
}
.detail-meta span { display: block; color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.detail-meta strong { font-size: 18px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

@media (max-width: 980px) {
    .stats-grid, .filters, .detail-meta { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; }
    .detail-meta { min-width: 0; width: 100%; }
}
