.occupancy-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.viewer-days {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin-bottom: 2px;
  scrollbar-width: thin;
}
.viewer-days button {
  flex: 0 0 auto;
  min-width: 92px;
  background: #e5f0ec;
  color: #16483e;
  white-space: nowrap;
}
.viewer-days button.active { background: #0e6758; color: #fff; }
.occupancy-legend span { display: inline-flex; align-items: center; gap: 7px; }
.occupancy-legend i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #bfd0ca; }
.legend-free { background: #fff; }
.legend-web { background: #e3ebe8; }
.legend-local { background: #d9f2e8; }
.occupancy-wrap { max-height: 68vh; }
.occupancy-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  background: #fff;
}
.occupancy-matrix th,
.occupancy-matrix td {
  border-right: 1px solid #dce7e3;
  border-bottom: 1px solid #dce7e3;
  padding: 9px;
  min-width: 112px;
  max-width: 160px;
  text-align: center;
  vertical-align: middle;
}
.occupancy-matrix thead th { position: sticky; top: 0; background: #edf5f2; z-index: 3; }
.occupancy-matrix th:first-child { position: sticky; left: 0; z-index: 2; background: #edf5f2; min-width: 125px; }
.occupancy-matrix thead th:first-child { z-index: 4; }
.occupancy-matrix th small { display: block; margin-top: 4px; font-weight: 500; color: #587069; white-space: normal; }
.occupancy-matrix td span { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.occupancy-free { background: #fff; color: #587069; }
.occupancy-select {
  width: 100%;
  min-height: 54px;
  padding: 7px;
  border-radius: 9px;
  background: transparent;
  color: #0e6758;
}
.occupancy-select:hover,
.occupancy-select:focus-visible { background: #e7f6ef; }
.occupancy-select small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 600; }
.occupancy-web { background: #e3ebe8; color: #31584f; font-weight: 700; }
.occupancy-local { background: #d9f2e8; color: #0b5b4d; font-weight: 750; }
.settings-group { border: 1px solid #d4e1dc; border-radius: 16px; padding: 18px; margin: 0 0 18px; }
.settings-group legend { padding: 0 7px; font-weight: 800; font-size: 1.1rem; }
.settings-group > label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
.inline-check { width: 22px; min-height: 22px; flex: 0 0 auto; }
.monitor-shell { min-height: 100vh; padding: clamp(18px, 3vw, 42px); background: #edf4f1; }
.monitor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 22px; }
.monitor-header h1 { margin-bottom: 0; }
.monitor-status { display: grid; justify-items: end; gap: 4px; text-align: right; }
.monitor-status strong { font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1; }
.monitor-status span { color: #4c655e; }
.monitor-status button { margin-top: 10px; }
.monitor-results { min-height: 60vh; }
.monitor-table-wrap { max-height: calc(100vh - 190px); background: #fff; }
.monitor-matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; background: #fff; }
.monitor-matrix th,.monitor-matrix td { min-width: 145px; max-width: 220px; padding: 14px; border-right: 1px solid #d8e5e0; border-bottom: 1px solid #d8e5e0; text-align: center; }
.monitor-matrix thead th { position: sticky; top: 0; z-index: 3; background: #dfece7; }
.monitor-matrix th:first-child { position: sticky; left: 0; z-index: 2; min-width: 130px; background: #edf5f2; }
.monitor-matrix thead th:first-child { z-index: 4; }
.monitor-matrix th small,.monitor-booking span { display: block; margin-top: 5px; font-size: .8rem; font-weight: 500; }
.monitor-free { color: #a1b2ac; }
.monitor-booking.future { background: #e4f3ed; color: #16483e; }
.monitor-booking.current { background: #0e6758; color: #fff; box-shadow: inset 0 0 0 3px #ffd166; }
.monitor-booking.past { background: #eef2f0; color: #6a7c76; }
.monitor-day-cell { padding: 7px !important; vertical-align: top; background: #f8fbfa; }
.monitor-booking-item { display: grid; gap: 3px; padding: 10px; margin: 0 0 7px; border-radius: 10px; text-align: left; }
.monitor-booking-item:last-child { margin-bottom: 0; }
.monitor-booking-item time { font-weight: 850; }
.monitor-booking-item span { font-size: .8rem; }
.monitor-booking-item.future { background: #e4f3ed; color: #16483e; }
.monitor-booking-item.current { background: #0e6758; color: #fff; box-shadow: inset 0 0 0 3px #ffd166; }
.current-row > th:first-child { box-shadow: inset 5px 0 #ffd166; }
.monitor-empty { min-height: 50vh; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: #fff; border: 1px solid #d6e2dd; border-radius: 24px; }
.monitor-empty strong { font-size: clamp(2rem, 6vw, 4rem); }
@media (max-width: 820px) {
  .viewer-days button { min-width: 84px; }
  .occupancy-matrix th, .occupancy-matrix td { min-width: 96px; padding: 8px 6px; }
  .occupancy-matrix th:first-child { min-width: 105px; }
  .monitor-header { display: grid; }
  .monitor-status { justify-items: start; text-align: left; }
  .monitor-matrix th,.monitor-matrix td { min-width: 112px; padding: 10px 8px; }
}
