/* עיצוב — Mobile First, עברית, RTL */
:root {
  --green: #0e7a5f;
  --green-dark: #0a5c47;
  --green-light: #e6f4ef;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #182420;
  --text-soft: #5c6b65;
  --border: #e2e8e5;
  --red: #d64545;
  --red-light: #fdecec;
  --yellow: #e8a913;
  --radius: 18px;
  --shadow: 0 2px 12px rgba(16, 40, 32, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100dvh;
}

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }

.loading { text-align: center; padding: 48px 0; color: var(--text-soft); }

/* כותרת עליונה */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 16px;
}
.topbar h1 { font-size: 22px; font-weight: 800; color: var(--green-dark); }
.topbar .back {
  background: none; border: none; font-size: 17px; font-weight: 600;
  color: var(--green); cursor: pointer; padding: 8px;
}

/* כרטיסים */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.card .sub { color: var(--text-soft); font-size: 15px; }

/* כפתורים — גדולים ונוחים למגע */
.btn {
  display: block; width: 100%; min-height: 54px;
  border: none; border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 700;
  background: var(--green); color: #fff;
  transition: transform .06s ease, opacity .15s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--green-light); color: var(--green-dark); }
.btn.danger { background: var(--red-light); color: var(--red); }
.btn.danger-solid { background: var(--red); color: #fff; }
.btn.ghost { background: none; color: var(--text-soft); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn + .btn { margin-top: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* טפסים */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
input, textarea, select {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 14px;
  font-family: inherit; font-size: 17px; background: #fff; color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); }
.hint { font-size: 14px; color: var(--text-soft); margin-top: 4px; }

/* מתג */
.switch { position: relative; display: inline-block; width: 56px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 32px;
  background: #cfd8d4; transition: .2s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 26px; width: 26px;
  right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(-24px); }

/* שורת קהילה בדשבורד */
.community-row { display: flex; align-items: center; gap: 12px; }
.community-row .info { flex: 1; min-width: 0; }
.community-row .name { font-weight: 700; font-size: 17px; }
.community-row .meta { font-size: 14px; color: var(--text-soft); }
.badge {
  display: inline-block; background: var(--green-light); color: var(--green-dark);
  border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700;
}
.badge.warn { background: #fff3d6; color: #8a6100; }

/* אשף */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .step { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.steps .step.done { background: var(--green); }

.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border: 1.5px solid var(--border); border-radius: 14px;
  margin-bottom: 10px; cursor: pointer; background: #fff;
}
.list-item.selected { border-color: var(--green); background: var(--green-light); }

/* בדיקות */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.check .icon { font-size: 22px; }
.check .help { font-size: 14px; color: var(--text-soft); margin-top: 2px; }

/* לוג */
.log-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-item .time { font-size: 13px; color: var(--text-soft); }

/* חירום */
.emergency-banner {
  background: var(--red); color: #fff; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px; font-weight: 700; text-align: center;
}

/* סרגל תחתון */
.tabbar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 6px 0 max(10px, env(safe-area-inset-bottom));
}
.tabbar button {
  background: none; border: none; font-family: inherit; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; min-width: 72px;
}
.tabbar button .ico { font-size: 22px; }
.tabbar button.active { color: var(--green-dark); }

/* הודעות toast */
#toast {
  position: fixed; bottom: 90px; right: 50%; transform: translateX(50%);
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 100; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; }

.qr-box { text-align: center; padding: 12px 0; }
.qr-box img { width: 240px; max-width: 80vw; border-radius: 12px; }

/* בורר ימים */
.days-row { display: flex; gap: 6px; }
.day-btn {
  flex: 1; min-height: 46px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--text-soft);
}
.day-btn.on { background: var(--green); border-color: var(--green); color: #fff; }

.center { text-align: center; }
.mt { margin-top: 14px; }
.big-emoji { font-size: 48px; text-align: center; display: block; margin-bottom: 8px; }
