:root {
  color-scheme: light;
  --bg: #eef3f2;
  --surface: #ffffff;
  --surface-soft: #f3f7f6;
  --ink: #152321;
  --muted: #65736f;
  --line: #dce5e2;
  --line-strong: #afbfba;
  --green: #0b6b61;
  --green-dark: #07564f;
  --blue: #0b86b8;
  --blue-soft: #e2f5fb;
  --amber: #a86612;
  --amber-soft: #fff4d6;
  --red: #b42318;
  --red-soft: #ffe4df;
  --shadow: 0 10px 28px rgba(20, 37, 33, 0.09);
  --shadow-soft: 0 6px 16px rgba(20, 37, 33, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f7faf9 0, var(--bg) 38%, #e7efed 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

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

button:active {
  transform: translateY(1px);
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
}

.orientation-note {
  align-items: center;
  background: rgba(238, 243, 242, 0.94);
  color: var(--ink);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  text-align: center;
  z-index: 100;
}

.orientation-note strong {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: inline-block;
  font-size: 1.24rem;
  padding: 18px 22px;
}

.topbar,
.workspace,
.map-panel,
.side-panel,
.booking-editor,
.bookings-list,
.settings-shell {
  width: 100%;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 6px 8px;
}

.topbar-brand {
  justify-self: center;
  min-width: 0;
  text-align: center;
}

.brand-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.eyebrow {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 1.08rem;
  line-height: 1.1;
}

h2 {
  font-size: 0.92rem;
}

h3 {
  font-size: 0.96rem;
}

.topbar-actions,
.form-actions,
.settings-actions,
.panel-header {
  align-items: center;
  display: flex;
  gap: 6px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  justify-self: end;
}

.connection-status {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  display: none;
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 30px;
  padding: 5px 8px;
}

.connection-status.offline {
  background: var(--amber-soft);
  border-color: #f5d27a;
  color: var(--amber);
}

.workspace {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.map-panel,
.booking-editor,
.bookings-list {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 6px;
}

.map-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 5px;
}

.panel-header.tight {
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 3px 0 0;
}

.date-summary {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.compact-field {
  min-width: 138px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 30px;
  padding: 5px 8px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.segmented {
  background: #edf4f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-auto-columns: minmax(72px, 1fr);
  grid-auto-flow: column;
  overflow: hidden;
}

.segment {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 750;
  min-height: 30px;
  padding: 5px 8px;
}

.segment.active {
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.primary-button,
.ghost-button,
.danger-button {
  border-radius: 8px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
}

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

.primary-button:hover {
  background: var(--green-dark);
}

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

.ghost-button:hover {
  background: #f8fbfa;
  border-color: var(--line-strong);
}

.danger-button {
  background: var(--red-soft);
  border: 1px solid #ffc7bd;
  color: var(--red);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.stats-row {
  display: none;
  gap: 5px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 5px;
}

.stat {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 28px;
  padding: 4px 8px;
}

.stat span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stat strong {
  font-size: 0.95rem;
}

.map-stage {
  background:
    linear-gradient(90deg, rgba(132, 120, 102, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(132, 120, 102, 0.1) 1px, transparent 1px),
    #ded6c8;
  background-size: 7.5% 10%, 7.5% 10%, auto;
  border: 1px solid #a8b3ad;
  border-radius: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.map-bed-button {
  align-items: center;
  background: #b45309;
  border-color: #b45309;
  bottom: 12px;
  box-shadow: 0 12px 24px rgba(124, 45, 18, 0.22);
  display: inline-flex;
  font-size: 1.04rem;
  gap: 10px;
  left: 12px;
  min-height: 46px;
  padding: 9px 16px;
  position: absolute;
  z-index: 12;
}

.map-icon-actions {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 66px;
  left: 26px;
  z-index: 12;
}

.map-icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(21, 35, 33, 0.16);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(20, 37, 33, 0.12);
  color: var(--green);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.map-icon-button:hover {
  background: #fff;
  border-color: rgba(21, 35, 33, 0.26);
}

.map-icon-button svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 20px;
}

.revenue-icon-button {
  font-size: 1.12rem;
  font-weight: 950;
}

.map-bed-button:hover {
  background: #92400e;
  border-color: #92400e;
}

.map-bed-button .bed-icon {
  height: 14px;
  width: 24px;
}

.grass-zone {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 34%),
    #1f5f34;
  position: absolute;
  z-index: 0;
}

.grass-zone.top {
  height: 22%;
  left: 20%;
  right: 8%;
  top: 0;
}

.grass-zone.bottom {
  bottom: 0;
  height: 26%;
  left: 26%;
  right: 0;
}

.grass-zone.left {
  bottom: 0;
  left: 0;
  top: 0;
  width: 20%;
}

.grass-zone.right {
  bottom: 0;
  right: 0;
  top: 0;
  width: 20%;
}

.deck-area {
  background:
    linear-gradient(90deg, rgba(110, 102, 87, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(110, 102, 87, 0.09) 1px, transparent 1px),
    #ddd5c6;
  background-size: 12.5% 16%, 12.5% 16%, auto;
  border: 1px solid rgba(101, 93, 78, 0.12);
  position: absolute;
  z-index: 1;
}

.main-deck {
  height: 45%;
  left: 20%;
  top: 24%;
  width: 60%;
}

.lower-walkway {
  bottom: 0;
  height: 31%;
  left: 20%;
  width: 6%;
}

.pool-furniture {
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.pool-furniture {
  opacity: 0.42;
}

.pool-furniture::before {
  background: repeating-linear-gradient(
    90deg,
    rgba(86, 94, 91, 0.38) 0 10px,
    transparent 10px 18px
  );
  content: "";
  display: block;
  height: 100%;
  width: 100%;
}

.pool-furniture.top-row {
  height: 5%;
  left: 29%;
  top: 25.5%;
  width: 42%;
}

.pool-furniture.bottom-row {
  height: 5%;
  left: 38%;
  top: 55.5%;
  width: 28%;
}

.pool-furniture.left-row {
  height: 23%;
  left: 22.8%;
  top: 32%;
  width: 3.2%;
}

.pool-furniture.left-row::before {
  background: repeating-linear-gradient(
    0deg,
    rgba(86, 94, 91, 0.34) 0 10px,
    transparent 10px 18px
  );
}

.pool-shape {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 42%),
    #0b8fb3;
  border: 9px solid #f3f0e8;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 50, 84, 0.2),
    0 12px 22px rgba(18, 65, 84, 0.1);
  color: #072433;
  display: flex;
  font-size: 1.1rem;
  font-weight: 900;
  height: 34%;
  justify-content: center;
  left: 25%;
  position: absolute;
  top: 31%;
  width: 55%;
  z-index: 3;
}

.pool-status {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.35fr 1fr 1fr;
  padding: 0 12px;
  position: relative;
  text-align: center;
  width: 100%;
  z-index: 7;
}

.pool-status > span {
  display: none;
}

.pool-info-card {
  align-content: center;
  background: #f6fafa;
  border: 1px solid rgba(7, 36, 51, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(7, 36, 51, 0.1);
  color: #07334a;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 86px;
  padding: 8px;
}

.pool-date-card {
  cursor: pointer;
}

.pool-date-card strong {
  font-size: 1.26rem;
  white-space: nowrap;
}

.pool-slot-selector {
  border-radius: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 100%;
  width: 100%;
}

.pool-slot-selector .segment {
  font-size: 0.68rem;
  min-height: 26px;
  padding: 4px 5px;
}

.pool-date-input {
  background: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  min-height: 24px;
  padding: 2px 6px;
  width: 124px;
}

.date-picker-trigger {
  display: none;
}

.date-actions {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
}

.today-button,
.next-day-button {
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
  min-height: 24px;
  padding: 3px 8px;
  white-space: nowrap;
}

.next-day-button {
  font-size: 0.9rem;
  min-width: 28px;
  padding: 3px 7px;
}

.pool-info-card span {
  color: #174457;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pool-info-card strong {
  color: var(--green);
  font-size: 1.38rem;
  font-weight: 950;
  line-height: 1;
}

.pool-info-card strong b,
.pool-info-card small b {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.pool-info-card small {
  color: #5f716f;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-link-button {
  background: #fff;
  border: 1px solid rgba(7, 36, 51, 0.12);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 24px;
  padding: 3px 8px;
}

.bed-count {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  white-space: nowrap;
}

.extra-bed-plus {
  background: var(--green);
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 0.72em;
  font-weight: 950;
  line-height: 1;
  margin-left: 4px;
  padding: 2px 5px;
  vertical-align: 1px;
}

.bed-icon {
  border: 1.8px solid currentColor;
  border-radius: 3px 3px 2px 2px;
  display: inline-block;
  height: 9px;
  position: relative;
  width: 16px;
}

.bed-icon::before {
  background: currentColor;
  border-radius: 2px;
  content: "";
  height: 4px;
  left: 2px;
  position: absolute;
  top: 2px;
  width: 5px;
}

.bed-icon::after {
  background: currentColor;
  bottom: -4px;
  box-shadow: 10px 0 0 currentColor;
  content: "";
  height: 4px;
  left: 1px;
  position: absolute;
  width: 2px;
}

.beds-drawer {
  background: rgba(255, 255, 255, 0.99);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(20, 37, 33, 0.14);
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  padding: 14px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 180ms ease;
  width: min(360px, 86vw);
  z-index: 60;
}

.beds-drawer.open {
  transform: translateX(0);
}

.beds-drawer-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

.beds-drawer-list {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: hidden;
}

.beds-drawer-item {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 54px;
  padding: 8px;
  text-align: left;
}

.beds-drawer-item.arrived {
  background: #e5f7ee;
  border-color: #91d7ae;
}

.arrival-check-button {
  align-items: center;
  align-self: start;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 950;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 30px;
}

.arrival-check-button::before {
  content: "\2713";
}

.beds-drawer-item:not(.arrived) .arrival-check-button {
  color: var(--line-strong);
}

.beds-drawer-item.arrived .arrival-check-button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.beds-drawer-main {
  background: transparent;
  border: 0;
  color: inherit;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.beds-drawer-main strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beds-drawer-main span,
.beds-drawer-main small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.2;
}

.beds-drawer-empty {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0;
}

.entrance-label {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 33, 31, 0.18);
  border-radius: 8px;
  bottom: 5%;
  font-weight: 900;
  left: 5%;
  padding: 8px 12px;
  position: absolute;
  z-index: 2;
}

.resource-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.resource-marker {
  align-items: center;
  border: 1px solid rgba(21, 35, 33, 0.18);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(20, 37, 33, 0.07);
  color: var(--ink);
  display: grid;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 2px;
  justify-items: center;
  line-height: 1.1;
  min-height: 44px;
  overflow: visible;
  padding: 6px;
  position: absolute;
  text-align: center;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
}

.resource-marker small {
  align-items: center;
  color: inherit;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.84rem;
  font-weight: 900;
  gap: 2px 4px;
  justify-content: center;
  line-height: 1.05;
  min-width: 0;
  opacity: 0.95;
  overflow: visible;
  width: 100%;
}

.marker-name {
  flex: 1 1 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.resource-marker.ombrellone small {
  font-size: 0.78rem;
}

.resource-marker.gazebo small {
  font-size: 0.78rem;
}

.resource-marker.gazebo {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 45%),
    repeating-linear-gradient(90deg, rgba(79, 87, 84, 0.13) 0 2px, transparent 2px 8px),
    #e5e9e3;
  border-color: #8e9991;
  border-radius: 8px;
  aspect-ratio: 1;
  height: auto !important;
}

.resource-marker.ombrellone {
  background: #f7edcf;
  border-color: #a7833f;
  border-radius: 50%;
  aspect-ratio: 1;
  height: auto !important;
  font-size: 0.68rem;
  padding: 4px;
}

.resource-marker.lettone {
  background: #eef3fb;
  border-color: #8aa3c7;
}

.resource-marker.lettino {
  background: #ecfeff;
  border-color: #67e8f9;
  font-size: 0.62rem;
  min-height: 20px;
  padding: 2px;
}

.resource-marker.available {
  box-shadow:
    0 0 0 1px rgba(11, 107, 97, 0.16),
    0 4px 10px rgba(20, 37, 33, 0.07);
}

.resource-marker.occupied {
  background: #a83226;
  border-color: #7a271a;
  color: #fff;
  z-index: 8;
  box-shadow:
    0 0 0 3px rgba(180, 35, 24, 0.18),
    0 8px 18px rgba(20, 37, 33, 0.14);
}

.resource-marker.blocked {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px),
    #275f72;
  border-color: #16495a;
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(39, 95, 114, 0.18),
    0 8px 18px rgba(20, 37, 33, 0.14);
}

.resource-marker.service {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 5px, transparent 5px 10px),
    #4b5563;
  border-color: #28313d;
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(75, 85, 99, 0.18),
    0 8px 18px rgba(20, 37, 33, 0.14);
}

.service-label {
  font-weight: 950;
  letter-spacing: 0;
}

.resource-marker.arrived {
  box-shadow:
    0 0 0 3px rgba(11, 107, 97, 0.24),
    0 8px 18px rgba(20, 37, 33, 0.14);
}

.arrival-check-marker {
  color: #34d399;
  flex: 0 0 auto;
  font-weight: 950;
}

.delay-time {
  color: inherit;
  flex: 0 0 auto;
  font-weight: 950;
  white-space: nowrap;
}

.delay-time.late {
  color: #facc15;
}

.delay-time.blink {
  animation: delayBlink 1s steps(2, start) infinite;
  color: #fecaca;
}

.block-suffix,
.extra-bed-plus {
  flex: 0 0 auto;
  font-weight: 950;
  white-space: nowrap;
}

.resource-marker.move-mode {
  cursor: crosshair;
}

.resource-marker.move-target {
  outline: 3px solid rgba(11, 107, 97, 0.42);
}

.resource-marker.move-disabled {
  opacity: 0.52;
}

.resource-marker.selected {
  border-color: var(--green);
  box-shadow:
    0 0 0 4px rgba(15, 118, 110, 0.24),
    0 10px 20px rgba(20, 37, 33, 0.18);
}

.resource-marker.inactive {
  opacity: 0.45;
}

.resource-marker.editing {
  cursor: grab;
  outline: 2px dashed var(--blue);
}

.resource-marker.dragging {
  cursor: grabbing;
}

@keyframes delayBlink {
  50% {
    opacity: 0.22;
  }
}

.booking-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(20, 37, 33, 0.18);
  left: var(--card-left, 2%);
  max-width: 420px;
  overflow: visible;
  padding: 10px;
  position: absolute;
  top: var(--card-top, 2%);
  width: min(420px, 38%);
  z-index: 20;
}

.booking-card .panel-header {
  align-items: start;
  gap: 8px;
  margin-bottom: 8px;
}

.booking-card .muted {
  display: -webkit-box;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.booking-mode-actions,
.block-panel {
  grid-column: 1 / -1;
}

.booking-mode-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.booking-mode-actions .ghost-button {
  min-height: 28px;
}

.booking-mode-actions .ghost-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.block-panel {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 8px;
}

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

.block-type-grid label {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
}

.block-type-grid input {
  min-height: auto;
}

.block-type-grid span {
  font-size: 0.8rem;
  font-weight: 850;
}

.block-preview {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0;
}

.block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.booking-resource-display {
  align-items: center;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 8px;
}

.booking-resource-display span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.booking-resource-display strong {
  color: var(--green-dark);
  font-size: 0.94rem;
}

.booking-card .field {
  gap: 3px;
}

.booking-card input,
.booking-card textarea {
  min-height: 30px;
  padding: 5px 8px;
}

.number-stepper {
  display: grid;
  gap: 6px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}

.number-stepper button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 950;
  min-height: 30px;
  padding: 0;
}

.number-stepper input {
  text-align: center;
  width: 100%;
}

.booking-card textarea {
  min-height: 42px;
  resize: none;
}

.booking-card .notes-field,
.booking-card .booking-total,
.booking-card .form-message,
.booking-card .form-actions {
  grid-column: 1 / -1;
}

.booking-card .form-message {
  font-size: 0.78rem;
  min-height: 16px;
}

.booking-total {
  align-items: center;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 8px;
}

.booking-total span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.booking-total strong {
  color: var(--green);
  font-size: 1rem;
}

.form-grid {
  display: grid;
  gap: 10px;
}

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

.form-message {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
  min-height: 20px;
}

.form-message.error {
  color: var(--red);
  font-weight: 800;
}

.form-message.ok {
  color: var(--green);
  font-weight: 800;
}

.form-actions {
  justify-content: flex-end;
}

.search-input {
  max-width: 130px;
}

.booking-items {
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.booking-item {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.booking-item strong {
  display: block;
  margin-bottom: 4px;
}

.booking-item span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
}

.booking-item.active {
  border-color: var(--green);
  box-shadow:
    inset 0 0 0 1px var(--green),
    0 8px 16px rgba(11, 107, 97, 0.08);
}

.settings-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(20, 37, 33, 0.18);
  max-width: 1060px;
  padding: 0;
  width: min(94vw, 1060px);
}

.settings-dialog::backdrop {
  background: rgba(10, 20, 18, 0.34);
}

.settings-shell {
  background: var(--surface);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  overflow: visible;
  padding: 16px;
}

.settings-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-section {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.settings-section[open] {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(20, 37, 33, 0.06);
}

.settings-section summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 0.92rem;
  font-weight: 900;
  gap: 8px;
  justify-content: space-between;
  list-style: none;
  min-height: 42px;
  padding: 10px 12px;
}

.settings-section summary::-webkit-details-marker {
  display: none;
}

.settings-section summary::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  height: 8px;
  margin-left: auto;
  opacity: 0.6;
  transform: rotate(45deg) translateY(-2px);
  width: 8px;
}

.settings-section[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.settings-summary-title {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.settings-summary-icon {
  align-items: center;
  background: var(--green);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 950;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.settings-section-body {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 12px;
}

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

.revenue-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
}

.revenue-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
}

.revenue-card strong {
  color: var(--green-dark);
  font-size: 1.6rem;
  font-weight: 950;
  line-height: 1;
}

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

.pricing-settings-list {
  display: grid;
  gap: 12px;
}

.pricing-group {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.pricing-group h4 {
  font-size: 0.86rem;
  margin: 0 0 8px;
}

.pricing-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
}

.pricing-field {
  display: grid;
  gap: 4px;
}

.pricing-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.pricing-field input {
  min-height: 34px;
  padding: 7px 8px;
}

.resource-row {
  align-items: end;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr 0.8fr auto;
  padding: 10px;
}

.resource-row label {
  display: grid;
  gap: 4px;
}

.resource-row label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.resource-row input,
.resource-row select {
  min-height: 34px;
  padding: 7px 8px;
}

.file-button {
  align-items: center;
  display: inline-flex;
  position: relative;
}

.file-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

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

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

@media (min-width: 821px) and (max-width: 1180px) and (orientation: landscape) {
  .map-icon-actions {
    bottom: 76px;
    gap: 12px;
    left: 28px;
  }

  .map-icon-button {
    border-radius: 10px;
    height: 48px;
    width: 48px;
  }

  .map-icon-button svg {
    height: 23px;
    width: 23px;
  }

  .revenue-icon-button {
    font-size: 1.24rem;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 44px;
    padding: 7px 12px;
  }

  .map-bed-button.primary-button {
    bottom: 14px;
    font-size: 1.08rem;
    gap: 11px;
    min-height: 54px;
    padding: 11px 18px;
  }

  .pool-info-card {
    min-height: 92px;
    padding: 10px;
  }

  .pool-date-card strong {
    font-size: 1.34rem;
  }

  .pool-date-input {
    min-height: 30px;
    width: 136px;
  }

  .today-button,
  .next-day-button {
    min-height: 32px;
    padding: 5px 10px;
  }

  .date-actions {
    gap: 7px;
  }

  .pool-slot-selector .segment {
    font-size: 0.74rem;
    min-height: 34px;
    padding: 6px 7px;
  }

  .resource-marker {
    touch-action: manipulation;
  }

  .booking-card {
    max-width: 460px;
    padding: 12px;
    width: min(460px, 42%);
  }

  .booking-card .form-grid {
    gap: 10px;
  }

  .booking-card input,
  .booking-card textarea {
    min-height: 42px;
    padding: 7px 10px;
  }

  .booking-card textarea {
    min-height: 54px;
  }

  .booking-mode-actions,
  .block-actions,
  .form-actions {
    gap: 8px;
  }

  .booking-mode-actions .ghost-button {
    min-height: 36px;
  }

  .number-stepper {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .number-stepper button {
    min-height: 42px;
  }
}

@media (orientation: portrait) and (max-width: 1100px) {
  .orientation-note {
    display: flex;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 6px;
  }

  .topbar {
    align-items: center;
    display: grid;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px;
  }

  .date-summary {
    font-size: 1.28rem;
  }

  .topbar-actions,
  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
  }

  .segmented {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

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

  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .map-stage {
    min-height: 0;
  }

  .pool-status {
    gap: 6px;
    padding: 0 8px;
  }

  .pool-info-card {
    gap: 3px;
    min-height: 74px;
    padding: 6px;
  }

  .pool-info-card span,
  .pool-info-card small,
  .mini-link-button {
    font-size: 0.64rem;
  }

  .pool-info-card strong {
    font-size: 1.18rem;
  }

  .resource-marker.gazebo small {
    font-size: 0.84rem;
  }

  .resource-marker.ombrellone small {
    font-size: 0.72rem;
  }

  .booking-card {
    bottom: 8px;
    left: 8px !important;
    max-width: none;
    right: 8px;
    top: auto !important;
    width: auto;
  }

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

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

@media (orientation: portrait) and (max-width: 640px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  body {
    background: #eef3f2;
  }

  .orientation-note {
    display: none;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 6px 18px 6px 6px;
    max-width: 100%;
    width: 100%;
  }

  .workspace,
  .map-panel {
    display: block;
    height: auto;
    max-width: 100%;
    min-height: 0;
    width: 100%;
  }

  .map-panel {
    padding: 0;
  }

  .map-stage {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 8px;
    height: auto;
    max-width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .grass-zone,
  .deck-area,
  .pool-furniture {
    display: none;
  }

  .pool-shape {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    display: block;
    height: auto;
    left: auto;
    max-width: 100%;
    order: 1;
    padding: 8px;
    position: static;
    top: auto;
    width: auto;
  }

  .pool-status {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    padding: 0;
  }

  .pool-date-card {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }

  .pool-date-card > span:first-child {
    grid-column: 1 / -1;
  }

  .pool-info-card {
    box-shadow: none;
    min-height: 68px;
    padding: 7px;
  }

  .pool-beds-card {
    display: none;
  }

  .pool-status .pool-info-card:not(.pool-date-card):not(.pool-beds-card) {
    grid-column: 1 / -1;
  }

  .pool-date-card strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.28rem;
    white-space: normal;
  }

  .pool-slot-selector {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .pool-slot-selector .segment {
    font-size: 0.62rem;
    min-height: 28px;
    padding: 4px 3px;
  }

  .pool-date-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
  }

  .date-picker-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--green);
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 950;
    justify-content: center;
    min-height: 28px;
    padding: 4px 5px;
    text-transform: none;
    white-space: nowrap;
  }

  .date-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .today-button,
  .next-day-button {
    min-height: 28px;
    padding: 4px 7px;
  }

  .pool-info-card .date-picker-trigger {
    color: var(--green);
    grid-column: 2;
    grid-row: 2;
    text-transform: none;
  }

  .map-icon-actions {
    display: none;
  }

  .map-bed-button {
    display: none;
  }

  .booking-card {
    bottom: auto;
    left: auto !important;
    max-width: none;
    order: 3;
    padding: 10px;
    position: static;
    right: auto;
    top: auto !important;
    width: auto;
  }

  .booking-card .panel-header {
    align-items: start;
  }

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

  .booking-mode-actions,
  .form-actions,
  .block-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .block-type-grid {
    grid-template-columns: 1fr;
  }

  .resource-layer {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    max-width: 100%;
    order: 4;
    pointer-events: auto;
    position: static;
  }

  body.booking-editor-open .resource-layer {
    display: none;
  }

  .mobile-resource-section {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    pointer-events: auto;
  }

  .mobile-resource-section summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    font-weight: 950;
    justify-content: flex-start;
    list-style: none;
    min-height: 48px;
    padding: 11px 12px;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .mobile-resource-section summary::-webkit-details-marker {
    display: none;
  }

  .mobile-resource-section summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 8px;
    margin-left: auto;
    opacity: 0.55;
    transform: rotate(45deg) translateY(-2px);
    width: 8px;
  }

  .mobile-resource-section[open] summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
  }

  .mobile-resource-section summary small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    margin-left: 8px;
    margin-right: 0;
  }

  .mobile-resource-section summary small b {
    color: var(--green);
    font-size: inherit;
    font-weight: 950;
  }

  .mobile-resource-section summary small span {
    color: var(--muted);
    font-size: inherit;
    font-weight: inherit;
  }

  .mobile-section-title {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-width: 0;
  }

  .mobile-section-icon {
    color: var(--green);
    display: inline-block;
    flex: 0 0 auto;
    height: 22px;
    position: relative;
    width: 24px;
  }

  .mobile-section-icon-bed,
  .mobile-section-icon-double-bed {
    border: 2px solid currentColor;
    border-radius: 4px 4px 3px 3px;
    height: 13px;
    margin-top: 5px;
  }

  .mobile-section-icon-bed::before,
  .mobile-section-icon-double-bed::before {
    background: currentColor;
    border-radius: 2px;
    content: "";
    height: 5px;
    left: 3px;
    position: absolute;
    top: 3px;
    width: 7px;
  }

  .mobile-section-icon-double-bed::before {
    box-shadow: 9px 0 0 currentColor;
  }

  .mobile-section-icon-bed::after,
  .mobile-section-icon-double-bed::after {
    background: currentColor;
    bottom: -6px;
    box-shadow: 15px 0 0 currentColor;
    content: "";
    height: 5px;
    left: 1px;
    position: absolute;
    width: 2px;
  }

  .mobile-section-icon-umbrella::before {
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    content: "";
    height: 10px;
    left: 1px;
    position: absolute;
    top: 2px;
    width: 20px;
  }

  .mobile-section-icon-umbrella::after {
    background: currentColor;
    box-shadow:
      -5px 10px 0 -1px currentColor,
      5px 10px 0 -1px currentColor;
    content: "";
    height: 16px;
    left: 11px;
    position: absolute;
    top: 7px;
    width: 2px;
  }

  .mobile-section-icon-gazebo::before {
    border-bottom: 9px solid currentColor;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    content: "";
    left: 0;
    position: absolute;
    top: 1px;
  }

  .mobile-section-icon-gazebo::after {
    border: 2px solid currentColor;
    border-top: 0;
    content: "";
    height: 11px;
    left: 4px;
    position: absolute;
    top: 10px;
    width: 16px;
  }

  .mobile-resource-grid {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    min-width: 0;
    padding: 8px;
    width: 100%;
  }

  .mobile-beds-actions {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .mobile-action-button {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    min-height: 46px;
    width: 100%;
  }

  .resource-marker,
  .resource-marker.gazebo,
  .resource-marker.ombrellone,
  .resource-marker.lettone {
    aspect-ratio: auto;
    border-radius: 8px;
    font-size: 0.98rem;
    height: auto !important;
    left: auto !important;
    min-height: 58px;
    min-width: 0;
    padding: 8px;
    position: relative;
    top: auto !important;
    width: auto !important;
  }

  .resource-marker.ombrellone {
    border-radius: 8px;
  }

  .resource-marker small,
  .resource-marker.gazebo small,
  .resource-marker.ombrellone small {
    font-size: 0.82rem;
  }

  .resource-marker.lettone {
    grid-column: span 2;
    min-height: 50px;
  }

  .beds-drawer {
    width: 100vw;
  }

  .settings-dialog {
    height: min(96dvh, 720px);
    max-width: none;
    width: 96vw;
  }

  .settings-shell {
    max-height: 96dvh;
    overflow: auto;
    padding: 12px;
  }

  .settings-header {
    gap: 8px;
  }

  .settings-actions,
  .revenue-grid,
  .resource-row,
  .pricing-grid,
  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    align-items: stretch;
    display: grid;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .map-icon-actions {
    display: none;
  }

  .pool-status {
    grid-template-columns: 1fr;
    height: 100%;
    padding: 0 8px;
  }

  .pool-beds-card,
  #poolRevenueCard {
    display: none;
  }

  .pool-date-card {
    align-content: center;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(34px, auto) minmax(38px, auto);
    height: 100%;
    min-height: 0;
    padding: 8px 10px;
    text-align: left;
  }

  .pool-date-card > span:first-child {
    display: none;
  }

  .pool-date-card strong {
    align-self: center;
    grid-column: 1;
    grid-row: 1;
    font-size: 1.18rem;
    line-height: 1.05;
    min-width: 0;
    white-space: normal;
  }

  .pool-date-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
  }

  .pool-info-card .date-picker-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--green);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 950;
    justify-content: center;
    min-height: 36px;
    min-width: 76px;
    padding: 6px 9px;
    text-transform: none;
    white-space: nowrap;
  }

  .date-actions {
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .today-button,
  .next-day-button {
    font-size: 0.72rem;
    min-height: 36px;
    min-width: 44px;
    padding: 6px 10px;
  }

  .next-day-button {
    min-width: 40px;
  }

  .pool-slot-selector {
    align-self: stretch;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .pool-slot-selector .segment {
    font-size: 0.72rem;
    line-height: 1;
    min-height: 38px;
    padding: 7px 5px;
  }

  .booking-card {
    bottom: auto;
    left: 8px !important;
    max-height: calc(100dvh - 16px);
    max-width: none;
    overflow: auto;
    right: 8px;
    top: 8px !important;
    width: auto;
    z-index: 80;
    -webkit-overflow-scrolling: touch;
  }

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

  .booking-card .panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .booking-card .form-actions {
    background: rgba(255, 255, 255, 0.98);
    bottom: 0;
    padding-top: 6px;
    position: sticky;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar-actions,
  .booking-editor,
  .settings-dialog,
  .ghost-button,
  .primary-button,
  .danger-button {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .topbar,
  .workspace,
  .map-panel,
  .bookings-list {
    border: 0;
    box-shadow: none;
  }

  .workspace {
    display: block;
  }

  .side-panel {
    display: block;
    margin-top: 12px;
  }

  .booking-items {
    max-height: none;
  }
}
