:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #6b7076;
  --line: #ddd8cc;
  --accent: #b5452b;
  --accent-ink: #ffffff;
  --ok: #2f7d4f;
  --warn: #c27a12;
  --none: #9aa0a6;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
header.top h1 { font-size: 18px; margin: 0; flex: 1; white-space: nowrap; }
header.top a, header.top button.link { color: var(--accent-ink); }
.badge {
  background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 10px; font-size: 13px;
}
.badge.warn { background: #ffd58a; color: #3a2a00; }

nav.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 46px; z-index: 9; }
nav.tabs button {
  flex: 1; border: 0; background: none; padding: 12px 4px; font-size: 15px; color: var(--muted);
  border-bottom: 3px solid transparent;
}
nav.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.card h2, .card h3 { margin: 0 0 10px; font-size: 17px; }
.card.closed { border-style: dashed; background: #fbf8f1; }

label.f { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=tel], input[type=password], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
}
textarea { min-height: 64px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: #fff; cursor: pointer;
  user-select: none;
}
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }

.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff3e6; margin: 4px 0 6px; }
.toggle input { width: 22px; height: 22px; }

button.btn {
  font: inherit; border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer;
  background: var(--ink); color: #fff;
}
button.btn.primary { background: var(--accent); }
button.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.btn.small { padding: 6px 10px; font-size: 14px; }
button.btn.block { width: 100%; }
button.btn:disabled { opacity: .5; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.addr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.side-pill { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: #eee; }

.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }

.photo-prev { max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 8px; display: block; }

.toast {
  position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 520px; margin: 0 auto;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 50;
  text-align: center;
}
.err { color: #b00020; font-size: 14px; margin-top: 6px; }

.login { max-width: 360px; margin: 12vh auto 0; }

#placeMap { height: 240px; border-radius: 10px; border: 1px solid var(--line); }
#areaChips { margin-bottom: 4px; }
.pin { background: var(--accent); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* מפה */
body.mapPage { height: 100vh; display: flex; flex-direction: column; }
#mapWrap { flex: 1; display: flex; min-height: 0; }
#map { flex: 1; min-height: 300px; }
aside.side {
  width: 340px; overflow: auto; background: var(--card); border-inline-start: 1px solid var(--line); padding: 12px 14px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 12px; font-size: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.leaflet-popup-content { direction: rtl; text-align: right; font-size: 14px; }
.leaflet-popup-content ul { padding-inline-start: 18px; margin: 6px 0 0; }
table.biz { width: 100%; border-collapse: collapse; font-size: 13px; }
table.biz td, table.biz th { border-bottom: 1px solid var(--line); padding: 4px; text-align: right; vertical-align: top; }
@media (max-width: 820px) {
  #mapWrap { flex-direction: column; }
  aside.side { width: auto; max-height: 45vh; border-inline-start: 0; border-top: 1px solid var(--line); }
}

.jform input { width: 100%; margin: 4px 0; }
.mark-on #map { cursor: crosshair; }
.leaflet-tooltip.jlabel { background: #2b6cb0; color: #fff; border: 0; font-weight: 600; padding: 2px 6px; }
.leaflet-tooltip.jlabel::before { display: none; }
