:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #17202a;
  --muted: #637083;
  --line: #dbe3eb;
  --accent: #1f8a70;
  --accent-2: #2962ff;
  --warn: #b85c00;
  --shadow: 0 18px 60px rgba(31, 45, 61, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.authShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.authCard {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.authCard h1 {
  margin-bottom: 12px;
  font-size: 30px;
}

.authText {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.loginForm {
  display: grid;
  gap: 12px;
}

.loginForm label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.loginForm input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.loginForm button {
  border: 0;
  border-radius: var(--radius);
  padding: 13px 16px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.loginError {
  min-height: 20px;
  color: #b42318;
  font-size: 13px;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

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

.topActions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.sourcePicker {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sourcePicker select {
  width: min(360px, 42vw);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
}

.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 750;
  line-height: 1.08;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 18px;
}

p {
  margin: 0;
}

.refresh {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.refresh:hover {
  border-color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

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

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

.metric strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1;
}

.todayAction {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  margin-bottom: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid rgba(31, 138, 112, 0.32);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.todayAction h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.todayAction p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.todayAction b {
  color: var(--text);
}

.todaySide {
  display: grid;
  gap: 10px;
  align-content: start;
}

.todaySide .chip {
  justify-self: start;
}

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

.stage {
  position: relative;
  min-height: 184px;
  padding: 18px;
}

.stageIndex {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.stage h2 {
  margin-bottom: 10px;
}

.stage p,
.item p,
.postRow span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stage.accent {
  border-color: rgba(31, 138, 112, 0.4);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-bottom: 14px;
}

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

.panel {
  min-height: 280px;
  padding: 18px;
}

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

.chip {
  align-self: start;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 170px;
  padding: 12px;
  background: linear-gradient(180deg, #f8fbff, #eef4f7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.bar {
  flex: 1;
  min-width: 10px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--accent), #7cc7ac);
}

.emptyChart {
  align-self: center;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.deltas span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdff;
}

.item h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.table {
  display: grid;
  gap: 8px;
}

.postRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.postRow:last-child {
  border-bottom: 0;
}

.postRow strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.postMeta {
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 920px) {
  .summary,
  .todayAction,
  .pipeline,
  .grid,
  .grid.lower {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }

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

  .topActions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .sourcePicker select {
    width: 100%;
  }
}
