:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e4e7ec;
  --blue: #2f7de1;
  --blue-soft: #eaf2fc;
  --green: #2d6a12;
  --red: #b42323;
  --amber: #8a5a0a;
  --green-soft: #eaf3de;
  --red-soft: #fceaea;
  --amber-soft: #faeeda;
  --shadow: 0 12px 28px rgba(23, 29, 27, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 18px 10px;
  overflow-y: auto;
}

.menu-group + .menu-group {
  margin-top: 18px;
}

.menu-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 8px;
  color: #748195;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.menu-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e4eaf2;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: #445268;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  text-align: left;
}

.menu-item:not(:disabled):hover {
  background: #edf2f8;
}

.menu-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.menu-item.active {
  background: #e3efff;
  color: #165eae;
  box-shadow: inset 3px 0 #2f7de1;
}

.menu-item.active:hover {
  background: #d8e9ff;
}

.menu-item.disabled {
  cursor: default;
  color: #929baa;
}

.menu-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-label {
  min-width: 0;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 180px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #cfe3fb;
  color: #1f5f9f;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
  line-height: 1.15;
}

.brand p,
.panel-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: grid;
  grid-template-columns: 1.1fr 0.85fr 0.85fr 1.4fr 96px;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

select,
.occupancy-filters input,
.export-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.occupancy-view {
  display: grid;
  gap: 14px;
  padding: 20px 18px 28px;
}

.occupancy-view[hidden] {
  display: none;
}

.occupancy-page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 0;
}

.occupancy-page-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.occupancy-page-heading h1,
.occupancy-page-heading p {
  margin: 0;
}

.occupancy-page-heading h1 {
  font-size: 21px;
  letter-spacing: -.02em;
}

.occupancy-page-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.occupancy-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 10px;
}

.occupancy-filter-badges,
.occupancy-summary-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  padding: 0 10px;
  background: #f7faff;
  color: #315b85;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-badge.is-range {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.occupancy-summary-actions {
  flex-wrap: nowrap;
}

.occupancy-summary-actions button {
  white-space: nowrap;
}

.occupancy-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
}

.occupancy-filters label {
  display: grid;
  min-width: 145px;
  gap: 5px;
}

.occupancy-filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.occupancy-filters input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.occupancy-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.occupancy-filters.report-builder {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  align-items: stretch;
  gap: 16px 18px;
  padding: 18px;
  background: #fff;
  border-radius: 10px;
}

.report-builder-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px 11px;
}

.report-builder-heading > div {
  display: grid;
  gap: 3px;
}

.report-builder-eyebrow,
.report-builder-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.report-builder-heading strong {
  font-size: 14px;
}

.filter-panel-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.filter-step {
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 4px 6px;
  background: transparent;
}

.filter-step legend,
.filter-step-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  padding: 0;
  color: #4d5551;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter-step legend > span,
.filter-step-title > b {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: #1f5f9f;
  font-size: 10px;
}

.filter-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.report-builder .filter-choice {
  position: relative;
  display: block;
  min-width: 0;
}

.filter-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  opacity: 0;
}

.filter-choice span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: #5f6863;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.filter-choice input:checked + span {
  border-color: #7fb1df;
  background: var(--blue-soft);
  color: #1f5f9f;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 204, .08);
}

.filter-choice input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.report-builder .filter-select-step {
  display: grid;
  min-width: 0;
  gap: 0;
}

.filter-select-step select {
  align-self: end;
  min-height: 34px;
}

.report-builder .period-count-step {
  grid-template-columns: max-content minmax(110px, 1fr);
  align-items: center;
  gap: 10px;
}

.period-count-step .filter-step-title {
  margin-bottom: 0;
  white-space: nowrap;
}

.period-count-step select {
  align-self: center;
}

.filter-step > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.report-builder .filter-custom-date {
  grid-column: 3;
  display: grid;
  min-width: 0;
  gap: 5px;
}

.report-builder .occupancy-filter-actions {
  grid-column: 4;
  align-items: end;
  justify-content: flex-end;
  margin-left: 0;
}

.report-builder .occupancy-filter-actions .primary-button {
  min-width: 128px;
}

.occupancy-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.occupancy-kpi {
  position: relative;
  display: grid;
  min-height: 112px;
  align-content: center;
  gap: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px 14px 18px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 41, 55, .035);
}

.occupancy-kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
  content: "";
}

.occupancy-kpi.is-green::before { background: #75a94b; }
.occupancy-kpi.is-amber::before { background: #d5a73c; }
.occupancy-kpi.is-red::before { background: #d66b6b; }

.occupancy-kpi > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.occupancy-kpi strong {
  color: var(--ink);
  font-size: 25px;
  letter-spacing: -.035em;
}

.occupancy-kpi small {
  color: #8b94a1;
  font-size: 11px;
  font-weight: 700;
}

.occupancy-chart-panel {
  display: grid;
  gap: 16px;
  border-radius: 10px;
  padding: 16px;
}

.occupancy-chart-toolbar,
.occupancy-chart-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.occupancy-chart-toolbar h2,
.occupancy-chart-toolbar p,
.occupancy-chart-heading h3,
.occupancy-chart-heading p,
.occupancy-chart-selection {
  margin: 0;
}

.occupancy-chart-toolbar h2 {
  font-size: 16px;
}

.occupancy-chart-toolbar p,
.occupancy-chart-heading p,
.occupancy-chart-selection {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.occupancy-chart-legend,
.occupancy-chart-scopes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.occupancy-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.occupancy-chart-legend i {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--blue);
}

.occupancy-chart-legend i.is-previous {
  background: repeating-linear-gradient(90deg, #8b94a1 0 4px, transparent 4px 7px);
}

.chart-scope-button {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: #fff;
  color: #55606e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.chart-scope-button:hover {
  border-color: #a9c7eb;
  background: #f7faff;
}

.chart-scope-button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.occupancy-chart-stack {
  display: grid;
  gap: 22px;
}

.occupancy-chart-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.occupancy-chart-block + .occupancy-chart-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.occupancy-chart-heading h3 {
  font-size: 14px;
}

.occupancy-chart-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.occupancy-chart-value strong {
  font-size: 20px;
}

.occupancy-chart-value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.occupancy-svg-chart {
  min-height: 230px;
}

.occupancy-svg-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-label,
.chart-period-label,
.chart-pickup-label {
  fill: #7b8490;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.chart-pickup-label {
  fill: #334155;
  font-weight: 900;
}

.chart-previous-line,
.chart-current-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-previous-line {
  stroke: #8b94a1;
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.chart-current-line {
  stroke: var(--blue);
  stroke-width: 3;
}

.chart-pickup-stem {
  stroke: #75a94b;
  stroke-width: 2;
  opacity: .78;
}

.chart-previous-dot {
  fill: #8b94a1;
}

.chart-current-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.occupancy-chart-selection {
  min-height: 18px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

@media (max-width: 1240px) {
  .occupancy-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .occupancy-filters.report-builder {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .report-builder .filter-custom-date {
    grid-column: 1;
  }

  .report-builder .occupancy-filter-actions {
    grid-column: 2;
  }
}

.primary-button,
.text-button {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid #1f69ad;
  background: var(--blue);
  color: #fff;
}

.text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
}

.snapshot-panel {
  display: grid;
  padding: 12px;
}

.snapshot-history-details {
  padding: 0;
}

.snapshot-history-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.snapshot-history-details summary span {
  margin-left: 4px;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--blue-soft);
  color: #1f5f9f;
  font-size: 10px;
}

.snapshot-history {
  display: grid;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.snapshot-history-row {
  display: grid;
  grid-template-columns: 10px minmax(130px, 1.2fr) minmax(75px, .7fr) minmax(50px, .6fr) minmax(125px, 1fr) minmax(70px, .7fr);
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  color: #4d5551;
  font-size: 11px;
  font-weight: 700;
}

.snapshot-history-row:last-child {
  border-bottom: 0;
}

.snapshot-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d29b23;
}

.snapshot-state.is-completed {
  background: var(--green);
}

.snapshot-state.is-failed {
  background: var(--red);
}

.snapshot-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.occupancy-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.occupancy-metrics .metric-card strong {
  font-size: 20px;
}

.occupancy-chart {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.occupancy-chart-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(220px, 1fr) 58px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
}

.occupancy-chart-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occupancy-chart-bars {
  display: grid;
  gap: 4px;
}

.occupancy-chart-bar {
  min-width: 2px;
  height: 8px;
  border-radius: 999px;
  background: #b8c0c8;
}

.occupancy-chart-bar.current {
  background: var(--blue);
}

.occupancy-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.occupancy-legend span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #b8c0c8;
}

.occupancy-legend span.current {
  margin-left: 6px;
  background: var(--blue);
}

.occupancy-table {
  width: max-content;
  min-width: 100%;
  margin-top: 12px;
}

.occupancy-table tbody tr[data-hotel-id] {
  cursor: pointer;
}

.occupancy-table tbody tr.is-total {
  background: #f3f7fb;
  font-weight: 900;
}

.occ-positive {
  color: var(--green);
  font-weight: 900;
}

.occ-negative {
  color: var(--red);
  font-weight: 900;
}

.occ-muted {
  color: var(--muted);
}

.occupancy-matrix-wrap {
  max-height: calc(100vh - 245px);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.occupancy-table-panel {
  border-radius: 10px;
  padding: 16px;
}

.occupancy-matrix-heading {
  align-items: center;
}

.occupancy-heat-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.occupancy-heat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.occupancy-heat-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.heat-cell {
  display: inline-flex;
  min-width: 64px;
  min-height: 28px;
  align-items: center;
  justify-content: flex-end;
  border-radius: 6px;
  padding: 0 8px;
  font-weight: 900;
}

.heat-low { background: var(--red-soft); color: var(--red); }
.heat-mid { background: var(--amber-soft); color: var(--amber); }
.heat-high { background: var(--green-soft); color: var(--green); }

.occupancy-table th,
.occupancy-table td {
  padding: 8px 12px;
}

.occupancy-table thead th {
  z-index: 4;
  height: 54px;
  border-bottom: 2px solid #cfd6d2;
  background: #f7f9fc;
}

.occupancy-table .entity-column {
  left: 0;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.occupancy-table .metric-column {
  left: 210px;
  width: 165px;
  min-width: 165px;
  max-width: 165px;
  border-right: 1px solid var(--line);
}

.occupancy-table thead .entity-column,
.occupancy-table thead .metric-column {
  z-index: 6;
}

.occupancy-table tbody .entity-column,
.occupancy-table tbody .metric-column {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.occupancy-table .entity-cell {
  border-right: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}

.occupancy-table .entity-cell button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.occupancy-table .disclosure {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #b9c7d2;
  border-radius: 5px;
  color: var(--blue);
  font-size: 15px;
  line-height: 1;
}

.occupancy-table .level-hotel {
  padding-left: 26px;
  background: #f8fafc;
}

.occupancy-table .level-room {
  padding-left: 58px;
  background: #fbfcfc;
}

.occupancy-table .room-label {
  display: block;
  color: #4d5551;
  font-size: 12px;
  font-weight: 800;
}

.occupancy-table .timeline-column {
  min-width: 142px;
  text-align: right;
}

.occupancy-table .timeline-column span,
.occupancy-table .timeline-column small {
  display: block;
}

.occupancy-table .timeline-column small {
  margin-top: 3px;
  color: #929a96;
  font-size: 10px;
  font-weight: 700;
}

.occupancy-table tr.entity-start > * {
  border-top: 2px solid #d7ddda;
}

.occupancy-table tr.matrix-total > * {
  background: #f0f5fc;
  font-weight: 900;
}

.occupancy-table tr.metric-currentOccupancy > .metric-column {
  color: var(--blue);
}

.occupancy-table tr.matrix-hotel > .metric-column {
  background: #f8fafc;
}

.occupancy-table tr.matrix-room > .metric-column {
  background: #fbfcfc;
}

select {
  width: 100%;
  min-width: 0;
  padding: 0 26px 0 10px;
  text-overflow: ellipsis;
}

#facility-filter,
#manufacturer-filter {
  min-width: 0;
}

.export-button {
  padding: 0 8px;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 16px 0;
}

.metric-card,
.panel {
  border: 1px solid #e4e7e5;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 86px;
  padding: 14px 12px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  font-size: 16px;
  line-height: 1.25;
}

#chart-period {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  align-items: end;
  gap: 14px;
  min-height: 156px;
  margin-top: 18px;
}

.bar-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-value {
  font-size: 13px;
  font-weight: 900;
}

.bar {
  width: min(44px, 100%);
  min-height: 16px;
  border: 1px solid var(--blue);
  border-radius: 5px;
  background: var(--blue-soft);
}

.bar-label {
  max-width: 88px;
  overflow: hidden;
  color: #4d5551;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  margin-top: 12px;
  overflow: auto;
}

.report-table-wrap {
  max-height: 360px;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
}

table.monthly-table {
  min-width: 0;
  table-layout: fixed;
}

table.monthly-table th:first-child,
table.monthly-table td:first-child {
  width: 34%;
}

table.monthly-table th,
table.monthly-table td {
  padding-right: 8px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
}

th.numeric .sort-button {
  justify-content: flex-end;
  text-align: right;
}

.sort-indicator {
  display: inline-block;
  min-width: 10px;
  color: var(--blue);
  font-size: 12px;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #d8f1dd;
  color: #226a31;
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.settings-table {
  min-width: 0;
}

.settings-table td {
  padding: 0;
}

.setting-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 14px 0;
  color: var(--ink);
  font-weight: 900;
}

.setting-row input {
  margin-top: 2px;
}

.setting-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.positive-change {
  color: var(--red);
  font-weight: 900;
}

.negative-change {
  color: var(--green);
  font-weight: 900;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow-x: auto;
    padding: 12px;
  }

  .menu-group {
    flex: 0 0 210px;
    min-width: 210px;
  }

  .sidebar {
    display: flex;
    gap: 12px;
  }

  .menu-group + .menu-group {
    margin-top: 0;
  }

  .topbar,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .topbar {
    padding: 10px 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .occupancy-filters {
    flex-wrap: wrap;
  }

  .occupancy-filters.report-builder {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .report-builder .filter-custom-date {
    grid-column: 1;
  }

  .report-builder .occupancy-filter-actions {
    grid-column: 2;
  }

  .occupancy-filter-actions {
    margin-left: 0;
  }

  .occupancy-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .occupancy-filter-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .occupancy-summary-actions button {
    flex: 1;
  }

  .filter-badge.is-range {
    width: 100%;
    padding-left: 2px;
  }

  .occupancy-kpis {
    grid-template-columns: 1fr;
  }

  .occupancy-matrix-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .occupancy-chart-toolbar,
  .occupancy-chart-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .occupancy-chart-scopes .chart-scope-button {
    flex: 1 1 calc(50% - 8px);
  }

  .occupancy-svg-chart {
    min-height: 180px;
  }

  .topbar-actions,
  .topbar-actions select,
  .export-button {
    width: 100%;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .metric-grid,
  .occupancy-view {
    padding-left: 10px;
    padding-right: 10px;
  }

  .occupancy-filters label,
  .occupancy-filter-actions,
  .occupancy-filter-actions button {
    width: 100%;
  }

  .occupancy-filters.report-builder {
    grid-template-columns: 1fr;
  }

  .report-builder-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-builder .filter-custom-date,
  .report-builder .occupancy-filter-actions {
    grid-column: 1;
  }

  .occupancy-metrics {
    grid-template-columns: 1fr;
  }

  .occupancy-chart-row {
    grid-template-columns: 100px minmax(140px, 1fr) 48px;
  }

  .snapshot-history {
    overflow-x: auto;
  }

  .snapshot-history-row {
    min-width: 620px;
  }

  table {
    min-width: 580px;
  }
}
body.auth-pending .app-shell { visibility: hidden; }
.auth-status { display: none; position: fixed; inset: 0; z-index: 1000; place-items: center; background: #f4f6f8; color: #425466; font: 600 14px/1.5 Arial, sans-serif; }
body.auth-pending .auth-status { display: grid; }
body.auth-ready .auth-status { display: none; }
.auth-page { display: grid; min-height: 100vh; place-items: center; margin: 0; padding: 24px; background: #f4f6f8; font-family: Arial, sans-serif; }
.auth-card { width: min(420px, 100%); border: 1px solid #dce2e8; border-radius: 12px; padding: 28px; background: #fff; box-shadow: 0 12px 40px rgba(25, 39, 52, .08); text-align: center; }
.auth-card h1 { margin: 0 0 10px; color: #17202a; font-size: 24px; }.auth-card p { margin: 0; color: #657282; line-height: 1.55; }.auth-card a { display: inline-flex; margin-top: 20px; border-radius: 7px; padding: 10px 15px; background: #0f766e; color: #fff; text-decoration: none; }
