:root {
  color-scheme: light;
  --background: #f5f7f9;
  --text: #17202a;
  --muted: #647181;
  --line: #d9e1e8;
  --surface: #ffffff;
  --green: #16855f;
  --green-soft: #dff5ec;
  --red: #c13f3f;
  --red-soft: #fde7e7;
  --button: #1d6f63;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--button);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

.support-text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.refresh-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 18px;
  white-space: nowrap;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 280px);
  gap: 12px;
  margin-bottom: 18px;
}

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

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
}

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

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0 14px;
}

.tab-button.active {
  border-color: var(--button);
  background: var(--button);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.table-panel {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.table-header span {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.table-wrap {
  max-height: calc(100vh - 320px);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f9fbfc;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  font-weight: 700;
  padding: 0 12px;
}

.status-pill.compact {
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.status-pill.filled {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.missing {
  background: var(--red-soft);
  color: var(--red);
}

.subtle-value {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.date-column,
.status-cell {
  min-width: 118px;
  text-align: center;
}

.sticky-pivo {
  position: sticky;
  left: 0;
  min-width: 130px;
  background: #f9fbfc;
  z-index: 3;
}

.row-header {
  color: var(--text);
  font-size: 14px;
  text-transform: none;
}

tbody .sticky-pivo {
  background: var(--surface);
}

.loading-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 980px);
    padding: 20px 0;
  }

  .toolbar,
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    max-height: none;
  }

  th,
  td {
    padding: 13px 12px;
  }
}
