/* VPS Dashboard — dark minimal, same tokens as models-provider-dashboard. */
:root {
  --bg: #0B0F16;
  --bg-alt: #111827;
  --surface: #151D2B;
  --surface-2: #1A2333;
  --border: #232E42;
  --border-strong: #2C3A52;
  --text: #E5EAF2;
  --text-2: #8995A8;
  --accent: #4F8CFF;
  --accent-hover: #6BA1FF;
  --success: #34C98B;
  --warning: #E9B44C;
  --error: #F16D78;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
.mono { font-family: var(--mono); font-size: 12.5px; }
.dim { color: var(--text-2); }
h2, h3 { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-weight: 700; letter-spacing: .06em; font-size: 14px;
  white-space: nowrap;
}
.brand .sep { color: var(--accent); margin: 0 4px; }
.brand-lg { font-size: 20px; }
.top-meta {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0; overflow: hidden;
}
.top-meta .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- dots */
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-2); display: inline-block; flex: none;
}
.dot[data-state="ok"], .dot.ok { background: var(--success); }
.dot[data-state="err"], .dot.bad { background: var(--error); }
.dot[data-state="wait"] { background: var(--warning); }
.dot.warn { background: var(--warning); }
.dot.off { background: #46536B; }
.dot.na { background: #2C3A52; }

/* ---------------------------------------------------------------- layout */
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding: 20px 20px 48px;
  display: flex; flex-direction: column; gap: 16px;
}
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .top-meta { display: none; }
}

/* ---------------------------------------------------------------- cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
}
.card h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-2); font-weight: 600; margin-bottom: 6px;
}
.big {
  font-family: var(--mono); font-size: 26px; font-weight: 600;
  line-height: 1.1; letter-spacing: -.02em;
}
.big small { font-size: 13px; color: var(--text-2); margin-left: 3px; }
.sub {
  color: var(--text-2); font-size: 11.5px; margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spark { width: 100%; height: 34px; display: block; margin-top: 6px; }
.bar {
  height: 5px; border-radius: 3px; background: var(--surface-2);
  margin-top: 10px; overflow: hidden;
}
.bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 3px;
  transition: width .4s ease;
}
.bar i.hi { background: var(--warning); }
.bar i.crit { background: var(--error); }

/* ---------------------------------------------------------------- panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel-head h2 { font-size: 13px; letter-spacing: .04em; }
.ctl { display: flex; align-items: center; gap: 8px; }
.hint { font-size: 11.5px; }

/* ---------------------------------------------------------------- rows */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.empty { padding: 16px 14px; color: var(--text-2); font-size: 13px; }

.row .unit { flex: none; width: 148px; font-weight: 600; }
.row .state { flex: 1; min-width: 0; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .since { color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.row .restarts { color: var(--text-2); font-size: 11.5px; width: 28px; text-align: right; }
.row .restarts.has { color: var(--warning); }
.row .acts { display: flex; gap: 6px; flex: none; }

.row.cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}
.row.cell .name { font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.cell .meta { grid-column: 1 / -1; color: var(--text-2); font-family: var(--mono);
  font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.cell .tag { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.row.cell .tag.ok { color: var(--success); }
.row.cell .tag.bad { color: var(--error); }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: inherit; font-size: 12.5px;
  padding: 4px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary {
  background: var(--accent); border-color: var(--accent);
  color: #0B0F16; font-weight: 600;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0B0F16; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; padding: 8px; font-size: 14px; }
.btn.danger:hover { border-color: var(--error); color: var(--error); }

select, input[type="text"], input[type="password"] {
  font: inherit; font-size: 13px;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

/* ---------------------------------------------------------------- logs */
.logs {
  margin: 0; padding: 12px 14px;
  max-height: 320px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--text-2); white-space: pre-wrap; word-break: break-all;
  background: var(--bg-alt);
}
.logs:empty::before { content: "Нет данных"; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success);
  color: var(--text); padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; max-width: 340px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.toast[data-bad="1"] { border-left-color: var(--error); }

/* ---------------------------------------------------------------- login */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, #131C2E 0%, var(--bg) 70%);
}
.login-wrap { width: 100%; max-width: 360px; padding: 20px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 18px;
}
.login-sub { color: var(--text-2); font-size: 13px; margin: 6px 0 20px; }
.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 12px; color: var(--text-2);
  margin-bottom: 5px;
}
.field input { width: 100%; padding: 8px 10px; }
.form-error { color: var(--error); font-size: 12.5px; margin: 0 0 10px; }
.login-foot {
  color: var(--text-2); font-size: 11.5px; text-align: center;
  margin: 16px 0 0;
}
