/* Charts page (charts.html). Loads after css/common.css. */

/* --- Differences from the shared rules ------------------------------------ */
.wrap { max-width: 1280px; }
.panel { padding: 20px 22px; }
/* The filter bar packs a lot in, so labels and controls run smaller here. */
label { font-size: 11.5px; margin: 0 0 5px; }
input, select { padding: 8px 11px; font-size: 13.5px; }
select { background-position: right 11px center; padding-right: 32px; }
button.primary { width: 100%; margin-top: 22px; }
.empty { text-align: center; padding: 40px 0; }

/* --- Filters -------------------------------------------------------------- */
.filters { margin-bottom: 20px; padding: 14px 20px; }
.filters-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.filters-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.filters-toggle:hover { color: var(--accent); }
.chev {
  display: inline-block;
  font-size: 11px;
  color: var(--ink-soft);
  transition: transform .15s ease;
}
.chev.open { transform: rotate(90deg); }
.filter-summary { font-size: 12.5px; color: var(--ink-soft); }
.filters-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.filter-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 16px;
}
button.apply {
  padding: 9px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.apply:hover { background: #17493f; }
button.reset {
  padding: 9px 16px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
}
button.reset:hover { border-color: #b9c1bc; color: var(--ink); }
.filter-note { font-size: 12.5px; color: var(--ink-soft); margin-left: auto; }

/* --- KPIs ----------------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.kpi-value {
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-top: 2px;
}
.kpi-value .unit { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-left: 3px; }

/* --- Chart grid ----------------------------------------------------------- */
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}
.chart-card { display: flex; flex-direction: column; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.capture-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 16px;
}

/* Chart visibility toggles */
.chart-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
}
.chart-toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.chart-toggles input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.chart-title { font-size: 14px; font-weight: 650; }
.chart-note { font-size: 12px; color: var(--ink-soft); }
.chart-body { position: relative; height: 280px; }
.chart-card.wide .chart-body { height: 320px; }

/* --- Login view ----------------------------------------------------------- */
/* The sign-in form keeps the larger controls the other pages use, rather than
   the compact sizing the filter bar needs. */
#login-view main { width: 100%; }
#login-view input { padding: 10px 12px; font-size: 14.5px; }
#login-view label { margin-top: 16px; font-size: 12.5px; }
#login-view label:first-of-type { margin-top: 0; }
