:root {
  --bg: #0c1117;
  --panel: #111a24;
  --panel-strong: #162231;
  --border: #26384a;
  --text: #edf4ff;
  --muted: #9ab0c6;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --danger: #f87171;
  --danger-strong: #ef4444;
  --good: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.16), transparent 24rem),
    radial-gradient(circle at bottom left, rgba(96, 165, 250, 0.16), transparent 26rem),
    var(--bg);
  color: var(--text);
}

code,
textarea,
input,
select {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.topbar,
.section-heading,
.inline-actions,
.stats-grid,
.dashboard-grid,
.form-grid,
.form-actions {
  display: flex;
  gap: 1rem;
}

.topbar,
.section-heading {
  justify-content: space-between;
  align-items: center;
}

.topbar {
  margin-bottom: 1.25rem;
}

.topbar-actions,
.inline-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

h2 {
  font-size: 1.1rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.login-layout,
.form-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 8rem);
}

.auth-panel,
.form-layout .panel {
  width: min(760px, 100%);
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card strong {
  display: block;
  font-size: 2.4rem;
  margin: 0.4rem 0;
}

.stat-good strong,
.status-up {
  color: var(--good);
}

.stat-bad strong,
.status-down {
  color: var(--danger);
}

.muted,
small,
.stacked-list span,
td,
th,
label span {
  color: var(--muted);
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

label {
  display: grid;
  gap: 0.45rem;
}

.full-span {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

input,
select,
textarea,
.code-view {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(8, 13, 18, 0.82);
  color: var(--text);
  padding: 0.9rem 1rem;
}

textarea {
  resize: vertical;
}

.code-view {
  min-height: 20rem;
}

button,
a.primary-button,
a.secondary-button {
  text-decoration: none;
}

button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.ghost-danger-button {
  border-radius: 999px;
  border: none;
  padding: 0.8rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.ghost-danger-button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.primary-button {
  background: var(--accent);
  color: #042a28;
}

.secondary-button {
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.danger-button {
  background: var(--danger);
  color: white;
}

.ghost-button,
.ghost-danger-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.ghost-danger-button {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.stacked-list {
  display: grid;
  gap: 0.25rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.error-cell {
  max-width: 32rem;
  word-break: break-word;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1rem, 100%);
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
