/* יומן שמחות — עיצוב */

@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@500;700;900&family=Heebo:wght@300;400;500;700&display=swap');

:root {
  --paper:  #F1F3F0;
  --card:   #FFFFFF;
  --ink:    #14161C;
  --wine:   #7A1F3D;
  --wine-d: #5C1630;
  --brass:  #A4813C;
  --slate:  #666C77;
  --line:   #DCDFDA;
  --ok:     #2E6B4F;
  --warn:   #B3541E;
  --shadow: 0 1px 2px rgba(20,22,28,.06), 0 8px 24px rgba(20,22,28,.06);
  --r: 10px;

  --t-brit:          #2E7D8F;
  --t-bar_mitzva:    #3A4E9B;
  --t-erusin:        #B0517E;
  --t-sheva_brachot: #C06A2B;
  --t-shabbat:       #5A7A55;
  --t-pidyon_haben:  #A4813C;
  --t-other:         #6B7078;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Heebo', system-ui, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body { direction: rtl; }

h1, h2, h3, .display {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate); }

/* ── התחברות ─────────────────────────────────────── */

#login-screen {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, #FFFFFF 0%, var(--paper) 70%);
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.login-card h1 { font-size: 30px; margin-bottom: 4px; }
.login-card .sub { color: var(--slate); font-size: 14px; margin-bottom: 24px; }
.login-card .rule { height: 2px; width: 40px; background: var(--wine); margin: 0 0 20px; }

/* ── טפסים ───────────────────────────────────────── */

label { display: block; font-size: 13px; font-weight: 500; color: var(--slate); margin-bottom: 6px; }
.field { margin-bottom: 16px; }

input[type=text], input[type=password], input[type=date], input[type=time],
input[type=tel], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--wine); outline: none; }
textarea { min-height: 76px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #F7F7F5; }
.btn-primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-d); border-color: var(--wine-d); }
.btn-danger { color: #96223A; border-color: #E4C9CF; }
.btn-danger:hover { background: #FBF2F4; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(20,22,28,.05); }

.msg { font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.msg-error { background: #FBF0F2; color: #8A1F35; border: 1px solid #EDD3D9; }
.msg-ok { background: #F0F6F2; color: var(--ok); border: 1px solid #CFE2D6; }

/* ── מסגרת האפליקציה ─────────────────────────────── */

header.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand {
  font-family: 'Frank Ruhl Libre', serif; font-size: 22px; font-weight: 900;
  display: flex; align-items: center; gap: 8px;
}
.brand span { color: var(--wine); }
.spacer { flex: 1; }

.tabs { display: flex; gap: 2px; background: #EAEBE8; padding: 3px; border-radius: 9px; }
.tab {
  border: 0; background: transparent; padding: 7px 14px;
  border-radius: 7px; font-weight: 500; color: var(--slate);
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.who { font-size: 13px; color: var(--slate); }
.who b { color: var(--ink); font-weight: 500; }

main { max-width: 1180px; margin: 0 auto; padding: 20px; }

/* ── ניווט חודשים ────────────────────────────────── */

.month-bar {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.month-title { font-size: 26px; }
.month-heb { color: var(--brass); font-size: 14px; font-weight: 500; }
.nav-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 16px;
}

/* ── לוח חודשי ───────────────────────────────────── */

.cal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div {
  padding: 10px 8px; text-align: center;
  font-size: 12px; font-weight: 500; color: var(--slate);
  border-bottom: 1px solid var(--line);
  background: #FBFBFA;
}
.cal-cell {
  min-height: 108px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 7px 8px;
  position: relative;
  background: #fff;
  text-align: right;
  cursor: pointer;
  transition: background .12s;
}
.cal-cell:nth-child(7n) { border-left: 0; }
.cal-cell:hover { background: #FAFAF8; }
.cal-cell.other-month { background: #FAFAF9; }
.cal-cell.other-month .d-greg { color: #B9BDB7; }
.cal-cell.shabbat { background: #F7F8F5; }
.cal-cell.today .d-greg {
  background: var(--wine); color: #fff;
  border-radius: 50%; width: 24px; height: 24px;
  display: inline-grid; place-items: center;
}
.d-greg { font-size: 14px; font-weight: 500; }
.d-heb { font-size: 10.5px; color: var(--brass); margin-right: 5px; font-weight: 500; }
.d-month { font-size: 10px; color: var(--slate); margin-right: 4px; }

.chip {
  display: block; width: 100%;
  margin-top: 4px; padding: 3px 6px;
  border-radius: 5px;
  font-size: 11.5px; line-height: 1.35;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: right;
  border: 0;
}
.chip .t { opacity: .85; font-variant-numeric: tabular-nums; }
.chip-more { font-size: 11px; color: var(--slate); margin-top: 3px; }

/* עמוד־שדרה של משבצות: בוקר / צהריים / ערב */
.spine {
  position: absolute; top: 8px; left: 5px;
  display: flex; flex-direction: column; gap: 2px;
}
.spine i { width: 3px; height: 11px; border-radius: 2px; background: #E6E8E4; display: block; }
.spine i.busy { background: var(--wine); }

/* ── רשימת אירועים ───────────────────────────────── */

.list-day {
  font-family: 'Frank Ruhl Libre', serif; font-size: 15px; font-weight: 700;
  padding: 16px 2px 8px; display: flex; align-items: baseline; gap: 8px;
}
.list-day .heb { font-family: 'Heebo'; font-size: 12px; font-weight: 400; color: var(--brass); }
.ev-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-right: 4px solid var(--t-other);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(20,22,28,.03);
}
.ev-row:hover { border-color: #C9CCC6; }
.ev-row .time { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 92px; color: var(--slate); font-size: 13px; }
.ev-row .name { font-weight: 500; flex: 1; }
.ev-row .name small { display: block; color: var(--slate); font-weight: 400; }
.ev-row .meta { font-size: 12px; color: var(--slate); text-align: left; }

.empty {
  text-align: center; padding: 56px 20px; color: var(--slate);
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--r);
}
.empty h3 { font-size: 18px; margin-bottom: 6px; color: var(--ink); }

/* ── מגירה / מודאל ───────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,22,28,.34);
  display: flex; justify-content: flex-start;
}
.drawer {
  background: var(--paper);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0,0,0,.14);
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(-24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

.drawer-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.drawer-head h2 { font-size: 20px; flex: 1; }
.drawer-body { padding: 20px; }
.drawer-foot {
  position: sticky; bottom: 0;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 14px 20px; display: flex; gap: 8px;
}

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 14px;
}
.panel h3 { font-size: 14px; color: var(--slate); font-family: 'Heebo'; font-weight: 500; margin-bottom: 12px; }

.kv { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #F0F1EE; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--slate); min-width: 84px; font-size: 13px; }
.kv .v { flex: 1; white-space: pre-wrap; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.type-opt {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 12px 6px; text-align: center; font-size: 13px; line-height: 1.4;
}
.type-opt .e { display: block; font-size: 21px; margin-bottom: 3px; }
.type-opt.sel { border-color: var(--wine); background: #FCF5F7; box-shadow: inset 0 0 0 1px var(--wine); }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.pill.sel { border-color: var(--wine); background: var(--wine); color: #fff; }

.menu-cat { margin-bottom: 10px; }
.menu-cat > label { display: flex; justify-content: space-between; align-items: center; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag {
  background: #F2F3F1; border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 8px; font-size: 12.5px; display: flex; align-items: center; gap: 5px;
}
.tag button { border: 0; background: none; color: var(--slate); padding: 0; line-height: 1; font-size: 15px; }

.conflict {
  background: #FDF6F0; border: 1px solid #EBD6C4; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px;
}
.conflict b { color: var(--warn); }
.conflict ul { margin: 8px 0 0; padding-right: 18px; }

table.users { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; }
table.users th, table.users td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: 14px; }
table.users th { background: #FBFBFA; font-size: 12px; color: var(--slate); font-weight: 500; }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 90;
  background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 8px; font-size: 14px; box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ── מסכים קטנים ─────────────────────────────────── */

@media (max-width: 720px) {
  main { padding: 12px; }
  .topbar-inner { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 18px; }
  .month-title { font-size: 21px; }
  .cal-cell { min-height: 78px; padding: 4px; }
  .d-heb { display: block; margin: 0; line-height: 1.2; }
  .d-month { display: none; }
  .chip { font-size: 10px; padding: 2px 4px; }
  .chip .t { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .ev-row { flex-wrap: wrap; gap: 6px; }
  .ev-row .time { min-width: auto; }
  .who { display: none; }
}

@media print {
  header.topbar, .drawer-foot, .btn { display: none !important; }
  body { background: #fff; }
}

/* ── בורר תאריך עברי ─────────────────────────────── */

.hebpick {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20,22,28,.28);
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .hebpick { animation: none; } }

.hebpick-head {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 12px 8px;
  flex: 0 0 auto;
}
.hebpick-title {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-family: 'Frank Ruhl Libre', serif; font-size: 18px; font-weight: 700;
  line-height: 1.2;
}
.hebpick-title small {
  display: block;
  font-family: 'Heebo'; font-size: 11px; font-weight: 400; color: var(--slate);
}
.hebpick .nav-btn { flex: 0 0 auto; width: 32px; height: 32px; }

.hebpick-days,
.hebpick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 8px;
}
.hebpick-days { padding-bottom: 4px; flex: 0 0 auto; }
.hebpick-days div {
  min-width: 0;
  text-align: center; font-size: 11px; font-weight: 500; color: var(--slate);
}

.hebpick-grid {
  gap: 2px;
  padding-bottom: 10px;
  overflow-y: auto;
}
.hp-cell {
  min-width: 0;
  height: 42px;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent;
  -webkit-appearance: none; appearance: none;
  font: inherit; color: inherit;
  overflow: hidden;
}
.hp-cell.empty { pointer-events: none; visibility: hidden; }
.hp-cell:active:not(.empty) { background: #EDEEEB; }
@media (hover: hover) { .hp-cell:hover:not(.empty) { background: #F2F3F1; } }
.hp-heb  { font-size: 13.5px; font-weight: 500; line-height: 1.05; }
.hp-greg { font-size: 9px; color: var(--slate); line-height: 1.05; }
.hp-cell.past .hp-heb  { color: #A9ADA6; }
.hp-cell.past .hp-greg { color: #C4C8C2; }
.hp-cell.today { border-color: var(--brass); }
.hp-cell.today .hp-heb { color: var(--brass); font-weight: 700; }
.hp-cell.sel { background: var(--wine); }
.hp-cell.sel .hp-heb, .hp-cell.sel .hp-greg { color: #fff; }

.hebpick-foot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line);
  padding: 9px 12px;
  flex: 0 0 auto;
}

/* ── לוגו ────────────────────────────────────────── */

.brand-logo {
  height: 34px; width: auto; display: block;
  border-radius: 6px;
}
.login-logo {
  max-width: 150px; width: 100%; height: auto;
  display: block; margin: 0 auto 16px;
  border-radius: 10px;
}

/* ── שורות שידרוג ────────────────────────────────── */

.up-row {
  display: grid;
  grid-template-columns: 1fr 88px 88px 32px;
  gap: 6px; align-items: end;
  padding: 8px 0; border-bottom: 1px solid #F0F1EE;
}
.up-row:last-of-type { border-bottom: 0; }
.up-row label { font-size: 11px; margin-bottom: 3px; }
.up-row input { padding: 8px 9px; }
.up-del { padding: 8px 0; height: 36px; }

@media (max-width: 480px) {
  .up-row { grid-template-columns: 1fr 1fr 32px; }
  .up-name { grid-column: 1 / -1; }
}

/* ── תזכורות ושריון ──────────────────────────────── */

.badge {
  background: var(--wine); color: #fff;
  font-size: 10.5px; font-weight: 600;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 4px;
}

.notif {
  background: var(--card); border: 1px solid var(--line);
  border-right: 4px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer;
}
.notif.unread { border-right-color: var(--wine); background: #FFFDFD; }
.notif h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; font-family: 'Heebo'; }
.notif p { margin: 0; font-size: 13px; color: var(--slate); white-space: pre-wrap; }
.notif time { display: block; margin-top: 6px; font-size: 11px; color: #9AA09A; }

.hold-banner {
  background: #FDF7EC; border: 1px solid #E8D6AE;
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px;
  font-size: 13.5px;
}
.hold-banner b { color: #8A6314; }

.chip.hold, .ev-row.hold {
  background-image: repeating-linear-gradient(45deg,
    rgba(255,255,255,.28) 0 4px, transparent 4px 8px);
}
.ev-row.hold { border-style: dashed; }

/* ── בורר פריטי תפריט ────────────────────────────── */

.pick-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 8px;
  border: 0; border-bottom: 1px solid #F2F3F1;
  background: transparent; text-align: right;
  font: inherit; color: inherit;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row.on { background: #FCF5F7; }
.pick-box {
  flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 5px;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; color: #fff;
}
.pick-row.on .pick-box { background: var(--wine); border-color: var(--wine); }
.pick-name { flex: 1; font-size: 14px; }
.pick-extra {
  flex: 0 0 auto;
  background: #F6EFE0; color: #8A6314;
  border-radius: 5px; padding: 2px 7px; font-size: 11.5px; font-weight: 500;
}
.menu-cat > label { gap: 8px; }

/* ── שורת פריט בתפריט ────────────────────────────── */

.mi-item { padding: 4px 0; border-bottom: 1px solid #F4F5F2; }
.mi-item:last-child { border-bottom: 0; }

.mi-row {
  display: grid;
  grid-template-columns: 1fr 62px 28px 28px;
  gap: 5px; align-items: center;
}
.mi-name {
  font-size: 13.5px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mi-qty { padding: 5px 6px; font-size: 12.5px; text-align: center; }

.mi-btn {
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--slate);
  font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
.mi-btn:hover { background: #F5F6F3; }
.mi-note-btn.has { border-color: var(--brass); color: var(--brass); background: #FCF8EF; }
.mi-del:hover { color: #96223A; border-color: #E4C9CF; }

input.mi-note {
  margin-top: 5px;
  padding: 6px 8px; font-size: 12.5px;
  background: #FBFBF9;
}

/* ── הערה מוסתרת בשורת פריט ──────────────────────── */

.mi-row { grid-template-columns: 1fr 62px 30px 28px; }
.mi-note-btn {
  border: 0; background: transparent; padding: 0;
  font-size: 14px; opacity: .35; line-height: 1;
}
.mi-row.has-note .mi-note-btn { opacity: 1; }
.mi-note { grid-column: 1 / -1; margin-top: 4px; }

@media (max-width: 480px) {
  .mi-row { grid-template-columns: 1fr 52px 28px 26px; }
}

/* ── רשימת הכנה ──────────────────────────────────── */

.prep-strip {
  background: #FDF7EC; border: 1px solid #E8D6AE; color: #8A6314;
  border-radius: var(--r); padding: 9px 14px; margin-bottom: 14px;
  font-size: 13.5px; font-weight: 500;
}
.prep-strip.done { background: #F0F6F2; border-color: #CFE2D6; color: var(--ok); }

.prep-bar {
  height: 6px; background: #E7E9E5; border-radius: 3px;
  overflow: hidden; margin: 0 2px 6px;
}
.prep-fill { height: 100%; background: var(--ok); width: 0; transition: width .2s; }
.prep-count { font-size: 12.5px; color: var(--slate); margin: 0 2px 14px; }

.prep-row {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 11px 6px;
  border: 0; border-bottom: 1px solid #F2F3F1;
  background: transparent; text-align: right; font: inherit; color: inherit;
}
.prep-row:last-child { border-bottom: 0; }
.prep-box {
  flex: 0 0 auto; margin-top: 1px;
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 13px; color: #fff;
}
.prep-row.on .prep-box { background: var(--ok); border-color: var(--ok); }
.prep-name { flex: 1; font-size: 14.5px; line-height: 1.4; }
.prep-name b { font-weight: 600; color: var(--wine); }
.prep-row.on .prep-name { color: var(--slate); text-decoration: line-through; }
.prep-row.on .prep-name b { color: var(--slate); }
.prep-note {
  display: block; font-size: 12.5px; color: var(--warn); font-weight: 500;
}

.cat-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 2px; border-bottom: 1px solid #F4F5F2; font-size: 13.5px;
}
.cat-item:last-child { border-bottom: 0; }

/* ── סיכום חודשי ─────────────────────────────────── */

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px;
}
.stat.wide { grid-column: span 2; }
.stat b {
  display: block; font-family: 'Frank Ruhl Libre', serif;
  font-size: 26px; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--wine);
}
.stat span { display: block; font-size: 12px; color: var(--slate); margin-top: 3px; }

@media (max-width: 480px) { .stat.wide { grid-column: span 2; } }

/* ── עריכת קטלוג ─────────────────────────────────── */

.cat-edit { margin-bottom: 16px; }
.cat-edit > label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.cat-row {
  display: grid; grid-template-columns: 1fr 76px 30px;
  gap: 5px; align-items: center; margin-bottom: 4px;
}
.cat-row input { padding: 6px 8px; font-size: 13px; }

/* ── פריטים נוספים בחשבון ────────────────────────── */

.ex-row {
  display: grid; grid-template-columns: 1fr 64px 72px auto 30px;
  gap: 6px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #F4F5F2;
}
.ex-row:last-child { border-bottom: 0; }
.ex-row input { padding: 7px 9px; font-size: 13px; }
.ex-amt { font-size: 12.5px; font-weight: 600; color: var(--wine); white-space: nowrap; min-width: 44px; text-align: left; }

@media (max-width: 480px) {
  .ex-row { grid-template-columns: 1fr 52px 60px 30px; }
  .ex-amt { display: none; }
}

/* ── פעולות בתזכורת ──────────────────────────────── */

.notif { cursor: default; }
.notif-actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid #F2F3F1;
  flex-wrap: wrap;
}
.notif-actions .spacer { flex: 1; }

.cal-cell.blank {
  background: #FAFAF9;
  cursor: default;
  border-left-color: #EDEEEB;
}

/* ── שורת טלפון עם פעולות ────────────────────────── */

.phone-line {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; flex-wrap: wrap;
}
.phone-line span { font-variant-numeric: tabular-nums; }

/* ── תשלומים ─────────────────────────────────────── */

.pay-row {
  display: grid; grid-template-columns: 110px 90px 1fr 30px;
  gap: 5px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #F4F5F2;
}
.pay-row:last-child { border-bottom: 0; }
.pay-row select, .pay-row input { padding: 7px 8px; font-size: 13px; }

.pay-strip {
  border-radius: var(--r); padding: 9px 14px; margin-bottom: 10px;
  font-size: 13.5px; font-weight: 500;
}
.pay-strip.paid    { background: #F0F6F2; border: 1px solid #CFE2D6; color: var(--ok); }
.pay-strip.partial { background: #FDF7EC; border: 1px solid #E8D6AE; color: #8A6314; }
.pay-strip.unpaid  { background: #FBF1F1; border: 1px solid #E9CBCB; color: var(--wine); }

.msg-warn { background: #FDF7EC; border: 1px solid #E8D6AE; color: #8A6314;
            border-radius: var(--r); padding: 8px 12px; font-size: 13px; }

@media (max-width: 480px) {
  .pay-row { grid-template-columns: 1fr 80px 30px; }
  .pay-row input[data-f="note"] { grid-column: 1 / -1; }
}

/* ── כפתור יציאה ─────────────────────────────────── */

.logout-btn {
  padding: 5px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--wine); margin-inline-start: 6px;
}
.logout-btn:hover { background: #FBF1F1; border-color: #E9CBCB; }

/* ── באנר צפייה כמשתמש ───────────────────────────── */

.viewas-banner {
  background: #6b1f33; color: #fff;
  padding: 9px 16px; font-size: 13.5px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.viewas-banner b { font-weight: 700; }
.viewas-banner .btn {
  margin-inline-start: auto; padding: 4px 12px; font-size: 12.5px;
  background: #fff; color: #6b1f33; border: 0;
}

/* ── חגי ישראל בלוח ──────────────────────────────── */

.cal-cell.yomtov { background: #FBF3F5; }        /* יום טוב — כמו שבת */
.cal-cell.shabbat.yomtov { background: #F7EDF0; }
.cal-cell.holiday { background: #FCFAF4; }        /* חג קל — חנוכה, פורים */

.d-holiday {
  display: block;
  font-size: 10.5px; line-height: 1.25;
  color: #6b1f33; font-weight: 600;
  background: #F3E4E9; border-radius: 3px;
  padding: 1px 4px; margin: 1px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-cell.holiday .d-holiday { background: #F1EAD6; color: #8A6314; }

/* ── בניית תפריט הבית ────────────────────────────── */

.hb-row {
  display: grid; grid-template-columns: 1fr 70px 1fr 30px;
  gap: 6px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #F4F5F2;
}
.hb-row:last-child { border-bottom: 0; }
.hb-row input { padding: 8px 9px; font-size: 13.5px; }

@media (max-width: 480px) {
  .hb-row { grid-template-columns: 1fr 60px 30px; }
  .hb-row input[data-f="note"] { grid-column: 1 / -1; }
}

/* ── פרשת השבוע ──────────────────────────────────── */

.d-parsha {
  display: block;
  font-size: 10px; line-height: 1.2;
  color: #7a6a52; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 1px 0 2px;
}

/* ── סימן שריון בלוח ─────────────────────────────── */

.chip-hold {
  display: inline-block;
  background: rgba(255,255,255,0.9); color: #6b1f33;
  font-weight: 800; font-size: 10px;
  width: 14px; height: 14px; line-height: 14px;
  text-align: center; border-radius: 50%;
  vertical-align: middle;
}
.chip.hold { opacity: 0.85; border: 1px dashed rgba(255,255,255,0.7); }

/* ── בניית תפריט לתפריט הבית ──────────────────────── */

.hb-cat { margin-bottom: 10px; }
.hb-cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hb-cat-head h3 { margin: 0; }
.hb-cat-head .btn { padding: 4px 12px; font-size: 12.5px; }
.hb-row {
  display: grid; grid-template-columns: 1fr 70px 1fr 30px;
  gap: 6px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #F4F5F2;
}
.hb-row:last-child { border-bottom: 0; }
.hb-row .hb-name { font-size: 13.5px; font-weight: 500; }
.hb-row input { padding: 7px 9px; font-size: 13px; }
.pick-extra { margin-inline-start: auto; font-size: 12px; color: var(--wine); font-weight: 600; }

@media (max-width: 480px) {
  .hb-row { grid-template-columns: 1fr 56px 30px; }
  .hb-row input[data-f="note"] { grid-column: 1 / -1; }
}

/* ── צומות ───────────────────────────────────────── */

.d-fast {
  display: block;
  font-size: 10px; line-height: 1.2;
  color: #5a6270; font-weight: 600;
  background: #EEF0F3; border-radius: 3px;
  padding: 1px 4px; margin: 1px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── סעודות שבת בטופס ────────────────────────────── */

.sh-slot {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; margin-top: 10px;
}
.sh-slot-title { font-weight: 700; color: var(--wine); margin-bottom: 8px; font-size: 14px; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.sh-grid input { padding: 7px 9px; font-size: 13.5px; }

@media (max-width: 480px) {
  .sh-grid { grid-template-columns: 1fr; }
}
.chat-box{display:flex;flex-direction:column;height:calc(100vh - 200px);min-height:400px}
.chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.chat-msg{max-width:80%;padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.5;word-break:break-word}
.chat-msg.out{align-self:flex-start;background:#7A1F3D;color:#fff;border-bottom-right-radius:4px}
.chat-msg.in{align-self:flex-end;background:#ffffff;color:var(--ink);border:1.5px solid #d0d0d0;border-bottom-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.chat-meta{font-size:11px;margin-top:4px;opacity:.7}
.chat-msg.out .chat-meta{color:rgba(255,255,255,.7)}
.chat-compose{border-top:1px solid var(--line);padding:12px;display:flex;gap:8px}
.chat-compose textarea{flex:1;min-height:44px;max-height:120px;resize:vertical;padding:10px 12px}
.chat-compose .btn{align-self:flex-end}
.email-badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600}
.email-badge.not_sent{background:#E8E9E6;color:#666}
.email-badge.sent{background:#FDF7EC;border:1px solid #E8D6AE;color:#8A6314}
.email-badge.confirmed{background:#F0F6F2;border:1px solid #CFE2D6;color:#2E6B4F}
.email-badge.modified{background:#FBF1F1;border:1px solid #E9CBCB;color:#7A1F3D}
.chat-actions{display:flex;gap:6px;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid var(--line);background:#FBFBFA}
.chat-empty{flex:1;display:flex;align-items:center;justify-content:center;color:var(--slate);text-align:center;padding:40px}
.chat-empty h3{font-size:16px;margin-bottom:6px;color:var(--ink)}


/* ── משימות הכנה ידניות ──────────────────────────── */

.prep-line { display: flex; align-items: center; gap: 4px; }
.prep-line .prep-row { flex: 1; }
.prep-del {
  flex: 0 0 auto; width: 28px; height: 28px;
  border: 0; background: transparent; color: var(--wine);
  font-size: 14px; cursor: pointer; border-radius: 6px; opacity: 0.6;
}
.prep-del:hover { background: #FBF1F1; opacity: 1; }
.prep-add { display: flex; gap: 8px; }
.prep-add input { flex: 1; padding: 9px 11px; font-size: 14px; }
.prep-add .btn { flex: 0 0 auto; }

/* ── תת-פריטים ברשימת הכנה ────────────────────────── */

.prep-line.prep-sub { padding-right: 26px; }
.prep-line.prep-sub .prep-row { opacity: 0.92; }
.prep-line.prep-sub .prep-name { font-size: 13px; color: #555; }
.prep-sub-add {
  flex: 0 0 auto; width: 28px; height: 28px;
  border: 1px solid var(--line); background: transparent; color: var(--wine);
  font-size: 16px; cursor: pointer; border-radius: 6px; line-height: 1;
}
.prep-sub-add:hover { background: #F6EEF0; }
