* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0a0e14;
    --panel: #131820;
    --panel-2: #1a2029;
    --border: #232a35;
    --text: #e6edf3;
    --muted: #7d8590;
    --accent: #4f9dff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
}
body {
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: #fff; border: none;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
button:hover, .btn:hover { filter: brightness(1.15); }
button:active { transform: translateY(1px); }
button.danger { background: #c93030; }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.ghost:hover { background: var(--panel-2); }
button:disabled { opacity: .4; cursor: not-allowed; }

/* Шапка */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px;
    background: rgba(19, 24, 32, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand .logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, #4f9dff, #7d5fff);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 14px;
}
.topbar .brand h1 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.topbar .brand .sub { font-size: 11px; color: var(--muted); }

.topbar .meta { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.topbar .meta .status { display: flex; align-items: center; gap: 8px; }
.topbar .meta .status b { color: var(--muted); font-weight: 500; }
.topbar .meta .host { color: var(--muted); font-size: 12px; }

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.on  { background: var(--green); box-shadow: 0 0 10px rgba(63,185,80,.5); }
.dot.off { background: var(--red);   box-shadow: 0 0 10px rgba(248,81,73,.5); }

/* Контейнер */
.container { padding: 28px; max-width: 1400px; margin: 0 auto; }
.section { margin-bottom: 32px; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.section-head h2 {
    font-size: 13px; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: .8px;
}
.section-head .count {
    display: inline-block; margin-left: 8px;
    background: var(--panel-2); border: 1px solid var(--border);
    padding: 1px 8px; border-radius: 6px;
    font-size: 11px; color: var(--text); font-weight: 600;
}

/* Таблица */
table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
th, td { padding: 12px 16px; text-align: left; font-size: 13.5px; }
th {
    background: var(--panel-2);
    font-weight: 600; color: var(--muted);
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

.spd {
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-weight: 600; color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.id-cell {
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    color: var(--muted); font-size: 12.5px;
}
.route-cell {
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-weight: 700; color: #fff;
    background: var(--panel-2); border: 1px solid var(--border);
    padding: 2px 8px; border-radius: 5px; display: inline-block;
    font-size: 12.5px; letter-spacing: 1px;
}
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.badge.ai {
    background: rgba(79,157,255,.12); color: #7dbeff;
    border: 1px solid rgba(79,157,255,.3);
}
.badge.manual {
    background: rgba(210,153,34,.12); color: #f0c674;
    border: 1px solid rgba(210,153,34,.3);
}

/* Логин */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: radial-gradient(circle at 50% 0%, #131a28 0%, #0a0e14 60%);
}
.login-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; padding: 40px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-card .logo-lg {
    width: 56px; height: 56px; margin: 0 auto 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f9dff, #7d5fff);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 20px;
}
.login-card h1 { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-card input {
    width: 100%; padding: 11px 14px; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font-size: 14px;
    font-family: inherit; transition: border-color .15s;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button { width: 100%; padding: 12px; font-size: 14px; margin-top: 6px; }
.login-card .divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: 12px; margin: 22px 0;
}
.login-card .divider::before, .login-card .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-steam {
    background: linear-gradient(180deg, #1b2838 0%, #171a21 100%);
    color: #fff; border: 1px solid #2a475e;
    font-weight: 600;
}
.btn-steam:hover { background: linear-gradient(180deg, #2a475e 0%, #1b2838 100%); }
.error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; margin-bottom: 8px; }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px; border-radius: 20px;
    background: var(--panel-2); border: 1px solid var(--border);
    font-size: 12.5px;
}
.user-chip img { width: 22px; height: 22px; border-radius: 50%; }
