:root {
  --bg: #10111a;
  --bg-alt: #151726;
  --card: #1d2033;
  --border: #2b2e47;
  --text: #f5f6fb;
  --muted: #9aa0be;
  --primary: #5c7cfa;
  --danger: #f25555;
  --success: #4ad295;
  --font: 'Inter', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at top left, #1b1d2d, #0b0c14 65%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.brand__title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.brand__subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__nav form {
  margin: 0;
}

.content {
  flex: 1;
  width: min(1080px, 94vw);
  margin: 2rem auto;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(12, 13, 22, 0.7);
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 20px 40px rgba(5, 6, 12, 0.45);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.panel__header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.panel__subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.panel__actions, .table__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.text-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(10, 11, 19, 0.45);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th, .table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
  background: rgba(92, 124, 250, 0.12);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.table--compact th, .table--compact td {
  padding: 0.6rem 0.8rem;
}

.table tr:last-child td {
  border-bottom: none;
}

.flash {
  width: min(800px, 92vw);
  margin: 1rem auto 0;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-weight: 500;
}

.flash--success {
  background: rgba(74, 210, 149, 0.18);
  border: 1px solid rgba(74, 210, 149, 0.6);
}

.flash--danger {
  background: rgba(242, 85, 85, 0.18);
  border: 1px solid rgba(242, 85, 85, 0.6);
}

.flash--info {
  background: rgba(92, 124, 250, 0.18);
  border: 1px solid rgba(92, 124, 250, 0.6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.btn--primary {
  background: linear-gradient(120deg, #5c7cfa, #4f8dfd);
  box-shadow: 0 10px 18px rgba(82, 113, 255, 0.25);
}

.btn--danger {
  background: linear-gradient(120deg, #f25555, #f27666);
  box-shadow: 0 10px 18px rgba(242, 85, 85, 0.3);
}

.btn--outlined {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn--block {
  width: 100%;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form__group label {
  font-size: 0.85rem;
  color: var(--muted);
}

.form__group input {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 11, 19, 0.7);
  color: var(--text);
  font-size: 0.95rem;
}

.form__group input[readonly] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.form__group--checkbox {
  grid-column: 1 / -1;
}

.form__group--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.form__group--checkbox small {
  color: var(--muted);
  font-size: 0.75rem;
}

.form__divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  margin: 0.6rem 0 0.2rem;
}

.form__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

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

.env-item {
  background: rgba(10, 11, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.env-item strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  color: var(--muted);
}

.env-item span {
  word-break: break-all;
}

.panel--centered {
  width: min(420px, 90vw);
  margin: 4rem auto 0;
}

.log-viewer {
  background: rgba(10, 11, 19, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 1.4rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-card {
  background: rgba(10, 11, 19, 0.6);
  border: 1px solid rgba(92, 124, 250, 0.16);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}

.summary-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.summary-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem 1.2rem;
}

.summary-card dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.08rem;
}

.summary-card dd {
  margin: 0.2rem 0 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  background: rgba(92, 124, 250, 0.15);
  border: 1px solid rgba(92, 124, 250, 0.4);
}

.status-running {
  color: #8fb3ff;
  background: rgba(92, 124, 250, 0.18);
}

.status-success {
  color: #4ad295;
  background: rgba(74, 210, 149, 0.18);
  border-color: rgba(74, 210, 149, 0.35);
}

.status-error {
  color: #f25555;
  background: rgba(242, 85, 85, 0.18);
  border-color: rgba(242, 85, 85, 0.35);
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .content {
    margin-top: 1rem;
  }
  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .form__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form__actions .btn {
    width: 100%;
  }
}
