/* PanicPanelKodeslav — тёмная неоновая тема */
:root {
  --bg: #070b12;
  --bg2: #0c1322;
  --panel: #101827;
  --panel2: #16223a;
  --line: #1f2c47;
  --txt: #d8e3f5;
  --dim: #7e8fb2;
  --cyan: #00e5ff;
  --mag: #ff3df5;
  --green: #2bff88;
  --red: #ff4d6d;
  --yellow: #ffd166;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 500px at 75% -10%, rgba(0, 229, 255, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 61, 245, 0.05), transparent 60%),
    var(--bg);
  color: var(--txt);
  font: 14.5px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }

h1, h2, h3 { margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 17px; letter-spacing: .4px; text-transform: uppercase; color: var(--cyan); }
h3 { font-size: 15px; color: var(--txt); }

code, pre, .mono { font-family: var(--mono); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 380px; max-width: 100%;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px 30px;
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.08), 0 20px 60px rgba(0,0,0,.5);
  text-align: center;
}
.login-logo { width: 92px; height: 92px; border-radius: 18px; object-fit: cover; margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(0,229,255,.35); }
.login-card h1 { font-size: 24px; letter-spacing: 2px; }
.login-card h1 span { color: var(--cyan); }
.login-card label { display: block; text-align: left; font-size: 12px; color: var(--dim); margin: 14px 0 6px;
  text-transform: uppercase; letter-spacing: 1px; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---------- layout ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: rgba(10, 15, 26, 0.9);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
.brand span { color: var(--cyan); }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tabs button:hover { color: var(--txt); background: var(--panel); }
.tabs button.active {
  color: var(--cyan); background: var(--panel);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.12) inset;
}
.admin-link {
  color: var(--mag) !important; border: 1px solid rgba(255, 61, 245, 0.4) !important;
  padding: 7px 12px !important; border-radius: 8px; text-decoration: none; font-size: 13px;
}
.userbox { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; white-space: nowrap; }
.userbox b { color: var(--txt); font-weight: 600; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.launch-grid { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .launch-grid { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
label.f { display: block; font-size: 12px; color: var(--dim); margin: 12px 0 5px;
  text-transform: uppercase; letter-spacing: 1px; }
input, select, textarea {
  width: 100%;
  background: var(--bg2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(0, 229, 255, 0.5); box-shadow: 0 0 0 2px rgba(0,229,255,.12); }
textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 6px; }

.btn {
  background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 14px;
  transition: all .12s ease;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.primary {
  background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(0,229,255,.06));
  border-color: rgba(0,229,255,.5); color: var(--cyan); font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 0 18px rgba(0,229,255,.25); }
.btn.danger { color: var(--red); border-color: rgba(255,77,109,.4); }
.btn.danger:hover { background: rgba(255,77,109,.1); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
/* кнопки-ссылки (a.btn), в т.ч. «Проверить доступность сайта» → ping.pe */
a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn.check { color: var(--green); border-color: rgba(43,255,136,.45); background: rgba(43,255,136,.05); }
.btn.check:hover { color: var(--green); border-color: rgba(43,255,136,.75); background: rgba(43,255,136,.12); box-shadow: 0 0 14px rgba(43,255,136,.15); }
.btn.big { width: 100%; padding: 11px; font-size: 15px; margin-top: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

.checklist { border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow: auto; background: var(--bg2); }
.srv-dd { position: relative; }
.srv-dd-btn { width: 100%; text-align: left; }
.srv-dd-btn::after { content: "  ▾"; color: var(--dim); }
.srv-dd-panel {
  display: none; position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.srv-dd-panel.open { display: block; }
.checklist .ci { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-bottom: 1px solid rgba(31,44,71,.6); }
.checklist .ci:last-child { border-bottom: none; }
.checklist .ci:hover { background: rgba(0,229,255,.05); }
.checklist .ci input { width: auto; }
.checklist .ci .host { color: var(--dim); font-size: 12.5px; font-family: var(--mono); }
.checklist .empty { padding: 12px; color: var(--dim); font-size: 13px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(31,44,71,.55); vertical-align: top; }
tr:hover td { background: rgba(0,229,255,.03); }
.td-mono { font-family: var(--mono); font-size: 12.5px; }
.tdim { color: var(--dim); }
.cmd-cell { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--dim); cursor: pointer; }
.cmd-cell.open { white-space: pre-wrap; word-break: break-all; color: var(--txt); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  border: 1px solid;
}
.badge.running { color: var(--green); border-color: rgba(43,255,136,.5); background: rgba(43,255,136,.08); }
.badge.starting { color: var(--yellow); border-color: rgba(255,209,102,.5); background: rgba(255,209,102,.08); }
.badge.paused { color: var(--yellow); border-color: rgba(255,209,102,.5); background: rgba(255,209,102,.08); }
.badge.stopping { color: var(--yellow); border-color: rgba(255,209,102,.5); background: rgba(255,209,102,.08); }
.badge.stopped, .badge.finished { color: var(--cyan); border-color: rgba(0,229,255,.5); background: rgba(0,229,255,.08); }
.badge.error { color: var(--red); border-color: rgba(255,77,109,.5); background: rgba(255,77,109,.08); }
.badge.ok { color: var(--green); border-color: rgba(43,255,136,.5); background: rgba(43,255,136,.08); }
.badge.fail { color: var(--red); border-color: rgba(255,77,109,.5); background: rgba(255,77,109,.08); }
.badge.admin { color: var(--mag); border-color: rgba(255,61,245,.5); background: rgba(255,61,245,.08); }
.badge.ruoff { color: var(--dim); border-color: var(--line); background: var(--bg2); }

/* ---------- run cards ---------- */
.run-card { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: var(--bg2); }
.run-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.run-head .info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-head .info b { font-size: 15px; }
.run-head .info .target { font-family: var(--mono); color: var(--cyan); }
.countdown {
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--yellow);
  min-width: 74px; text-align: center;
  border: 1px solid rgba(255,209,102,.4); border-radius: 8px; padding: 3px 8px;
  background: rgba(255,209,102,.06);
}
.countdown.done { color: var(--dim); border-color: var(--line); background: transparent; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.run-servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; padding: 14px; }
.srv { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.srv-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap;
}
.srv-head .host { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.srv-head .meta { margin-left: auto; color: var(--dim); font-family: var(--mono); font-size: 11.5px; }
.log {
  margin: 0; padding: 10px 12px;
  height: 190px; overflow-y: auto;
  background: #05080f;
  font-size: 11.8px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all;
  color: #9fd8ff;
}
.log .l-ok { color: var(--green); }
.log .l-err { color: var(--red); }
.log .l-warn { color: var(--yellow); }
.log .l-info { color: #6ea8d8; }

.empty-note { color: var(--dim); padding: 18px 6px; font-size: 13.5px; text-align: center; }

/* ---------- history ---------- */
.hist-row-click { cursor: pointer; }
.hist-detail { background: var(--bg2); }
.hist-detail pre { margin: 8px 0; max-height: 260px; overflow: auto; background: #05080f; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 11.8px; white-space: pre-wrap; word-break: break-all; color: #9fd8ff; }
.hist-detail h4 { margin: 12px 0 4px; font-size: 13px; color: var(--cyan); }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  color: var(--txt); padding: 11px 16px; border-radius: 8px; font-size: 13.5px; max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: fade .18s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

.budget{font-size:12px;color:var(--muted);white-space:nowrap}
.pager{display:flex;align-items:center;gap:12px;justify-content:center;margin:10px 0}
.pager-info{font-size:13px;color:var(--muted)}
.pager .btn:disabled{opacity:.4;cursor:not-allowed}

/* ---------- live launch stats ---------- */
.launch-live { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.launch-live:empty { display: none; }
.live-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.live-card.paused { border-color: rgba(255,180,0,.5); }
.live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.live-title { font-size: 12px; letter-spacing: .08em; color: var(--cyan); text-transform: uppercase; }
.live-status { font-size: 11px; color: var(--dim); }
.live-kpi { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.live-kpi span { font-size: 12px; color: var(--muted); }
.live-rps { font: 700 30px/1 monospace; color: var(--cyan); }
.live-card.paused .live-rps { color: var(--yellow); }
.live-meter { height: 8px; border-radius: 99px; background: #05080f; border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.live-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2f6fa8, var(--cyan)); transition: width .35s linear; }
.live-card.paused .live-meter i { background: var(--yellow); }
.live-spark { width: 100%; height: 72px; margin-top: 8px; display: block; }
.live-foot { display: flex; justify-content: space-between; font: 11px monospace; color: var(--dim); margin-top: 4px; }
.live-empty { color: var(--dim); font-size: 12.5px; text-align: center; padding: 8px 0 2px; }
