:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #0d6efd;
  --success: #198754;
  --danger: #dc3545;
  --warning: #ffc107;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 16px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header h1 {
  margin: 0 0 8px;
}
.subtitle {
  margin: 0;
  color: var(--muted);
}
.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.top-nav a {
  text-decoration: none;
  color: var(--primary);
  background: #eef5ff;
  padding: 10px 14px;
  border-radius: 8px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}
textarea, input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.form-actions {
  display: flex;
  gap: 12px;
}
.inline-form {
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 10px;
}
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: bold;
}
.btn-primary { background: var(--primary); color: white; }
.btn-warning { background: var(--warning); color: #222; }
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.alert-success { background: #d1e7dd; color: #0f5132; }
.alert-danger { background: #f8d7da; color: #842029; }
.alert-info { background: #cff4fc; color: #055160; }
.alert-warning { background: #fff3cd; color: #664d03; }
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
  font-size: 14px;
}
th { background: #f1f5f9; }
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}
.badge-success { background: var(--success); }
.badge-danger { background: var(--danger); }
.badge-warning { background: var(--warning); color: #222; }
.small-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}
.pill-success { background: #d1e7dd; color: #0f5132; }
.pill-danger { background: #f8d7da; color: #842029; }
.kv-list div {
  margin-bottom: 8px;
}
.mono {
  font-family: Consolas, monospace;
  word-break: break-all;
}
.text-success { color: var(--success); font-weight: bold; }
.text-danger { color: var(--danger); font-weight: bold; }
pre {
  background: #101828;
  color: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
}
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
  }
}

[hidden] { display:none !important; }
.progress-bar-outer { width:100%; height:14px; background:#e5e7eb; border-radius:999px; overflow:hidden; }
.progress-bar-inner { height:100%; background:linear-gradient(90deg, #0d6efd, #3b82f6); border-radius:999px; transition: width .35s ease; }
.pipeline-progress-wrap { display:flex; flex-direction:column; gap:18px; }
.pipeline-progress-meta { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; }
.stage-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:14px; }
.stage-card { border:1px solid var(--border); border-radius:12px; padding:14px; background:#fff; }
.stage-title { font-weight:bold; margin-bottom:6px; }
.stage-name { font-size:13px; color:var(--muted); min-height:34px; margin-bottom:10px; }
.stage-percent { font-weight:bold; margin-top:8px; }
.stage-status { font-size:12px; text-transform:uppercase; margin-top:4px; color:var(--muted); }
.stage-card.is-running { border-color:#0d6efd; box-shadow:0 0 0 2px rgba(13,110,253,.12); }
.stage-card.is-completed { border-color:#198754; }
.stage-card.is-failed { border-color:#dc3545; }
.stage-card.is-completed .stage-inner { background:linear-gradient(90deg, #198754, #22c55e); }
.stage-card.is-failed .stage-inner { background:linear-gradient(90deg, #dc3545, #ef4444); }

.title-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.result-card-group h2 {
  margin-top: 0;
}
@media (min-width: 900px) {
  .title-input-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.stage-card.is-stopped {
    border-color: #f59e0b;
    background: #fffbeb;
}


.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
}


.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.image-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.image-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}
.image-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafafa;
}
.muted-box {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #fafafa;
}


.visual-grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.visual-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.muted-box {
  background: #f8fafc;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 16px;
}
.chart-box {
  min-height: 220px;
}
.simple-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.simple-chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  align-items: center;
  gap: 10px;
}
.simple-chart-label {
  font-size: 13px;
  color: var(--text);
}
.simple-chart-bar-wrap {
  width: 100%;
  height: 22px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.simple-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, #0d6efd, #60a5fa);
  border-radius: 999px;
}
.simple-chart-value {
  font-size: 13px;
  font-weight: bold;
  text-align: right;
}
.cm-grid {
  display: grid;
  gap: 6px;
  align-items: stretch;
}
.cm-head {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
}
.cm-cell {
  border-radius: 8px;
  padding: 18px 10px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,.04);
}

input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  background: #fff;
}
.btn-secondary { background: #6b7280; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.status-box { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.actions-stack { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.detail-card { border:1px solid var(--border); border-radius:12px; padding:14px; background:#fff; margin-bottom:14px; }
.required-mark { color: var(--danger); }
