:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-strong: #eef3ef;
  --ink: #17211c;
  --muted: #66736c;
  --line: #d9e0dc;
  --accent: #236b52;
  --accent-strong: #164b3a;
  --warning: #a25222;
  --danger: #b42318;
  --review: #7250a5;
  --shadow: 0 18px 50px rgba(23, 33, 28, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: #17211c;
  color: #f7faf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #2e7a5f;
  color: #ffffff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p,
.source-panel p,
.eyebrow {
  margin: 0;
  color: var(--muted);
}

.brand p,
.source-panel p {
  color: #b7c6be;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  color: #dce7e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.source-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.source-panel h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.source-panel button,
.ask-form button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.source-panel button {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 34px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.date-chip {
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.summary-grid,
.content-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-bottom: 16px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 36px;
}

.metric.urgent strong {
  color: var(--danger);
}

.metric.review strong {
  color: var(--review);
}

.content-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  margin-bottom: 16px;
}

.lower-grid {
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

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

.recommendation,
.task-item,
.person-item,
.answer-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.recommendation {
  padding: 14px;
}

.recommendation strong,
.task-item strong,
.person-item strong {
  display: block;
  margin-bottom: 5px;
}

.recommendation p,
.task-item p,
.person-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.task-item,
.person-item {
  padding: 12px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag.danger {
  color: var(--danger);
}

.tag.warning {
  color: var(--warning);
}

.tag.review {
  color: var(--review);
}

.ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  margin-bottom: 12px;
}

.ask-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
}

.ask-form button {
  min-height: 44px;
}

.answer-box {
  min-height: 136px;
  padding: 14px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.connection-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pipeline-grid div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.pipeline-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pipeline-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.empty-state {
  color: var(--muted);
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

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

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 28px;
  }

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

  .ask-form {
    grid-template-columns: 1fr;
  }
}
