:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-muted: #edf3f2;
  --text: #15211f;
  --muted: #5b6b67;
  --line: #d9e4e1;
  --primary: #0b6f63;
  --primary-strong: #084f47;
  --accent: #c47b25;
  --danger: #b3261e;
  --ok: #167549;
  --warn: #a86b00;
  --shadow: 0 18px 55px rgba(13, 35, 31, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; }
.shell { min-height: 100vh; }
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a, .ghost, button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px 14px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
button.primary, a.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
button.primary:hover, a.primary:hover { background: var(--primary-strong); }
button.danger { color: var(--danger); border-color: #e7b8b4; }
button:disabled { opacity: .55; cursor: not-allowed; }

.page { max-width: 1180px; margin: 0 auto; padding: 34px 22px 64px; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 30px;
  align-items: start;
  margin-top: 18px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
  margin: 0 0 18px;
}
.lead { font-size: 19px; color: var(--muted); max-width: 720px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel h2, .panel h3 { margin: 0 0 14px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 16px;
  align-items: start;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.stat strong { display: block; font-size: 28px; }
.stat span { color: var(--muted); }

form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 14px; }
.status { min-height: 24px; font-weight: 700; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.day {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
  display: grid;
  align-content: space-between;
}
.day.free { border-color: #b8dbca; background: #f4fbf7; }
.day.blocked { border-color: #efc3bf; background: #fff5f4; }
.day.pending { border-color: #f2d8a2; background: #fff9ec; }
.day b { font-size: 14px; }
.day span { font-size: 12px; color: var(--muted); }

.calendar-toolbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: end;
}
.calendar-toolbar button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}
.month-controls {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}
.booking-calendar {
  --cell-size: 82px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}
.calendar-weekday {
  min-height: 30px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.calendar-day {
  min-height: var(--cell-size);
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 3px;
  text-align: right;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.calendar-day:not(:disabled):hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 111, 99, .12);
}
.calendar-day.free { background: #f6fcf9; border-color: #b9dfcf; }
.calendar-day.blocked { background: #fff4f3; border-color: #edbbb6; }
.calendar-day.pending { background: #fff8e8; border-color: #f1d697; }
.calendar-day.outside {
  opacity: .38;
  background: #f6f8f8;
}
.calendar-day.in-range {
  background: #e8f6f2;
  border-color: #77b8ac;
}
.calendar-day.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 8px 22px rgba(11, 111, 99, .25);
}
.calendar-day.selected .calendar-day-status,
.calendar-day.selected .calendar-day-price { color: rgba(255,255,255,.88); }
.calendar-day:disabled {
  cursor: not-allowed;
}
.calendar-day-number {
  font-size: 17px;
  font-weight: 800;
}
.calendar-day-price {
  align-self: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-strong);
}
.calendar-day-status {
  font-size: 12px;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.free { background: #49a974; }
.legend-dot.blocked { background: #cc4b42; }
.legend-dot.pending { background: #d69523; }
.legend-dot.selected { background: var(--primary); }
.selection-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}
.selection-card span,
.selection-card small {
  color: var(--muted);
}
.selection-card strong {
  font-size: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.side {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 10px;
}
.side button { text-align: right; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td { text-align: right; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); background: var(--surface-muted); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}
.badge.pending { color: var(--warn); background: #fff3d7; }
.badge.confirmed { color: var(--ok); background: #e9f7ef; }
.badge.cancelled { color: var(--danger); background: #ffe6e3; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .topbar { padding: 12px 16px; align-items: flex-start; flex-direction: column; }
  .hero, .admin-layout, .demo-layout, .grid.cols-3, .grid.cols-2, .form-row { grid-template-columns: 1fr; }
  .side { position: static; }
  table { display: block; overflow-x: auto; }
  .booking-calendar { --cell-size: 70px; gap: 5px; padding: 6px; }
  .calendar-day { padding: 6px; }
  .calendar-day-price, .calendar-day-status { font-size: 11px; }
}

@media (max-width: 520px) {
  .booking-calendar { --cell-size: 58px; }
  .month-controls { grid-template-columns: 1fr; }
  .calendar-toolbar { grid-template-columns: 40px 1fr 40px; }
  .calendar-day-number { font-size: 15px; }
}
