* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font: 14px/1.5 -apple-system, "Segoe UI", Arial, sans-serif;
    background: #0f1115; color: #d7dae0;
    padding: 18px; max-width: 1280px; margin: 0 auto;
}
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
h1 { font-size: 22px; color: #4fc3f7; }
h2 { font-size: 14px; color: #9aa3b2; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.header-right { display: flex; gap: 12px; align-items: center; }
.muted { color: #6b7280; font-size: 12px; }

.btn {
    background: #1d2330; color: #d7dae0; border: 1px solid #2c3444;
    padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
    text-decoration: none;
}
.btn:hover:not(:disabled) { background: #262e3f; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-ghost { background: transparent; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: #161a22; border: 1px solid #232a38; border-radius: 8px; padding: 14px 16px; }
.card-num { font-size: 26px; font-weight: 700; color: #e8eaf0; }
.card-crit .card-num { color: #ff6b6b; }
.card-label { font-size: 12px; color: #6b7280; margin-top: 2px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.panel { background: #161a22; border: 1px solid #232a38; border-radius: 8px; padding: 14px 16px; overflow-x: auto; }

.bar-row { display: grid; grid-template-columns: 160px 1fr 60px; gap: 8px; align-items: center; margin-bottom: 6px; }
.bar-label { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { background: #0f1115; border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, #f59e0b, #ef4444); height: 100%; }
.bar-num { font-size: 12px; text-align: right; color: #9aa3b2; }

.alerts { max-height: 220px; overflow-y: auto; }
.alert-row { padding: 7px 0; border-bottom: 1px solid #232a38; font-size: 13px; }
.alert-row:last-child { border-bottom: 0; }
.alert-detail { color: #9aa3b2; font-size: 12px; margin-top: 2px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input {
    background: #161a22; color: #d7dae0; border: 1px solid #2c3444;
    border-radius: 6px; padding: 7px 10px; font-size: 13px;
}
.filters input[type=search] { flex: 1; min-width: 220px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #6b7280; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid #2c3444; }
td { padding: 7px 10px; border-bottom: 1px solid #1c222e; vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #1a2029; }
.td-time { white-space: nowrap; color: #9aa3b2; font-size: 12px; }
.td-msg { word-break: break-word; max-width: 560px; }
.td-count, .th-count { text-align: center; }
.count { background: #2c3444; border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.loading { text-align: center; color: #6b7280; padding: 24px; }

.badge { border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.b-info { background: #1e293b; color: #94a3b8; }
.b-warn { background: #3b2f14; color: #fbbf24; }
.b-err  { background: #3b1a1a; color: #f87171; }
.b-crit { background: #7f1d1d; color: #fff; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px 0 2px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #161a22; border: 1px solid #2c3444; border-radius: 10px; padding: 20px; max-width: 760px; width: 92%; max-height: 80vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: #6b7280; font-size: 16px; cursor: pointer; }
.modal-box pre { background: #0f1115; border-radius: 6px; padding: 12px; margin-top: 10px; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: #cbd5e1; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-box { background: #161a22; border: 1px solid #232a38; border-radius: 10px; padding: 32px; width: 320px; text-align: center; }
.login-box h1 { margin-bottom: 4px; }
.login-box .muted { margin-bottom: 18px; }
.login-box input { width: 100%; margin-bottom: 12px; background: #0f1115; color: #d7dae0; border: 1px solid #2c3444; border-radius: 6px; padding: 10px; }
.login-box button { width: 100%; background: #2563eb; color: #fff; border: none; border-radius: 6px; padding: 10px; cursor: pointer; font-size: 14px; }
.login-error { color: #f87171; margin-bottom: 12px; font-size: 13px; }
