/* ==========================================================================
   Villa Victoria — Admin and Guest calendars on the Liquid Glass system
   (liquid-glass.css, the same system as the BAF.So Calendar). This file only
   sets the villa's own palette and lays out the classes the pages' scripts
   render. Light theme only, as before.
   ========================================================================== */

:root {
  /* Resort palette: forest green, sage, terracotta and warm sand */
  --tint: #2f5d4a;
  --tint-hover: #274f3f;
  --tint-on: #ffffff;
  --tint-soft: rgba(47, 93, 74, .12);
  --tint-ring: rgba(47, 93, 74, .30);

  --label: #14241d;
  --label-2: rgba(24, 40, 32, .70);
  --label-3: rgba(24, 40, 32, .48);
  --label-4: rgba(24, 40, 32, .28);
  --separator: rgba(24, 40, 32, .10);
  --separator-strong: rgba(24, 40, 32, .17);
  --fill-1: rgba(120, 128, 108, .24);
  --fill-2: rgba(120, 128, 108, .16);
  --fill-3: rgba(120, 128, 108, .11);
  --fill-4: rgba(120, 128, 108, .07);

  --canvas: #e6dfd2;
  --canvas-gradient:
    radial-gradient(72vmax 62vmax at 0% 0%, rgba(126, 160, 126, .80), transparent 66%),
    radial-gradient(62vmax 56vmax at 100% 4%, rgba(222, 160, 118, .72), transparent 66%),
    radial-gradient(68vmax 58vmax at 100% 100%, rgba(232, 204, 152, .80), transparent 66%),
    radial-gradient(62vmax 56vmax at 0% 100%, rgba(84, 128, 108, .70), transparent 66%),
    radial-gradient(46vmax 40vmax at 50% 50%, rgba(244, 238, 226, .55), transparent 70%),
    linear-gradient(160deg, #ece5d8 0%, #e2dacb 100%);
  --ambient-a: rgba(110, 156, 120, .50);
  --ambient-b: rgba(226, 150, 100, .44);
  --shadow-content: 0 1px 2px rgba(20, 30, 24, .05), 0 12px 34px rgba(40, 52, 36, .10);
  --glass-shadow: 0 1px 1px rgba(20, 30, 24, .05), 0 6px 16px rgba(40, 52, 36, .10), 0 18px 44px rgba(40, 52, 36, .10);
  --dim: rgba(20, 32, 26, .20);

  --font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --booked: #2c5444;
  --booked-on: #ffffff;
  --today: #b76843;
  --price: #f3b33d;
  --price-ink: #3a2910;
  --switch-on: #34c759;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --bar-gap: max(16px, env(safe-area-inset-bottom));
}

* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-variant-numeric: tabular-nums; }

/* Canvas lights */
.ambient {
  position: fixed;
  z-index: 0;
  width: 72vmax;
  height: 72vmax;
  border-radius: 50%;
  pointer-events: none;
  animation: ambient-drift 32s ease-in-out infinite alternate;
  will-change: transform;
}
.ambient-one { top: -40vmax; left: -24vmax; background: radial-gradient(closest-side, var(--ambient-a), transparent); }
.ambient-two { right: -26vmax; bottom: -42vmax; background: radial-gradient(closest-side, var(--ambient-b), transparent); animation-delay: -14s; }
@keyframes ambient-drift { to { transform: translate3d(5vmax, 3vmax, 0) scale(1.08); } }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 90;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-solid);
  color: var(--label);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */
.header {
  position: relative;
  z-index: 16;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: min(72rem, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; justify-self: start; }
.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(160deg, #3f7a62 0%, #1f3d31 100%);
  color: #fffaf0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 2px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .18), 0 6px 16px rgba(31, 61, 49, .28);
}
.brand-copy { min-width: 0; line-height: 1.15; }
.brand-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--label-3);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.header h1 { color: var(--label); font-family: var(--font-serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.header p { margin-top: 3px; color: var(--label-2); font-size: var(--fs-footnote); }

.year-picker {
  display: grid;
  grid-template-columns: 36px minmax(70px, auto) 36px;
  align-items: center;
  justify-self: center;
  padding: 4px;
  border-radius: var(--radius-pill);
}
.year-picker button,
.year-picker select {
  height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-3) var(--spring);
}
.year-picker button { display: grid; place-items: center; width: 36px; }
.year-picker button:hover,
.year-picker select:hover { background: var(--fill-3); }
.year-picker button:active { transform: scale(.9); }
.year-picker select { padding: 0 10px; text-align: center; text-align-last: center; -webkit-appearance: none; appearance: none; cursor: pointer; }
.refresh-btn { justify-self: end; }
.refresh-btn:disabled { opacity: .7; cursor: wait; }
.refresh-btn.is-loading .refresh-icon { animation: villa-spin .8s linear infinite; }
@keyframes villa-spin { to { transform: rotate(360deg); } }

/* ---------- Floating controls ---------- */
.controls-shell {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  margin: 4px auto 0;
  padding: 6px;
  border-radius: var(--radius-pill);
}
.tabs > button,
.view-toggle > button { min-height: 36px; padding: 0 20px; font-size: var(--fs-callout); }
.tabs .lg-icon,
.view-toggle .lg-icon { display: none; }

/* ---------- Content ---------- */
.container { position: relative; width: min(72rem, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 22px 0 72px; }
.villa-section { display: none; }
.villa-section.active { display: block; animation: villa-fade var(--dur-3) var(--ease-out) both; }
.year-view.hidden { display: none; }
.single-view { display: none; }
.single-view.active { display: block; }
@keyframes villa-fade { from { opacity: 0; transform: translateY(6px); } }

/* Frosted panels (same material as .lg-surface) */
.month-card,
.single-card {
  position: relative;
  isolation: isolate;
  background: var(--surface-sheen), var(--surface);
  box-shadow: var(--lg-panel-shadow);
}
.month-card::before,
.single-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.25px;
  border-radius: inherit;
  pointer-events: none;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Year view */
.months-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.month-card {
  padding: 14px 12px 12px;
  border-radius: 24px;
  cursor: pointer;
  transition: transform var(--dur-3) var(--spring), box-shadow var(--dur-2) ease;
  animation: villa-fade var(--dur-4) var(--ease-out) both;
}
.month-card:active { transform: scale(.98); }
.month-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
  color: var(--label);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}
.month-stats {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--tint-soft);
  color: var(--tint);
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: 600;
  white-space: nowrap;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; }
.day-lbl { padding-bottom: 3px; color: var(--label-3); font-size: 9px; font-weight: 600; text-align: center; }

/* Day cells (year and month views). Consecutive booked days join into one
   capsule, like a range in iOS Calendar. */
.day-cell,
.single-day-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: var(--label);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-3) var(--spring), box-shadow var(--dur-2) ease;
}
.day-cell { aspect-ratio: 1; border-radius: 50%; font-size: 10px; }
.single-day-cell { height: 48px; border-radius: var(--radius-pill); font-size: 17px; }
.day-cell.empty,
.single-day-cell.empty { cursor: default; pointer-events: none; }
.guest-page .day-cell,
.guest-page .single-day-cell { cursor: default; }
.guest-page .month-card .day-cell { cursor: pointer; }
/* Weekends (T7, CN) are a shade lighter, unless booked or today. */
.cal-grid > .day-cell:not(.booked):not(.today):nth-child(7n),
.cal-grid > .day-cell:not(.booked):not(.today):nth-child(7n - 1),
.single-cal-grid > .single-day-cell:not(.booked):not(.today):nth-child(7n),
.single-cal-grid > .single-day-cell:not(.booked):not(.today):nth-child(7n - 1) { color: var(--label-2); }
.day-cell.booked,
.single-day-cell.booked {
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%), var(--booked);
  color: var(--booked-on);
  font-weight: 600;
}
.day-cell.booked:has(+ .booked):not(:nth-child(7n)),
.single-day-cell.booked:has(+ .booked):not(:nth-child(7n)) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.booked + .day-cell.booked:not(:nth-child(7n + 1)),
.booked + .single-day-cell.booked:not(:nth-child(7n + 1)) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.day-cell.today,
.single-day-cell.today { color: var(--today); font-weight: 700; }
.day-cell.today { box-shadow: inset 0 0 0 1.5px var(--today); }
.single-day-cell.today::before {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--today);
  transform: translateX(-50%);
}
.day-cell.booked.today,
.single-day-cell.booked.today { color: var(--booked-on); }
.single-day-cell.booked.today::before { background: #ffd6bd; }
.day-cell:active,
.single-day-cell:active { transform: scale(.9); }
.single-day-cell:not(.booked):active { background: var(--fill-1); }
@media (hover: hover) {
  .single-day-cell:not(.booked):not(.empty):hover { background: var(--fill-3); }
  .guest-page .single-day-cell:not(.booked):hover { background: transparent; }
  .month-card:hover { transform: translateY(-2px); box-shadow: var(--lg-panel-shadow), 0 18px 40px rgba(40, 52, 36, .12); }
}
.guest-page .single-day-cell:active { transform: none; }
/* Admin: the tapped day stays marked while its sheet is open (villa-ui.js). */
.day-cell.is-selected,
.single-day-cell.is-selected {
  box-shadow: inset 0 0 0 2px var(--tint), 0 0 0 3px var(--tint-ring);
  animation: day-pop var(--dur-4) var(--spring);
}
.single-day-cell.is-selected:not(.booked) { background: var(--thumb-bg); }
@keyframes day-pop { from { transform: scale(.78); } }
.single-day-cell:focus-visible,
.month-card:focus-visible,
.single-booking-row:focus-visible { outline: 3px solid var(--tint-ring); outline-offset: 2px; }

/* Price rises: small amber capsule */
.single-day-cell.price-adjustment::after,
.day-cell.price-adjustment::after {
  content: attr(data-price-adjustment);
  position: absolute;
  padding: 2px 5px;
  border-radius: var(--radius-pill);
  background: var(--price);
  color: var(--price-ink);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  box-shadow: 0 1px 3px rgba(58, 41, 16, .2);
}
.single-day-cell.price-adjustment::after { top: 1px; right: 1px; }
.day-cell.price-adjustment::after { bottom: -3px; left: 50%; padding: 1px 2px; font-size: 6px; transform: translateX(-50%); }
.single-day-cell.price-discount::after,
.day-cell.price-discount::after { background: #dcebe4; color: #245343; }

/* Month view */
.month-nav { display: flex; align-items: center; justify-content: space-between; max-width: 36rem; margin: 0 auto 14px; }
.nav-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--glass-sheen), var(--glass-bg);
  -webkit-backdrop-filter: var(--lg-glass-filter);
  backdrop-filter: var(--lg-glass-filter);
  box-shadow: var(--lg-glass-shadow);
  color: var(--label);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  padding-bottom: 3px;
  transition: transform var(--dur-3) var(--spring), background-color var(--dur-2) ease;
}
.nav-btn:hover:not(:disabled) { background: var(--glass-sheen), var(--control-bg); }
.nav-btn:active:not(:disabled) { transform: scale(.9); }
.nav-btn:disabled { opacity: .4; cursor: default; }
.nav-month-name { color: var(--label); font-family: var(--font-serif); font-size: 28px; font-weight: 600; letter-spacing: -.015em; }
.single-card { max-width: 36rem; margin: 0 auto; padding: 18px 16px 16px; border-radius: 30px; }
.single-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 6px; margin-bottom: 16px; }
.single-day-lbl { padding-bottom: 4px; color: var(--label-3); font-size: var(--fs-caption); font-weight: 600; text-align: center; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--fill-4);
  color: var(--label-2);
  font-size: var(--fs-footnote);
  font-weight: 500;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.full { background: var(--booked); }
.legend-dot.room { background: #769181; }
.legend-dot.small { background: #c18462; }
.legend-price-chip { padding: 2px 6px; border-radius: var(--radius-pill); background: var(--price); color: var(--price-ink); font-size: 10px; font-weight: 700; }
.legend-price-chip.discount { background: #dcebe4; color: #245343; }

.booking-section-title {
  margin: 20px 6px 6px;
  color: var(--label-3);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.single-booking-row {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 14px;
  padding: 12px 12px 12px 22px;
  border-radius: 16px;
  font-size: var(--fs-callout);
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-3) var(--spring);
}
.single-booking-row::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 9px;
  width: 4px;
  border-radius: 2px;
  background: var(--booked);
}
.single-booking-row + .single-booking-row::after {
  content: "";
  position: absolute;
  top: 0;
  right: 12px;
  left: 22px;
  height: .5px;
  background: var(--separator);
}
.single-booking-row[role="button"] { cursor: pointer; }
.single-booking-row[role="button"]:active { background: var(--fill-3); transform: scale(.985); }
@media (hover: hover) {
  .single-booking-row[role="button"]:hover { background: var(--surface-hover); }
  .single-booking-row[role="button"]:hover::after,
  .single-booking-row[role="button"]:hover + .single-booking-row::after { opacity: 0; }
}
.sbdate { color: var(--label); font-weight: 600; white-space: nowrap; }
.badge { color: var(--label-2); font-size: var(--fs-callout); font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.badge-full { color: var(--label-2); }
.badge-room { color: #3f6656; }
.badge-small { color: #8c4e32; }

.empty-state { padding: 22px 0 6px; color: var(--label-2); font-size: var(--fs-callout); text-align: center; }
.loading {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 12rem;
  color: var(--label-2);
  font-size: var(--fs-callout);
  font-weight: 500;
}
.loading::before,
.busy-box::before {
  content: "";
  width: 30px;
  height: 30px;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--label) 10%, transparent), var(--label-2));
  -webkit-mask: repeating-conic-gradient(from -4deg, #000 0deg 8deg, transparent 8deg 45deg), radial-gradient(circle, transparent 38%, #000 39%, #000 69%, transparent 70%);
  -webkit-mask-composite: source-in;
  mask: repeating-conic-gradient(from -4deg, #000 0deg 8deg, transparent 8deg 45deg) intersect, radial-gradient(circle, transparent 38%, #000 39%, #000 69%, transparent 70%);
  animation: villa-spin .8s steps(8) infinite;
}
.error {
  max-width: 36rem;
  margin: 24px auto;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--red-soft);
  color: var(--red);
  font-size: var(--fs-callout);
  line-height: 1.5;
}

/* ---------- Admin: day sheet and form ---------- */
.day-drawer { position: fixed; inset: 0; z-index: 50; display: none; }
.day-drawer.active { display: flex; flex-direction: column; justify-content: flex-end; }
.drawer-backdrop { position: fixed; inset: 0; background: var(--dim); animation: villa-dim var(--dur-3) ease both; }
@keyframes villa-dim { from { opacity: 0; } }
.booking-editor {
  position: relative;
  width: min(36rem, calc(100% - 16px));
  max-height: min(86dvh, 46rem);
  margin: 0 auto max(8px, env(safe-area-inset-bottom));
  padding: 26px 18px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 34px;
  background: var(--glass-sheen), var(--glass-thick-bg);
  -webkit-backdrop-filter: var(--lg-thick-filter);
  backdrop-filter: var(--lg-thick-filter);
  box-shadow: var(--lg-thick-shadow);
  animation: sheet-in var(--dur-4) var(--spring-smooth) both;
}
@keyframes sheet-in { from { transform: translateY(calc(100% + 24px)); } }
.booking-editor::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--fill-1);
  transform: translateX(-50%);
}
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 0 2px; }
.editor-title { color: var(--label); font-size: var(--fs-title-3); font-weight: 700; letter-spacing: -.015em; }
.editor-hint { margin-top: 3px; color: var(--label-2); font-size: var(--fs-subhead); }
.drawer-close { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
.day-bookings { display: grid; gap: 8px; margin-bottom: 14px; }
.day-booking-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 22px;
  border-radius: 18px;
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 0 var(--control-rim), inset 0 0 0 .5px var(--control-edge);
}
.day-booking-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 9px;
  width: 4px;
  border-radius: 2px;
  background: var(--booked);
}
.day-booking-date { color: var(--label); font-size: 15px; font-weight: 600; }
.day-booking-note { margin-top: 2px; color: var(--label-2); font-size: var(--fs-subhead); overflow-wrap: anywhere; }
.day-booking-actions { display: flex; gap: 6px; }
.mini-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--control-bg-hover);
  color: var(--label);
  font: inherit;
  font-size: var(--fs-subhead);
  font-weight: 600;
  box-shadow: inset 0 1px 0 0 var(--control-rim), 0 0 0 .5px var(--control-edge);
  transition: transform var(--dur-3) var(--spring), background-color var(--dur-2) ease;
}
.mini-btn:active { transform: scale(.94); }
.mini-btn.danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
.drawer-empty {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  background: var(--fill-4);
  color: var(--label-2);
  font-size: var(--fs-callout);
  text-align: center;
}
.booking-form { display: grid; gap: 14px; }
.booking-form.is-hidden { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--label-2); font-size: var(--fs-subhead); font-weight: 600; }
.form-field input:not([type="date"]),
.form-field select,
.date-input-wrap {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--fill-4);
  color: var(--label);
  font: inherit;
  font-size: 16px;
  box-shadow: inset 0 0 0 .5px var(--separator-strong);
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.form-field input:not([type="date"]),
.form-field select { padding: 0 14px; outline: 0; }
.form-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23838b80' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.form-field input:not([type="date"]):focus,
.form-field select:focus,
.date-input-wrap:focus-within {
  background-color: var(--control-bg-active);
  box-shadow: inset 0 0 0 .5px var(--tint), 0 0 0 4px var(--tint-ring);
}
.form-field input::placeholder { color: var(--label-3); }
.date-input-wrap { position: relative; min-width: 0; overflow: hidden; }
.date-input-wrap input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: inherit;
  outline: 0;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  color-scheme: light;
  font-size: 16px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.date-display {
  position: absolute;
  inset: 0 36px 0 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--label);
  font-size: 16px;
  white-space: nowrap;
  pointer-events: none;
}
.date-display.is-empty { color: var(--label-3); }
/* iOS-style switch for "Báo về Telegram" */
.notify-row { display: flex; align-items: center; gap: 12px; color: var(--label); font-size: var(--fs-callout); font-weight: 500; cursor: pointer; }
.notify-row input {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: var(--fill-1);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--dur-2) var(--ease-out);
}
.notify-row input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .06);
  transition: transform var(--dur-3) var(--spring);
}
.notify-row input:checked { background: var(--switch-on); }
.notify-row input:checked::before { transform: translateX(20px); }
.notify-row input:focus-visible { outline: 3px solid var(--tint-ring); outline-offset: 2px; }
.editor-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.editor-actions .lg-btn { min-height: 46px; font-size: 15px; }
.booking-form.is-new .clear-btn,
.booking-form.is-new .delete-btn { display: none; }
.booking-form.is-new .save-btn { grid-column: 1 / -1; }
.form-status { min-height: 18px; color: var(--label-2); font-size: var(--fs-subhead); }
.form-status.error { color: var(--red); }
.form-status.success { color: var(--green); }

.busy-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 24px; background: var(--dim); }
.busy-overlay.active { display: grid; }
.busy-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(15rem, 80vw);
  padding: 22px 26px;
  border-radius: 26px;
  background: var(--glass-sheen), var(--glass-thick-bg);
  -webkit-backdrop-filter: var(--lg-thick-filter);
  backdrop-filter: var(--lg-thick-filter);
  box-shadow: var(--lg-thick-shadow);
  color: var(--label);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  animation: busy-in var(--dur-4) var(--spring) both;
}
@keyframes busy-in { from { opacity: 0; transform: scale(.9); } }

/* ---------- Landing (/) ---------- */
.landing { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px var(--gutter); }
.landing-card { width: min(100%, 30rem); padding: 30px 26px 26px; text-align: center; }
.landing-card .brand-mark { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; font-size: 20px; }
.landing-card h1 { font-family: var(--font-serif); font-size: clamp(30px, 7vw, 40px); font-weight: 600; letter-spacing: -.015em; }
.landing-card p { margin: 8px 0 22px; color: var(--label-2); font-size: 15px; line-height: 1.5; }
.landing-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.landing-actions .lg-btn { min-height: 50px; font-size: 16px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .months-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Phone: villa tabs and view switch float at the bottom as glass, like the
   iOS 26 tab bar. */
@media (max-width: 680px) {
  .header { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding-top: max(12px, env(safe-area-inset-top)); }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
  .brand-kicker { display: none; }
  .header h1 { font-size: 20px; }
  .year-picker { grid-template-columns: 30px minmax(52px, auto) 30px; padding: 3px; }
  .year-picker button, .year-picker select { height: 34px; }
  .year-picker button { width: 30px; }
  .year-picker select { padding: 0 4px; }
  .refresh-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .refresh-btn { width: 40px; min-width: 40px; padding: 0; }

  .controls-shell {
    position: fixed;
    top: auto;
    right: var(--gutter);
    bottom: var(--bar-gap);
    left: var(--gutter);
    justify-content: space-between;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    isolation: auto;
  }
  .controls-shell::before { display: none; }
  .tabs,
  .view-toggle {
    --lg-seg-pad: 4px;
    height: 58px;
    background: var(--glass-sheen), var(--glass-bg);
    -webkit-backdrop-filter: var(--lg-glass-filter);
    backdrop-filter: var(--lg-glass-filter);
    box-shadow: var(--lg-glass-shadow);
  }
  .tabs { flex: 1; min-width: 0; }
  .tabs::before,
  .view-toggle::before { background: var(--control-bg-hover); box-shadow: inset 0 1px 0 0 var(--control-rim), 0 0 0 .5px var(--control-edge); }
  .tabs > button { flex-direction: column; gap: 2px; min-height: 50px; padding: 0 6px; font-size: 11px; }
  .view-toggle > button { min-height: 50px; width: 50px; padding: 0; }
  .tabs > button.active,
  .view-toggle > button.active { color: var(--tint); }
  .tabs .lg-icon,
  .view-toggle .lg-icon { display: block; width: 22px; height: 22px; stroke-width: 1.9; }
  .view-toggle .toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .container { padding: 14px 0 calc(100px + env(safe-area-inset-bottom)); }
  .months-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .month-card { padding: 12px 8px 10px; border-radius: 22px; }
  .month-title { font-size: 15px; }
  .nav-month-name { font-size: 24px; }
  .single-card { padding: 14px 10px 12px; border-radius: 28px; }
  .single-day-cell { height: 46px; font-size: 18px; }
  .single-day-cell.price-adjustment::after { top: -1px; right: -1px; font-size: 8px; padding: 2px 4px; }
  .booking-editor { width: calc(100% - 16px); max-height: 88dvh; }
  .editor-actions { grid-template-columns: 1fr; }
  .lg-scroll-edge--bottom { height: 120px; }
}
@media (max-width: 360px) {
  .months-grid { grid-template-columns: 1fr; }
  .header h1 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ambient { animation: none; }
}
