:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #627184;
  --line: #d8dee8;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --blue: #2f5f9f;
  --blue-dark: #244a7c;
  --green: #2f7d58;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef2f6;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  align-self: end;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.secondary-button:hover {
  background: var(--soft);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: 560px;
}

#syncStatus {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
}

main {
  padding: 20px 24px 32px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.data-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 16px;
}

.data-status span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.summary article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary article {
  padding: 16px;
}

.summary span,
.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.two-column {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

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

.bar-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: var(--green);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
}

.num {
  text-align: right;
  white-space: nowrap;
}

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

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  #syncStatus {
    text-align: left;
  }

  .filters,
  .summary,
  .two-column {
    grid-template-columns: 1fr;
  }
}
