:root { --pico-font-size: 15px; --pico-spacing: 0.75rem; }
.topbar { border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; }
.topbar nav { padding: 0 1rem; }
.topbar .brand { color: var(--pico-color); }
.topbar form { margin: 0; }
.small, button.small, [role=button].small { font-size: 0.85rem; padding: 0.3rem 0.7rem; }
.muted { color: var(--pico-muted-color); }
.narrow { max-width: 28rem; margin: 2rem auto; }
.flash { padding: 0.6rem 1rem; border-radius: 6px; background: #e8f4fd; }
.flash.error { background: #fdecea; }
.flash.success { background: #e8f5e9; }
.layout-sidebar { display: grid; grid-template-columns: 16rem 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .layout-sidebar { grid-template-columns: 1fr; } }
.sidebar label { font-size: 0.85rem; margin-bottom: 0.4rem; }
.sidebar select, .sidebar input { font-size: 0.85rem; padding: 0.35rem 0.5rem; margin-bottom: 0.5rem; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; color: #fff; font-size: 0.8rem; white-space: nowrap; }
.chip { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 4px; background: var(--pico-muted-border-color); font-size: 0.8rem; margin: 0 0.2rem 0.2rem 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.8rem; }
.legend span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.3rem; background: var(--c); vertical-align: middle; }
.event-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.actions form { margin: 0; }
dl.meta { display: grid; grid-template-columns: 9rem 1fr; gap: 0.3rem 1rem; }
dl.meta dt { color: var(--pico-muted-color); font-weight: normal; }
dl.meta dd { margin: 0; }
.report-body { border-left: 3px solid var(--pico-muted-border-color); padding-left: 1rem; }
.report-body strong, .report-body b { background: #fff3bf; }
trix-toolbar .trix-button-group--file-tools { display: none; }
trix-editor { min-height: 18rem; background: #fff; }
.fc { font-size: 0.85rem; }
.fc .fc-button { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.fc-event { cursor: pointer; }
/* Calendar side panel (opens beside the calendar; stacks below it on phones) */
.calendar-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.calendar-wrap.has-panel { grid-template-columns: minmax(0, 1fr) 22rem; }
.event-panel { position: sticky; top: 1rem; }
.panel-card { margin: 0; padding: 1rem; font-size: 0.9rem; }
.panel-card dl.meta { grid-template-columns: 6rem 1fr; }
.panel-card .event-head { flex-wrap: nowrap; }
.panel-close { margin: 0; padding: 0.1rem 0.55rem; line-height: 1.2; flex: none; width: auto; }
@media (max-width: 800px) {
  .calendar-wrap.has-panel { grid-template-columns: 1fr; }
  .event-panel { position: static; }
}
table.compact td, table.compact th { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.errorlist { color: #c62828; font-size: 0.85rem; list-style: none; padding: 0; }
/* Tom Select inside Pico: undo Pico's input sizing on the inner search box */
.ts-wrapper { margin-bottom: var(--pico-spacing); }
.ts-wrapper .ts-control { min-height: 2.6rem; padding: 0.3rem 0.5rem; border-radius: var(--pico-border-radius); border-color: var(--pico-form-element-border-color); background: var(--pico-form-element-background-color); }
.ts-wrapper .ts-control > input { margin: 0 !important; padding: 0 !important; height: auto !important; min-height: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; font-size: inherit; }
.ts-wrapper.multi .ts-control > .item { padding: 0.05rem 0.4rem; border-radius: 4px; }
.ts-dropdown { font-size: 0.9rem; }
.sidebar .ts-wrapper .ts-control { min-height: 2.1rem; font-size: 0.85rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fc .fc-toolbar { flex-wrap: wrap; gap: 0.4rem; }
.fc .fc-toolbar-title { font-size: 1.1rem; }
@media (max-width: 800px) {
  dl.meta { grid-template-columns: 1fr; gap: 0 }
  dl.meta dt { margin-top: 0.5rem; }
  .topbar nav { flex-wrap: wrap; }
  .topbar nav ul { flex-wrap: wrap; }
  .topbar .user-menu { width: 100%; justify-content: flex-end; padding-bottom: 0.3rem; }
  .fc .fc-toolbar.fc-header-toolbar { flex-direction: column; align-items: stretch; }
  .fc .fc-toolbar-chunk { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: center; }
  .fc .fc-button { padding: 0.2rem 0.45rem; font-size: 0.8rem; }
  .grid { grid-template-columns: 1fr; }
}
.filter-box > summary { display: none; }
@media (max-width: 800px) {
  .filter-box > summary { display: list-item; cursor: pointer; font-weight: 600; margin-bottom: 0.5rem; }
}
/* Reports area */
.report-menu ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0; margin: 0 0 0.5rem; list-style: none; font-size: 0.9rem; }
.report-menu a[aria-current] { font-weight: 600; text-decoration: underline; }
.report-controls { margin-bottom: 0.5rem; }
.report-controls .actions { align-items: end; }
.report-controls label.inline { display: inline-flex; flex-direction: column; margin: 0; font-size: 0.85rem; }
.report-controls label.inline input, .report-controls label.inline select { margin: 0; font-size: 0.85rem; padding: 0.3rem 0.5rem; width: auto; }
.report-controls label.inline:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 0.3rem; }
.report-cards article { margin: 0; }
.report-group h3 { font-size: 1.05rem; margin: 1rem 0 0.25rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.15rem 0; }
.report-table { max-width: 40rem; }
.report-table .num { text-align: right; }
.report-table .bar-col { width: 40%; }
.report-table .bar { display: block; height: 0.9rem; background: #1e88e5; border-radius: 2px; }
@media print {
  .topbar, footer, .no-print, .report-menu, .actions, details, .flash { display: none !important; }
  main.container-fluid { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
.report-controls button, .report-controls [role=button] { width: auto; margin: 0; }
.send-form { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.send-form button { width: auto; margin: 0; }
.quick-search { margin: 0; }
.quick-search input { margin: 0; padding: 0.25rem 0.6rem; font-size: 0.85rem; width: 11rem; height: auto; }
.filters-active { background: #fff3bf; }
@media print { aside, .legend, .fc-header-toolbar .fc-button-group, .fc-header-toolbar .fc-jumpTo-button, .fc-header-toolbar .fc-today-button, .fc-header-toolbar .fc-prev-button, .fc-header-toolbar .fc-next-button { display: none !important; } .layout-sidebar { display: block; } }
.flash.warn { background: #fff3bf; }
.badge.count { background: #e53935; padding: 0 0.45rem; font-size: 0.75rem; }
.inline-report { margin-top: 0.3rem; }
.inline-report .report-body { max-height: 20rem; overflow: auto; margin-top: 0.3rem; }
.preview-banner { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; padding: 0.5rem 1rem; background: #fff8e1; border-bottom: 1px solid #ffe082; }
.preview-banner[hidden] { display: none; }
.preview-banner button { margin: 0 0 0 auto; }
.help-page { max-width: 46rem; }
.account-menu { margin: 0; }
.account-menu > summary { padding: 0.3rem 0.5rem; font-size: 0.9rem; }
.account-menu > ul { min-width: 11rem; }
.account-menu > ul li { white-space: nowrap; }
.account-menu button { width: auto; margin: 0; }
