/* MiniHost — стили панели */
:root {
  --bg: #f6f6f7;
  --bg-elev: #ffffff;
  --bg-sunken: #f1f1f3;
  --bg-input: #ffffff;
  --bg-hover: #efeff1;
  --bg-hover-soft: #f8f8f9;
  --border: #e6e6e9;
  --border-strong: #d6d6db;
  --text: #18181b;
  --text-muted: #6b6b76;
  --text-faint: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-text: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.09);
  --accent-soft-strong: rgba(99, 102, 241, 0.14);
  --accent-ring: rgba(99, 102, 241, 0.22);
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --gray: #a1a1aa;
  --green-text: #15803d;
  --yellow-text: #b45309;
  --red-text: #dc2626;
  --green-soft: rgba(34, 197, 94, 0.1);
  --yellow-soft: rgba(245, 158, 11, 0.12);
  --red-soft: rgba(239, 68, 68, 0.08);
  --code-bg: #111114;
  --code-text: #e4e4e7;
  --shadow-xs: 0 1px 2px rgba(16, 16, 24, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 16, 24, 0.14), 0 2px 6px rgba(16, 16, 24, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-elev: #141417;
    --bg-sunken: #0f0f12;
    --bg-input: #101013;
    --bg-hover: #1e1e23;
    --bg-hover-soft: #18181c;
    --border: #26262c;
    --border-strong: #34343c;
    --text: #ececef;
    --text-muted: #9a9aa6;
    --text-faint: #62626c;
    --accent-text: #a5b4fc;
    --accent-soft: rgba(99, 102, 241, 0.14);
    --accent-soft-strong: rgba(99, 102, 241, 0.22);
    --accent-ring: rgba(99, 102, 241, 0.35);
    --green-text: #4ade80;
    --yellow-text: #fbbf24;
    --red-text: #f87171;
    --green-soft: rgba(34, 197, 94, 0.12);
    --yellow-soft: rgba(245, 158, 11, 0.12);
    --red-soft: rgba(239, 68, 68, 0.12);
    --code-bg: #0a0a0c;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 10px; }
b, strong { font-weight: 600; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 5px;
  word-break: break-all;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft-strong); }

.icon { flex: none; vertical-align: middle; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-between p { margin: 2px 0 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2:empty { display: none; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Каркас ---------- */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px;
  font-weight: 650; font-size: 15px; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.brand-logo {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #818cf8, #6366f1 55%, #4f46e5);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar-foot {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px 4px 0;
  border-top: 1px solid var(--border);
}
.sidebar-ip { display: flex; flex-direction: column; padding: 0 6px; line-height: 1.35; }
.main { min-width: 0; padding: 28px 32px 72px; }
.view { max-width: 1180px; margin: 0 auto; }

@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    height: auto;
    flex-direction: row; align-items: center; gap: 6px;
    padding: 8px 12px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0 6px 0 0; }
  .nav { flex-direction: row; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; flex-direction: row; }
  .sidebar-ip { display: none; }
  .main { padding: 20px 16px 56px; }
}
@media (max-width: 600px) {
  .brand span, .nav a span, .sidebar-foot .btn span { display: none; }
  .nav a { padding: 8px 11px; }
}

/* ---------- Заголовки страниц ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; }
.page-sub { margin: 4px 0 0; color: var(--text-muted); }

/* ---------- Карточки ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  min-height: 50px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.card-title .icon { color: var(--text-muted); }
.card-body { padding: 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.danger-zone { border-color: rgba(239, 68, 68, 0.35); }
.danger-zone .card-header { border-bottom-color: rgba(239, 68, 68, 0.22); }
.danger-zone .card-title .icon { color: var(--red); }

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; gap: 5px; }
.btn-block { width: 100%; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn-primary.is-busy::after, .btn-danger.is-busy::after { border-color: #fff; border-right-color: transparent; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px;
  padding: 0;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red-text); }
.icon-btn.sm { width: 22px; height: 22px; border-radius: 6px; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--text); }
.label .muted { font-weight: 400; }
.hint { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.hint .icon { margin: -2px 2px 0 0; }
.input, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input.mono, .textarea.mono { font-size: 13px; }
.textarea { height: auto; min-height: 64px; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.row-form { display: flex; gap: 8px; }
.row-form .input { flex: 1; min-width: 0; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.type-card {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.type-card:hover { border-color: var(--text-faint); }
.type-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.type-card.checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.type-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-card .t { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.type-card.checked .t { color: var(--accent-text); }
.type-card .d { font-size: 12px; line-height: 1.35; color: var(--text-muted); }
.type-fields { margin-top: 4px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; flex: none;
  width: 34px; height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.15s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.6; }

/* ---------- Бейджи, точки, статусы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px; font-weight: 550;
  white-space: nowrap;
}
.badge.mono { font-size: 11.5px; }
.badge-static { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.badge-php { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.badge-app { background: rgba(34, 197, 94, 0.13); color: #15803d; }
.badge-proxy { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-redirect { background: rgba(236, 72, 153, 0.12); color: #db2777; }
.badge-muted { background: var(--bg-sunken); color: var(--text-muted); border-color: var(--border); }
@media (prefers-color-scheme: dark) {
  .badge-static { color: #60a5fa; }
  .badge-php { color: #a78bfa; }
  .badge-app { color: #4ade80; }
  .badge-proxy { color: #fbbf24; }
  .badge-redirect { color: #f472b6; }
}
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.dot-gray { background: var(--gray); }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.status-line { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; white-space: nowrap; }
.st-ok { color: var(--green-text); }
.st-bad { color: var(--red-text); }
.st-warn { color: var(--yellow-text); }
.st-wait { color: var(--text-muted); }
.ok-text { color: var(--green-text); }
.bad-text { color: var(--red-text); }
.problems { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--red-text); }
.problems.warn { color: var(--yellow-text); }
.chip {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text-muted);
}

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: 12px; font-weight: 550; text-align: left;
  color: var(--text-muted);
  white-space: nowrap;
}
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover-soft); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card > .table-wrap .table th:first-child, .card > .table-wrap .table td:first-child { padding-left: 16px; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: 12px; }
.card > .table-wrap:first-child .table th:last-child { border-top-right-radius: 12px; }
.card-body > .table-wrap { border: 1px solid var(--border); border-radius: 10px; }
.card-body > .table-wrap .table th:first-child { border-top-left-radius: 9px; }
.card-body > .table-wrap .table th:last-child { border-top-right-radius: 9px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Список сайтов ---------- */
.site-list {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.site-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.site-row:last-child { border-bottom: 0; }
.site-row:hover { background: var(--bg-hover-soft); }
.site-row:focus-visible { outline-offset: -2px; }
.site-ico {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-sunken);
  color: var(--text-muted);
}
.site-main { flex: 1; min-width: 0; }
.site-domain { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-sub { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .site-row { flex-wrap: wrap; }
  .site-meta { width: 100%; justify-content: flex-start; padding-left: 50px; }
}

/* ---------- Страница сайта ---------- */
.back {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 10px;
  color: var(--text-muted); text-decoration: none; font-size: 13px;
}
.back:hover { color: var(--text); }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-head-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.site-title { overflow-wrap: anywhere; }
.site-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-aliases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tabs {
  display: flex; gap: 2px;
  margin: 18px 0 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.copy-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.copy-line .mono { overflow-wrap: anywhere; }
.tls-list { display: flex; flex-direction: column; gap: 12px; }
.tls-item { display: flex; align-items: flex-start; gap: 10px; }
.tls-item .st { margin-top: 2px; }

/* ---------- Файловый менеджер ---------- */
.fm { position: relative; }
.fm-head { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13.5px; min-width: 0; }
.crumbs a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted); text-decoration: none;
  overflow-wrap: anywhere;
}
.crumbs a:hover { background: var(--bg-hover); color: var(--text); }
.crumbs .cur { padding: 2px 6px; font-weight: 600; overflow-wrap: anywhere; }
.crumbs .sep { color: var(--text-faint); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fm-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.bulk { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.fm-table .w-check { width: 36px; padding-right: 0; }
.fm-table .w-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.fm-name {
  display: inline-flex; align-items: center; gap: 9px;
  max-width: 100%;
  padding: 0;
  border: 0; background: none;
  color: var(--text); font: inherit; text-align: left;
  cursor: pointer;
}
.fm-name span { overflow-wrap: anywhere; }
.fm-name:hover span { text-decoration: underline; text-underline-offset: 2px; }
.fm-name-cell { min-width: 180px; }
.fm-name-cell .badge { margin-left: 8px; height: 18px; font-size: 11px; }
.ic-folder { color: #f59e0b; fill: rgba(245, 158, 11, 0.18); }
.ic-file { color: var(--text-muted); }
.fm-actions { width: 1%; white-space: nowrap; text-align: right; }
.fm-up td { color: var(--text-muted); }
.fm-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 16px;
  color: var(--text-muted); text-align: center;
}
.dropzone { position: relative; }
.drop-overlay {
  position: absolute; inset: 6px;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-soft-strong);
  backdrop-filter: blur(1px);
  color: var(--accent-text); font-weight: 600;
  pointer-events: none;
  z-index: 5;
}
.dropzone.drag .drop-overlay { display: flex; }

/* ---------- Загрузка ---------- */
.upload-panel {
  order: 99;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.16s ease;
}
.upload-panel.done { opacity: 0.85; }
.up-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.up-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.up-note { margin-top: 4px; }
.progress { height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.2s ease; }

/* ---------- Логи, консоль, редактор ---------- */
.logs {
  margin: 0;
  min-height: 160px; max-height: 540px;
  padding: 12px 14px;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  border-radius: 0 0 12px 12px;
}
.card > .logs:not(:last-child) { border-radius: 0; }
.logs.console { min-height: 260px; max-height: 620px; }
.console-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 6px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}
.exec-form { display: flex; align-items: center; gap: 8px; }
.exec-form .prompt { color: var(--accent-text); font-weight: 700; font-size: 15px; }
.exec-form .input { flex: 1; min-width: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.quick .btn { font-family: var(--mono); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .exec-form { flex-wrap: wrap; }
  .exec-form .input { flex-basis: calc(100% - 24px); }
}
.editor {
  display: block;
  width: 100%;
  height: min(68vh, 720px);
  min-height: 280px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  resize: vertical;
}
.editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.editor-status.dirty { color: var(--yellow-text); }

/* ---------- Сервер ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--border); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s ease; }
.meter.warn > i { background: var(--yellow); }
.meter.crit > i { background: var(--red); }
.svc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.svc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.svc-list li:first-child { padding-top: 0; }
.svc-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.link-list li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.link-list a { overflow-wrap: anywhere; }

/* ---------- Состояния ---------- */
.loading { display: flex; align-items: center; gap: 10px; padding: 20px 4px; color: var(--text-muted); }
.card .loading { padding: 20px 16px; }
.spinner {
  display: inline-block; flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-sunken);
  font-size: 13.5px;
}
.alert .icon { margin-top: 2px; }
.alert-error { border-color: rgba(239, 68, 68, 0.35); background: var(--red-soft); color: var(--red-text); }
.card .alert-error { margin: 16px; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 52px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elev);
  text-align: center;
}
.empty-ico {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { max-width: 440px; margin: 0 0 10px; color: var(--text-muted); }

/* ---------- Вход ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background: radial-gradient(900px 480px at 50% -8%, var(--accent-soft-strong), transparent 70%), var(--bg);
}
.login-card {
  width: 100%; max-width: 360px;
  padding: 28px 24px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-align: center; }
.login-brand .brand-logo { width: 46px; height: 46px; border-radius: 13px; }
.login-title { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.login-error { min-height: 20px; margin: -6px 0 10px; font-size: 13px; color: var(--red-text); }

/* ---------- Модальные окна ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px;
  overflow-y: auto;
  background: rgba(9, 9, 11, 0.5);
  backdrop-filter: blur(2px);
  animation: fade 0.14s ease;
}
.modal {
  display: flex; flex-direction: column;
  width: 100%; max-width: 520px;
  margin-bottom: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.16s ease;
}
.modal-md { max-width: 640px; }
.modal-wide { max-width: 1000px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.modal-body { padding: 16px; }
.modal-body > p:last-child { margin-bottom: 0; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

/* ---------- Тосты ---------- */
.toasts {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toasts > * { pointer-events: auto; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 10px 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: pop 0.16s ease;
  transition: opacity 0.16s, transform 0.16s;
}
.toast.out { opacity: 0; transform: translateY(4px); }
.toast > .icon { margin-top: 2px; }
.toast > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-success > .icon { color: var(--green); }
.toast-error { border-color: rgba(239, 68, 68, 0.4); }
.toast-error > .icon { color: var(--red); }
.toast-info > .icon { color: var(--accent); }
.toast-x {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px;
  padding: 0;
  border: 0; border-radius: 5px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.toast-x:hover { background: var(--bg-hover); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
