/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.filter-group label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

select {
  font-family: inherit;
  font-size: .875rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}

select:focus { border-color: var(--primary); }

.btn {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  align-self: flex-end;
}

.btn:hover { background: var(--primary-h); }

/* ── Content grid ────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* ── Blue header (shared by both summary tables) ─────────── */
#locationSummaryTable thead th,
#table thead th {
  background: var(--primary);
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: .8rem;
}

/* ── Location Summary table ──────────────────────────────── */
#locationSummaryTable thead th {
  text-align: center;
}

#locationSummaryTable thead th:first-child {
  text-align: left;
  min-width: 160px;
}

#locationSummaryTable tbody td {
  text-align: center;
}

#locationSummaryTable tbody td:first-child {
  text-align: left;
  font-weight: 500;
}

#locationSummaryTable tbody td.zero {
  color: #d1d5db;
}

#locationSummaryTable tr.summary-total td {
  background: #fefce8;
  border-top: 2px solid var(--border);
  font-weight: 700;
  color: var(--text);
}

/* ── Sortable headers (both tables) ──────────────────────── */
#locationSummaryTable thead th[data-field],
#table thead th[data-field] {
  cursor: pointer;
  user-select: none;
}

#locationSummaryTable thead th[data-field]::after,
#table thead th[data-field]::after {
  content: "⇅";
  margin-left: 6px;
  opacity: 0.35;
  font-size: .65rem;
}

#locationSummaryTable thead th.sort-asc::after,
#table thead th.sort-asc::after  { content: "↑"; opacity: 1; }

#locationSummaryTable thead th.sort-desc::after,
#table thead th.sort-desc::after { content: "↓"; opacity: 1; }

/* ── Clickable rows ──────────────────────────────────────── */
#locationSummaryTable tbody tr.clickable-row,
#table tbody tr.clickable-row {
  cursor: pointer;
}

#locationSummaryTable tbody tr.clickable-row:hover,
#table tbody tr.clickable-row:hover {
  background: #ede9fe;
}

/* ── Count pill ──────────────────────────────────────────── */
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  background: #ede9fe;
  color: var(--primary);
}

/* ── Charts column (right-hand stack) ────────────────────── */
.charts-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Chart card ──────────────────────────────────────────── */
.chart-inner {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas { max-width: 100%; }
