:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #4a9eff;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 0;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 { font-size: 1.2rem; font-weight: 600; }

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

footer {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

.server-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    list-style: none;
    border-radius: 6px;
    transition: background 0.1s;
}

.server-header:hover { background: #ffffff06; }

.server-header::-webkit-details-marker { display: none; }

.server-header::before {
    content: "\25B6";
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    width: 1rem;
}

details[open] > .server-header::before {
    transform: rotate(90deg);
}

details[open] > .server-header {
    border-bottom: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
}

.server-preview {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-left: 1rem;
    margin-top: -0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.preview-target {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

details[open] .server-preview { display: none; }

.server-body {
    padding: 0 1.5rem 1.5rem;
}

.server-header h2 { font-size: 1rem; font-weight: 600; }

.server-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.server-root {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-ssl { background: #22c55e22; color: var(--green); border: 1px solid var(--green); }
.badge-listen { background: #4a9eff22; color: var(--accent); border: 1px solid var(--accent); }
.badge-file { background: #f59e0b22; color: var(--orange); border: 1px solid var(--orange); }
.badge-error { background: #ef444422; color: var(--red); border: 1px solid var(--red); }
.badge-count { background: #ffffff0a; color: var(--text-muted); border: 1px solid var(--border); }

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

th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

td code {
    background: #ffffff0a;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

td a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

td a:hover { text-decoration: underline; }

.directive {
    color: var(--orange);
    font-family: monospace;
    font-size: 0.8rem;
}

.muted { color: var(--text-muted); }

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-logout:hover { border-color: var(--text); color: var(--text); }

.logout-form { display: inline; }

.login-box {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2rem;
}

.btn-login {
    display: inline-block;
    margin-top: 1rem;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.btn-login:hover { opacity: 0.9; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}
