:root {
  --bg-1: #f6f8fb;
  --bg-2: #dde7f7;
  --card: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-ink: #ecfeff;
  --secondary: #1d4ed8;
  --danger: #b91c1c;
  --border: #dbe4f0;
  --ok: #15803d;
  --warn: #b45309;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(29, 78, 216, 0.14), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(15, 118, 110, 0.16), transparent 35%);
  pointer-events: none;
}

.shell {
  width: min(1100px, 95vw);
  margin: 32px auto;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
}

.top-actions { display: flex; gap: 10px; align-items: center; }
.badge {
  border: 1px solid var(--border);
  background: #eef6ff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(13, 30, 63, 0.08);
}
.card h2 { margin: 0 0 12px 0; }
.muted { color: var(--muted); margin-top: 0; }

.grid,
.trade-grid {
  display: grid;
  gap: 12px;
}
.trade-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

input, select, button {
  font: inherit;
  border-radius: 10px;
}

input, select {
  border: 1px solid var(--border);
  padding: 10px;
  background: #fff;
}

button {
  border: 1px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
button:active { transform: scale(0.98); }

.primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.secondary {
  background: var(--secondary);
  color: #fff;
}
.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

.app-layout {
  display: grid;
  gap: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
}

.status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
}
.status-submitted { background: #2563eb; }
.status-running { background: var(--warn); }
.status-success { background: var(--ok); }
.status-failed { background: var(--danger); }
.status-canceled { background: #6b7280; }

button:disabled {
  background: #9ca3af !important;
  border-color: #9ca3af !important;
  color: #f3f4f6 !important;
  filter: grayscale(1);
  opacity: 0.95;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.hidden { display: none !important; }

.log-viewer {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  background: #0b1220;
  color: #d1d5db;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .shell { margin: 18px auto; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
