:root {
    color-scheme: dark;
    --bg: #0b1120;
    --panel: #151e2f;
    --border: #263449;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --green: #4ade80;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, sans-serif;
}
header {
    min-height: 72px;
    padding: 16px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header small {
    display: block;
    color: var(--muted);
}
.brand {
    font-size: 24px;
    letter-spacing: 3px;
    color: var(--accent);
}
.layout {
    display: grid;
    grid-template-columns: 220px minmax(0,1fr);
    min-height: calc(100vh - 72px);
}
aside {
    padding: 24px;
    background: var(--panel);
    border-right: 1px solid var(--border);
}
aside h3 {
    color: var(--muted);
    font-size: 12px;
}
aside a {
    display: block;
    padding: 12px 0;
    color: var(--text);
    text-decoration: none;
}
aside a:hover { color: var(--accent); }
main { padding: 24px; min-width: 0; }
h1 { font-size: 26px; }
h2 { font-size: 19px; margin-top: 32px; }
.metrics {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,minmax(175px,1fr)
    );
    gap: 14px;
}
.metrics section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}
.metrics label {
    display: block;
    color: var(--muted);
    font-size: 13px;
}
.metrics strong {
    display: block;
    font-size: 25px;
    margin-top: 10px;
}
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}
td,th {
    padding: 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
th { color: var(--muted); }
.online { color: var(--green); }
.offline { color: #f87171; }
.muted { color: var(--muted); }
button {
    background: #0369a1;
    color: white;
    padding: 10px 18px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.login-card h1 {
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 0;
}
.login-card p {
    color: var(--muted);
    margin-bottom: 30px;
}
.login-card label {
    display: block;
    margin-bottom: 8px;
}
.login-card input {
    width: 100%;
    padding: 13px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}
.login-card button { width: 100%; }
.error {
    color: #f87171;
    margin-bottom: 20px;
}
@media(max-width:800px) {
    .layout { grid-template-columns: 1fr; }
    aside { display: none; }
    main { padding: 14px; }
}
