:root {
  color: #17211b;
  background: #f5f7f4;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 {
  font-size: 20px;
  font-weight: 700;
}

.subtitle {
  margin-top: 4px;
  color: #5f6f66;
  font-size: 14px;
}

.status {
  color: #5f6f66;
  font-size: 14px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid #dce4dc;
}

.tab-button {
  min-width: 120px;
  height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #5f6f66;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab-button.active {
  color: #1f5138;
  border-bottom-color: #2f6f4e;
}

.tab-page {
  display: none;
}

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

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

.card {
  min-height: 104px;
  padding: 16px;
  border: 1px solid #dce4dc;
  border-radius: 8px;
  background: #ffffff;
}

.label {
  margin-bottom: 8px;
  color: #5f6f66;
  font-size: 13px;
}

.value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.value-time {
  font-size: 20px;
}

.chart-grid {
  display: grid;
  gap: 16px;
}

.chart-panel {
  border: 1px solid #dce4dc;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-note {
  margin-top: 4px;
  color: #5f6f66;
  font-size: 13px;
}

.range-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce4dc;
  border-radius: 8px;
  background: #f5f7f4;
}

.range-button {
  min-width: 76px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: #34453b;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.range-button.active {
  color: #ffffff;
  background: #2f6f4e;
}

.chart {
  width: 100%;
  height: 460px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e8eee8;
  text-align: left;
}

th {
  color: #5f6f66;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 820px) {
  header,
  .chart-toolbar {
    align-items: start;
    flex-direction: column;
  }

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

  .status {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab-button {
    min-width: 112px;
  }

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

  .range-switch {
    width: 100%;
  }

  .range-button {
    min-width: 0;
  }

  .chart {
    height: 360px;
  }
}
