:root {
  --bg: #0f172a;
  --bg-soft: #111c36;
  --panel: rgba(8, 15, 33, 0.78);
  --panel-border: rgba(148, 163, 184, 0.16);
  --text: #e5eef8;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 30px 80px rgba(15, 23, 42, 0.42);
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 25%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 25%),
    linear-gradient(180deg, #09111f, #111827 55%, #08111e);
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

code, pre {
  font-family: var(--font-mono);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.background-orb {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.4;
  pointer-events: none;
}

.orb-a {
  top: -8rem;
  left: -8rem;
  background: rgba(245, 158, 11, 0.16);
}

.orb-b {
  right: -8rem;
  bottom: -10rem;
  background: rgba(59, 130, 246, 0.16);
}

.topbar, .hero, .log-grid {
  display: grid;
  gap: 18px;
}

.topbar {
  grid-template-columns: 1.2fr auto auto;
  align-items: center;
  margin-bottom: 24px;
}

.nav {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
}

.nav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
}

.nav a.active {
  background: rgba(245, 158, 11, 0.14);
  color: var(--text);
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  grid-template-columns: 1.4fr 0.8fr;
  margin-bottom: 18px;
}

.compact {
  align-self: stretch;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.74rem;
}

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

.stats {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stats strong {
  display: block;
  font-size: 2rem;
}

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

.stats-spacious {
  gap: 28px;
  margin-top: 22px;
  margin-bottom: 0;
}

.toolbar, .action-row, .inline-form, .pill-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-stacked {
  gap: 18px;
}

.toolbar-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.toolbar-head h3,
.quick-guide h3,
.job-card h3,
.run-card h3 {
  margin: 4px 0 0;
}

.toolbar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-row input {
  flex: 1 1 24rem;
}

.stack-form {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

input, textarea, button {
  font: inherit;
}

input[type="text"], input[type="search"], input[type="password"], textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  color: var(--text);
  padding: 13px 14px;
}

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #fb7185);
  color: #101828;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  text-decoration: none;
}

.secondary-button {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text);
}

.ghost-button, .ghost-link {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
}

.danger-button {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.table-wrap {
  overflow-x: auto;
}

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

th, td {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.command-cell {
  max-width: 22rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pill.managed, .pill.enabled {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.pill.legacy, .pill.disabled {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.pill.success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.pill.failed {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.pill.running {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.pill.neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.preview-list, .detail-grid {
  margin: 0;
  padding-left: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-left: 0;
}

.detail-grid dt {
  color: var(--muted);
  margin-bottom: 6px;
}

.center-card {
  min-height: 80vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(460px, 100%);
}

.error-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
}

.empty-state h3 {
  color: var(--text);
  margin: 0 0 8px;
}

.split-top {
  margin-top: 18px;
}

.log-grid {
  grid-template-columns: 1fr 1fr;
}

#stdout-log, #stderr-log {
  min-height: 360px;
  max-height: 540px;
  overflow: auto;
  background: rgba(2, 6, 23, 0.65);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-jobs {
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quick-guide {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.search-panel {
  margin-bottom: 18px;
}

.job-list,
.run-list {
  display: grid;
  gap: 16px;
}

.job-card,
.run-card {
  overflow: hidden;
}

.job-card-top,
.run-card-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.job-card-copy h3,
.run-card h3 {
  font-size: 1.5rem;
}

.job-focus {
  margin: 10px 0 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.98rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: min(100%, 18rem);
}

.job-metadata,
.run-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric-chip,
.run-meta > div,
.job-comment {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.metric-chip span,
.run-meta span,
.job-comment span,
.detail-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.metric-chip strong,
.run-meta strong {
  display: block;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.metric-chip code {
  font-size: 1rem;
  color: var(--text);
}

.status-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-note {
  margin: 16px 0 0;
  line-height: 1.6;
}

.job-comment {
  margin-top: 14px;
}

.job-comment p {
  margin: 0;
  line-height: 1.6;
}

.command-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.command-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.command-details[open] summary {
  margin-bottom: 14px;
}

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

.command-details pre {
  margin: 0;
  min-height: 5rem;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  padding: 16px;
}

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

.preset-button {
  min-height: 40px;
  font-weight: 600;
}

@media (max-width: 920px) {
  .topbar, .hero, .log-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    justify-items: start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-head,
  .job-card-top,
  .run-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .job-actions {
    justify-content: flex-start;
  }

  .job-metadata,
  .run-meta,
  .job-detail-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-row {
    align-items: stretch;
  }

  .toolbar-row button,
  .toolbar-row .ghost-link {
    width: 100%;
  }
}
