:root {
  --bg: #f2efe8;
  --bg-strong: #e7e0d4;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #fffdf8;
  --surface-dark: #1f2937;
  --text: #1d1b18;
  --muted: #6f6a61;
  --line: rgba(29, 27, 24, 0.12);
  --primary: #c4562c;
  --accent: #0f766e;
  --glow: rgba(196, 86, 44, 0.18);
  --success: #15803d;
  --warn: #ca8a04;
  --danger: #b91c1c;
  --shadow: 0 20px 60px rgba(44, 32, 12, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(196, 86, 44, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.1), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #f7f4ed 100%);
}

button,
select,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.72);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 12px 32px var(--glow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
}

.brand-lockup h1,
.topbar h2,
.hero-card h3,
.panel h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.tenant-picker {
  margin-bottom: 22px;
}

.tenant-picker label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tenant-picker select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
}

.nav-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.sidebar-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.sidebar-card-accent {
  background: linear-gradient(180deg, rgba(196, 86, 44, 0.12), rgba(255, 255, 255, 0.7));
}

.sidebar-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.domain-chip,
.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.domain-chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.main-panel {
  padding: 28px;
}

.topbar,
.panel-head,
.task-row,
.agent-row,
.project-row,
.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-pill,
.badge,
.ghost-link {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.badge-soft {
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
}

.pulse {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(15, 118, 110, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
  }
}

.hero-card,
.panel {
  border-radius: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 22px;
}

.hero-copy {
  margin: 10px 0 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.mini-stat {
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(231, 224, 212, 0.44));
  border: 1px solid var(--line);
}

.mini-stat strong,
.kpi-card strong,
.agent-card strong,
.project-card strong,
.analytics-bar strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  margin-bottom: 6px;
}

.mini-stat span,
.kpi-card span,
.agent-card p,
.project-card p,
.analytics-bar span {
  color: var(--muted);
  font-size: 14px;
}

.kpi-grid,
.agent-grid,
.project-board,
.chart-stack {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.kpi-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.content-grid {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

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

.panel {
  padding: 20px;
}

.task-list,
.project-list,
.activity-list,
.agent-table {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.task-row,
.agent-row,
.project-row,
.activity-row,
.kanban-column,
.project-card,
.agent-card,
.analytics-bar,
.brand-preview {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
}

.task-row,
.agent-row,
.project-row,
.activity-row {
  padding: 16px;
}

.task-meta,
.activity-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-todo {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}

.status-in-progress {
  background: rgba(202, 138, 4, 0.12);
  color: var(--warn);
}

.status-done,
.status-live {
  background: rgba(21, 128, 61, 0.1);
  color: var(--success);
}

.status-building,
.status-review {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
}

.metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.agent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.agent-card,
.project-card,
.analytics-bar,
.brand-preview {
  padding: 18px;
}

.agent-card ul,
.notes-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 27, 24, 0.08);
  margin-top: 10px;
}

.progress-fill,
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.kanban-column {
  padding: 16px;
}

.kanban-column h4 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
}

.kanban-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.kanban-column .stack {
  display: grid;
  gap: 10px;
}

.agent-table {
  margin-top: 18px;
}

.line-chart {
  width: 100%;
  height: auto;
  margin-top: 14px;
}

.line-grid,
.line-path {
  fill: none;
}

.line-grid {
  stroke: rgba(29, 27, 24, 0.08);
  stroke-width: 1;
}

.line-path {
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-area {
  fill: rgba(196, 86, 44, 0.12);
}

.analytics-bar {
  display: grid;
  gap: 10px;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(29, 27, 24, 0.08);
}

.brand-preview {
  display: grid;
  gap: 14px;
}

.token-row span {
  color: var(--muted);
  font-weight: 700;
}

.token-swatch {
  width: 120px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.brand-domain {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 800;
  text-align: center;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

@media (max-width: 1120px) {
  .app-shell,
  .hero-card,
  .two-up {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 760px) {
  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .kpi-grid,
  .agent-grid,
  .kanban {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head,
  .task-row,
  .agent-row,
  .project-row,
  .token-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .sync-pill,
  .ghost-link {
    width: 100%;
    text-align: center;
  }
}
