:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #14211b;
  --muted: #65746d;
  --line: #dce4de;
  --willow: #145d3b;
  --willow-2: #1f7a53;
  --airbnb: #ff5a5f;
  --booking: #0a4fa3;
  --makemytrip: #6554c0;
  --direct: #2f855a;
  --warning: #c05621;
  --shadow: 0 18px 48px rgba(20, 33, 27, 0.12);
  --soft-shadow: 0 8px 22px rgba(20, 33, 27, 0.09);
  --radius: 8px;
  --tap: 46px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans Telugu", "Noto Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(246, 247, 242, 0.78), rgba(246, 247, 242, 0.9)),
    url("assets/listing/willow-2.jpeg") center top / cover no-repeat,
    var(--bg);
  color: var(--ink);
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.sprite {
  display: none;
}

.site-shell {
  width: 100%;
  max-width: 980px;
  overflow-x: hidden;
  margin: 0 auto;
  padding: 8px 8px 34px;
}

main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(20, 93, 59, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border: 1px solid rgba(20, 93, 59, 0.24);
  border-radius: var(--radius);
  background: #fffaf0;
}

.brand span {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-left: 10px;
}

.brand strong {
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.header-actions,
.calendar-header,
.calendar-actions,
.form-actions,
.booking-actions {
  display: flex;
  align-items: center;
}

.header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.ghost-button,
.language-toggle,
.square-button,
.primary-button,
.danger-button,
.contact-link {
  min-height: var(--tap);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.ghost-button,
.primary-button,
.danger-button,
.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.header-actions .ghost-button,
.header-actions .primary-button,
.header-actions .language-toggle {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.language-toggle {
  padding: 0 13px;
  background: var(--ink);
  color: #fff;
}

.square-button {
  display: grid;
  place-items: center;
  width: var(--tap);
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  border-color: var(--willow-2);
  background: var(--willow-2);
  color: #fff;
}

.danger-button {
  border-color: #efc6bb;
  background: #fff5f2;
  color: #a43d27;
}

.contact-link {
  min-width: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--willow);
  text-decoration: none;
}

.ghost-button:hover,
.language-toggle:hover,
.square-button:hover,
.primary-button:hover,
.danger-button:hover,
.contact-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.month-heading p,
.section-title p {
  margin: 0 0 4px;
  color: var(--willow);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calendar-card,
.selected-card,
.import-card,
.entry-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.calendar-card {
  order: 1;
  overflow: hidden;
  padding: 9px;
}

.entry-card {
  order: 3;
}

.selected-card {
  order: 2;
}

.import-card {
  order: 6;
}

.calendar-header {
  justify-content: space-between;
  gap: 10px;
}

.month-heading {
  min-width: 0;
  text-align: center;
}

.month-heading h2 {
  margin: 0;
  font-size: clamp(1.18rem, 6vw, 2rem);
  line-height: 1.08;
}

.legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin: 12px 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--direct);
}

.source-dot.airbnb,
.source-bar.airbnb,
.source-chip.airbnb {
  background: var(--airbnb);
}

.source-dot.booking,
.source-bar.booking,
.source-chip.booking {
  background: var(--booking);
}

.source-dot.makemytrip,
.source-bar.makemytrip,
.source-chip.makemytrip {
  background: var(--makemytrip);
}

.source-dot.direct,
.source-bar.direct,
.source-chip.direct {
  background: var(--direct);
}

.weekday-row,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  gap: 3px;
  margin: 8px 0 5px;
}

.weekday-row span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.month-grid {
  gap: 3px;
}

.day-cell {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-rows: auto minmax(38px, 1fr);
  min-width: 0;
  min-height: clamp(58px, 14vw, 92px);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.day-cell.outside {
  background: #f2f4ef;
  color: #9aa59f;
}

.day-cell.today {
  border-color: var(--willow-2);
}

.day-cell.has-start,
.day-cell.has-middle {
  z-index: 2;
}

.day-cell.selected {
  z-index: 4;
  border-color: var(--willow);
  box-shadow: inset 0 0 0 2px var(--willow);
}

.day-number {
  font-size: clamp(0.86rem, 4vw, 1.2rem);
  font-weight: 950;
  line-height: 1;
}

.booking-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(30px, 1fr);
  gap: 0;
  align-items: center;
  align-self: stretch;
  height: 100%;
  min-height: 100%;
  margin-top: 6px;
  overflow: visible;
}

.source-bar {
  height: 6px;
  border-radius: 999px;
}

.booking-pill {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: 3px 7px;
  color: #fff;
  font-size: clamp(0.62rem, 1.85vw, 0.78rem);
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 7px 14px rgba(20, 33, 27, 0.18);
}

.booking-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.booking-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-pill.start .booking-name,
.booking-pill.same-day .booking-name {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.booking-pill.start {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  width: var(--booking-width, calc(200% + 8px));
  margin-right: -8px;
  border-radius: 999px 0 0 999px;
}

.booking-pill.end {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  margin-left: -8px;
  border-radius: 0 999px 999px 0;
}

.booking-pill.middle {
  grid-column: 1 / 3;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  margin-inline: -8px;
  border-radius: 0;
}

.booking-pill.same-day {
  grid-column: 1 / 3;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  border-radius: 999px;
}

.day-cell.dow-6 .booking-pill.start {
  width: 100%;
  margin-right: 0;
  border-radius: 999px;
}

.day-cell.dow-0 .booking-pill.end {
  margin-left: 0;
  border-radius: 999px;
}

.day-cell.dow-0 .booking-pill.middle {
  margin-left: 0;
  border-radius: 999px 0 0 999px;
}

.day-cell.dow-6 .booking-pill.middle {
  margin-right: 0;
  border-radius: 0 999px 999px 0;
}

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

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

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

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

.more-count {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-actions {
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.calendar-actions .ghost-button {
  flex: 1;
}

.selected-card {
  padding: 14px;
}

.booking-modal,
.form-modal,
.import-modal,
.admin-login-modal,
.admin-panel-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(20, 33, 27, 0.54);
  backdrop-filter: blur(8px);
}

.booking-modal[hidden],
.form-modal[hidden],
.import-modal[hidden],
.admin-login-modal[hidden],
.admin-panel-modal[hidden] {
  display: none;
}

.booking-modal-panel,
.form-modal-panel,
.import-modal-panel,
.admin-login-panel,
.admin-panel {
  width: min(100%, 760px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.form-modal-panel {
  width: min(100%, 820px);
  padding: 14px;
}

.import-modal-panel {
  width: min(100%, 520px);
  padding: 14px;
}

.admin-login-panel {
  width: min(100%, 390px);
  padding: 16px;
}

.admin-login-panel label + label {
  display: block;
  margin-top: 12px;
}

.admin-login-actions {
  margin-top: 15px;
}

.admin-login-actions .primary-button {
  width: 100%;
}

.admin-error {
  margin: 10px 0 0;
  color: #a43d27;
  font-weight: 900;
}

.admin-panel {
  width: min(100%, 680px);
  padding: 16px;
}

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

.finance-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.finance-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.finance-card strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1.24rem;
  line-height: 1.1;
}

.admin-panel-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 14px;
}

.admin-panel-actions button {
  width: 100%;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  color: var(--willow);
  font-size: 1.12rem;
  line-height: 1.15;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.14rem, 5vw, 1.7rem);
}

.booking-count {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.selected-bookings {
  display: grid;
  gap: 10px;
}

.guest-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.guest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.guest-name {
  min-width: 0;
}

.guest-name h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  line-height: 1.1;
}

.guest-name p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.guest-name p.missing-phone {
  color: var(--warning);
}

.source-chip {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
}

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

.detail {
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.detail strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: 0.94rem;
  line-height: 1.22;
}

.detail.full {
  grid-column: 1 / -1;
}

.booking-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.booking-actions > * {
  flex: 1 1 124px;
}

.contact-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid #efc6bb;
  border-radius: var(--radius);
  background: #fff5f2;
  color: #a43d27;
  font-weight: 950;
  text-align: center;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  min-height: 124px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1rem;
}

.empty-state span {
  max-width: 34rem;
  line-height: 1.35;
}

.import-card,
.entry-card {
  overflow: hidden;
}

.import-card summary,
.entry-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 14px;
  color: var(--willow);
  font-weight: 950;
  list-style: none;
  cursor: pointer;
}

.advanced-fields {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.advanced-fields summary {
  min-height: 46px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.advanced-fields .form-grid {
  padding: 0 12px 12px;
}

.import-card summary::-webkit-details-marker,
.entry-card summary::-webkit-details-marker {
  display: none;
}

.form-modal-panel form,
.import-modal-panel .import-grid {
  padding: 0;
}

.import-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.import-button {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}

.import-modal-panel .import-button {
  width: 100%;
  margin: 14px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.note-preview {
  display: block;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #cfe2d7;
  border-radius: var(--radius);
  background: #edf8f1;
  color: var(--willow);
  font-weight: 900;
  line-height: 1.35;
  white-space: pre-line;
}

.note-preview[hidden] {
  display: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--willow-2);
  box-shadow: 0 0 0 3px rgba(31, 122, 83, 0.14);
}

.form-actions {
  gap: 9px;
  margin-top: 13px;
}

.form-actions button {
  flex: 1;
}

.toast {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 900;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 430px) {
  .site-shell {
    padding-inline: 6px;
  }

  .brand span {
    margin-left: 7px;
  }

  .brand strong {
    max-width: 168px;
  }

  .day-cell {
    min-height: 58px;
    padding: 5px;
  }

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

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

@media (max-width: 719px) {
  .site-shell {
    max-width: 480px;
  }

  .site-header,
  .calendar-card,
  .selected-card,
  .entry-card,
  .import-card {
    width: 100%;
    max-width: 100%;
  }

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

  .calendar-card {
    padding: 8px;
  }

  .month-grid,
  .weekday-row {
    gap: 3px;
  }

  .day-cell {
    min-height: clamp(58px, 15vw, 72px);
    padding: 4px;
  }

  .booking-stack {
    grid-template-rows: minmax(24px, 1fr);
  }

  .booking-pill {
    min-height: 24px;
    gap: 4px;
    padding: 2px 5px;
    font-size: 0.62rem;
  }

  .booking-avatar {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    border-width: 1px;
    font-size: 0.62rem;
  }

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

  .calendar-actions .ghost-button {
    min-width: 0;
    overflow: hidden;
    padding-inline: 6px;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .booking-modal,
  .form-modal,
  .import-modal,
  .admin-login-modal,
  .admin-panel-modal {
    align-items: end;
    padding: 8px;
  }

  .booking-modal-panel,
  .form-modal-panel,
  .import-modal-panel,
  .admin-login-panel,
  .admin-panel {
    max-height: calc(100dvh - 16px);
  }
}

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

@media (min-width: 480px) and (max-width: 719px) {
  .legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .site-shell {
    padding: 18px 18px 46px;
  }

  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .header-actions {
    display: flex;
    width: auto;
    gap: 8px;
    justify-content: flex-end;
  }

  .quick-add-button {
    grid-column: auto;
  }

  main {
    display: block;
  }

  .header-actions .ghost-button,
  .header-actions .primary-button,
  .header-actions .language-toggle {
    width: auto;
    padding: 0 12px;
  }

  .brand img {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .brand strong {
    font-size: 1.28rem;
  }

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

  .calendar-card,
  .selected-card,
  .import-card,
  .entry-card {
    margin-top: 16px;
  }

  .calendar-card,
  .selected-card {
    padding: 18px;
  }

  .month-grid {
    gap: 7px;
  }

  .weekday-row {
    gap: 7px;
  }

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

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

  .admin-panel-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .import-grid {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .form-grid .full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .site-shell {
    width: min(1120px, 100%);
  }

  .day-cell {
    min-height: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
