@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #06080f;
  --bg-2: #0b1020;
  --surface: rgba(14, 22, 40, 0.72);
  --surface-strong: #111a2f;
  --surface-soft: rgba(141, 170, 224, 0.08);
  --text: #edf2ff;
  --muted: #9fb0d6;
  --accent: #67e8f9;
  --accent-strong: #0ea5e9;
  --success: #4ade80;
  --danger: #fb7185;
  --warn: #fbbf24;
  --border: rgba(143, 170, 220, 0.2);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.2), transparent 40%),
    radial-gradient(circle at 85% 12%, rgba(14, 116, 144, 0.16), transparent 34%),
    linear-gradient(180deg, #05070d 0%, #080c16 45%, #060810 100%);
  min-height: 100vh;
  line-height: 1.45;
}

.page {
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 12, 24, 0.7);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.03em;
}

.content {
  width: min(1200px, 100% - 96px);
  margin: 0 auto;
  padding: 32px 0 90px;
}

.detail {
  display: grid;
  gap: 22px;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.section-intro p {
  margin: 6px 0 0;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--surface), var(--surface-strong));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: rise-in 0.42s ease both;
}

.card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(103, 232, 249, 0.7), rgba(148, 163, 184, 0));
}

.card h2,
.card h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.card h3 {
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.instance-title {
  font-size: 26px;
  line-height: 1.1;
}

.card-body .row,
.card .row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(143, 170, 220, 0.14);
  font-size: 14px;
}

.card-body .row:last-child,
.card .row:last-child {
  border-bottom: none;
}

.card .row span:first-child,
.card-body .row span:first-child {
  color: var(--muted);
}

.row-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: capitalize;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: rgba(143, 170, 220, 0.12);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.status.online {
  color: var(--success);
  background: rgba(74, 222, 128, 0.13);
  border-color: rgba(74, 222, 128, 0.28);
}

.status.offline {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.13);
  border-color: rgba(251, 113, 133, 0.28);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.link {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

button {
  border: 1px solid rgba(143, 170, 220, 0.25);
  border-radius: 12px;
  padding: 9px 15px;
  cursor: pointer;
  color: var(--text);
  background: rgba(143, 170, 220, 0.12);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
  background: rgba(143, 170, 220, 0.22);
  border-color: rgba(143, 170, 220, 0.4);
}

button.primary {
  border: 1px solid rgba(6, 182, 212, 0.55);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #041018;
}

button.primary:hover {
  background: linear-gradient(135deg, #8bf6ff, #1bb8f0);
}

.panel button.primary {
  width: 100%;
  margin-top: 8px;
}

button.ghost {
  background: transparent;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  color: #8bf6ff;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  max-width: 450px;
  margin: 88px auto;
  background: linear-gradient(165deg, rgba(12, 20, 36, 0.92), rgba(8, 14, 28, 0.92));
  padding: 34px;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(103, 232, 249, 0.38));
}

.topbar .brand {
  margin-bottom: 0;
}

.panel h1 {
  margin: 0;
}

.panel form {
  display: grid;
  gap: 2px;
}

label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 10, 20, 0.76);
  color: var(--text);
}

input:focus,
button:focus,
.link:focus {
  outline: 2px solid rgba(103, 232, 249, 0.58);
  outline-offset: 1px;
}

.alert {
  padding: 12px 13px;
  border-radius: 12px;
  margin: 12px 0;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert.error {
  background: rgba(251, 113, 133, 0.14);
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.4);
}

.alert.warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fef08a;
  border-color: rgba(251, 191, 36, 0.35);
}

.warn {
  color: #fcd34d;
}

.log {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  background: rgba(5, 10, 20, 0.8);
  border: 1px solid rgba(143, 170, 220, 0.2);
  border-radius: 12px;
  padding: 16px;
  max-height: 320px;
  overflow: auto;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(143, 170, 220, 0.14);
  font-size: 13px;
}

.table-row.head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 20;
}

.toast.hidden {
  display: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .content {
    width: calc(100% - 40px);
    padding: 20px 0 64px;
  }

  .card-actions,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-header {
    flex-direction: column;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .panel {
    margin: 42px 20px;
  }
}
