* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e6eaf2;
  --text: #171b26;
  --muted: #667085;
  --border: rgba(23, 27, 38, 0.08);
  --capsule-border: rgba(255, 255, 255, 0.5);
  --shadow: 0 16px 40px rgba(23, 27, 38, 0.08);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --success: #2450a4;
  --warning: #e8b21a;
  --danger: #e65a66;
  --danger-highlight: #e65a66;
  --disabled: #b9bfcb;
  --sidebar: #12172a;
  --sidebar-2: #19203a;
  --sidebar-text: #f6f7fb;
  --day-width: 72px;
  --unit-width: 220px;
  --row-height: 84px;
  --radius: 18px;
  --speed: 240ms;
  --button-highlight: #02020223;
  --paid-button-highlight: #70b5ff;
  --disabled-button-highlight: #000;
  --disabled-button-highlight-text: #000;
  --field-bg: #dddddd60;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #131a2e;
  --surface-2: #171f37;
  --surface-3: #1e2845;
  --text: #ecf1ff;
  --muted: #9aa6c4;
  --border: rgba(236, 241, 255, 0.08);
  --capsule-border: rgba(23, 27, 38, 0.884);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --accent: #7c79ff;
  --accent-soft: rgba(124, 121, 255, 0.18);
  --success: #2c5fc3;
  --warning: #d6a21a;
  --danger: #e96c76;
  --disabled: #6f778e;
  --sidebar: #0d1324;
  --sidebar-2: #131a2e;
  --sidebar-text: #f4f7ff;
  --button-highlight: #ffffff23;
  --paid-button-highlight: #fff;
  --disabled-button-highlight: #fff;
  --disabled-button-highlight-text: #fff;
  --field-bg: #00000060;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea,
table {
  font: inherit;
}

button {
  cursor: pointer;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  flex: 0 0 300px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-text);
  padding: 20px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transform: translateX(0);
  transition: transform var(--speed) ease;
  box-shadow: var(--shadow);
}

.sidebar.is-collapsed {
  transform: translateX(-100%);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}


.brand-mark img{
  width: 52px;
  height: 52px;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1rem;
}

.brand p {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.66);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  transition: background var(--speed) ease, transform var(--speed) ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-anchor {
  display: block;
}

.main-content {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 300px;
  padding: 22px 22px 28px;
  transition: margin-left var(--speed) ease;
}

.main-content.is-full {
  margin-left: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  position: relative;
  z-index: 100;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.topbar-left {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-right {
  flex: 0 0 auto;
  padding-top: 2px;
}

.topbar-left,
.topbar-right,
.title-block,
.title-row-calendar-controls,
.year-picker-wrap,
.month-picker-wrap {
  position: relative;
}

.title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.icon-button,
.toggle-button,
.sort-button,
.search-clear {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 25rem;
  transition: transform var(--speed) ease, background var(--speed) ease, border-color var(--speed) ease;
}

.icon-button:hover,
.toggle-button:hover,
.sort-button:hover,
.search-clear:hover {
  background: var(--button-highlight);
}

.icon-button {
  width: 44px;
  height: 44px;
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.toggle-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
  pointer-events: none;
}

.toggle-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.search-row {
  display:flex;
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
}

.search-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: min(720px, 100%);
  padding: 0 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-icon {
  color: var(--muted);
  font-size: 1rem;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field:focus-within {
  border-color: var(--accent);
}

.search-clear {
  width: 32px;
  height: 32px;
  padding: 0;
}

.content-section {
  display: none;
  min-height: calc(100vh - 110px);
}

.content-section.is-active {
  display: block;
}

.board-shell,
.list-table-wrap,
.module-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.board-shell {
  overflow: hidden;
}

.timeline-grid {
  overflow: auto;
  max-height: calc(100vh - 210px);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(180deg, transparent, transparent) border-box;
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-template-columns: var(--unit-width) repeat(var(--day-count), var(--day-width));
  min-width: calc(var(--unit-width) + (var(--day-count) * var(--day-width)));
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.corner-cell {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 7;
  justify-content: flex-start;
  padding: 14px 18px;
  font-weight: 600;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.corner-cell,
.day-cell,
.unit-cell,
.timeline-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.corner-cell,
.day-cell {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-cell {
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}

.day-cell .weekday {
  color: var(--muted);
  font-size: 0.74rem;
}

.day-cell.is-other-month,
.timeline-cell.is-other-month {
  background: var(--surface-2);
}

.day-cell.is-today {
  background: var(--accent-soft);
}

.timeline-row {
  min-height: var(--row-height);
  position: relative;
}

.unit-cell {
  padding: 12px 16px;
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.unit-cell small {
  color: var(--muted);
  font-weight: 500;
}

.timeline-track {
  position: absolute;
  inset: 20px 0 10px var(--unit-width);
  pointer-events: none;
  display: flex;
  container-type: inline-size;
}

.timeline-cell {
  min-height: var(--row-height);
}

.booking-pill {
  position: absolute;
  height: 44px;
  top: 0;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: #ffffff;
  pointer-events: auto;
  box-shadow: 0 12px 24px rgba(23, 27, 38, 0.12);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
  font-size: clamp(0.5rem, 0.8cqi, 0.95rem);
  min-width: 0;
  overflow: hidden;
}

.booking-pill:hover {
  box-shadow: 0 14px 30px rgba(23, 27, 38, 0.18);
}

.booking-pill span:last-child {
  white-space: nowrap;
}

.booking-pill.paid {
  background: var(--success);
}

.booking-pill.pending {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.booking-pill.pending:hover {
  background: var(--danger-highlight);
  color: #ffffff;
}

.booking-pill.paid:hover {
  background: var(--paid-button-highlight);
  color: #000;
}

.booking-pill.disabled:hover {
  filter: brightness(1.35);
  color: var(--disabled-button-highlight);
  border: 1px solid var(--disabled-button-highlight-text);
}

.booking-pill.disabled {
  background: repeating-linear-gradient(-45deg,
    rgba(140, 146, 161, 0.2) 0px,
    rgba(140, 146, 161, 0.2) 8px,
    rgba(140, 146, 161, 0.32) 8px,
    rgba(140, 146, 161, 0.32) 16px);
  color: var(--muted);
  border: 1px solid rgba(140, 146, 161, 0.4);
}

.status-icon {
  font-size: 1rem;
  margin-right: 1rem;
  padding: 0 0.45rem;
  border: 1px solid currentColor;
  border-radius: 25rem;
}

.list-table-wrap {
  padding: 12px;
  overflow: auto;
  max-height: calc(100vh - 210px);
}

.booking-table {
  width: 100%;
  border-collapse: collapse;
}

.booking-table th {
  background: var(--surface-2);
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.booking-table th,
.booking-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

#bookingTableBody tr:hover,
#clientsTableBody tr:hover {
  background: var(--button-highlight);
  cursor: pointer;
}

.sort-button {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 0;
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sort-indicator {
  display: inline-block;
  min-width: 1ch;
  color: var(--text);
}

.sort-button[data-active="true"] {
  color: var(--text);
  font-weight: 600;
}

.table-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #ffffff;
  border: 0;
}

.table-pill.paid {
  background: var(--success);
}

.table-pill.pending {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.table-pill.disabled {
  background: repeating-linear-gradient(-45deg,
    rgba(140, 146, 161, 0.2) 0px,
    rgba(140, 146, 161, 0.2) 8px,
    rgba(140, 146, 161, 0.32) 8px,
    rgba(140, 146, 161, 0.32) 16px);
  color: var(--muted);
  border: 1px solid rgba(140, 146, 161, 0.4);
}

.module-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
}

.stat-module {
  min-height: 180px;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  flex: 1 1 280px;
  min-width: 280px;
}

.occupancy-module {
  min-width: 25%;
}

.stay-lengths-module {
  min-width: 25%;
}

.popular-units-module {
  min-width: 25%;
}

.client-activity-module {
  min-width: 300px;
}

.costings-module {
  min-width: 420px;
}

.module-lg {
  min-width: min(100%, 640px);
}

.module-md {
  min-width: min(100%, 360px);
}

.module-sm {
  min-width: min(100%, 280px);
}

.booking-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.booking-modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(1260px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-header h3,
.modal-header p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.detail-panel {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.detail-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  word-break: break-word;
}

.link-box {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--speed) ease, visibility var(--speed) ease;
  z-index: 30;
}

.backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.title-row-calendar-controls {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-right: 12px;
}

.year-picker-wrap,
.month-picker-wrap {
  position: relative;
  margin: 0;
}

.title-button.title-month-button,
.title-button.title-year-button {
  padding: 0.5rem 1.2rem;
  border-radius: 25rem;
  color: var(--text);
}

.title-month-button:hover,
.title-button.title-year-button:hover {
  background: var(--button-highlight);
}

.year-picker-wrap {
  z-index: 2;
  flex: 0 0 auto;
}

.title-button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  line-height: 1;
}

.title-year-button {
  font-size: 1.2rem;
  color: var(--muted);
}

.title-month-button {
  font-size: 1.7rem;
  font-weight: 700;
}

.title-button:hover {
  opacity: 0.8;
}

.title-select {
  position: absolute;
  inset: 100% auto auto 0;
  min-width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

.title-select.is-open {
  display: block;
}

.month-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1;
}

.month-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.calendar-view {
  display: flex;
  flex-direction: column;
}

.calendar-zoom-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.calendar-zoom-wrap input[type="range"] {
  width: min(360px, 100%);
}

.calendar-view[hidden],
.list-view[hidden],
.calendar-view.is-hidden,
.list-view.is-hidden {
  display: none !important;
}

.is-list-view .calendar-control {
  display: none;
}

.is-list-view #searchRow {
  margin-top: 0;
}

.is-clients-section .title-row-calendar-controls,
.is-clients-section .view-toggle {
  display: none;
}

.is-clients-section #searchRow {
  margin-top: 0;
}

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

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

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

  .title-row-calendar-controls {
    position: static;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-right: 0;
  }

  .month-nav {
    position: static;
    left: auto;
    transform: none;
    justify-content: flex-start;
    width: 100%;
  }

  .search-row,
  .is-list-view #searchRow {
    width: 100%;
  }

  .timeline-grid,
  .list-table-wrap {
    max-height: calc(100vh - 280px);
  }
}

#themeToggle{
  margin-top: 0.45rem;
}

.main-content.is-clients-section .calendar-control,
.main-content.is-clients-section .view-toggle {
  display: none;
}

.main-content.is-clients-section #searchRow {
  margin-top: 0;
}


.is-dashboard-section .title-row-calendar-controls,
.is-dashboard-section .view-toggle,
.is-dashboard-section #searchRow,
.is-stats-section .title-row-calendar-controls,
.is-stats-section .view-toggle,
.is-stats-section #searchRow {
  display: none;
}

.dashboard-grid {
  align-items: stretch;
}

.dashboard-module {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-module h3,
.dashboard-module p,
.dashboard-module ul {
  margin: 0;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.module-value {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
}

.module-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-chart {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 220px;
  height: 100%;
}

.dashboard-chart.compact {
  min-height: 180px;
}

.chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.chart-bar-wrap {
  width: 100%;
  min-height: 140px;
  display: flex;
  align-items: end;
}

.chart-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, var(--accent), rgba(79, 70, 229, 0.45));
  position: relative;
  overflow: hidden;
}

.chart-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
}

.chart-bar.is-warning {
  background: linear-gradient(180deg, var(--warning), rgba(232, 178, 26, 0.5));
}

.chart-bar.is-muted {
  background: linear-gradient(180deg, var(--muted), rgba(102, 112, 133, 0.4));
}

.chart-value {
  font-size: 0.82rem;
  font-weight: 600;
}

.chart-label {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 1rem;
}

.rank-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
}

.rank-label {
  min-width: 0;
  font-weight: 600;
}

.rank-subtext {
  color: var(--muted);
  font-size: 0.82rem;
}

.rank-value {
  white-space: nowrap;
  font-weight: 600;
}

.rank-track {
  grid-column: 1 / -1;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), rgba(79, 70, 229, 0.45));
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.snapshot-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.snapshot-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.snapshot-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.dashboard-empty {
  color: var(--muted);
  padding: 10px 0 0;
}

@media (max-width: 720px) {
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}


.occupancy-module {
  flex: 1 1 420px;
  min-width: min(100%, 420px);
}

.occupancy-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.occupancy-donut-wrap {
  position: relative;
  flex: 0 1 300px;
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}

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

.occupancy-donut-track,
.occupancy-donut-segment {
  transition: stroke-dasharray var(--speed) ease, stroke-dashoffset var(--speed) ease;
}

.occupancy-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.occupancy-donut-value {
  font-size: clamp(1rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1;
}

.occupancy-donut-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.occupancy-legend {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.occupancy-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.occupancy-legend-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.occupancy-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.occupancy-legend-name {
  font-weight: 600;
  min-width: 0;
}

.occupancy-legend-values {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.occupancy-legend-values span:last-child {
  color: var(--muted);
  min-width: 52px;
  text-align: right;
}

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

  .occupancy-donut-wrap {
    width: min(100%, 260px);
  }

  .occupancy-legend-values {
    gap: 8px;
  }
}


.client-modal-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.contacts-panel {
  min-width: 0;
}

.contacts-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 220px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
  min-height: 100%;
}

.contact-list-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
}

.contact-list-item:hover {
  background: var(--button-highlight);
}

.contact-list-item.is-active {
  background: var(--surface-3);
}

.contact-list-empty {
  color: var(--muted);
  padding: 6px 8px;
}

.contact-detail-list {
  grid-template-columns: 70px 1fr;
  gap: 10px 12px;
  margin: 0;
  min-width: 0;
}

.contact-detail-list dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 700px) {
  .client-modal-grid {
    grid-template-columns: 1fr;
  }

  .contacts-layout {
    grid-template-columns: 1fr;
  }

  .contacts-list {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
