:root {
    --bg: #090f1d;
    --panel: rgba(21, 31, 54, 0.78);
    --panel-strong: #111a2f;
    --stroke: #2a3961;
    --text: #e5edf9;
    --muted: #9fb2d3;
    --accent: #4f8cff;
    --danger: #ef4444;
    --radius: 18px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #132041 0%, var(--bg) 40%);
}

.glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.app-shell {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 18px;
    padding: 18px;
    min-height: 100vh;
}

.sidebar {
    padding: 16px;
    overflow: auto;
    max-height: calc(100vh - 36px);
}

.brand h1 {
    margin: 0;
    font-size: 20px;
}

.brand p {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.user-box {
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    margin-bottom: 14px;
}

.user-box small {
    color: var(--muted);
    display: block;
    margin: 4px 0 8px;
}

.user-box a {
    color: #c7dcff;
    text-decoration: none;
}

.zip-menu {
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    margin-bottom: 14px;
}

.zip-menu h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.log-tree details { margin-bottom: 6px; }
.log-tree summary { cursor: pointer; color: #dbe7ff; }
.log-tree ul { margin: 6px 0 6px 18px; padding: 0; list-style: none; }
.log-tree a {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #b9d0ff;
}
.log-tree a:hover, .log-tree a.active {
    background: rgba(79, 140, 255, 0.2);
    color: #fff;
}

.main-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sticky-header {
    position: sticky;
    top: 10px;
    z-index: 40;
    padding: 12px;
}

.sticky-header.is-scrolled {
    border-color: #4f8cff;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted);
}

input, select, button {
    width: 100%;
    background: var(--panel-strong);
    border: 1px solid var(--stroke);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 10px;
}

button {
    background: linear-gradient(180deg, #4f8cff, #2f69db);
    border: 0;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text);
    background: var(--panel-strong);
}

.type-filters {
    grid-column: 1 / span 3;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.type-filters label {
    font-size: 12px;
    color: #c7d7f6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.type-filters input { width: auto; }

.header-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.stat {
    padding: 10px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: rgba(17, 26, 47, 0.75);
    font-size: 13px;
}

.viewer {
    padding: 0;
    overflow: hidden;
}

.viewer-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--stroke);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

.notepad {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    max-height: calc(100vh - 330px);
    overflow: auto;
}

.log-line {
    display: grid;
    grid-template-columns: 76px 140px 1fr;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px dashed #2c3d66;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.04);
}

.line-no {
    color: #8ea6ce;
}

.line-type {
    font-weight: 700;
}

.line-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.event-join .line-type { color: #22c55e; }
.event-leave .line-type { color: #94a3b8; }
.event-kill .line-type { color: #ef4444; }
.event-illegal-kill .line-type { color: #a855f7; }
.event-command .line-type { color: #f59e0b; }
.event-chat .line-type { color: #38bdf8; }
.event-world-kill .line-type { color: #991b1b; }
.event-other .line-type { color: #d1d5db; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--stroke);
}

.pager a { color: #c0d8ff; text-decoration: none; }

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #7f1d1d;
    background: #3f0d0d;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.login-card {
    width: min(440px, 100%);
    padding: 20px;
}

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

.login-card .btn {
    display: inline-flex;
    text-decoration: none;
    background: linear-gradient(180deg, #4f8cff, #2f69db);
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
}

@media (max-width: 1200px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { max-height: none; }
    .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .type-filters { grid-column: 1 / -1; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
