/* ==========================================================
   מערכת ניהול הזמנות — ממשק ניהול היומן
   ========================================================== */

:root {
  --teal-900: #0b3a38;
  --teal-800: #0f4c4a;
  --teal-700: #14625f;
  --teal-100: #dcefec;
  --sand-50:  #faf7f2;
  --sand-100: #f3ede3;
  --sand-200: #e6dccc;
  --ink:      #1c2b2a;
  --ink-soft: #5c6b6a;
  --ink-mute: #8a9796;
  --gold:     #c08a3e;
  --wa:       #1ea855;
  --danger:   #b93f3f;
  --purple:   #6b5b95;
  --white:    #ffffff;
  --radius:   16px;
  --radius-sm: 10px;
  --shadow:   0 2px 8px rgba(11, 58, 56, .07), 0 12px 28px rgba(11, 58, 56, .06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--sand-50);
  color: var(--ink);
  font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  background-image: radial-gradient(circle at 100% 0%, rgba(20, 98, 95, .07), transparent 45%);
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ==========================================================
   מסך התחברות
   ========================================================== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(155deg, var(--teal-800), var(--teal-900) 60%, #072826);
}
.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border-radius: 22px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .35);
}

.gate-logo {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--teal-700), var(--teal-900));
  color: #fff;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 900;
}

/* הלוגו האמיתי החליף את האות "ב"; הרקע נשאר לזמן שבו התמונה עוד לא נטענה. */
img.gate-logo { object-fit: cover; display: block; }

.gate-card h1 { margin: 0; font-size: 21px; font-weight: 700; }
.gate-sub { margin: 2px 0 22px; font-size: 13.5px; color: var(--ink-mute); }
.gate-card .field { text-align: right; }
.gate-card input[type="password"] { text-align: center; letter-spacing: 6px; font-size: 20px; }
.gate-card .primary-btn { margin-top: 16px; }

/* "זכור אותי במכשיר הזה" */
.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.remember-row input[type="checkbox"] {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  accent-color: var(--teal-800);
  cursor: pointer;
}

/* ==========================================================
   כותרת עליונה
   ========================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--teal-700), var(--teal-900));
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900;
  box-shadow: var(--shadow);
}

.brand-text h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.brand-sub { font-size: 13px; color: var(--ink-mute); }

.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--sand-200);
  background: var(--white);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { background: var(--teal-100); color: var(--teal-800); border-color: var(--teal-100); }
.icon-btn.accent { border-color: #f0d9d9; color: var(--danger); }
.icon-btn.accent:hover { background: #fdf3f3; border-color: #eccaca; color: var(--danger); }
.icon-btn.install { border-color: var(--teal-100); background: var(--teal-100); color: var(--teal-800); font-weight: 700; }
.icon-btn.install:hover { background: var(--teal-800); color: #fff; border-color: var(--teal-800); }
.icon-btn[hidden] { display: none; }

/* הוראות ההתקנה ב-iOS */
.install-steps { margin: 0; padding-inline-start: 20px; font-size: 15px; line-height: 1.9; color: var(--ink); }
.install-steps strong { color: var(--teal-800); }
.install-note { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-mute); line-height: 1.6; }

.badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.badge[hidden] { display: none; }

/* ==========================================================
   מסכים
   ========================================================== */
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.view-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 4px 0 18px;
}
.view-head h2 { margin: 0; font-size: 21px; font-weight: 700; }
.view-sub { font-size: 14px; color: var(--ink-mute); }

.back-btn {
  border: 1px solid var(--sand-200);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--teal-800);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: .15s;
}
.back-btn:hover { background: var(--teal-100); border-color: var(--teal-100); }
.back-btn.solo { margin: 4px 0 16px; }

/* ==========================================================
   ניווט חודשים ולוח שנה
   ========================================================== */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.month-title { text-align: center; }
.month-title h2 { margin: 0; font-size: 20px; font-weight: 700; }

.nav-arrow {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--sand-200);
  background: var(--sand-50);
  color: var(--teal-800);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.nav-arrow:hover { background: var(--teal-800); color: #fff; border-color: var(--teal-800); }

.link-btn {
  border: 0; background: none;
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* minmax(0,1fr) ולא 1fr: ברירת המחדל של פריט grid היא min-width:auto,
   ולכן שם של יום מיוחד ארוך ("חול המועד סוכות") היה מרחיב את העמודה
   וגורם ליומן כולו לגלוש לרוחב במסך צר. */
.weekdays, .calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekdays { margin-bottom: 8px; padding: 0 2px; }
.weekdays span {
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-mute);
}

.day-cell {
  position: relative;
  min-width: 0;       /* מאפשר לתוכן ארוך להיחתך במקום להרחיב את העמודה */
  min-height: 92px;   /* שתי שורות נוספות: התאריך העברי ושם היום המיוחד */
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 8px 8px 6px;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: .15s;
}
.day-cell:hover {
  border-color: var(--teal-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.day-cell.empty { background: transparent; border: 0; cursor: default; }
.day-cell.empty:hover { transform: none; box-shadow: none; }

.day-num { font-size: 16px; font-weight: 700; color: var(--ink); }

.day-cell.weekend { background: var(--sand-100); }
.day-cell.has-events { border-color: var(--teal-100); }

/* ----------------------------------------------------------
   הלוח העברי
   ------------------------------------------------------------
   הצבע עצמו לעולם אינו כתוב כאן: כל תא מיוחד מקבל --heb-color
   בזמן ריצה מהקטגוריה שהשרת החזיר (HebrewDayCategories), וכל מה
   שה-CSS עושה הוא לגזור ממנו מסגרת, רקע ופס צד. הוספת קטגוריה
   או שינוי צבע אינם דורשים נגיעה בקובץ הזה.

   סדר הכתיבה מכוון: הכללים האלה באים אחרי weekend/has-events
   כדי שסימון היום המיוחד יגבר עליהם, ולפני today — כי "היום"
   הוא סימון ניווט וחייב להישאר מזוהה גם בחג.
   ---------------------------------------------------------- */
.day-heb {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  line-height: 1.2;
  margin-top: -3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-heb-name {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--heb-color, var(--ink-soft));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-cell.heb-mark {
  border-color: color-mix(in srgb, var(--heb-color) 45%, var(--sand-200));
  background: color-mix(in srgb, var(--heb-color) 8%, var(--white));
}
.day-cell.heb-mark .day-heb { color: var(--heb-color); }

/* פס הצבע בקצה הפנימי של התא — הסימון היחיד שאף מצב אחר לא דורס. */
.day-cell.heb-mark::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--heb-color);
}

.day-cell.today { border-color: var(--gold); background: #fffdf8; }
.day-cell.today .day-num {
  background: var(--gold); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
}

/* המקרא שמתחת ליומן */
.heb-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 14px;
}
.heb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.heb-chip::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--heb-color);
}

/* שורת התאריך העברי במסך היום ובטופס האירוע */
.heb-line {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
}
.heb-line.marked { color: var(--heb-color); }

.month-heb {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: 1px;
}

.day-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 999px;
  padding: 1px 8px;
  align-self: flex-start;
}
.day-count.owing { background: #fdeaea; color: var(--danger); }

.day-mini { font-size: 11px; color: var(--ink-soft); line-height: 1.35; overflow: hidden; }
.day-mini b { font-weight: 500; }
.day-mini .cross { color: var(--purple); font-weight: 700; }
.day-more { font-size: 10.5px; color: var(--ink-mute); }

.month-summary {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-mute);
  text-align: center;
}

/* ==========================================================
   רשימות אירועים
   ========================================================== */
.free-strip {
  background: var(--teal-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--teal-900);
  margin-bottom: 14px;
}
.free-strip b { font-weight: 700; }

.total-strip {
  background: linear-gradient(150deg, var(--teal-700), var(--teal-900));
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.total-strip span { font-size: 14px; opacity: .85; }
.total-strip strong { font-size: 26px; font-weight: 900; }

.rng {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.event-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-right: 4px solid var(--teal-700);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
  width: 100%;
  transition: .15s;
  box-shadow: 0 1px 3px rgba(11,58,56,.04);
}
.event-row:hover { border-right-color: var(--gold); transform: translateX(-3px); box-shadow: var(--shadow); }
.event-row.paid      { border-right-color: var(--wa); }
.event-row.free      { border-right-color: var(--purple); }
.event-row.unpaid    { border-right-color: var(--danger); }
.event-row.cancelled { opacity: .55; border-right-color: var(--ink-mute); background: var(--sand-100); }
.event-row.cancelled .event-cust { text-decoration: line-through; }

.event-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-800);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  direction: ltr;
  text-align: center;
}
.event-time small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
}
/* טקסט הסבר בעברית — צריך כיוון RTL, בניגוד לשעות שמסביבו */
.event-time small.note { direction: rtl; color: var(--purple); font-size: 10px; }

.event-main { flex: 1; min-width: 0; }
.event-cust { display: block; font-size: 16px; font-weight: 500; }
.event-meta { display: block; font-size: 12.5px; color: var(--ink-mute); }
.event-meta .num { direction: ltr; unicode-bidi: isolate; }
.event-meta .xtra { color: var(--teal-800); font-weight: 600; }
.event-meta .xtra.none { color: var(--ink-mute); font-weight: 400; }
.event-chev { color: var(--ink-mute); font-size: 20px; }

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  margin-inline-start: 4px;
}
.tag.paid   { background: #dff5e6; color: #106c35; }
.tag.unpaid { background: #fdeaea; color: var(--danger); }
.tag.free   { background: #ece8f5; color: var(--purple); }
.tag.cancel { background: var(--sand-200); color: var(--ink-soft); }
.tag.cross  { background: #efe9fb; color: var(--purple); }

.empty-state {
  background: var(--white);
  border: 1px dashed var(--sand-200);
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 15px;
}

/* ==========================================================
   רשימת הלקוחות
   ========================================================== */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.search-bar input { flex: 1; }
.search-bar select { flex: 1; }
.search-bar .ghost-btn[hidden] { display: none; }

/* שורת יומן התשלומים היא תצוגה בלבד — אין לאן ללחוץ ממנה. */
.event-row.static { cursor: default; }
.event-row.static:hover { transform: none; box-shadow: 0 1px 3px rgba(11,58,56,.04); }
.event-row.static:hover.paid { border-right-color: var(--wa); }
.event-row.static:hover.unpaid { border-right-color: var(--danger); }
.event-row.static:hover.cancelled { border-right-color: var(--ink-mute); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.mini-stats:empty { display: none; }

.mini-stat {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  box-shadow: 0 1px 3px rgba(11,58,56,.04);
}
.mini-stat span { display: block; font-size: 11.5px; color: var(--ink-mute); }
.mini-stat b {
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-800);
  font-variant-numeric: tabular-nums;
}
.mini-stat.alert b { color: var(--danger); }

/* שורת לקוח — אותו בסיס כמו שורת אירוע, עם עיגול ראשי תיבות במקום השעה */
.cust-avatar {
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--teal-100);
  color: var(--teal-800);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700;
}
.event-row.cust.unpaid .cust-avatar { background: #fdeaea; color: var(--danger); }
.event-row.cust.free   .cust-avatar { background: var(--sand-100); color: var(--ink-mute); }

.tag.next { background: var(--teal-100); color: var(--teal-800); }

/* היסטוריית האירוח בתוך כרטיס — בלי מרווח תחתון כפול */
.list.tight { margin-bottom: 0; }

/* ==========================================================
   כרטיסים וטפסים
   ========================================================== */
.card {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-800);
}
.card-title.tight { margin: 0; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field .heb-line { margin-top: 6px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.req { color: var(--danger); }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

input[type=text], input[type=tel], input[type=number],
input[type=password], input[type=date], select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  background: var(--sand-50);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  transition: .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--teal-700);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,98,95,.12);
}
select { cursor: pointer; }

.hint { font-size: 12.5px; color: var(--ink-mute); margin: 10px 0 0; }
.hint.tight { margin: -6px 0 14px; }

/* חיפוש לקוח לפי טלפון */
.phone-wrap { position: relative; }
.phone-status {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  pointer-events: none;
}
.phone-status.found   { background: #dff5e6; color: #106c35; }
.phone-status.new     { background: var(--teal-100); color: var(--teal-800); }
.phone-status.loading { background: var(--sand-100); color: var(--ink-mute); }

/* פרטים נוספים מקופלים */
.more { margin-top: 6px; border-top: 1px solid var(--sand-100); padding-top: 12px; }
.more summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--teal-800);
  list-style: none;
  user-select: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+ '; font-weight: 700; }
.more[open] summary::before { content: '– '; }
.more > *:not(summary) { margin-top: 14px; }

/* הערת גלישה ליום הבא */
.span-note {
  display: none;
  background: #f4efff;
  border: 1px solid #ddd2f5;
  color: #4c3f7a;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13.5px;
  margin-top: 4px;
}
.span-note.show { display: block; }
.span-note b { font-weight: 700; }

/* שעות פנויות */
.free-slots { display: flex; flex-wrap: wrap; gap: 8px; }

.slot-chip {
  border: 1px solid var(--teal-100);
  background: var(--teal-100);
  color: var(--teal-900);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  transition: .15s;
}
.slot-chip:hover { background: var(--teal-800); color: #fff; }
.slot-chip.none {
  background: var(--sand-100); border-color: var(--sand-200);
  color: var(--ink-mute); cursor: default; direction: rtl;
}
.slot-chip.none:hover { background: var(--sand-100); color: var(--ink-mute); }

/* ==========================================================
   כפתורים
   ========================================================== */
.primary-btn {
  background: linear-gradient(150deg, var(--teal-700), var(--teal-900));
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15,76,74,.22);
  transition: .15s;
}
.primary-btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .6; cursor: progress; }
.primary-btn.full { width: 100%; padding: 15px; font-size: 17px; }

.ghost-btn {
  background: none;
  border: 1px solid var(--sand-200);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.ghost-btn:hover { background: var(--sand-100); }
.ghost-btn.small { padding: 10px 14px; font-size: 13.5px; white-space: nowrap; }
.ghost-btn.wide { width: 100%; margin-top: 14px; }

.danger-btn {
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 1px solid #eccfcf;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.danger-btn:hover { background: #fdf3f3; }
.danger-btn.inline { width: auto; margin: 0; padding: 13px 22px; }

.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.sticky-actions .primary-btn { flex: 1 1 200px; }

/* ==========================================================
   טבלת המחשבון
   ========================================================== */
.calc-table {
  border: 1px solid var(--sand-100);
  border-radius: 13px;
  overflow: hidden;
  margin: 16px 0 14px;
  background: var(--sand-50);
}
.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--sand-100);
}
.calc-row:last-child { border-bottom: 0; }
.calc-row span { color: var(--ink-soft); }
/* בלי direction:ltr גורף — חלק מהערכים הם טקסט עברי ("2 שעות").
   הרכיבים שחייבים LTR (נוסחאות, טווחי שעות) עטופים ב-.rng בנפרד. */
.calc-row b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: start;
}
.calc-row b small { font-weight: 400; color: var(--ink-mute); font-size: 12px; }
.calc-row.off span, .calc-row.off b { color: var(--ink-mute); font-weight: 400; }
.calc-row.sum {
  background: var(--teal-800);
  color: #fff;
  padding: 13px 14px;
}
.calc-row.sum span { color: rgba(255,255,255,.82); font-size: 14px; }
.calc-row.sum b { font-size: 20px; font-weight: 900; }

.price-final {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.price-final .field { flex: 1 1 180px; margin-bottom: 0; }
.price-final input { font-size: 20px; font-weight: 700; }

.override-note {
  margin-top: 10px;
  background: #fffdf5;
  border: 1px dashed #ecd9b2;
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 13px;
  color: #8a6b34;
}
.override-note[hidden] { display: none; }

/* ==========================================================
   מסך אירוע
   ========================================================== */
.ev-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(145deg, var(--teal-700), var(--teal-900));
  color: #fff;
  border-radius: 22px;
  padding: 22px 22px 20px;
  margin-bottom: 16px;
  box-shadow: 0 16px 36px rgba(11, 58, 56, .22);
}
.ev-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: -50px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  z-index: -1;
}

.ev-hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ev-avatar {
  width: 54px; height: 54px;
  border-radius: 17px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center;
  font-size: 21px; font-weight: 900;
  letter-spacing: .5px;
  flex: 0 0 auto;
}

.ev-ident { flex: 1; min-width: 0; }
.ev-ident h2 { margin: 0 0 1px; font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.ev-when { font-size: 13.5px; color: rgba(255, 255, 255, .78); }

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.yes    { background: #dff5e6; color: #106c35; }
.status-pill.no     { background: rgba(255, 255, 255, .16); color: #ffdfd8; border: 1px solid rgba(255, 255, 255, .3); }
.status-pill.free   { background: #ece8f5; color: var(--purple); }
.status-pill.cancel { background: rgba(255,255,255,.14); color: rgba(255,255,255,.8); }

.ev-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.ev-stat {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 15px;
  padding: 11px 13px;
  min-width: 0;
}
.ev-stat > span {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .75);
  margin-bottom: 3px;
}
.ev-stat > strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-stat.total { background: rgba(255, 255, 255, .18); }
.ev-stat.total > strong { font-size: 22px; font-weight: 900; }

.ev-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ev-flags:empty { display: none; }
.flag {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.pay-text { min-width: 0; }
.pay-text .hint { margin: 2px 0 0; }
.seg-pay { flex: 1 1 260px; max-width: 380px; }

.notes-text {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

/* פירוט המחיר במסך האירוע */
.bd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.bd-item {
  background: var(--sand-50);
  border: 1px solid var(--sand-100);
  border-radius: 13px;
  padding: 11px 13px;
}
.bd-item span { display: block; font-size: 11.5px; color: var(--ink-mute); margin-bottom: 2px; }
.bd-item b { font-size: 15px; font-weight: 700; color: var(--ink); }
.bd-item.off b { color: var(--ink-mute); font-weight: 500; }

.bd-formula {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--sand-200);
  font-size: 13px;
  color: var(--ink-mute);
}
.bd-formula code {
  direction: ltr;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 8px;
  padding: 5px 11px;
  font-variant-numeric: tabular-nums;
}

/* כפתורי פעולה */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: 14px;
  padding: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
  transition: .15s;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.action-btn.wa:hover   { border-color: var(--wa); }
.action-btn.pay:hover  { border-color: var(--gold); }
.action-btn.book:hover { border-color: var(--teal-700); }

.action-ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--sand-100);
  display: grid; place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
}
.action-btn.wa   .action-ico { background: #e6f7ec; }
.action-btn.pay  .action-ico { background: #fbf1e0; }
.action-btn.book .action-ico { background: var(--teal-100); }

.action-btn span > b { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.action-btn span > small { display: block; font-size: 12.5px; color: var(--ink-mute); }

/* ==========================================================
   שגיאות, מודאל, בורר, טוסט
   ========================================================== */
.form-error {
  display: none;
  background: #fdeeee;
  border: 1px solid #f4d5d5;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  margin-top: 12px;
}
.form-error.show { display: block; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 58, 56, .45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(11, 58, 56, .3);
  animation: pop .2s ease;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--sand-100);
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }

.close-btn {
  border: 0; background: var(--sand-100);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 14px; color: var(--ink-soft);
  font-family: inherit;
}
.close-btn:hover { background: var(--sand-200); }

.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--sand-100);
}
.modal-foot .primary-btn { flex: 1; }

.seg {
  display: flex;
  gap: 6px;
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.seg button {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 7px;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.seg button.active {
  background: var(--white);
  color: var(--teal-800);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(11,58,56,.12);
}
.seg-3 button { font-size: 13px; padding: 10px 4px; }
.seg-3 button.active[data-val="Paid"]        { color: #106c35; }
.seg-3 button.active[data-val="Unpaid"]      { color: var(--danger); }
.seg-3 button.active[data-val="NotRequired"] { color: var(--purple); }

.calc-result {
  background: linear-gradient(150deg, var(--teal-700), var(--teal-900));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #fff;
  margin: 14px 0 0;
}
.calc-total { display: flex; justify-content: space-between; align-items: baseline; }
.calc-total span { font-size: 14px; opacity: .82; }
.calc-total strong { font-size: 26px; font-weight: 900; }

/* ---------- חשבונית מס קבלה ---------- */

/* חמישה אמצעי תשלום לא נכנסים בשורה אחת במסך צר — כאן הבוררים נשברים לשורות */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 30%; font-size: 13.5px; padding: 10px 6px; }

.inv-ask { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.inv-ask-row { margin-top: 18px; }
.inv-ask-row .primary-btn { flex: 1 1 100%; }
.inv-ask-row .ghost-btn { flex: 1 1 100%; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 14px;
  font-size: 14px; color: var(--ink-soft);
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--teal-700); }

.inv-summary {
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: grid;
  gap: 4px;
}
.inv-summary b { color: var(--ink); font-weight: 700; }

/* כרטיס החשבונית שהופקה, במסך האירוע */
.inv-doc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.inv-doc div {
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.inv-doc span { display: block; font-size: 11.5px; color: var(--ink-mute); margin-bottom: 2px; }
.inv-doc b { font-size: 15px; font-weight: 700; color: var(--ink); }

.action-btn.doc:hover { border-color: var(--purple); }
.action-btn.doc .action-ico { background: #ece8f5; }
.action-btn:disabled { opacity: .5; cursor: not-allowed; }
.action-btn:disabled:hover { transform: none; box-shadow: none; border-color: var(--sand-200); }

.tag.inv { background: #ece8f5; color: var(--purple); }

/* ==========================================================
   טיפול ידני בעסקה שלא הותאמה (המודאל של סעיף 12ג ב-app.js)
   ========================================================== */

.pm-summary {
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: grid;
  gap: 4px;
}
.pm-summary b { color: var(--ink); font-weight: 700; }
.pm-amount {
  font-size: 22px; font-weight: 800; color: var(--ink);
  margin-bottom: 4px;
}

/* ההערה שמסבירה למה ההתאמה האוטומטית נכשלה — מה שמכריע את ההחלטה */
.pm-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-right: 3px solid var(--danger);
  background: #fdf3f3;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-soft);
}
.pm-note[hidden] { display: none; }

.pm-actions .primary-btn { flex: 1 1 100%; }
.pm-actions .danger-btn.inline { flex: 1 1 100%; }

.pm-explain { margin: 0 0 16px; font-size: 14.5px; color: var(--ink-soft); }
.pm-explain b { color: var(--ink); }

/* רשימת האירועים המועמדים. גובה מוגבל כדי שהכפתורים במודאל יישארו נגישים. */
.pm-list {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-left: 2px;
}

.pm-cand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: right;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.pm-cand:hover { border-color: var(--teal-700); }
.pm-cand.selected {
  border-color: var(--teal-700);
  background: var(--teal-100);
}

.pm-cand-main { flex: 1; display: grid; gap: 3px; min-width: 0; }
.pm-cand-name {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-weight: 700;
}
.pm-cand-meta { font-size: 12.5px; color: var(--ink-soft); }
.pm-cand-pick {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--sand-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--teal-700); background: var(--white);
}
.pm-cand.selected .pm-cand-pick { border-color: var(--teal-700); font-weight: 800; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--teal-900);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(11,58,56,.35);
  opacity: 0;
  pointer-events: none;
  transition: .28s cubic-bezier(.2,.8,.2,1);
  z-index: 80;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ==========================================================
   עריכת נוסחי ההודעות
   ---------------------------------------------------------
   העורך עצמו (.toolbar / .editor / .variable-badge / התצוגה האפורה)
   נבנה לפי הדוגמה שהמשתמש אישר, בצבעי הממשק.
   ========================================================== */
/* .list הוא display:flex, שגובר על [hidden] של הדפדפן — בלי זה
   "הצג עוד" לא היה מסתיר כלום. אותו תיקון כמו ב-.icon-btn[hidden]. */
.list[hidden] { display: none; }

.tpl-row { display: block; }
.tpl-row .event-main { display: block; }
.tpl-title { display: block; font-size: 16px; font-weight: 600; }
.tpl-when { display: block; font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }

/* הנוסח הנוכחי — טקסט של הודעה, ולכן שורה אחת חתוכה ולא גלישה */
.tpl-preview {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpl-preview.empty { color: var(--danger); border-style: dashed; background: #fdf6f6; }

.tpl-hint { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.add-btn {
  background: var(--wa);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}
.add-btn:hover { filter: brightness(1.08); }

.editor {
  border: 2px solid var(--sand-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  min-height: 170px;
  padding: 14px;
  font-size: 16px;
  line-height: 1.9;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: right;
}
.editor:focus { border-color: var(--wa); }
.editor:empty::before { content: attr(placeholder); color: var(--ink-mute); }

.variable-badge {
  background: var(--teal-100);
  color: var(--teal-800);
  border: 1px solid #bfe0dc;
  padding: 1px 9px;
  border-radius: 999px;
  margin: 0 3px;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
  display: inline-block;
  white-space: nowrap;
}
/* משתנה שאינו מוכר למערכת — יישלח ללקוח כמו שהוא, ולכן מסומן ולא נמחק */
.variable-badge.unknown { background: #fdeaea; color: var(--danger); border-color: #f0d9d9; }

.system-preview-label { color: var(--ink-mute); font-size: 13px; margin: 22px 0 6px; }

.system-preview-box {
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--ink-soft);
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 60px;
  font-size: 14px;
  line-height: 1.6;
}
.system-preview-box.placeholder { color: var(--ink-mute); }

/* ==========================================================
   מובייל
   ========================================================== */
@media (max-width: 620px) {
  .app { padding: 0 12px 48px; }
  .weekdays span { font-size: 10.5px; }
  .weekdays, .calendar { gap: 5px; }
  .day-cell { min-height: 78px; padding: 6px 4px; }
  .day-num { font-size: 14px; }
  .day-mini { display: none; }

  /* התא צר מכדי להכיל "כ״ג באלול" בשורה אחת, ולכן כאן דווקא כן מרשים
     שבירה — עדיף תאריך שלם בשתי שורות מאשר "כ״ג בא…" חתוך.
     שם היום המיוחד נשאר חתוך: הוא מופיע במלואו בפתיחת היום. */
  .day-heb {
    font-size: 9.5px;
    margin-top: -2px;
    line-height: 1.15;
    white-space: normal;
  }
  .day-heb-name { font-size: 9px; }
  .heb-legend { gap: 4px 8px; }
  .heb-chip { font-size: 10.5px; }
  .day-count { font-size: 10px; padding: 0 6px; }
  .field-row { flex-direction: column; gap: 0; }
  .brand-text h1 { font-size: 17px; }
  .month-title h2 { font-size: 17px; }
  .topbar-actions { width: 100%; }
  .icon-btn { flex: 1; justify-content: center; }

  .ev-hero { padding: 18px 16px 16px; border-radius: 20px; }
  .ev-avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 20px; }
  .ev-ident h2 { font-size: 20px; }
  .ev-stats { grid-template-columns: repeat(2, 1fr); margin-top: 16px; }
  .ev-stat.total { grid-column: 1 / -1; }
  .pay-row { gap: 12px; }
  .seg-pay { flex-basis: 100%; max-width: none; }
  .danger-btn.inline { width: 100%; }

  .mini-stats { grid-template-columns: 1fr; }
  .cust-avatar { width: 38px; height: 38px; font-size: 14px; }

  .add-btn { font-size: 12.5px; padding: 7px 10px; }
  .editor { font-size: 15.5px; min-height: 200px; }
}

/* ============================================================
   מסך הגדרות העסק — לשונית המחירים
   ============================================================ */
.modal.wide { max-width: 720px; }

.pricing-h {
  margin: 22px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-800);
}

/* כל תעריף/תוספת בקופסה משלו, כדי שהעין תפריד ביניהם */
.price-block {
  background: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px 2px;
  margin-bottom: 10px;
}

/* ============================================================
   יחידות אירוח (ריבוי צימרים)
   ------------------------------------------------------------
   כל מה שכאן מופיע *רק* כשמוגדרת יותר מיחידה אחת — ה-JS מסתיר את
   האלמנטים עצמם (multiRoom()), ולכן אין כאן מצב "יחידה אחת" לטפל בו.

   --room-color מוצב על האלמנט ב-JS מהצבע שבהגדרות. אין כאן שום צבע
   של יחידה מסוימת, בדיוק כמו בצבעי הלוח העברי (--heb-color).
   ============================================================ */

/* ---- פילטר היחידות מעל היומן ---- */
.room-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
}
.room-filter-label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--sand-200);
  background: var(--white);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.room-chip:hover { background: var(--sand-100); }

/* הנקודה הצבעונית לפני שם היחידה — אותו קוד צבע שביומן ובעמודות,
   כדי שאפשר יהיה לקשר ביניהם במבט. */
.room-chip[style*="--room-color"]::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--room-color);
  flex: none;
}
.room-chip.active {
  color: var(--white);
  border-color: transparent;
  background: var(--room-color, var(--teal-800));
  font-weight: 700;
}
.room-chip.active[style*="--room-color"]::before { background: var(--white); }

/* ---- נקודות התפוסה בתא היומן ---- */
.day-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.day-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--room-color, var(--teal-700));
}
/* יחידה פנויה: אותו מקום, בלי צבע — כך מספר הנקודות קבוע לכל החודש
   והעין קולטת תפוסה לפי כמה מהן "דלוקות" ולא לפי כמה יש. */
.day-dots .dot.off { background: transparent; box-shadow: inset 0 0 0 1px var(--sand-200); }

.day-count.full { background: #fdeaea; color: var(--danger); font-weight: 700; }

/* ---- לוח הבקרה היומי ---- */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.mini-stat {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(11,58,56,.04);
}
.mini-stat span { display: block; font-size: 12.5px; color: var(--ink-mute); }
.mini-stat b { font-size: 17px; font-weight: 700; color: var(--teal-800); }
.mini-stat.alert b { color: var(--danger); }

/* ---- עמודה לכל יחידה במסך היום ---- */
.rooms-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
}
/* במסך צר העמודות נשארות ברוחב קבוע וגוללים אופקית: דחיסה שלהן הייתה
   הופכת כל שורת אירוע לבלתי קריאה. */
@media (max-width: 720px) {
  .rooms-container { grid-auto-columns: 270px; }
}

.room-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-top: 3px solid var(--room-color, var(--teal-700));
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}
.room-column.inactive { opacity: .7; }

.room-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid var(--sand-200);
  padding-bottom: 8px;
}
.room-title b { font-size: 15px; font-weight: 700; color: var(--teal-800); }
.room-free {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--ink-mute);
  direction: rtl;
}

/* שורת אירוע בתוך עמודה: אנכית ולא אופקית — הרוחב לא מספיק לשעות,
   לשם ולפרטים באותה שורה. */
.room-column .event-row {
  display: block;
  padding: 10px 12px;
  gap: 0;
}
.room-column .event-row .event-time { display: block; text-align: right; font-size: 14px; }
.room-column .event-chev { display: none; }

.empty-state.tight { padding: 14px; font-size: 13px; margin: 0; }

/* פס הצבע בצד שורת אירוע — הזיהוי המהיר של היחידה. גובר על צבע
   הסטטוס בכוונה: ברשימה מעורבת "איזה צימר" היא השאלה הראשונה, וסטטוס
   התשלום ממילא מופיע כתגית. */
.event-row.has-room { border-right-color: var(--room-color, var(--teal-700)); }
.event-row.has-room:hover { border-right-color: var(--room-color, var(--gold)); }

.tag.room { background: var(--room-color, var(--teal-700)); color: var(--white); }
.flag.room {
  background: color-mix(in srgb, var(--room-color) 14%, var(--white));
  color: color-mix(in srgb, var(--room-color) 75%, var(--ink));
  border-color: color-mix(in srgb, var(--room-color) 35%, var(--sand-200));
}

/* ---- לשונית "צימרים ויחידות" בהגדרות ---- */
/* הלשוניות עברו מ-3 ל-4; במסך צר הן נשברות לשתי שורות במקום להצטמצם
   לרוחב שבו הכיתוב נחתך. */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 45%; }

.room-card {
  border: 1px solid var(--sand-200);
  border-right: 4px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--white);
}
.room-card.inactive { opacity: .65; background: var(--sand-50); }

.room-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.room-card-head b { font-size: 15px; color: var(--teal-800); }
.room-card-head .link-btn.danger { margin-inline-start: auto; color: var(--danger); }

.room-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--room-color, var(--teal-700));
  flex: none;
}
.room-key {
  font-size: 10.5px;
  color: var(--ink-mute);
  background: var(--sand-100);
  border-radius: 4px;
  padding: 1px 5px;
  direction: ltr;
}

.field.narrow { flex: 0 0 96px; }

.room-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 4px;
}
.room-price-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  padding: 4px 3px;
  border-bottom: 1px solid var(--sand-200);
}
.room-price-table td { padding: 3px; }
.room-price-table td.lbl { color: var(--ink-soft); white-space: nowrap; font-size: 12.5px; }
.room-price-table td.lbl.sub { padding-inline-start: 14px; color: var(--ink-mute); font-size: 12px; }
.room-price-table input[type="number"] {
  width: 100%;
  min-width: 62px;
  padding: 6px 6px;
  font-size: 13px;
  border: 1px solid var(--sand-200);
  border-radius: 7px;
  font-family: inherit;
  background: var(--sand-50);
  text-align: center;
}
.room-price-table tr.addon-head td { padding-top: 10px; }
.room-price-table tr.addon-head.off td { opacity: .65; }
.room-price-table .chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
