/* YARDEN ASKAYO — design system */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #F2E9DF;
  --bg-deep: #EADFD2;
  --card: #FBF7F1;
  --ink: #4A3428;
  --brand: #7E4F3D;
  --brand-dark: #64392B;
  --brand-soft: #A9836F;
  --muted: #9B8574;
  --line: #E3D5C6;
  --accent2: #B98A6F;
  --success: #6E8B5E;
  --danger: #B3563E;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 3px 16px rgba(126, 79, 61, .09);
  --shadow-lg: 0 10px 34px rgba(100, 57, 43, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Assistant', -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  touch-action: manipulation;   /* מבטל זום בהקשה כפולה במובייל */
}

body { direction: rtl; }

h1, h2, h3 { font-weight: 600; color: var(--brand-dark); letter-spacing: .01em; }

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  min-height: 100%;
}
.page.wide { max-width: 1080px; }

/* ---------- header ---------- */
.app-header {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 2px 12px; min-height: 62px;
}
.app-header .logo-img { height: 15px; display: block; }

/* ---------- avatar ---------- */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--bg-deep); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.6rem; }

/* logout button (left side) */
.user-box {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%); z-index: 55;
  display: flex; align-items: center; gap: 8px;
}
.hdr-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; padding: 0;
  border: 1.5px solid var(--line); background: var(--card); cursor: pointer;
}
.hdr-avatar .avatar { width: 100%; height: 100%; font-size: .95rem; }
@media (max-width: 600px) {
  .app-header .logo-img { height: 11px; }
  .user-box { gap: 5px; }
  .logout-btn, .hdr-avatar { width: 33px; height: 33px; }
  .logout-btn svg { width: 15px; height: 15px; }
}
.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--line); cursor: pointer;
  color: var(--brand-dark);
}
.logout-btn svg { width: 18px; height: 18px; }

.section-title {
  font-size: 1.15rem; margin: 22px 2px 10px; display: flex;
  align-items: center; justify-content: space-between;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 12px;
}
.card.flat { box-shadow: none; }

.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  border-radius: 999px; padding: 13px 22px;
  background: var(--brand); color: #FBF7F1;
  transition: transform .06s ease, background .15s ease, opacity .15s;
  min-height: 48px;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--brand-soft);
}
.btn.soft { background: var(--bg-deep); color: var(--brand-dark); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.small { padding: 7px 14px; min-height: 34px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.icon-btn { padding: 10px; min-height: 42px; min-width: 42px; border-radius: 50%; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--brand-dark); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; outline: none;
  width: 100%;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand-soft); }
.field .hint { font-size: .8rem; color: var(--muted); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-family: inherit;
  font-size: .95rem; font-weight: 500; cursor: pointer;
  transition: all .12s ease;
}
.chip.selected { background: var(--brand); border-color: var(--brand); color: #FBF7F1; }
.chip:disabled { opacity: .35; cursor: default; text-decoration: line-through; }

/* ---------- lists ---------- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px;
  cursor: pointer; transition: background .12s;
}
.list-item:hover { background: #fff; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.price-tag { font-weight: 700; color: var(--brand); white-space: nowrap; }

.empty {
  text-align: center; color: var(--muted); padding: 34px 10px;
  font-size: .95rem;
}
.empty .big { font-size: 1.9rem; margin-bottom: 8px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 40;
  background: rgba(251, 247, 241, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  flex: 1; max-width: 130px; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .74rem; font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
  border-radius: 12px; position: relative;
}
.bottom-nav button svg { width: 23px; height: 23px; stroke: currentColor; }
.bottom-nav button.active { color: var(--brand); }
.nav-badge {
  position: absolute; top: 0; inset-inline-end: 22%;
  background: var(--danger); color: #fff; font-size: .62rem;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- modal / sheet ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(74, 52, 40, .45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  transform: translateY(30px); transition: transform .2s ease;
}
.modal-back.open .modal { transform: none; }
.modal { position: relative; }
.modal h3 { margin-bottom: 14px; font-size: 1.15rem; padding-left: 40px; }
.modal-x {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--bg-deep); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
}
.modal-x svg { width: 15px; height: 15px; }
.modal-x:active { transform: scale(.92); }
.modal .modal-close { float: left; }
@media (min-width: 700px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 22px; }
}

/* ---------- misc ---------- */
.tag {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 10px; font-size: .75rem; font-weight: 700;
}
.tag.staff-c0 { background: #E9D8CB; color: var(--brand-dark); }
.tag.staff-c1 { background: #DDE3D3; color: #4C5F3D; }
.tag.staff-c2 { background: #E3D3DD; color: #5F3D51; }
.tag.staff-c3 { background: #D3DDE3; color: #3D515F; }
.tag.staff-c4 { background: #EFE4C8; color: #6B5A2E; }
.tag.staff-c5 { background: #E0D5EA; color: #4E3D5F; }
.tag.cancelled { background: #F0DBD3; color: var(--danger); }
.tag.done { background: #E3E8DC; color: var(--success); }
.tag.pay { background: var(--bg-deep); color: var(--brand-dark); }
.tag.pending { background: #F3E6C9; color: #8A6A2F; }

/* health declaration */
.decl-intro { white-space: pre-line; color: var(--muted); font-size: .9rem; margin: 6px 0 14px; text-align: center; }
.decl-questions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.decl-q {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--bg); border-radius: 11px; padding: 9px 12px;
}
.decl-q-label { flex: 1; min-width: 55%; font-size: .9rem; }
.decl-yn { display: flex; gap: 6px; }
.decl-yn .chip { padding: 5px 14px; font-size: .85rem; }
.decl-detail { width: 100%; font-family: inherit; font-size: .9rem; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff; outline: none; }
.decl-note { font-size: .78rem; color: var(--muted); margin: 4px 0; }
.decl-consent-title { font-weight: 700; color: var(--brand-dark); margin: 16px 0 6px; }
.decl-consent { white-space: pre-line; font-size: .84rem; line-height: 1.65; color: var(--ink);
  background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 34vh; overflow-y: auto; }
.decl-sig-label { font-weight: 700; color: var(--brand-dark); margin: 16px 0 8px; }
.sig-wrap { text-align: center; margin-bottom: 10px; }
.sig-wrap canvas {
  width: 100%; height: 150px; touch-action: none; cursor: crosshair;
  background: #fff; border: 1.5px dashed var(--brand-soft); border-radius: var(--radius-sm);
}
.sig-wrap .btn { margin-top: 8px; }

/* service info button + modal */
.info-btn {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line); background: var(--bg-deep); color: var(--brand-dark);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.info-btn svg { width: 16px; height: 16px; }
.info-btn-spacer { width: 30px; flex-shrink: 0; }
/* עמודת מחיר ברוחב קבוע — כל המחירים על אותו קו */
.svc-price { min-width: 72px; text-align: center; flex-shrink: 0; }
.sub .svc-chevron { display: inline-flex; vertical-align: middle; margin-inline-start: 2px; }
.sub .svc-chevron svg { width: 14px; height: 14px; }
.svc-desc {
  white-space: pre-line; color: var(--ink); font-size: .93rem; line-height: 1.7;
  background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px;
  max-height: 42vh; overflow-y: auto;
}

/* service add-ons (accordion) */
.service-group { margin-bottom: 8px; }
.svc-chevron {
  display: flex; align-items: center; color: var(--brand-soft); margin-inline-start: 2px;
}
.svc-chevron svg { width: 18px; height: 18px; transition: transform .18s; }
.svc-chevron.open svg { transform: rotate(180deg); }
.addon-panel {
  background: var(--bg-deep); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px 14px 14px; margin-top: -4px;
  animation: fadeIn .18s ease;
}
.addon-hint { font-size: .82rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 8px; }
.addon-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 11px;
  padding: 10px 12px; margin-bottom: 6px; font-size: .93rem;
}
.addon-row:has(input:checked) { border-color: var(--brand); background: #fff; }
.addon-row input[type="checkbox"] {
  width: 19px; height: 19px; accent-color: var(--brand); flex-shrink: 0;
}
.addon-row .addon-price { font-weight: 700; color: var(--brand); }

/* payment method selector (booking) */
.pay-option {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; cursor: pointer; transition: border-color .12s, background .12s;
}
.pay-option.selected { border-color: var(--brand); background: #fff; }
.pay-option .po-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pay-option.selected .po-radio { border-color: var(--brand); }
.pay-option.selected .po-radio::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
}
.pay-option .po-title { font-weight: 700; }
.pay-option .po-sub { font-size: .8rem; color: var(--muted); margin-top: 1px; }

/* payment sheet */
.pay-amount { text-align: center; font-size: 2rem; font-weight: 700; color: var(--brand-dark); margin: 8px 0 2px; }
.pay-phone {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-deep); border-radius: 14px; padding: 14px; margin: 14px 0;
  font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); direction: ltr;
}

.divider { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

.toast {
  position: fixed; bottom: 92px; right: 50%; transform: translateX(50%) translateY(10px);
  background: var(--brand-dark); color: #FBF7F1; padding: 12px 22px;
  border-radius: 999px; font-weight: 600; z-index: 90; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all .22s ease; max-width: 90vw; text-align: center;
  font-size: .95rem;
}
.toast.show { opacity: 1; transform: translateX(50%); }

.segmented {
  display: flex; background: var(--bg-deep); border-radius: 999px; padding: 4px; gap: 2px;
}
.segmented button {
  flex: 1; border: none; background: transparent; font-family: inherit;
  font-weight: 600; font-size: .9rem; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.segmented button.active { background: var(--card); color: var(--brand-dark); box-shadow: var(--shadow); }

.fab-wrap {
  position: fixed; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45;
  right: 50%; transform: translateX(50%);
  display: flex; gap: 10px;
}
.fab {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .95rem;
  background: var(--brand); color: #FBF7F1; border-radius: 999px;
  padding: 13px 20px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 7px;
}
.fab.secondary { background: var(--card); color: var(--brand); border: 1.5px solid var(--brand-soft); }

.skeleton { color: var(--muted); text-align: center; padding: 26px; }

/* ---------- client picker (dropdown + quick create) ---------- */
.picker-dropdown {
  position: absolute; top: 100%; right: 0; left: 0; z-index: 70;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto;
  display: none; margin-top: 4px;
}
.picker-dropdown.open { display: block; animation: fadeIn .12s ease; }
.pd-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; font-size: .95rem;
}
.pd-item:hover { background: var(--bg-deep); }
.pd-item .pd-phone { color: var(--muted); font-size: .84rem; direction: ltr; }
.pd-item.pd-new { color: var(--brand); font-weight: 700; border-top: 1px solid var(--line); }
.pd-item.pd-new:only-child { border-top: none; }
.pd-empty { padding: 11px 14px; color: var(--muted); font-size: .88rem; }
.quick-client {
  background: var(--bg-deep); border-radius: 14px; padding: 14px; margin-top: 10px;
}
.quick-client .field input { background: #fff; }

/* ---------- datepicker ---------- */
.dp-input { cursor: pointer; background: #fff; }
.dp-overlay {
  position: fixed; inset: 0; z-index: 85; background: rgba(74, 52, 40, .45);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.dp-overlay.open { display: flex; animation: fadeIn .15s ease; }
.dp-card {
  background: #FDFBF7; border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 16px; width: 100%; max-width: 360px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-nav {
  width: 46px; height: 42px; border-radius: 14px; border: none; cursor: pointer;
  background: #F2EDE5; color: #6B6257; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.dp-nav svg { width: 19px; height: 19px; }
.dp-title {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 1.15rem; color: var(--ink); padding: 8px 14px; border-radius: 12px;
}
.dp-title:hover { background: #F2EDE5; }
.dp-grid.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid.months, .dp-grid.years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 0; }
.dp-dow { text-align: center; font-size: .8rem; color: #A99F92; font-weight: 700; padding: 8px 0 6px; }
.dp-cell {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 1.05rem; font-weight: 600; color: var(--ink); border-radius: 12px;
}
.dp-grid.days .dp-cell { aspect-ratio: 1; }
.dp-grid.months .dp-cell, .dp-grid.years .dp-cell { padding: 13px 4px; font-size: .95rem; }
.dp-cell:hover { background: #F2EDE5; }
.dp-cell.out { color: #BFB7AA; }
.dp-cell.sel { background: #C8813F; color: #3F2A1A; }
.dp-cell.now { color: #C8813F; }
.dp-today {
  width: 100%; margin-top: 12px; padding: 14px; border-radius: 999px;
  background: #F2EDE5; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 1rem; color: var(--ink);
}

/* view switching */
.view { display: none; }
.view.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* studio card photo */
.studio-card { padding-top: 0; padding-left: 0; padding-right: 0; overflow: hidden; }
.studio-card .row { padding: 0 18px; }
.studio-card .row:last-child { padding-bottom: 4px; }
.studio-photo {
  width: 100%; max-height: 300px; object-fit: cover; display: block;
  margin-bottom: 14px;
}

/* info footer */
.biz-footer {
  text-align: center; color: var(--muted); font-size: .85rem;
  padding: 18px 0 8px;
}
.biz-footer .contact-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }

/* ===== אישור הגעה ===== */
.ta-conf {
  flex-shrink: 0; width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; margin-top: 2px;
}
.ta-conf.ok { background: #DCEBDA; color: #47703F; }
.ta-conf.no { background: #F3E6C9; color: #8A6D1F; }
.wk-conf { color: #47703F; font-weight: 700; }
.next-appt .conf-line { font-size: .88rem; margin-top: 10px; opacity: .95; }
.next-appt .conf-btn {
  margin-top: 12px; background: #FBF7F1; color: var(--brand-dark);
  width: 100%; font-size: .95rem;
}
.next-appt .conf-hint { font-size: .74rem; opacity: .8; margin-top: 7px; text-align: center; }
.conf-hint { font-size: .76rem; margin-top: 6px; }

/* ===== רשימת המתנה ===== */
.chip.wl { border-style: dashed; color: var(--muted); }
.chip.wl.mine {
  background: var(--bg-deep); border-style: solid; border-color: var(--brand-soft);
  color: var(--brand-dark); opacity: 1;
}
.wl-box {
  width: 100%; margin-top: 18px; background: var(--card);
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.wl-title { font-weight: 700; color: var(--brand-dark); font-size: .95rem; }
.wl-sub { font-size: .82rem; color: var(--muted); margin: 3px 0 10px; }

.wl-admin {
  background: var(--card); border: 1.5px dashed var(--brand-soft);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
}
.wl-admin-title { font-weight: 700; color: var(--brand-dark); font-size: .9rem; margin-bottom: 6px; }
.wl-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; font-size: .88rem; border-top: 1px solid var(--line);
}
.wl-row:first-of-type { border-top: none; }
.wl-row b { color: var(--brand-dark); }
.wl-row .grow { min-width: 0; }

/* desktop tweaks */
@media (min-width: 900px) {
  .page { padding-top: 26px; }
  .bottom-nav {
    top: 0; bottom: auto; border-top: none; border-bottom: 1px solid var(--line);
    justify-content: center; gap: 18px; padding: 8px;
  }
  .bottom-nav button { flex-direction: row; font-size: .95rem; max-width: none; flex: none; padding: 8px 16px; }
  .bottom-nav button svg { width: 19px; height: 19px; }
  .nav-badge { position: static; margin-inline-start: 4px; }
  .page { padding-top: 84px; }
  .fab-wrap { right: auto; left: 40px; transform: none; bottom: 40px; }
}
