/* ---------- «Серверы» (web/admin-nodes.js): status, plain bars, a few facts; technical detail in the dialog ---------- */
.srv-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-section); }
.srv-page > * { min-width: 0; margin: 0; }
.srv-intro { display: grid; gap: 4px; max-width: 920px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.srv-intro p { margin: 0; }
.srv-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.srv-summary span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 14px; }
.srv-summary .srv-warn { border-color: rgb(242 122 111 / .45); color: var(--danger); }
.srv-filters { gap: 10px; }
.srv-filters .segmented { flex-wrap: wrap; }
.srv-stopped > summary { width: fit-content; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--panel); color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.srv-stopped > summary:hover { color: var(--text); }
.srv-stopped[open] > summary { margin-bottom: 14px; }

.srv-card { display: grid; align-content: start; gap: 18px; }
.srv-card.is-silent { border-color: rgb(242 122 111 / .45); }
.srv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.srv-title { min-width: 0; }
.srv-title h2 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
/* «Главный сервер» / «Дополнительный сервер» above the name: the main one stands out, the others stay quiet. */
.srv-kind { display: inline-flex; align-items: center; margin: 0 0 8px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.srv-kind.is-main { border-color: var(--text-2); background: var(--panel-3); color: var(--text); }
.srv-title p { margin: 0; font-size: 14px; }
.srv-status { flex: none; gap: 7px; }
.srv-status.srv-silent { background: rgb(242 122 111 / .12); color: var(--danger); }
.srv-status.srv-silent .dot { background: var(--danger); }

.srv-bars { display: grid; gap: 16px; }
.srv-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.srv-bar-head span { color: var(--text-2); }
.srv-bar-head strong { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.srv-meter { display: block; width: 100%; height: 8px; margin: 8px 0 0; border: 0; border-radius: 999px; background: var(--panel-3); -webkit-appearance: none; appearance: none; }
.srv-meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: 999px; background: var(--panel-3); }
.srv-meter::-webkit-meter-optimum-value { border-radius: 999px; background: var(--text-2); }
.srv-meter::-webkit-meter-suboptimum-value { border-radius: 999px; background: var(--warn); }
.srv-meter::-webkit-meter-even-less-good-value { border-radius: 999px; background: var(--danger); }
.srv-meter::-moz-meter-bar { border-radius: 999px; background: var(--text-2); }
.srv-meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
.srv-meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); }
.srv-bar-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.srv-bar.is-busy .srv-bar-note { color: var(--warn); }
.srv-bar.is-full .srv-bar-note { color: var(--danger); }
/* A silent or stopped service shows its last known figures, greyed: they are not live. */
.srv-card:not(.is-online) .srv-meter { opacity: .5; }
.srv-card:not(.is-online) .srv-bar-note { color: var(--muted); }

.srv-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.srv-facts > div { min-width: 0; }
.srv-facts dt { color: var(--muted); font-size: 13px; }
.srv-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.srv-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
/* The code version the node runs, quiet, left of «Подробнее». */
.srv-code { margin-right: auto; min-width: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Working nodes on different code versions. */
.srv-version-warn { display: grid; gap: 6px; padding: 12px 16px; border: 1px solid rgb(228 174 79 / .45); border-radius: var(--radius-md); background: rgb(228 174 79 / .08); color: var(--warn); font-size: 14px; line-height: 1.5; }
.srv-version-warn p { margin: 0; overflow-wrap: anywhere; }
.node-facts code { font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 619px) {
  .srv-head { flex-wrap: wrap; }
  .srv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srv-actions .button, .srv-actions button, .srv-buttons { width: 100%; }
}

/* Host management uses the existing cabinet palette and controls. */
.sm-toolbar { margin: 0 0 16px; gap: 10px; }
.sm-unavailable { overflow-wrap: anywhere; }
.sm-form p { margin: 0; }
.sm-form { display: grid; gap: 14px; min-width: 0; }
.sm-form label { margin-top: 0; }
.sm-form .check-row, .sm-form .form-actions { margin: 0; }
.sm-form .form-grid { gap: 14px; }
.sm-form input, .sm-form select, .sm-form textarea { width: 100%; min-width: 0; }
.sm-form input[type=checkbox] { width: auto; }
.sm-form [hidden] { display: none; }
.sm-managed { padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; }
.sm-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.sm-facts div:last-child { grid-column: 1 / -1; }
.sm-facts dt { color: var(--muted); font-size: 13px; }
.sm-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
/* State line + only the actions that fit it; «Удалить» sits apart on the right. */
.sm-state { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; color: var(--text-2); }
.sm-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sm-state.is-same::before { background: var(--ok); }
.sm-state.is-behind { color: var(--warn); }
.sm-state.is-behind::before { background: var(--warn); }
.sm-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.sm-controls-main { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-controls button { white-space: normal; }
.sm-last { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sm-last .text-link { min-height: 44px; }
.sm-task, .sm-fingerprint { min-width: 0; overflow-wrap: anywhere; }
.sm-fingerprint { display: grid; gap: 12px; }
.sm-fingerprint code { display: block; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.sm-steps { display: grid; gap: 8px; list-style: none; padding: 0; }
.sm-steps li { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sm-step-head { display: flex; align-items: center; gap: 12px; }
.sm-step-head > span:first-child { flex: 1 1 auto; min-width: 0; }
.sm-step-pct { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-steps .pill { flex: 0 0 auto; min-height: 0; width: auto; padding: 4px 9px; font-size: 12px; }
.sm-steps li.is-waiting { color: var(--muted); }
.sm-overall { margin: 16px 0 8px; }
.sm-task-head { margin: 0 0 12px; color: var(--text-2); }
.sm-task-head strong { color: var(--text); }
.sm-done { padding: 12px 14px; border: 1px solid rgb(90 196 143 / .35); border-radius: var(--radius-md); background: rgb(90 196 143 / .08); color: var(--text); }
.sm-fingerprint { margin-bottom: 8px; }
.sm-overall .field-hint { margin: 6px 0 0; }
/* The same thin bar as the CPU and memory meters of «Серверы»; a finished step turns the success colour. */
.sm-progress { display: block; width: 100%; height: 6px; margin: 0; border: 0; border-radius: 999px; background: var(--panel-3); color: var(--text-2); -webkit-appearance: none; appearance: none; overflow: hidden; }
.sm-overall .sm-progress { height: 8px; margin-top: 8px; }
.sm-progress::-webkit-progress-bar { border-radius: 999px; background: var(--panel-3); }
.sm-progress::-webkit-progress-value { border-radius: 999px; background: var(--text-2); transition: width .6s ease; }
.sm-progress::-moz-progress-bar { border-radius: 999px; background: var(--text-2); }
.sm-steps li.is-succeeded .sm-progress::-webkit-progress-value, .sm-overall.is-succeeded .sm-progress::-webkit-progress-value { background: var(--ok); }
.sm-steps li.is-succeeded .sm-progress::-moz-progress-bar, .sm-overall.is-succeeded .sm-progress::-moz-progress-bar { background: var(--ok); }
.sm-error { color: var(--danger); }
.sm-batch { display: grid; gap: 8px; }
@media (max-width: 619px) {
  .sm-toolbar > button { width: 100%; }
  .sm-form .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sm-form .form-field:nth-child(-n+2) { grid-column: 1 / -1; }
  .sm-steps li { align-items: flex-start; }
  .sm-steps .pill { max-width: 42%; white-space: normal; }
}

/* «Перенести ботов»: the buttons of a card's last row, and the dialog — the target server, then the bots by server. */
.srv-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sm-move select { width: 100%; }
.sm-move-label { margin: 16px 0 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.sm-move-list { display: grid; gap: 10px; max-height: min(46vh, 420px); overflow-y: auto; padding: 4px 2px; }
.sm-move-group { display: grid; gap: 2px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); min-width: 0; }
.sm-move-group legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.sm-move-group .check-row { margin: 0; overflow-wrap: anywhere; }
