:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: #10151b;
  --panel-2: #151b22;
  --line: rgba(184, 199, 211, .16);
  --line-strong: rgba(55, 183, 139, .5);
  --text: #f4f7f9;
  --muted: #9aabb7;
  --green: #37d486;
  --red: #ff5f6d;
  --amber: #f0bd4b;
  --cyan: #49c7df;
  --ink: #07100d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(9, 14, 17, .96), rgba(4, 6, 8, 1)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 96px),
    var(--bg);
}

button, input, textarea, select { font: inherit; }
button, .button {
  min-height: 38px;
  border: 1px solid rgba(73, 199, 223, .34);
  border-radius: 8px;
  padding: 0 12px;
  background: #10212a;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}
button:hover, .button:hover { border-color: var(--cyan); background: #15303b; }
button:disabled { cursor: not-allowed; opacity: .45; }
.ghost { border-color: var(--line); background: rgba(255,255,255,.035); }
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell { min-height: 100vh; }
.cockpit {
  width: min(1760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.cockpit-top {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--green);
  background: rgba(55, 212, 134, .08);
}

.identity span,
.eyebrow,
.panel-head span,
.info span,
.status-tile span,
.editor label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: 0; }
h2 { font-size: 18px; letter-spacing: 0; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.refresh-time {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 13px;
}

.hero-status {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(520px, .95fr);
  gap: 16px;
  padding: 18px 0;
}

.hero-main,
.panel,
.status-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 21, 27, .88);
  box-shadow: var(--shadow);
}

.hero-main {
  min-height: 160px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 950;
  line-height: 1;
}

.hero-main p {
  color: var(--muted);
  font-size: 15px;
}

.orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 22px rgba(255, 95, 109, .55);
}
.orb.ok { background: var(--green); box-shadow: 0 0 26px rgba(55, 212, 134, .65); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-tile {
  min-height: 75px;
  padding: 14px;
}
.status-tile b {
  display: block;
  margin-top: 8px;
  color: var(--red);
  font-size: 24px;
  text-transform: uppercase;
}
.status-tile.ok b { color: var(--green); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .7fr);
  gap: 16px;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.info {
  min-width: 0;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255,255,255,.026);
}

.info b {
  display: block;
  margin-top: 7px;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-grid button {
  min-height: 86px;
  display: grid;
  justify-items: start;
  text-align: left;
  align-content: center;
  gap: 5px;
  padding: 12px;
}

.command-grid button svg { color: var(--amber); }
.command-grid b { font-size: 14px; }
.command-grid span { color: var(--muted); font-size: 12px; line-height: 1.25; }

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}

.node-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255,255,255,.026);
}

.node-card.ok {
  border-color: rgba(55, 212, 134, .34);
}

.node-card.warn {
  border-color: rgba(240, 189, 75, .28);
}

.node-card strong,
.node-card b,
.node-card span,
.node-card small {
  display: block;
  overflow-wrap: anywhere;
}

.node-card strong {
  color: #fff;
  font-size: 14px;
}

.node-card span,
.node-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.node-card b {
  color: var(--green);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.check-grid,
.config-list {
  display: grid;
  gap: 8px;
}

.check,
.config-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.026);
}

.check.ok {
  border-color: rgba(55, 212, 134, .28);
}

.check.bad {
  border-color: rgba(255, 95, 109, .38);
}

.check b,
.config-row b {
  color: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.check span,
.config-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 7px;
  max-height: 455px;
  overflow: auto;
  padding-right: 4px;
}

.event-row {
  display: grid;
  grid-template-columns: 78px 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(0,0,0,.18);
}

.event-row time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.event-row strong { color: var(--cyan); font-size: 12px; text-transform: uppercase; }
.event-row span { color: #d9e3ea; font-size: 12px; overflow-wrap: anywhere; }

.page-preview {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: rgba(55, 212, 134, .07);
  margin-bottom: 12px;
}

.page-preview b {
  display: block;
  font-size: 20px;
}

.page-preview span {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.page-preview p {
  margin-top: 12px;
  color: #d8e6df;
  line-height: 1.5;
}

.editor {
  display: grid;
  gap: 10px;
}

.editor label {
  display: grid;
  gap: 6px;
}

.editor input,
.editor textarea,
.editor select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070a0e;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

.editor textarea {
  min-height: 108px;
  resize: vertical;
}

.editor input:focus,
.editor textarea:focus,
.editor select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(73, 199, 223, .12);
}

.empty {
  color: var(--muted);
  padding: 12px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-grid { display: none; }

.login-shell {
  width: min(980px, calc(100vw - 28px));
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 390px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(16, 21, 27, .95);
  box-shadow: var(--shadow);
}

.login-identity,
.login-panel {
  padding: 38px;
}

.login-identity {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: #0b1117;
  border-right: 1px solid var(--line);
}

.drpc-logo-card {
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 18px 54px rgba(0,0,0,.38);
}
.drpc-logo-card img { width: 162px; height: 162px; border-radius: 50%; }
.login-crest span { display: block; margin-top: 14px; color: var(--amber); font-weight: 950; }
.login-title-block { margin-top: 24px; }
.login-title-block h1 { font-size: 38px; line-height: 1.05; }
.login-title-block p { color: var(--green); font-size: 20px; font-weight: 900; margin-top: 10px; }
.login-title-block strong { display: block; color: var(--muted); margin-top: 8px; }
.radio-band, .login-stats { display: none; }
.login-panel { display: grid; align-content: center; }
.login-panel-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 22px; }
.access-chip { border: 1px solid var(--green); border-radius: 999px; color: var(--green); padding: 7px 11px; font-size: 12px; font-weight: 900; }
.login-panel-head strong { color: var(--muted); font-size: 12px; }
.login-panel h2 { font-size: 30px; }
.login-panel p { color: var(--muted); margin-top: 9px; line-height: 1.5; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.login-form input { min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #070a0e; color: #fff; padding: 0 13px; outline: none; }
.login-form button { min-height: 50px; background: #123324; border-color: rgba(55, 212, 134, .55); }
.login-error { display: none; color: var(--red); }
.login-help { margin-top: 18px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--muted); font-size: 12px; }
.login-help strong { color: var(--green); }

@media (max-width: 1180px) {
  .hero-status,
  .layout {
    grid-template-columns: 1fr;
  }
  .metric-grid,
  .command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cockpit { padding: 10px; }
  .cockpit-top,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .status-grid,
  .metric-grid,
  .command-grid,
  .event-row,
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-identity { border-right: 0; border-bottom: 1px solid var(--line); }
}
