:root {
  --bg: #eef4ff;
  --bg-secondary: #e3ecff;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --panel-border: rgba(20, 40, 120, 0.08);
  --text: #dbe6ff;
  --text-dark: #1a2b4c;
  --text-secondary: #5f6f91;
  --muted: #8c9bb8;
  --accent: #4a78ff;
  --accent-strong: #0f2a66;
  --accent-strong-hover: #173a85;
  --ok: #1fbf75;
  --ok-bg: #e8f9f0;
  --warn: #f2b705;
  --warn-bg: #fff6db;
  --danger: #e5484d;
  --danger-bg: #ffe9ea;
  --shadow: 0 18px 42px rgba(39, 74, 168, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text-dark);
  background:
    radial-gradient(circle at top left, rgba(74, 120, 255, 0.18), transparent 26%),
    radial-gradient(circle at right, rgba(74, 120, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #f4f8ff 0%, var(--bg) 48%, #eaf2ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 32px 24px;
  background:
    linear-gradient(180deg, #123071 0%, var(--accent-strong) 54%, #0b2255 100%);
  color: var(--text);
  position: sticky;
  top: 0;
  min-height: 100vh;
}

.brand-block h1,
.page-header h2,
.panel h3,
.metric-card strong,
.agent-card h3,
.task-row strong {
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow,
.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
}

.eyebrow {
  color: #8cb0ff;
}

.muted,
.sidebar .muted {
  color: var(--muted);
  line-height: 1.6;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin: 36px 0;
}

.nav-link {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  transform: translateX(4px);
  border-color: rgba(74, 120, 255, 0.65);
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-panel,
.panel,
.metric-card,
.agent-card {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.sidebar-panel {
  background: rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.sidebar-panel .sidebar-stat-item,
.sidebar-panel .health-row,
.sidebar-panel .deadline-item,
.sidebar-panel .timeline-item {
  color: var(--text-dark);
}

.sidebar-panel .sidebar-stat-item strong,
.sidebar-panel .sidebar-stat-item span,
.sidebar-panel .sidebar-stat-item .muted {
  color: inherit;
}

.sidebar-panel .sidebar-stat-item .muted {
  color: var(--text-secondary);
}

.priority-agent,
.sidebar-stats {
  display: grid;
  gap: 12px;
}

.main-panel {
  padding: 32px;
}

.page-header,
.panel-head,
.task-row,
.agent-meta,
.metric-spark,
.status-row,
.timeline-item,
.deadline-item,
.sidebar-stat-item,
.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-header {
  margin-bottom: 24px;
}

.header-badge,
.pill,
.chip,
.filter-chip,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.header-badge,
.pill,
.filter-chip {
  padding: 10px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
  color: var(--text-dark);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(31, 191, 117, 0.12);
}

.hero-grid,
.content-grid,
.agent-grid {
  display: grid;
  gap: 20px;
}

.snapshot-section {
  margin-bottom: 24px;
}

.snapshot-section .panel-head {
  margin-bottom: 16px;
}

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

.content-grid {
  grid-template-columns: 1.4fr 1fr;
  margin-bottom: 20px;
}

.overview-stack {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.lower-grid {
  grid-template-columns: 1fr;
}

.full-span-panel {
  width: 100%;
}

.slim-panel {
  margin-bottom: 20px;
}

.deadline-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.deadline-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  min-height: 132px;
}

.deadline-card strong {
  display: block;
  margin: 14px 0 10px;
  font-size: 1rem;
  line-height: 1.35;
}

.deadline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deadline-date {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--accent-strong);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.toggle-button:hover {
  background: var(--accent-strong-hover);
  border-color: var(--accent-strong-hover);
  transform: translateY(-1px);
}

.toggle-button .toggle-arrow {
  transition: transform 180ms ease;
}

.toggle-button.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.metric-card,
.panel,
.agent-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.metric-card {
  padding: 22px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 16px;
  font-size: 2rem;
  color: var(--text-dark);
}

.metric-spark span:last-child {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.trend-up {
  color: var(--ok);
}

.trend-warn {
  color: #ba8600;
}

.panel {
  padding: 24px;
}

.wide-panel {
  min-height: 320px;
}

.status-board,
.stack-list,
.health-grid,
.timeline,
.task-table {
  display: grid;
  gap: 14px;
}

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

.status-column {
  padding: 18px;
  background: linear-gradient(180deg, #183a84 0%, var(--accent-strong) 100%);
  color: #eff4ff;
  border-radius: 22px;
}

.status-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-column ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.status-column li,
.deadline-item,
.sidebar-stat-item,
.health-row {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
}

.status-column li {
  color: var(--text-dark);
}

.status-column li strong {
  color: var(--text-dark);
}

.status-column li .muted {
  color: var(--text-secondary);
}

.health-row {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.health-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  display: grid;
  gap: 14px;
}

.health-card-head,
.health-card-metrics {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.health-card-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.progress-meter {
  height: 8px;
  border-radius: 999px;
  background: #e4edff;
  overflow: hidden;
}

.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #7ea1ff 100%);
}

.health-row strong,
.deadline-item strong,
.agent-card h3,
.health-card strong {
  font-size: 1rem;
}

.deadline-item,
.health-row,
.task-row {
  align-items: flex-start;
}

.stack-list,
.timeline {
  margin-top: 4px;
}

.timeline {
  gap: 0;
}

.timeline-head,
.timeline-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 2fr 0.7fr;
  gap: 16px;
  align-items: center;
}

.timeline-head {
  padding: 0 4px 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-row {
  padding: 14px 4px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-dark);
}

.timeline-row span:last-child {
  color: var(--text-secondary);
  font-weight: 600;
}

.toolbar,
.filter-row,
.agent-card footer,
.task-table-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-input {
  width: min(320px, 100%);
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: #ffffff;
  color: var(--text-dark);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(20, 40, 120, 0.04);
}

.search-input:focus {
  outline: none;
  border-color: rgba(74, 120, 255, 0.55);
  box-shadow:
    0 0 0 4px rgba(74, 120, 255, 0.12),
    inset 0 1px 2px rgba(20, 40, 120, 0.04);
}

.filter-panel {
  margin-bottom: 20px;
}

.filter-chip {
  cursor: pointer;
  color: var(--text-secondary);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.filter-chip:hover {
  transform: translateY(-1px);
  background: #edf3ff;
  border-color: rgba(74, 120, 255, 0.24);
  color: var(--accent-strong);
}

.filter-chip.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

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

.agent-card {
  padding: 22px;
}

.agent-meta {
  margin: 14px 0 18px;
}

.agent-card footer {
  margin-top: 18px;
}

.chip {
  padding: 8px 12px;
  background: #edf3ff;
  border: 1px solid rgba(74, 120, 255, 0.12);
  color: var(--accent-strong);
}

.status-badge {
  padding: 7px 11px;
  font-weight: 600;
}

.status-badge.active,
.status-badge.completed {
  background: var(--ok-bg);
  color: #0f8d55;
}

.status-badge.monitoring,
.status-badge.in-progress {
  background: #e8efff;
  color: var(--accent);
}

.status-badge.at-risk,
.status-badge.blocked {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.queued {
  background: var(--warn-bg);
  color: #a06d00;
}

.task-table-head,
.task-row {
  padding: 0 6px;
}

.task-table-head {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-row {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--panel-border);
}

.task-row > div,
.task-table-head > span {
  flex: 1;
}

.task-row > div:first-child,
.task-table-head > span:first-child {
  flex: 1.5;
}

.task-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 8px;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 1120px) {
  .hero-grid,
  .deadline-cards,
  .health-grid,
  .status-board,
  .agent-grid,
  .content-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .main-panel {
    padding: 20px;
  }

  .page-header,
  .panel-head,
  .task-row,
  .agent-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-head,
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .task-row > div,
  .task-table-head > span {
    width: 100%;
  }
}
