/* Global app header — shared by every page. */
.app-header {
  background: var(--pico-primary, #1095c1);
  padding: 1rem 0;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
/* .app-header-inner inherits Pico's responsive .container so its left edge
   lines up exactly with main.container on every page. We only layer flex
   layout on top. */
.app-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.app-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.app-brand-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}
.app-brand:hover { color: #fff; opacity: 0.85; }
.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
.app-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  line-height: 1;
  font-weight: 500;
}
.app-nav a:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.app-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
@media (max-width: 520px) {
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-nav { width: 100%; }
}

/* Page titles use the same brand blue as the header. */
main.container > h1 {
  color: var(--pico-primary, #1095c1);
}

/* Time cells stay on a single line so the table doesn't reflow awkwardly. */
time { white-space: nowrap; }

/* ── Shared across pages ── */
:root { --pico-font-size: 90%; }
table { font-size: 0.85rem; }

/* ── Sortable column headers ── */
thead a { color: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; }
thead a:hover, thead a:focus { color: inherit; text-decoration: none; }
.sort-ind { font-size: 0.75em; opacity: 0.6; }

/* ── Badges (dashboard) ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-available { background: #d4edda; color: #155724; }
.badge-occupied  { background: #f8d7da; color: #721c24; }
.badge-option    { background: #fff3cd; color: #856404; }
.badge-unavailable { background: #e2e3e5; color: #383d41; }

/* ── Sparklines (dashboard) ── */
.sparkline { width: 60px; height: 16px; vertical-align: middle; }
.sparkline path { fill: none; stroke: #4a7aef; stroke-width: 1.5; }
svg.sparkline-clickable { cursor: pointer; background: none; border: none; box-shadow: none; padding: 0; border-radius: 0; }
svg.sparkline-clickable:focus-visible { outline: 2px solid rgba(74, 122, 239, 0.6); outline-offset: 1px; }

/* ── Inquiry detail modal (dashboard) ── */
#inquiry-detail article { max-width: 720px; }
#inquiry-detail header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.detail-chart { position: relative; }
.detail-chart svg { width: 100%; height: auto; display: block; }
.detail-chart .axis   { stroke: var(--pico-muted-border-color, #ccc); stroke-width: 1; }
.detail-chart .grid   { stroke: var(--pico-muted-border-color, #e3e3e3); stroke-width: 1; stroke-dasharray: 3 3; }
.detail-chart .series { fill: none; stroke: #4a7aef; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.detail-chart .marker { fill: #4a7aef; }
.detail-chart .hit    { fill: transparent; cursor: pointer; }
.detail-chart .label  { fill: var(--pico-muted-color, #666); font-size: 11px; }
.chart-tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  background: rgba(20, 20, 20, 0.92); color: #fff;
  padding: 4px 8px; border-radius: 4px; font-size: 11px; line-height: 1.3;
  white-space: nowrap; pointer-events: none; z-index: 10;
}

/* ── Stat cards (stats) ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat-card { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 1rem; text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat-card .label { font-size: 0.8rem; color: var(--pico-muted-color); margin-top: 0.25rem; }
.breakdown { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breakdown-item { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 6px; padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.breakdown-item strong { margin-left: 0.3rem; }

/* ── Config page ── */
.grid-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ── Login page ── */
.login-wrap { max-width: 24rem; margin: 0 auto; }
