:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: #0f172a;
  --panel-alt: #090f1f;
  --border: #1e293b;
  --border-hi: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --amber: #fbbf24;
  --purple: #c084fc;
  --red: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner, .container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.bolt { font-size: 20px; color: var(--cyan); }
.brand h1 { font-size: 16px; font-weight: 700; color: #fff; }
.brand p { font-size: 11px; color: var(--dim); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.container { display: flex; flex-direction: column; gap: 18px; padding-top: 20px; padding-bottom: 40px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.dispatch-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; align-items: center; }
.dispatch-bar input, .dispatch-bar select {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 11px;
  font-family: var(--mono);
  font-size: 12px;
}
.dispatch-bar input { flex: 1; min-width: 220px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 7px; padding: 7px 12px; font-family: var(--mono);
  font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); transition: 0.15s ease;
}
.btn-primary { background: #0e7490; border-color: #06b6d4; color: #fff; }
.btn-primary:hover { background: #0891b2; }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }
.btn-ghost { background: var(--panel-alt); color: var(--muted); }
.btn-ghost:hover { color: #fff; border-color: var(--border-hi); }
.btn-tiny { background: #1e293b; color: var(--muted); padding: 3px 8px; font-size: 10px; }
.btn-tiny:hover { color: #fff; }

.badge { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700; border: 1px solid var(--border); }
.badge-live { background: rgba(16, 185, 129, 0.12); color: var(--emerald); border-color: rgba(16, 185, 129, 0.4); }
.badge-phase { background: rgba(34, 211, 238, 0.12); color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); }

.active-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.active-title { font-size: 15px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 7px; }
.status-left { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.progress-track { width: 100%; height: 11px; background: var(--panel-alt); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #06b6d4, #14b8a6, #34d399);
  transition: width 0.35s ease;
}
.progress-fill.done { background: linear-gradient(90deg, #10b981, #34d399); }

.meta-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; }
.meta-pill { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; color: var(--muted); }
.meta-pill b { color: var(--cyan); }

.workers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.worker-slot {
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 11px;
}
.worker-slot.busy { border-color: rgba(34, 211, 238, 0.5); }
.worker-top { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 700; }
.worker-file { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.hint { font-size: 10px; color: var(--dim); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-cyan { background: var(--cyan); }
.dot-emerald { background: var(--emerald); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

.item-list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.row-title { font-weight: 700; color: var(--text); font-size: 12px; }
.row-sub { color: var(--dim); font-size: 11px; margin-top: 2px; }
.empty-state { text-align: center; padding: 24px 10px; color: var(--dim); font-size: 12px; }
