/* The web client's one stylesheet (FEATURE_18): owners' pages, the onboarding wizard and admin.
   Style "soft": rounded cards without borders on a tinted background, blue primary buttons, amber for bookings.
   Colours follow the landing page. Logical properties (inline-start/end) keep Hebrew and English right. */
:root {
  --ink: #0b0f14; --ink-2: #4b5563; --ink-3: #7c8591;
  --line: #e3e8f4; --soft: #f5f6f8; --bg: #eef2fb; --card: #ffffff;
  --accent: #2b59ff; --accent-soft: #eef2ff;
  --booked: #f5b544; --booked-soft: #fff4de; --booked-ink: #3b2600;
  --ok: #0f7a54; --ok-soft: #e7f6ef; --bad: #a5281d; --bad-soft: #fbeceb;
  --sans: "Rubik", "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 26px; --r-btn: 16px; --r-in: 14px;
  --shadow: 0 8px 24px -10px rgba(43, 89, 255, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Wide screens: scale the whole page so it fills them like it fills a 1280 px laptop. */
@media (min-width: 1600px) { html { zoom: 1.25; } }
@media (min-width: 1920px) { html { zoom: 1.5; } }
@media (min-width: 2400px) { html { zoom: 1.75; } }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .9em; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.stack { display: grid; gap: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Header */
header.top { position: sticky; top: 0; z-index: 2; background: rgba(255, 255, 255, .8); backdrop-filter: blur(8px); }
header.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); position: relative; flex: none; }
.brand i::after { content: ""; position: absolute; inset: 9px 4px 5px 4px; border-radius: 2px; background: var(--booked); }
.env-badge { font: 500 .7rem var(--mono); background: #fff3bf; color: #6b5200; border-radius: 6px; padding: 1px 6px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs a { color: var(--ink-2); padding: 7px 12px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
nav.tabs a:hover { background: var(--accent-soft); text-decoration: none; }
nav.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.head-end { margin-inline-start: auto; display: flex; gap: 12px; align-items: center; }
.head-end form { margin: 0; display: inline; }
.banner { background: #fff8c5; padding: 8px 0; font-size: .88rem; }

main { padding: 28px 0 72px; }
main > .wrap { display: grid; gap: 20px; }

/* Buttons: primary, secondary, quiet, risk */
button, .btn { font: 600 .92rem var(--sans); border-radius: var(--r-btn); padding: 10px 20px; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; justify-self: start; text-decoration: none; line-height: 1.3; }
button, .btn.primary { background: var(--accent); color: #fff; }
button:hover, .btn.primary:hover { background: #1f4ae6; text-decoration: none; }
.btn.secondary, button.secondary, button.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover, button.secondary:hover, button.ghost:hover { border-color: var(--ink-3); background: var(--card); }
.btn.quiet, button.quiet { background: none; color: var(--ink-2); padding-inline: 8px; }
.btn.quiet:hover, button.quiet:hover { color: var(--ink); background: none; }
.btn.risk, button.risk { background: none; color: var(--bad); border-color: #efc9c5; }
.btn.risk:hover, button.risk:hover { background: var(--bad-soft); }
.btn.google { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; }
.btn.google span { font-weight: 700; color: #4285f4; }
p.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; margin: 14px 0; }
p.or::before, p.or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn.small, button.small { padding: 6px 13px; font-size: .85rem; border-radius: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* Cards, chips, notices */
.card { background: var(--card); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: .8rem; font-weight: 500; white-space: nowrap; background: var(--soft); color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.live { background: var(--ok-soft); color: var(--ok); }
.chip.setup, .chip.onboarding, .chip.new { background: var(--accent-soft); color: var(--accent); }
.chip.paused, .chip.declined { background: var(--bad-soft); color: var(--bad); }
.notice { border-radius: var(--r-in); padding: 10px 14px; background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.confirm { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.error { color: var(--bad); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); border: 2px dashed #c9d3ee; border-radius: var(--r); }

/* Forms */
form { display: grid; gap: 14px; margin: 0; }
label { display: grid; gap: 5px; font-weight: 500; font-size: .92rem; }
label small, label .muted { font-weight: 400; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: var(--r-in); padding: 9px 12px; width: 100%; background: var(--card); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 90px; }
input[type=tel], input[type=email], input[type=time], input[type=number] { direction: ltr; }
[dir=rtl] input[type=tel], [dir=rtl] input[type=email] { text-align: right; }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { color: var(--bad); font-size: .82rem; font-weight: 400; }
.bad input { border-color: var(--bad); }
.narrow { max-width: 440px; }
.form-end { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }

/* Log in and reset: one centred card */
.center { max-width: 440px; margin: 24px auto 0; width: 100%; }
.center .card { display: grid; gap: 16px; }

/* Owner home */
.hello { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.today { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 12px 18px; min-width: 120px; }
.stat b { display: block; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--ink-3); }
.stat.next { background: var(--booked); }
.stat.next b { font-size: 1rem; padding-top: 4px; color: var(--booked-ink); }
.stat.next span { color: var(--booked-ink); }
.home { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.biz { display: grid; gap: 14px; }
.biz-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.biz-top p { margin-top: 3px; color: var(--ink-2); font-size: .9rem; }
.slots { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.slot { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--booked-soft); }
.slot time { font: 500 .9rem var(--mono); background: var(--booked); color: var(--booked-ink); border-radius: 10px; padding: 2px 8px; text-align: center; }
.slot small { color: var(--ink-3); }
.slot.pending { background: var(--soft); }
.slot.pending time { background: var(--line); color: var(--ink-2); }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.steps span { height: 10px; border-radius: 5px; background: var(--line); }
.steps span.done { background: var(--ok); }
.steps span.now { background: var(--accent); }
.steps-label { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--ink-3); margin-top: 6px; }
.add { border: 2px dashed #c9d3ee; background: none; border-radius: var(--r); padding: 18px; color: var(--ink-2); width: 100%; justify-self: stretch; }
.add:hover { border-color: var(--accent); color: var(--accent); background: none; }
.add-form { display: flex; gap: 8px; align-items: end; }
.add-form label { flex: 1; }

/* Owner agent */
.agent { display: grid; gap: 12px; }
.agent-log { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.agent-log:empty { display: none; }
.msg { padding: 8px 13px; border-radius: 20px; max-width: 88%; white-space: pre-wrap; font-size: .92rem; }
.msg.user { align-self: flex-start; background: var(--accent); color: #fff; }
.msg.assistant { align-self: flex-end; background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: 400 .82rem var(--sans); background: var(--card); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.chips button:hover { border-color: var(--accent); color: var(--accent); background: var(--card); }
.agent-form { display: flex; gap: 6px; align-items: start; }
.agent-form input { flex: 1; }
.wa { display: flex; gap: 12px; align-items: center; }
.wa .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-weight: 700; flex: none; }
#wa-code bdi { font-family: var(--mono); font-weight: 600; }

/* Settings */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.side-nav { display: grid; gap: 2px; position: sticky; top: 84px; }
.side-nav a { color: var(--ink-2); padding: 8px 12px; border-radius: 12px; }
.side-nav a:hover { background: var(--card); text-decoration: none; }
.settings .card { display: grid; gap: 14px; scroll-margin-top: 84px; }

/* Onboarding wizard */
.progress { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.progress a { display: block; background: var(--card); border-radius: 16px; padding: 9px 12px; color: var(--ink-2); font-size: .85rem; border-top: 4px solid var(--line); }
.progress a:hover { text-decoration: none; color: var(--ink); }
.progress .done a { border-top-color: var(--ok); }
.progress a.on { color: var(--ink); font-weight: 600; border-top-color: var(--accent); box-shadow: var(--shadow); }
.progress small { display: block; font-size: .75rem; font-weight: 400; color: var(--ink-3); }
.progress .done small { color: var(--ok); }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); }
.row label { flex: 1 1 140px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: block; position: relative; flex: none; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); font-weight: 600; cursor: pointer; background: var(--card); user-select: none; }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.times { display: flex; gap: 8px; align-items: end; }
.times label { flex: 0 1 130px; }

/* Admin */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { background: var(--card); border-radius: 999px; padding: 5px 13px; color: var(--ink-2); }
.filters a:hover { text-decoration: none; color: var(--ink); }
.filters a.on { background: var(--accent); color: #fff; }
.scroll { overflow-x: auto; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-3); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.note { color: var(--ink-2); max-width: 260px; }
td.muted { color: var(--ink-3); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 500; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.badge.new { background: var(--accent-soft); color: var(--accent); }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.declined { background: var(--bad-soft); color: var(--bad); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dt { color: var(--ink-3); } dd { margin: 0; white-space: pre-line; }
.contact { display: flex; flex-wrap: wrap; gap: 8px; }
.contact a { background: var(--card); border-radius: 12px; padding: 6px 13px; }
.grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.grid > section { min-width: 0; display: grid; gap: 14px; align-content: start; }
ol.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ol.timeline li { border-inline-start: 3px solid var(--line); padding-inline-start: 12px; }
ol.timeline small { color: var(--ink-3); display: block; }
pre { background: var(--card); border-radius: 16px; padding: 14px; overflow-x: auto; font-size: .82rem; margin: 0; }
[dir="ltr"] [dir="auto"] { text-align: left; }   /* Hebrew keeps its reading order, but lines up with an English page */

@media (max-width: 900px) {
  .home, .settings, .grid { grid-template-columns: 1fr; }
  .side-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .grid > section:last-child { order: -1; }
}
@media (max-width: 760px) {
  .progress { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  header.top .wrap { gap: 10px; padding-block: 8px; }
  nav.tabs a { padding: 6px 9px; font-size: .9rem; }
  h1 { font-size: 1.55rem; }
  .stat { min-width: 0; flex: 1; }
  .stat.next { flex-basis: 100%; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* the booking bot's calendar on the owner's card (FEATURE_28) */
.calendar-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.calendar-line p { flex-basis: 100%; margin: 0; }

/* a moving bar while a slow form is sent (the calendar step) */
.working { margin-top: 12px; max-width: 420px; }
.working .bar { position: relative; height: 6px; border-radius: 3px; background: #d9e0f5; overflow: hidden; }
.working .bar span { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 3px; background: var(--accent);
  animation: working-slide 1.2s ease-in-out infinite; }
[dir="rtl"] .working .bar span { animation-direction: reverse; }
@keyframes working-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .working .bar span { animation: none; width: 100%; opacity: 0.5; } }
button[aria-busy="true"] { opacity: 0.6; cursor: progress; }
