/* Backoffice — bouwt voort op de tokens in style.css */
:root { --chart-1: #b06f35; --chart-2: #305fa6; --grid: rgba(0, 0, 0, 0.07); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --chart-1: #bb7d40; --chart-2: #4386ea; --grid: rgba(255, 255, 255, 0.08); }
}

body.bo { min-height: 100%; height: auto; }
.bo-app { min-height: 100vh; display: flex; flex-direction: column; }
.bo-brand { display: flex; align-items: center; gap: 10px; }
.bo-tag { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.bo-month input { width: auto; padding: 7px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel-2); color: inherit; font: inherit; }
.bo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bo-inline-btn { width: auto; text-decoration: none; }
a.btn { text-decoration: none; color: inherit; }

.bo-nav { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--border); background: var(--panel); overflow-x: auto; }
.bo-nav button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.bo-nav button.active { color: var(--text); border-bottom-color: var(--accent); }
.bo-nav .ico { width: 16px; height: 16px; }

.bo-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.bo-main section { display: flex; flex-direction: column; gap: 16px; }
.bo-main section[hidden] { display: none; }
.bo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-title { font-size: 22px; font-weight: 900; text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.bo-spacer { flex: 1; }
.bo-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }
.bo-back .ico { width: 14px; height: 14px; }
.bo-search input { width: 280px; max-width: 100%; }

/* stat-tegels */
.bo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.bo-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; }
.bo-tile .label { font-size: 12px; color: var(--muted); font-weight: 700; }
.bo-tile .value { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bo-tile .sub { font-size: 12px; color: var(--muted); }

/* grafieken */
.bo-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.bo-chart-card h3 { margin: 0; font-size: 15px; font-weight: 900; }
.bo-chart-card p { margin: 2px 0 10px; }
.bo-chart { position: relative; width: 100%; }
.bo-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bo-chart .axis { font: 12px Lato, system-ui, sans-serif; fill: var(--muted); }
.bo-chart .gridline { stroke: var(--grid); stroke-width: 1; }
.bo-chart .baseline { stroke: var(--border); stroke-width: 1; }
.bo-chart .bar { transition: opacity .1s; }
.bo-chart .hit { fill: transparent; cursor: default; outline: none; }
.bo-chart .hit:hover + .bar, .bo-chart .hit:focus + .bar { opacity: .75; }
.bo-chart .empty { font-size: 13px; fill: var(--muted); }
.bo-tooltip { position: fixed; z-index: 20; pointer-events: none; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 12px; min-width: 120px; }
.bo-tooltip .tt-value { font-size: 16px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.bo-tooltip .tt-key { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }
.bo-tooltip .tt-label { color: var(--muted); }

.bo-table-toggle summary { cursor: pointer; font-weight: 700; }
.bo-table-toggle .table-wrap { margin-top: 10px; max-height: 360px; overflow: auto; }
.table-card { padding: 4px 8px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel-2); }
.table .org-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.table .sub { display: block; font-size: 11px; color: var(--muted); }
.roles { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.bo-subtitle { font-size: 14px; font-weight: 900; margin: 8px 8px 4px; }

/* moderatie en blokkeren */
.bo-feed-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bo-feed-post { padding: 14px 16px; }
.bo-feed-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bo-feed-meta strong { color: var(--text); }
.bo-feed-title { margin: 8px 0 0; font-weight: 700; }
.bo-feed-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bo-feed-comments { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.bo-feed-comment { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.bo-feed-comment p { margin: 0; flex: 1; overflow-wrap: anywhere; }
.bo-feed-actions { display: flex; gap: 8px; margin-top: 12px; }
.bo-feed-actions .btn { width: auto; margin: 0; }
.danger-link { color: #e5484d; }
.bo-block-dialog { width: min(420px, calc(100vw - 32px)); }
.bo-block-durations { border: 0; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.bo-block-durations legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.bo-block-durations label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.bo-block-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.bo-block-actions .btn { width: auto; margin: 0; }
.bo-feed-imgs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bo-feed-imgs img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.bo-org-plan { padding: 14px 16px; margin-bottom: 14px; }
.bo-plan-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bo-plan-row select { width: auto; margin: 0; }
.bo-plan-row .btn { width: auto; margin: 0; }
.bo-org-plan p { margin: 8px 0 0; }

/* panden */
.bo-inline-form { display: flex; gap: 8px; align-items: center; }
.bo-inline-form input { width: 240px; }
.bo-buildings { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.bo-building { display: flex; flex-direction: column; gap: 12px; }
.bo-building-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-building-name { font: 800 17px Lato, system-ui, sans-serif; border: 1px solid transparent; background: transparent; color: var(--text); padding: 4px 8px; border-radius: 8px; width: 320px; max-width: 100%; flex: 0 1 320px; }
.bo-building-name:hover, .bo-building-name:focus { border-color: var(--border); background: var(--panel-2); }
.bo-building-linkrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border-radius: 12px; background: var(--panel-2); }
.bo-building-link { flex: 1; min-width: 220px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.bo-building-orgs { display: flex; flex-direction: column; }
.bo-building-org { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px; border-top: 1px solid var(--border); }
.bo-building-org .org-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bo-building-org .bo-org-link { font-weight: 700; color: var(--text); text-decoration: none; }
.bo-building-org .bo-org-link:hover { text-decoration: underline; }
.bo-building-org select { width: auto; padding: 5px 8px; font-size: 13px; }
@media (max-width: 640px) { .bo-inline-form { width: 100%; } .bo-inline-form input { flex: 1; width: auto; } }

/* telefoon: bovenbalk netjes laten omslaan, formulieren onder elkaar */
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar .topbar-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; flex: 1 1 100%; }
  .topbar .topbar-actions .btn { padding: 6px 10px; font-size: 13px; }
  .bo-main { padding-left: 12px; padding-right: 12px; }
  .bo-inline-form { flex-wrap: wrap; width: 100%; }
  .bo-inline-form input, .bo-inline-form .btn { flex: 1 1 100%; width: 100%; }
  .bo-building-name { flex: 1 1 100%; width: 100%; }
  .bo-building-org select { flex: 1 1 100%; width: 100%; }
}
@media (max-width: 800px) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}
