:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #ebe8df;
  --surface-3: #faf9f5;
  --text: #202124;
  --muted: #6a6f76;
  --line: #d8d4c8;
  --line-soft: #ece8dc;
  --lodgify: #2d7ff9;
  --apaleo: #15946b;
  --danger: #b4423a;
  --shadow: 0 18px 46px rgba(37, 42, 50, 0.12);
  --shadow-soft: 0 8px 24px rgba(37, 42, 50, 0.08);
  --focus: 0 0 0 3px rgba(45, 127, 249, 0.18);
  --day-width: 96px;
  --name-width: 240px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.app-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.is-auth-screen .app-header {
  display: none;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
}

.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 9px 14px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(31, 34, 38, 0.1);
}

main {
  padding: 22px 32px 42px;
}

.is-hidden {
  display: none !important;
}

.view.is-hidden {
  display: none;
}

.auth-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.calendar-controls-toggle {
  display: none;
}

.calendar-controls-panel {
  display: contents;
}

.calendar-manual-panel {
  max-width: 860px;
  margin-bottom: 16px;
}

.primary-button,
.icon-button,
.secondary-button {
  border: 1px solid #1f2328;
  background: #1f2328;
  color: #fff;
  border-radius: 7px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.primary-button:hover,
.icon-button:hover {
  background: #30343a;
  border-color: #30343a;
}

.secondary-button:hover,
.dropdown-button:hover,
.tab:hover {
  border-color: #bdb7aa;
  background: #fbfaf6;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
}

.select-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.filter-panel {
  position: relative;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
}

.dropdown-button::after {
  content: "⌄";
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow);
}

.dropdown-menu.is-hidden {
  display: none;
}

.dropdown-menu[hidden] {
  display: none !important;
}

.checkbox-actions {
  display: flex;
  gap: 8px;
}

.text-button {
  border: 0;
  background: transparent;
  color: #202124;
  padding: 0;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text);
  padding: 0 10px;
  text-transform: none;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-field input {
  margin: 0;
}

.input-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.select-field select,
.select-field input,
.input-field input,
.input-field select,
.input-field textarea {
  min-height: 40px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.input-field textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  line-height: 1.4;
}

.select-field select:hover,
.select-field input:hover,
.input-field input:hover,
.input-field select:hover,
.input-field textarea:hover {
  border-color: #bdb7aa;
}

.input-field input,
.input-field select,
.input-field textarea {
  width: 100%;
}

.range-label {
  margin-left: auto;
  color: var(--muted);
  font-weight: 650;
}

.calendar-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
}

.timeline-grid {
  display: grid;
  grid-template-columns: var(--name-width) max-content;
  min-width: 100%;
  width: max-content;
}

.empty-state {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px dashed #bdb7aa;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 700;
}

.timeline-name-spacer {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
  font-weight: 800;
}

.date-header {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--day-width);
  overflow: visible;
  border-bottom: 1px solid var(--line);
}

.date-cell {
  height: 32px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  border-right: 1px dashed #e2ded4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.date-cell.is-weekend {
  background: #f5f2ec;
}

.date-cell.is-today {
  background: #1f2328;
  color: #fff;
  font-weight: 800;
}

.timeline-rows {
  grid-column: 1 / -1;
}

.property-row {
  display: grid;
  grid-template-columns: var(--name-width) 1fr;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.property-row:hover .property-name,
.property-row:hover .day-slot {
  background-color: #fffdf8;
}

.property-row:hover .day-slot.is-weekend {
  background-color: #f7f3eb;
}

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

.property-name {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: #fbfaf7;
  font-weight: 800;
}

.property-rename-button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.property-rename-button:hover {
  border-color: #bdb7aa;
  color: var(--text);
}

.property-name img,
.property-image-placeholder {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #e5dfd3;
}

.property-name div:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.property-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  font-size: 12.5px;
  line-height: 1.18;
}

.property-name span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.row-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--day-width);
  min-height: 76px;
  overflow: visible;
}

.day-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 76px;
  padding: 6px 4px 10px;
  border-right: 1px dashed #e2ded4;
  background: #fff;
}

.day-slot.is-weekend {
  background: #f4f2ee;
}

.day-slot.is-today {
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px rgba(45, 127, 249, 0.18);
}

.booking-pill {
  position: absolute;
  top: 32px;
  z-index: 2;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 2px solid #30343a;
  border-radius: 999px;
  padding: 0 8px 0 7px;
  background: #fff;
  color: #25272a;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(32, 33, 36, 0.08);
}

.booking-pill:hover {
  background: #fbfaf6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(32, 33, 36, 0.14);
}

.booking-pill span,
.booking-guest {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-pill strong,
.booking-guests {
  flex: 0 0 auto;
  color: #555b62;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-pill.lodgify {
  border-color: #30343a;
}

.booking-pill.apaleo {
  border-color: #15946b;
}

.booking-pill.blocked {
  border-color: #454545;
  background: #454545;
  color: #fff;
}

.booking-pill.blocked:hover {
  background: #363636;
}

.booking-pill.is-past {
  border-color: #9aa0a6;
  background: #e5e7eb;
  color: #69707a;
  opacity: 0.58;
  box-shadow: none;
}

.booking-pill.is-past strong,
.booking-pill.is-past .booking-guests {
  color: #69707a;
}

.booking-pill.is-past:hover {
  background: #dfe3e8;
  opacity: 0.78;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  font-size: 30px;
  letter-spacing: 0;
}

.revenue-list {
  display: grid;
  gap: 10px;
}

.revenue-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(37, 42, 50, 0.04);
}

.source-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.source-badge.lodgify {
  background: var(--lodgify);
}

.source-badge.apaleo {
  background: var(--apaleo);
}

.source-badge.blocked {
  background: #454545;
}

.connection-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.connection-grid-single {
  grid-template-columns: minmax(320px, 760px);
}

.settings-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-panel h2,
.settings-section h3 {
  margin: 0;
}

.settings-panel h2 {
  font-size: 22px;
}

.settings-section h3 {
  font-size: 16px;
}

.panel-copy {
  margin: 0;
  max-width: 62ch;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-3);
}

.settings-section > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.status-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ece8df;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.is-connected {
  background: #ddf3e9;
  color: #11664c;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.booking-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  min-height: 40px;
  border: 1px solid #d14343;
  border-radius: 10px;
  background: #fff1f1;
  color: #b42318;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.danger-button:hover {
  background: #ffe3e3;
  border-color: #b42318;
}

.booking-edit-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
}

.booking-edit-form h3 {
  margin: 0;
}

.connection-message {
  min-height: 22px;
  margin: 0;
  font-weight: 800;
  line-height: 1.4;
}

.connection-message.success {
  color: #11664c;
}

.connection-message.error {
  color: var(--danger);
}

.connection-message.pending {
  color: var(--muted);
}

.booking-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.booking-dialog::backdrop {
  background: rgba(20, 24, 30, 0.42);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 24px;
}

.detail-content {
  display: grid;
  gap: 18px;
  padding: 30px;
}

.detail-content h2 {
  margin: 0;
  padding-right: 46px;
  font-size: 24px;
}

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

.booking-note-section {
  display: grid;
  gap: 10px;
}

.booking-note-section > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.booking-note-section > p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  line-height: 1.45;
  white-space: pre-wrap;
}

.detail-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-3);
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.notes {
  padding: 14px;
  border-left: 4px solid var(--danger);
  background: #fff7f6;
  border-radius: 7px;
  color: #4d2a27;
}

@media (max-width: 760px) {
  :root {
    --name-width: 156px;
    --day-width: 88px;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px 14px;
  }

  .header-actions {
    justify-items: stretch;
    gap: 8px;
  }

  h1 {
    font-size: 22px;
  }

  p {
    font-size: 14px;
  }

  .tabs {
    width: 100%;
    overflow: auto;
  }

  .tab {
    flex: 1 0 auto;
    padding: 10px 12px;
    white-space: nowrap;
  }

  main {
    padding: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: end;
    gap: 10px;
    padding: 10px;
  }

  .toolbar .select-field,
  .toolbar .filter-panel,
  .toolbar .range-label {
    grid-column: 1 / -1;
  }

  .primary-button,
  .secondary-button,
  .icon-button,
  .dropdown-button,
  .select-field select,
  .select-field input,
  .input-field input {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
    font-size: 24px;
  }

  .dropdown-button,
  .select-field select,
  .select-field input {
    width: 100%;
    min-width: 0;
  }

  .dropdown-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: min(420px, 70vh);
  }

  .range-label {
    margin-left: 0;
    width: 100%;
    font-size: 13px;
  }

  .summary-grid,
  .revenue-row,
  .detail-grid,
  .connection-grid {
    grid-template-columns: 1fr;
  }

  .property-name {
    gap: 8px;
    padding: 8px;
  }

  .property-name img,
  .property-image-placeholder {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .property-name strong {
    font-size: 11px;
    -webkit-line-clamp: 3;
  }

  .property-name span {
    font-size: 10px;
  }

  .timeline-name-spacer {
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .date-cell {
    height: 34px;
    font-size: 11px;
  }

  .row-track,
  .day-slot,
  .property-row {
    min-height: 88px;
  }

  .day-slot {
    padding: 8px 3px 10px;
  }

  .booking-pill {
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .booking-pill strong,
  .booking-guests {
    display: none;
  }

  .metric strong {
    font-size: 24px;
  }

  .revenue-row {
    gap: 6px;
    padding: 14px;
  }

  .settings-panel,
  .auth-panel,
  .detail-content {
    padding: 18px;
  }

  .auth-gate {
    align-items: start;
    min-height: 100svh;
    padding: 16px;
    padding-top: max(28px, env(safe-area-inset-top));
  }

  .auth-panel {
    width: 100%;
    gap: 16px;
    box-shadow: var(--shadow-soft);
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-section {
    padding: 14px;
  }

  .settings-section > div {
    align-items: start;
    flex-direction: column;
  }

  .booking-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }
}

@media (max-width: 420px) {
  :root {
    --name-width: 138px;
    --day-width: 76px;
  }

  .toolbar {
    grid-template-columns: 42px 1fr 42px;
  }

  .primary-button,
  .secondary-button {
    padding: 0 12px;
  }

  .property-name img,
  .property-image-placeholder {
    display: none;
  }

  .property-name strong {
    font-size: 10.5px;
  }

  .booking-pill {
    font-size: 11px;
  }
}

/* Modern visual refresh */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --surface-3: #f8fafc;
  --text: #18202f;
  --muted: #667085;
  --line: #d9e0ea;
  --line-soft: #e8edf4;
  --lodgify: #2563eb;
  --apaleo: #059669;
  --danger: #d14343;
  --accent: #0f766e;
  --accent-soft: #dff7f1;
  --warning-soft: #fff4d8;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.16);
  --shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.08);
  --focus: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 32rem),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.10), transparent 30rem),
    var(--bg);
}

.app-header {
  align-items: center;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(217, 224, 234, 0.88);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(16px);
}

.app-header h1 {
  font-size: 24px;
  font-weight: 850;
}

.app-header p {
  margin-top: 4px;
  color: #667085;
}

.auth-status {
  color: #475467;
}

.tabs {
  gap: 3px;
  border: 1px solid #d8dee8;
  background: #eef2f7;
  border-radius: 999px;
  padding: 4px;
}

.tab {
  border-radius: 999px;
  padding: 9px 16px;
}

.tab.is-active {
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.10);
}

main {
  padding: 24px 32px 42px;
}

.toolbar,
.calendar-shell,
.metric,
.revenue-row,
.settings-panel,
.auth-panel {
  border-color: rgba(217, 224, 234, 0.92);
  background: rgba(255, 255, 255, 0.92);
}

.toolbar {
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
}

.primary-button,
.icon-button,
.secondary-button,
.dropdown-button,
.select-field select,
.select-field input,
.input-field input,
.input-field select,
.input-field textarea {
  border-radius: 10px;
}

.primary-button,
.icon-button {
  border-color: #0f766e;
  background: linear-gradient(180deg, #0f8b82, #0f766e);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.primary-button:hover,
.icon-button:hover {
  border-color: #0b635d;
  background: linear-gradient(180deg, #0f766e, #0b635d);
  transform: translateY(-1px);
}

.secondary-button,
.dropdown-button {
  border-color: #d2dae6;
  background: #ffffff;
  color: #18202f;
}

.secondary-button:hover,
.dropdown-button:hover,
.tab:hover {
  border-color: #b8c2d1;
  background: #f8fafc;
}

.compact-button {
  min-height: 34px;
  border-radius: 9px;
  box-shadow: none;
}

.select-field,
.filter-panel,
.input-field {
  color: #667085;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.select-field select,
.select-field input,
.input-field input,
.input-field select,
.input-field textarea {
  border-color: #d2dae6;
  background: #ffffff;
}

.select-field select:hover,
.select-field input:hover,
.input-field input:hover,
.input-field select:hover,
.input-field textarea:hover {
  border-color: #9aa8bb;
}

.dropdown-menu {
  border-color: #d9e0ea;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.18);
}

.checkbox-field {
  border-color: #e4eaf2;
  border-radius: 10px;
  background: #f8fafc;
}

.checkbox-field:hover {
  border-color: #c7d2df;
  background: #ffffff;
}

.text-button {
  color: #0f766e;
}

.range-label {
  color: #475467;
  font-size: 13px;
}

.calendar-shell {
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.10);
}

.timeline-name-spacer,
.property-name {
  background: #f8fafc;
  border-color: #d9e0ea;
}

.timeline-name-spacer {
  height: 36px;
  color: #334155;
}

.date-header {
  border-bottom-color: #d9e0ea;
}

.date-cell {
  height: 36px;
  border-right-color: #e1e7ef;
  color: #667085;
}

.date-cell.is-weekend {
  background: #f1f5f9;
}

.date-cell.is-today {
  background: #0f766e;
  color: #ffffff;
}

.property-row {
  min-height: 70px;
  border-bottom-color: #e2e8f0;
}

.row-track,
.day-slot {
  min-height: 70px;
}

.property-row:hover .property-name,
.property-row:hover .day-slot {
  background-color: #f9fbff;
}

.property-row:hover .day-slot.is-weekend {
  background-color: #eef3f8;
}

.property-name {
  padding: 10px;
}

.property-name img,
.property-image-placeholder {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 10px;
  background: #e2e8f0;
}

.property-name strong {
  color: #18202f;
  font-size: 12.5px;
}

.property-name span {
  color: #667085;
}

.property-rename-button {
  border-color: #d2dae6;
  border-radius: 9px;
}

.day-slot {
  border-right-color: #e3e9f1;
  background: #ffffff;
}

.day-slot.is-weekend {
  background: #f5f7fa;
}

.day-slot.is-today {
  background: #e8f5f3;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.20);
}

.booking-pill {
  top: 24px;
  height: 28px;
  border-width: 1.5px;
  border-color: #334155;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.booking-pill:hover {
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.16);
}

.booking-pill.lodgify {
  border-color: #2563eb;
}

.booking-pill.apaleo {
  border-color: #059669;
}

.booking-pill.blocked {
  border-color: #475467;
  background: #475467;
}

.booking-pill.is-past {
  border-color: #c4ccd8;
  background: #eef2f7;
  color: #788294;
  opacity: 0.72;
}

.booking-pill strong,
.booking-guests {
  color: #475467;
}

.summary-grid {
  gap: 16px;
}

.metric {
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.07);
}

.metric span {
  color: #667085;
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  color: #101828;
  font-size: 28px;
}

.revenue-row {
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.source-badge {
  padding: 5px 9px;
}

.settings-panel,
.auth-panel {
  border-radius: 16px;
}

.settings-section,
.detail-item,
.booking-note-section > p {
  border-color: #e1e7ef;
  border-radius: 12px;
  background: #f8fafc;
}

.status-badge {
  background: #eef2f7;
}

.status-badge.is-connected {
  background: #dff7f1;
  color: #0f766e;
}

.booking-dialog {
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.24);
}

.booking-dialog::backdrop {
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(3px);
}

.close-button {
  border-color: #d2dae6;
  border-radius: 10px;
}

.detail-content {
  gap: 18px;
  padding: 28px;
}

.detail-content h2 {
  font-size: 26px;
  line-height: 1.15;
}

.detail-item {
  padding: 13px;
}

.notes {
  border-left-color: #f59e0b;
  background: #fff8e7;
  color: #5a3b0b;
}

.empty-state {
  border-color: #c7d2df;
  border-radius: 14px;
  background: #ffffff;
}

@media (max-width: 760px) {
  .app-header {
    padding: 16px 14px;
  }

  main {
    padding: 12px;
  }

  .toolbar {
    border-radius: 14px;
  }

  .calendar-shell {
    border-radius: 14px;
  }

  .booking-pill {
    top: 28px;
  }
}

/* Mobile calendar readability */
@media (max-width: 760px) {
  :root {
    --name-width: clamp(96px, 25vw, 112px);
    --day-width: clamp(50px, 13vw, 58px);
  }

  body {
    background: #f6f7fb;
  }

  body:not(.is-auth-screen) {
    display: flex;
    flex-direction: column;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body:not(.is-auth-screen) .app-header {
    flex: 0 0 auto;
  }

  .app-header {
    gap: 12px;
  }

  .app-header h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  .app-header p {
    display: none;
  }

  .auth-status {
    justify-content: space-between;
    width: 100%;
  }

  main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  #calendarView {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
  }

  #revenueView,
  #connectionsView {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    margin: -10px -10px 10px;
    padding: 10px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.10);
  }

  .toolbar > .primary-button,
  .toolbar > .secondary-button,
  .toolbar > .icon-button {
    min-width: 0;
    padding-inline: 10px;
  }

  .toolbar #todayButton {
    width: 100%;
  }

  .calendar-controls-toggle {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: none;
  }

  .calendar-controls-toggle::after {
    content: "⌄";
    margin-left: 8px;
    color: #667085;
    font-size: 14px;
  }

  .toolbar.is-controls-open .calendar-controls-toggle::after {
    transform: rotate(180deg);
  }

  .calendar-controls-panel {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 2px;
  }

  .toolbar.is-controls-open .calendar-controls-panel {
    display: grid;
  }

  .calendar-controls-panel .select-field,
  .calendar-controls-panel .filter-panel,
  .calendar-controls-panel .range-label,
  .calendar-controls-panel #manualBookingToggle {
    grid-column: 1 / -1;
  }

  .toolbar #manualBookingToggle {
    width: 100%;
  }

  .range-label {
    order: 20;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.25;
  }

  .calendar-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: none;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
  }

  .calendar-shell::after {
    content: none;
  }

  .timeline-grid {
    grid-template-columns: var(--name-width) max-content;
  }

  .timeline-name-spacer,
  .date-header {
    position: sticky;
    top: 0;
  }

  .timeline-name-spacer {
    z-index: 12;
    height: 46px;
    padding: 0 8px;
    font-size: 12.5px;
  }

  .date-header {
    z-index: 10;
    background: #ffffff;
  }

  .date-cell {
    height: 46px;
    font-size: 11px;
    line-height: 1.05;
  }

  .date-cell strong {
    font-size: 17px;
    line-height: 1;
  }

  .property-row,
  .row-track,
  .day-slot {
    min-height: 76px;
  }

  .property-name {
    position: sticky;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 28px 8px 7px;
  }

  .property-name img,
  .property-image-placeholder {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
  }

  .property-name strong {
    font-size: 12px;
    line-height: 1.15;
    -webkit-line-clamp: 3;
  }

  .property-name span {
    font-size: 10px;
    line-height: 1.2;
  }

  .property-rename-button {
    position: absolute;
    top: 6px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 24px;
    min-height: 28px;
    border-radius: 8px;
    padding: 0;
    font-size: 0;
  }

  .property-rename-button::before {
    content: "✎";
    color: #475467;
    font-size: 15px;
    line-height: 1;
  }

  .day-slot {
    padding: 4px 2px;
  }

  .booking-pill {
    top: 18px;
    height: 40px;
    min-width: 44px;
    border-width: 2px;
    border-radius: 10px;
    padding: 0 7px;
    font-size: 12px;
    line-height: 1.1;
    box-shadow: 0 5px 12px rgba(17, 24, 39, 0.16);
  }

  .booking-guest {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .booking-pill strong,
  .booking-guests {
    display: none;
  }

  .manual-booking-grid {
    grid-template-columns: 1fr;
  }

  .detail-content {
    padding: 20px 16px;
  }
}

@media (max-width: 420px) {
  :root {
    --name-width: 92px;
    --day-width: 50px;
  }

  .tabs {
    border-radius: 12px;
  }

  .tab {
    padding: 9px 12px;
  }

  .property-name img,
  .property-image-placeholder {
    display: none;
  }

  .property-name {
    padding: 8px 26px 8px 6px;
  }

  .booking-pill {
    padding: 0 6px;
    font-size: 11.5px;
  }
}
