:root {
  --blue: #0072ce;
  --red: #ab2328;
  --gray: #54585a;
  --light-blue: #89b5d8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--gray); background: #f6f8fa; }

.brand-header { background: var(--blue); color: #fff; padding: 20px 32px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand-logo { display: flex; flex-direction: column; }
.logo-mark { font-size: 34px; font-weight: 800; letter-spacing: 2px; }
.logo-sub { font-size: 12px; opacity: 0.85; }
.brand-header h1 { margin: 0; font-size: 26px; font-weight: 600; }
.brand-stripe { height: 6px; background: var(--red); }

.office-filter { display: flex; gap: 10px; padding: 20px 32px 0; flex-wrap: wrap; }
.filter-btn { text-decoration: none; color: var(--gray); background: #fff; border: 2px solid var(--light-blue); border-radius: 999px; padding: 8px 22px; font-size: 17px; font-weight: 600; }
.filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

main { padding: 12px 32px 48px; }
.office-title { font-size: 26px; color: var(--blue); border-bottom: 3px solid var(--light-blue); padding-bottom: 6px; margin: 28px 0 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.kpi-card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); cursor: default; }
.kpi-card[data-chart] { cursor: pointer; }
.metric-name { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.value-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.metric-value { font-size: 44px; font-weight: 800; color: var(--blue); line-height: 1; }
.delta { font-size: 19px; font-weight: 700; }
.delta.good { color: #1a7f37; }
.delta.bad { color: var(--red); }
.delta.neutral { color: var(--gray); }
.period-label { margin-top: 8px; font-size: 14px; color: var(--light-blue); font-weight: 600; }
.list-values { margin: 0; padding-left: 20px; font-size: 19px; font-weight: 600; color: var(--blue); }
.chart-wrap { margin-top: 14px; }
.chart-hint { margin-top: 10px; font-size: 12px; color: #9aa0a6; }
.empty-state { font-size: 18px; padding: 40px; }

/* forms */
.form-page { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }
.form-card { background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.form-card h2 { margin-top: 0; color: var(--blue); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .meta { font-size: 13px; color: #888; }
.field input[type=text], .field input[type=number], .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; }
button, .btn { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 12px 26px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
button.danger { background: var(--red); }
.flash { background: #e8f4e8; border: 1px solid #1a7f37; color: #1a7f37; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }

/* admin */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background: var(--blue); color: #fff; }
.superseded { opacity: 0.45; text-decoration: line-through; }
.missing-list li { margin-bottom: 6px; }
.correct-form { display: flex; gap: 6px; align-items: center; }
.correct-form input { padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; width: 110px; }
.correct-form button { padding: 7px 12px; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.seed { background: #fff3cd; color: #7a5b00; }
.badge.form { background: #e2effa; color: var(--blue); }
.badge.admin { background: #f6e2e3; color: var(--red); }
.badge.slack { background: #e8e8e8; color: var(--gray); }

/* History view */
.site-header nav a { color: #fff; text-decoration: none; font-weight: 600; }
.filter-bar { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin: 16px 0; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #54585a; font-weight: 600; }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid #c8ccce; border-radius: 6px; }
.filter-bar button { padding: 8px 18px; background: #0072ce; color: #fff; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
.muted { color: #54585a; font-size: 0.85rem; }
.history-block { background: #fff; border-radius: 10px; padding: 20px 24px; margin: 16px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.history-block h2 { font-size: 1.05rem; margin: 0 0 12px; color: #54585a; }
.history-block .office-tag { color: #0072ce; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 8px; }
.history-chart { max-width: 900px; height: 260px; }
.history-chart canvas { max-height: 260px; }
