/* Remna Console — тёмная тема в духе Remnawave, плавающие окна как у консоли VNC */

:root {
  --bg:        #0a0c0e;
  --card:      #121619;
  --card-2:    #171c21;
  --line:      #232b32;
  --line-soft: #1c2329;
  --text:      #e6edf3;
  --muted:     #8b969f;
  --accent:    #4c8dff;
  --ok:        #37c98b;
  --warn:      #f0a848;
  --danger:    #f0603f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--muted); }
a:hover { color: var(--accent); }

/* --------------------------------------------------------------- кнопки */
.btn {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card-2); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .13s ease, border-color .13s ease, opacity .13s ease;
}
.btn:hover:not(:disabled) { background: #1f272e; border-color: #2e383f; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--wide { width: 100%; justify-content: center; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #08111f; font-weight: 600; }
.btn--primary:hover:not(:disabled) { background: #63a0ff; border-color: #63a0ff; }
.btn--accent { background: transparent; border-color: #2b4c73; color: #8ab4ff; }
.btn--accent:hover:not(:disabled) { background: rgba(76,141,255,.12); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn--quiet:hover:not(:disabled) { color: var(--text); background: var(--card-2); }
.btn--light { background: #f2f5f8; border-color: #f2f5f8; color: #10151a; font-weight: 600; }
.btn--light:hover { background: #fff; }

.chip { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.badge[data-tone="ok"]    { color: var(--ok);     border-color: rgba(55,201,139,.35);  background: rgba(55,201,139,.1); }
.badge[data-tone="warn"]  { color: var(--warn);   border-color: rgba(240,168,72,.35);  background: rgba(240,168,72,.1); }
.badge[data-tone="down"]  { color: var(--danger); border-color: rgba(240,96,63,.35);   background: rgba(240,96,63,.1); }

/* ---------------------------------------------------------------- вход */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.gate__card { width: min(380px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); display: grid; gap: 15px; }
.gate__eyebrow { margin: 0; color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.gate__title { margin: 0 0 8px; font-size: 22px; }
.gate__error { margin: 0; min-height: 18px; color: var(--danger); font-size: 13px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 12px; }
.field input { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #0d1114; }
.field input:focus { border-color: var(--accent); outline: none; }

/* -------------------------------------------------------------- шапка */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 13px 24px; background: rgba(10,12,14,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: .01em; }
.topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(76,141,255,.8); }
.topbar__right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.page { max-width: 1360px; margin: 0 auto; padding: 22px 24px 80px; }

.alert { margin: 0 0 16px; padding: 11px 14px; border: 1px solid rgba(240,96,63,.35); border-radius: var(--r); background: rgba(240,96,63,.08); color: #ffbfae; font-size: 13px; }

/* -------------------------------------------------------------- карточки */
.card { border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--card); padding: 18px; }
.card--panel { display: grid; gap: 14px; }
.card__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.card__eyebrow { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.card__title { margin: 4px 0 0; font-size: 20px; font-family: var(--mono); }
.card__title .arrow { color: var(--warn); padding: 0 7px; }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }

.verdicts { display: grid; gap: 8px; }
.verdict { padding: 10px 13px; border-radius: 10px; background: var(--card-2); border-left: 3px solid var(--line); font-size: 13px; }
.verdict[data-verdict="ok"] { border-left-color: var(--ok); }
.verdict[data-verdict="simple"] { border-left-color: var(--warn); }
.verdict[data-verdict="manual"], .verdict[data-verdict="major"] { border-left-color: var(--danger); }
.verdict__keys { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; color: var(--warn); word-break: break-all; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.section-head h2 { font-size: 15px; }
.section-head__count { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.card--node { display: grid; gap: 12px; }
.node__top { display: flex; align-items: flex-start; gap: 10px; }
.node__id { flex: 1; min-width: 0; }
.node__name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node__addr { margin: 2px 0 0; color: var(--muted); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.node__ver { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.node__ver b { color: var(--text); }
.node__ver .arrow { color: var(--warn); padding: 0 5px; }
.node__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.card--node[data-state="online"]  .dot { background: var(--ok); box-shadow: 0 0 8px rgba(55,201,139,.7); }
.card--node[data-state="offline"] .dot { background: var(--danger); }
.card--node[data-busy="1"] .dot { background: var(--warn); animation: pulse 1.1s ease-in-out infinite; }
.card--node[data-busy="1"] { border-color: rgba(240,168,72,.4); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
@media (prefers-reduced-motion: reduce) { .card--node[data-busy="1"] .dot { animation: none } }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ------------------------------------------------------- плавающие окна */
.win {
  position: fixed; z-index: 40;
  width: min(760px, 92vw); height: min(460px, 70vh);
  min-width: 340px; min-height: 200px;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: #0b0e10;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  resize: both;
}
.win--min { height: auto !important; min-height: 0; resize: none; }
.win--min .win__body { display: none; }
.win__bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--card); border-bottom: 1px solid var(--line-soft); cursor: grab; user-select: none; }
.win__bar:active { cursor: grabbing; }
.win__grip { width: 26px; height: 3px; border-radius: 2px; background: var(--line); flex: none; }
.win__title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win__state { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.win__state[data-tone="run"]  { color: var(--warn); }
.win__state[data-tone="ok"]   { color: var(--ok); }
.win__state[data-tone="fail"] { color: var(--danger); }
.win__btn { width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.win__btn:hover { background: var(--card-2); color: var(--text); }
.win__btn--close:hover { background: rgba(240,96,63,.16); color: var(--danger); }
.win__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.win__screen { flex: 1; min-height: 0; padding: 8px 10px; }
.xterm { height: 100%; }

/* заглушка консоли */
.console-idle { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.console-idle__frame {
  flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r);
  background-color: #080a0c;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 14px 14px;
}
.console-idle__icon { font-size: 26px; color: #3c454d; }
.console-idle__text { margin: 0; color: var(--muted); font-size: 13px; }
.console-idle__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.console-idle__hint { margin: 0; color: #6d7880; font-size: 12px; max-width: 380px; }

@media (max-width: 640px) {
  .page { padding: 16px 14px 60px; }
  .win { width: 96vw; height: 64vh; left: 2vw !important; }
}
