* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  background: #ffffff;
}

.top-panel {
  background: #fdf6d3;
  border-bottom: 1px solid #d8c98a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: #3d3418;
}

.top-panel__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #3d3418;
}

.top-panel__user[hidden] {
  display: none;
}

.btn-link {
  border: 1px solid #d8c98a;
  background: #fffbe8;
  color: #3d3418;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.btn-link:hover {
  background: #f5eec3;
}

.login-screen {
  min-height: calc(100vh - 49px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-screen[hidden] {
  display: none;
}

.login-form {
  width: 100%;
  max-width: 320px;
  border: 1px solid #e0e0e0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1a1a1a;
}

.login-form__hint {
  margin: 0 0 8px 0;
  color: #666;
  font-size: 12px;
}

.login-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #333;
}

.login-form__field input {
  border: 1px solid #cfcfcf;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
}

.login-form__error {
  color: #a13a2f;
  font-size: 12px;
  margin: 0;
}

.btn-primary {
  background: #fdf6d3;
  border: 1px solid #d8c98a;
  color: #3d3418;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #f5eec3;
}

.workspace {
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #555;
  padding: 6px 4px 12px 4px;
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 16px;
}

.status-bar__sep {
  color: #bbb;
}

.status-bar__warning {
  color: #a13a2f;
  font-weight: 600;
}

.panel {
  margin-bottom: 20px;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.data-table th,
.data-table td {
  border: 1px solid #cfcfcf;
  padding: 4px 8px;
}

.data-table thead th {
  background: #f5eec3;
  font-weight: 600;
  text-align: center;
}

.data-table tbody th {
  text-align: left;
  font-weight: 400;
  background: #f7f7f7;
}

.data-table td {
  text-align: right;
  white-space: nowrap;
}

.data-table tbody tr.total-row th,
.data-table tbody tr.total-row td {
  font-weight: 700;
  background: #fbfaf2;
}

.chart-panel {
  border: 1px solid #e0e0e0;
  padding: 8px;
}

.chart-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chart-scroll {
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.chart-scroll svg {
  display: block;
}

.chart-legend {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px;
  font-size: 12px;
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-legend__swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.chart-legend__swatch--line {
  border-radius: 50%;
}

@media (max-width: 700px) {
  .chart-container {
    flex-direction: column;
  }

  .chart-legend {
    flex-direction: row;
    flex-wrap: wrap;
    align-self: flex-end;
  }
}
