:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color-scheme: dark;

  --bg: #11161b;
  --panel: #1b2229;
  --panel-2: #232c34;
  --line: #35414c;
  --text: #eef3f7;
  --muted: #9eabb6;
  --accent: #2d9cdb;
  --good: #43b77a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.page {
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  margin: 0 0 5px;
  font-size: 19px;
}

.subtle {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input[type="date"] {
  min-width: 170px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.secondary {
  background: var(--panel-2);
  color: var(--text);
}

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

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.metric span,
.summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 38px;
}

.metric-total {
  border-color: var(--accent);
}

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

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.summary-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.section-panel {
  margin-top: 12px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.empty {
  color: var(--muted);
  text-align: center !important;
  padding: 24px;
}

.status {
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status-neutral {
  color: var(--muted);
}

.status-good {
  color: var(--good);
  border-color: var(--good);
}

.status-bad {
  color: #ff7b7b;
  border-color: #ff7b7b;
}

.footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  padding: 11px 2px 0;
}

@media (max-width: 850px) {

  .page {
    padding: 14px;
  }

  .header {
    flex-direction: column;
  }

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

  .date-row {
    align-items: stretch;
  }

  .field {
    flex: 1 1 180px;
  }

  input[type="date"] {
    width: 100%;
  }

}

@media (max-width: 520px) {

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

  .date-row {
    flex-direction: column;
  }

  .field,
  .primary {
    width: 100%;
  }

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

}

.chart {
  height: 240px;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 20px 8px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.chart-group {
  min-width: 34px;
  flex: 1 0 34px;
  max-width: 60px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
}

.chart-bars {
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.chart-bar {
  width: 10px;
  min-height: 0;
  border-radius: 3px 3px 0 0;
}

.bar-in,
.in-box {
  background: #2d9cdb;
}

.bar-out,
.out-box {
  background: #43b77a;
}

.chart-group span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 18px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend-box {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 2px;
}

.total-row td {
  border-top: 2px solid var(--line);
  background: rgba(255,255,255,.025);
}

@media (max-width: 700px) {
  .chart {
    height: 210px;
  }

  .chart-bars {
    height: 160px;
  }
}
