:root {
  --bg: #0d141b;
  --panel: rgba(14, 27, 36, 0.82);
  --panel-strong: #122433;
  --text: #edf4f8;
  --muted: #8aa5b8;
  --line: rgba(148, 184, 209, 0.18);
  --accent: #0ea5a4;
  --accent-2: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 164, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 22%),
    linear-gradient(180deg, #091117 0%, #0d141b 52%, #111a22 100%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

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

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.94;
  max-width: 12ch;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.metric {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.metric span,
.summary-grid span,
label,
small,
.status-text {
  color: var(--muted);
}

.metric strong,
.summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.94rem;
}

input,
textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 15, 0.55);
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(14, 165, 164, 0.6);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
}

textarea {
  resize: vertical;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

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

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

.primary {
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #042126;
  font-weight: 700;
}

.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-grid > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.code-block,
.log-block {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: #081017;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.5;
}

.code-block {
  max-height: 180px;
}

.log-wrap {
  margin-top: 14px;
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.log-block {
  min-height: 260px;
  max-height: 360px;
}

.error-text {
  color: #fca5a5;
}

.jobs-list {
  display: grid;
  gap: 12px;
}

.job-item {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
}

.job-item.active {
  border-color: rgba(14, 165, 164, 0.8);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 164, 0.25);
}

.job-top,
.job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-top {
  margin-bottom: 8px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.running {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.badge.finished {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.badge.failed,
.badge.canceled {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.badge.pending {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.empty-state {
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.hidden {
  display: none;
}


.devices-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 24px;
}
.device-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.device-meta input {
  max-width: 220px;
}
.device-actions {
  margin-bottom: 12px;
}
.device-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 10px;
  background: rgba(4,10,15,0.6);
}
.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: "IBM Plex Mono", monospace;
}
.device-item:last-child {
  border-bottom: none;
}
.device-item label {
  flex: 1;
  cursor: pointer;
}
.device-item span {
  color: var(--muted);
  font-size: 0.82rem;
}
.device-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .device-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 920px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .two-cols,
  .summary-grid,
  .panel-head,
  .job-top,
  .job-meta,
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
