:root {
  --bg-color: #0b1120;
  --card-bg: #1e293b;
  --card-hover: #24344d;
  --border-color: #334155;
  --primary: #ffa600;
  --primary-hover: #e69500;
  --primary-glow: rgba(255, 166, 0, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  background: var(--primary);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.version-tag {
  background: #334155;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.status-indicator .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
}

.status-indicator.connected .dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.hub-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  transition: all 0.2s;
}

.hub-link:hover {
  background: var(--primary);
  color: #000;
}

/* Cards & Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.full-width {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Form inputs */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

textarea, input[type="datetime-local"] {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus, input[type="datetime-local"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

input[type="number"] {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

input[type="number"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #334155;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-main);
}

.checkbox-label input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  flex: 1;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background: #334155;
  color: #fff;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.btn-text:hover {
  text-decoration: underline;
}

/* Progress Panel */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.progress-percent {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffa600, #fbbf24);
  transition: width 0.3s ease;
}

.stages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s;
}

.stage-item.running {
  border-color: var(--info);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.stage-item.passed {
  border-color: rgba(34, 197, 94, 0.4);
}

.stage-item.failed {
  border-color: var(--danger);
}

.stage-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #334155;
  color: #fff;
}

.stage-title {
  font-size: 13.5px;
  font-weight: 500;
}

.stage-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-pending {
  background: #334155;
  color: #94a3b8;
}

.badge-running {
  background: rgba(56, 189, 248, 0.2);
  color: var(--info);
}

.badge-passed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Console logs */
.console-window {
  background: #070d19;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  height: 220px;
  overflow-y: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12.5px;
}

.log-entry {
  margin-bottom: 4px;
  line-height: 1.5;
  word-break: break-all;
}

.log-entry.info { color: #94a3b8; }
.log-entry.success { color: #4ade80; }
.log-entry.warn { color: #facc15; }
.log-entry.error { color: #f87171; }

/* History Table */
.table-responsive {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.history-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 24px !important;
}

.action-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-right: 12px;
  cursor: pointer;
}

.action-link:hover {
  text-decoration: underline;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  color: #1e293b;
  width: 900px;
  max-width: 100%;
  height: 80vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
}

.modal-body {
  flex: 1;
  padding: 0;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}
