:root {
  --bg: #0b1220;
  --panel: #111827;
  --panel2: #172033;
  --line: #263247;
  --text: #eef2f7;
  --muted: #94a3b8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #60a5fa;
  --purple: #a78bfa;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
.hidden {
  display: none !important;
}
.app-shell {
  display: grid;
  grid-template-columns: 255px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0e1626;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}
.brand div:last-child {
  display: flex;
  flex-direction: column;
}
.brand span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow);
}
.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav button,
.settings-nav button {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar nav button:hover,
.sidebar nav button.active,
.settings-nav button:hover,
.settings-nav button.active {
  background: #172033;
  color: #fff;
}
.sidebar nav button span {
  width: 20px;
  text-align: center;
  color: #94a3b8;
}
.nav-badge {
  margin-left: auto;
  background: #7f1d1d;
  color: #fecaca;
  border-radius: 999px;
  min-width: 22px;
  padding: 2px 7px;
  text-align: center;
  font-size: 11px;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.connection {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}
.connection i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 12px currentColor;
}
.connection.ok i {
  background: var(--ok);
}
.connection.bad i {
  background: var(--bad);
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-row div {
  display: flex;
  flex-direction: column;
}
.user-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.user-row button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
}
.main {
  min-width: 0;
  padding: 0 32px 42px;
}
.topbar {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.topbar h1 {
  font-size: 24px;
  margin: 0;
}
.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-button,
.secondary,
.primary,
.danger,
.warn-button {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 9px 13px;
  cursor: pointer;
  transition: 0.15s;
}
.icon-button,
.secondary {
  background: #131d2e;
  color: #dbe4ef;
}
.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.danger {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fee2e2;
}
.warn-button {
  background: #78350f;
  border-color: #92400e;
  color: #fef3c7;
}
.wide {
  width: 100%;
}
.icon-button:hover,
.secondary:hover {
  background: #1b2940;
}
.primary:hover {
  background: #1d4ed8;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.summary-card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.summary-card span {
  color: var(--muted);
  font-size: 12px;
}
.summary-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}
.summary-card small {
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 18px 0 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
}
.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  padding: 5px 9px;
  white-space: nowrap;
}
.pill.ok,
.badge.ok {
  color: #86efac;
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(34, 197, 94, 0.24);
}
.pill.warn,
.badge.warn {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.24);
}
.pill.bad,
.badge.bad {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.24);
}
.pill.neutral,
.badge.neutral {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.08);
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.server-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  cursor: pointer;
  transition: 0.15s;
}
.server-card:hover {
  border-color: #3e506d;
  transform: translateY(-1px);
}
.server-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.server-title {
  display: flex;
  gap: 10px;
  align-items: center;
}
.server-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.server-title h3 {
  margin: 0;
  font-size: 15px;
}
.server-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.server-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.metric {
  background: #0d1524;
  border: 1px solid #1e2b40;
  border-radius: 10px;
  padding: 10px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}
.issues {
  margin-top: 12px;
  font-size: 12px;
  color: #fca5a5;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input,
.toolbar select,
label input,
label select,
.form-grid input,
.form-grid select {
  background: #0e1727;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}
.toolbar input {
  flex: 1;
}
.toolbar input:focus,
label input:focus,
label select:focus {
  border-color: #3b82f6;
}
.stack-list {
  display: grid;
  gap: 12px;
}
.server-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.server-row-summary {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1fr) 180px 130px 100px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}
.server-row-vms {
  border-top: 1px solid var(--line);
  padding: 8px 16px 14px;
  background: #0e1626;
}
.vm-row {
  display: grid;
  grid-template-columns: 70px minmax(220px, 1fr) 150px 140px 130px 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(38, 50, 71, 0.65);
  font-size: 12px;
}
.vm-row:last-child {
  border-bottom: 0;
}
.muted {
  color: var(--muted);
}
.timeline {
  display: grid;
  gap: 10px;
}
.event {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
}
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--info);
}
.event.critical .event-dot {
  background: var(--bad);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.event.warning .event-dot {
  background: var(--warn);
}
.event.recovery .event-dot {
  background: var(--ok);
}
.event h4 {
  margin: 0 0 4px;
  font-size: 14px;
}
.event p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.event time {
  color: var(--muted);
  font-size: 11px;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.action-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.action-card h3 {
  font-size: 14px;
  margin: 0 0 7px;
}
.action-card p {
  font-size: 12px;
  color: var(--muted);
  min-height: 35px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
}
.command-list {
  display: grid;
  gap: 8px;
}
.command {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) 120px 90px;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.command-detail {
  width: 100%;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.command-detail:hover {
  background: #172033;
}
.command-output {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080f1c;
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
}
.protected-note {
  padding: 10px 12px;
  border: 1px solid #92400e;
  border-radius: 10px;
  background: #451a03;
  color: #fde68a;
}
.settings-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
}
.settings-nav {
  display: grid;
  align-content: start;
  gap: 5px;
}
.settings-nav button {
  border: 1px solid transparent;
}
.settings-content {
  min-width: 0;
}
.settings-pane {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
}
.settings-pane.active {
  display: block;
}
.settings-pane h2 {
  margin: 0 0 5px;
  font-size: 17px;
}
.settings-pane > .muted {
  margin-top: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.form-grid label,
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbd5e1;
  font-size: 12px;
}
.form-grid label span {
  color: var(--muted);
  font-size: 10px;
}
.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.toggle-row input {
  width: 18px;
  height: 18px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th,
.table td {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}
.table th {
  color: var(--muted);
  font-weight: 600;
}
.inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.inline-actions button {
  padding: 5px 8px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle at 50% 20%,
    #17233a 0,
    #0b1220 40%,
    #080d16 100%
  );
  padding: 20px;
}
.login-card {
  width: min(390px, 100%);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 28px;
}
.login-card .brand-mark {
  margin-bottom: 20px;
}
.login-card h1 {
  margin: 0;
  font-size: 26px;
}
.login-card > p {
  color: var(--muted);
  margin: 6px 0 22px;
}
.login-card form {
  display: grid;
  gap: 14px;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}
.login-card input {
  width: 100%;
  background: #0b1321;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  color: white;
}
.form-error {
  color: #fca5a5;
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}
.modal-card {
  position: relative;
  width: min(950px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 28px;
  cursor: pointer;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.detail-box {
  background: #0c1422;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.detail-box span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.detail-box strong {
  font-size: 12px;
}
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 100;
}
.toast {
  width: min(370px, calc(100vw - 36px));
  background: #172033;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.toast.bad {
  border-color: #7f1d1d;
}
.toast.ok {
  border-color: #166534;
}
#mobileMenu {
  display: none;
}
@media (max-width: 1050px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .server-row-summary {
    grid-template-columns: 90px 1fr 150px 100px;
  }
  .server-row-summary > *:nth-child(5) {
    display: none;
  }
  .vm-row {
    grid-template-columns: 60px 1fr 130px 120px;
  }
  .vm-row > *:nth-child(5),
  .vm-row > *:nth-child(6) {
    display: none;
  }
  .settings-layout {
    grid-template-columns: 190px 1fr;
  }
}
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -275px;
    z-index: 40;
    width: 255px;
    transition: 0.2s;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    left: 0;
  }
  .main {
    padding: 0 16px 28px;
  }
  .topbar {
    height: 82px;
  }
  .topbar h1 {
    font-size: 20px;
  }
  #mobileMenu {
    display: inline-flex;
  }
  .top-actions .secondary {
    display: none;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .server-grid {
    grid-template-columns: 1fr;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .server-row-summary {
    grid-template-columns: 70px 1fr 110px;
  }
  .server-row-summary > *:nth-child(4),
  .server-row-summary > *:nth-child(5) {
    display: none;
  }
  .vm-row {
    grid-template-columns: 55px 1fr 110px;
  }
  .vm-row > *:nth-child(n + 4) {
    display: none;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .command {
    grid-template-columns: 100px 1fr 80px;
  }
  .command > *:nth-child(4) {
    display: none;
  }
}
