:root {
  --bg: #0b1020;
  --card: #121a33;
  --muted: #98a2b3;
  --text: #e5e7eb;
  --accent: #7c3aed;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --border: #26314f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 500px at 80% -20%, #2d1b69 0%, transparent 60%), var(--bg);
  color: var(--text);
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.switch-wrap input {
  display: none;
}

.switch-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #314166;
  background: #182440;
  transition: all 0.2s ease;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.2s ease;
}

.switch-wrap input:checked + .switch-ui {
  background: #1d4ed8;
  border-color: #2563eb;
}

.switch-wrap input:checked + .switch-ui::after {
  transform: translateX(18px);
  background: #ffffff;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #f8fafc;
  text-shadow: 0 1px 18px rgba(124, 58, 237, 0.28);
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

button {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1e2a4d, #121a33);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.layout {
  max-width: 1160px;
  margin: 24px auto;
  padding: 0 20px 40px;
  display: grid;
  gap: 16px;
}

.card {
  background: color-mix(in oklab, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}

.card h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 750;
  color: #e9d5ff;
  letter-spacing: 0.2px;
}

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

.agent {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #101a35 0%, #0d152b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.agent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.agent-title-wrap {
  min-width: 0;
  flex: 1;
}

.agent-meta-stack {
  display: grid;
  gap: 4px;
  margin: 6px 0 8px;
}

.agent-meta-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}

.agent-meta-line .k {
  width: 44px;
  color: #93a4c1;
  flex-shrink: 0;
}

.agent-meta-line .v {
  color: #d8e0ec;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.agent-stat {
  border: 1px solid #2c3658;
  border-radius: 8px;
  padding: 7px 8px;
  background: #0f1a35;
}

.agent-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.agent-stat strong {
  font-size: 13px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #1f2937;
}

.agent h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.meta {
  color: #9fb0c9;
  font-size: 13px;
  margin: 4px 0;
}

.inline-link {
  color: #c4b5fd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(196, 181, 253, 0.5);
}

.inline-link:hover {
  color: #e9d5ff;
  border-bottom-color: rgba(233, 213, 255, 0.9);
}

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

.orch-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.orch-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(180deg, #131d39 0%, #101732 100%);
}

.orch-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.orch-card strong {
  font-size: 14px;
}

.orch-card-wide {
  grid-column: span 2;
}

.orch-status strong {
  color: #86efac;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.pill.ok {
  color: #86efac;
  border-color: #14532d;
  background: #052e16;
}

.pill.warn {
  color: #fde68a;
  border-color: #78350f;
  background: #451a03;
}

.pill.bad {
  color: #fecaca;
  border-color: #7f1d1d;
  background: #450a0a;
}

.task-list,
.project-list {
  display: grid;
  gap: 10px;
}

.task-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
}

.task-sidebar {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  max-height: 760px;
  overflow: auto;
  align-self: start;
}

.task-item {
  width: 100%;
  text-align: left;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #111a33;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.task-item strong {
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.task-item.active {
  border-color: #6d28d9;
  background: #171f43;
}

.task-item span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-detail {
  min-width: 0;
}

.task-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #101934;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.kpi strong {
  font-size: 16px;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font-size: 13px;
}

.task-table th {
  color: #c4b5fd;
}

@media (max-width: 980px) {
  .task-panel {
    grid-template-columns: 1fr;
  }

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

  .orch-card-wide {
    grid-column: span 2;
  }
}

.task {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #0f1730;
}

.task h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 780;
  color: #f5d0fe;
}

.task-hero {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.task-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.share-wrap {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 8px;
}

.share-bar {
  height: 6px;
  border-radius: 999px;
  background: #233152;
  overflow: hidden;
}

.share-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed 0%, #22c55e 100%);
}

.timeline {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #2a3760;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  z-index: 1;
}

.timeline-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101a34;
  padding: 8px 10px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.stage {
  font-weight: 600;
  color: #c4b5fd;
}

.project {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #0f1730;
}

.project h3 {
  margin: 0 0 8px;
}

.ux-block {
  margin-top: 14px;
}

.ux-block h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #c4b5fd;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.result-card {
  border: 1px solid #2f3b61;
  border-radius: 10px;
  background: linear-gradient(180deg, #111d3a 0%, #0f1830 100%);
  padding: 10px;
}

.result-card strong {
  display: block;
  font-size: 13px;
  margin: 2px 0 4px;
}

.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.result-badge {
  display: inline-block;
  font-size: 10px;
  border: 1px solid #4c1d95;
  color: #ddd6fe;
  background: #2e1065;
  border-radius: 999px;
  padding: 2px 7px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.checklist li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #2c3658;
  border-radius: 10px;
  padding: 8px 10px;
  background: #101a33;
}

.check-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
}

.check-dot.done {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.checklist strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.checklist p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.shell-footer {
  max-width: 1160px;
  margin: 0 auto 30px;
  padding: 0 20px;
  color: var(--muted);
}
