:root {
    --bg: #0b0e14;
    --bg-alt: #11141c;
    --bg-card: #161a25;
    --bg-hover: #1c2130;
    --bg-input: #0e1119;
    --border: #232838;
    --border-light: #2e3446;
    --text: #e4e7f0;
    --text-dim: #8a92ab;
    --text-muted: #5b6379;
    --accent: #4f7cff;
    --accent-hover: #6b91ff;
    --accent-soft: rgba(79, 124, 255, .12);
    --green: #34d399;
    --green-soft: rgba(52, 211, 153, .12);
    --yellow: #fbbf24;
    --yellow-soft: rgba(251, 191, 36, .12);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, .12);
    --purple: #a78bfa;
    --sidebar-w: 248px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 8px 30px rgba(0, 0, 0, .45);
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #eef1f8;
    --bg-input: #f7f9fc;
    --border: #dfe4ee;
    --border-light: #cbd3e1;
    --text: #161a25;
    --text-dim: #5b6379;
    --text-muted: #8a92ab;
    --accent-soft: rgba(79, 124, 255, .1);
    --shadow: 0 6px 22px rgba(20, 30, 60, .1);
}

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

html, body { height: 100%; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Загрузка ─────────────────────────────────────────────── */
.boot {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--text-dim);
}
.boot-logo {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .4; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }

/* ── Каркас ───────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform .2s ease;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px; color: #fff;
    flex-shrink: 0;
}
.brand-text b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; }
.brand-text span { font-size: 11px; color: var(--text-muted); }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group { margin-bottom: 18px; }
.nav-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .09em; color: var(--text-muted);
    padding: 0 10px 7px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8.5px 10px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 500; font-size: 13.5px;
    cursor: pointer; border: none; background: none; width: 100%;
    text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; }

.sidebar-foot { padding: 12px 10px; border-top: 1px solid var(--border); }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: var(--radius-sm);
    cursor: pointer; width: 100%; border: none; background: none; text-align: left;
}
.user-chip:hover { background: var(--bg-hover); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: grid; place-items: center;
    font-weight: 700; font-size: 12.5px; color: #fff; flex-shrink: 0;
}
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--text-muted); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 58px; flex-shrink: 0;
    display: flex; align-items: center; gap: 14px;
    padding: 0 22px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.topbar .spacer { flex: 1; }
.icon-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: grid; place-items: center; cursor: pointer;
    background: none; border: 1px solid transparent; color: var(--text-dim);
    position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-toggle { display: none; }

.page { padding: 24px; flex: 1; }
.page-narrow { max-width: 980px; margin: 0 auto; }

/* ── Элементы ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text);
    font-size: 13.5px; font-weight: 550;
    cursor: pointer;
    transition: all .13s;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.btn-success { background: var(--green-soft); border-color: transparent; color: var(--green); }
.btn-success:hover:not(:disabled) { background: var(--green); color: #062; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 18px; font-size: 14.5px; }

.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .13s, box-shadow .13s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 13px; }
.select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input:disabled, .select:disabled { opacity: .6; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field label {
    display: block; margin-bottom: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--text-dim);
}
.field .hint { margin-top: 5px; font-size: 12px; color: var(--text-muted); }
.field .error { margin-top: 5px; font-size: 12px; color: var(--red); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.checkbox span { font-size: 13.5px; }

.switch { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
    position: absolute; inset: 0;
    background: var(--border-light); border-radius: 21px;
    cursor: pointer; transition: background .16s;
}
.switch span::before {
    content: ''; position: absolute;
    width: 15px; height: 15px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .16s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(17px); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}
.card-head h2 { font-size: 14.5px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: 11px 16px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.bold { font-weight: 650; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-lg { margin-top: 28px; }
.hide { display: none !important; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2.5px 8px; border-radius: 20px;
    font-size: 11.5px; font-weight: 650;
    background: var(--bg-hover); color: var(--text-dim);
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-purple { background: rgba(167, 139, 250, .12); color: var(--purple); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green .dot { animation: live 1.6s ease-in-out infinite; }
@keyframes live { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.stat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 650; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; line-height: 1.15; }
.stat .sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.progress { height: 6px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.progress.green span { background: var(--green); }
.progress.red span { background: var(--red); }

.empty { padding: 44px 20px; text-align: center; color: var(--text-muted); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 12px; }
.empty p { font-size: 13.5px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 9px 14px; border: none; background: none; cursor: pointer;
    color: var(--text-dim); font-size: 13.5px; font-weight: 550;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .badge { margin-left: 5px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.toolbar .search .input { padding-left: 33px; }
.toolbar .spacer { flex: 1; }

.pagination { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px; }
.pagination button {
    min-width: 32px; height: 32px; padding: 0 9px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-card); cursor: pointer; font-size: 13px;
}
.pagination button:hover:not(:disabled) { background: var(--bg-hover); }
.pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .info { font-size: 12.5px; color: var(--text-muted); margin-left: 8px; }

/* ── Карточка сервера ─────────────────────────────────────── */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.server-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    cursor: pointer; transition: border-color .14s, transform .14s;
    display: block;
}
.server-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.server-card .sc-top { display: flex; align-items: flex-start; gap: 11px; }
.server-card .sc-icon {
    width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
    background: var(--bg-hover); display: grid; place-items: center; color: var(--text-dim);
}
.server-card:hover .sc-icon { background: var(--accent-soft); color: var(--accent); }
.server-card .sc-icon svg { width: 19px; height: 19px; }
.server-card h3 { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .sc-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.server-card .sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.server-card .sc-stat { background: var(--bg-input); border-radius: 6px; padding: 7px 9px; }
.server-card .sc-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 650; }
.server-card .sc-stat .v { font-size: 12.5px; font-weight: 600; margin-top: 1px; }
.server-card .sc-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── Консоль ──────────────────────────────────────────────── */
.console-wrap {
    background: #05070c; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
}
.console-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.console-out {
    font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
    padding: 12px 14px; height: 460px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word; color: #c8d0e0;
}
.console-out .l { display: block; }
.console-out .t { color: #6b7a99; margin-right: 8px; }
.console-out .err { color: var(--red); }
.console-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-alt); }
.console-in .input { font-family: var(--mono); font-size: 12.5px; }

.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.file-row:hover { background: var(--bg-hover); }
.file-row .fi { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }
.file-row .fi.dir { color: var(--accent); }
.file-row .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-row .fs { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--text-muted); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { word-break: break-word; }

.activity-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-item .ai-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--bg-hover); display: grid; place-items: center; flex-shrink: 0; }
.activity-item .ai-icon svg { width: 14px; height: 14px; color: var(--text-dim); }
.activity-item .ai-body { flex: 1; min-width: 0; }
.activity-item .ai-time { font-size: 11.5px; color: var(--text-muted); }

/* ── Модалка ──────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(4, 6, 12, .68);
    backdrop-filter: blur(3px);
    display: grid; place-items: center; padding: 20px;
    animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow);
    width: 100%; max-width: 520px; max-height: 88vh;
    display: flex; flex-direction: column;
    animation: pop .16s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { max-width: 780px; }
.modal.xwide { max-width: 1000px; }
@keyframes pop { from { transform: scale(.95) translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15.5px; font-weight: 650; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-alt); }

.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert-warn { background: var(--yellow-soft); color: var(--yellow); }

/* ── Тосты ────────────────────────────────────────────────── */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    padding: 12px 16px; min-width: 260px; max-width: 380px;
    font-size: 13.5px; animation: slide .2s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--yellow); }
.toast b { display: block; margin-bottom: 1px; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ── Авторизация ──────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
    width: 100%; max-width: 396px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 30px;
    box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 40px; height: 40px; font-size: 17px; border-radius: 11px; }
.auth-brand b { font-size: 17px; font-weight: 700; letter-spacing: -.3px; display: block; }
.auth-brand span { font-size: 12px; color: var(--text-muted); }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.auth-foot button { background: none; border: none; color: var(--accent); cursor: pointer; font-weight: 550; }

.chk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.chk-item { display: flex; align-items: center; gap: 8px; padding: 6px 9px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.chk-item:hover { border-color: var(--border-light); }
.chk-item input { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.chk-item.checked { background: var(--accent-soft); border-color: var(--accent); }
.chk-group-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 7px; }

/* ── Адаптив ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main { margin-left: 0; }
    .menu-toggle { display: grid; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .page { padding: 16px; }
    .chk-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 14px; }
}
@media (max-width: 520px) {
    .server-grid { grid-template-columns: 1fr; }
    .modal-foot { flex-direction: column-reverse; }
    .modal-foot .btn { width: 100%; }
    .console-out { height: 340px; }
}
