/* ============================================================
 *  זהבה (Zahava) — styles
 *  Gold #E8A838 · full RTL · mobile-first 480px · desktop-centered
 * ============================================================ */
:root {
  --gold: #E8A838;
  --gold-light: #FDF3E0;
  --gold-dark: #C4872A;
  --text: #2C2A20;
  --text-muted: #7A7060;
  --bg: #FAFAF8;
  --white: #FFFFFF;
  --border: #EDE8DC;
  --success: #3B6D11; --success-bg: #EAF3DE;
  --danger: #A32D2D;  --danger-bg: #FCEBEB;
  --info: #185FA5;    --info-bg: #E6F1FB;
  --warn: #854F0B;    --warn-bg: #FAEEDA;
  --radius: 14px; --radius-sm: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.6;
}
button { font-family: inherit; }
a { color: inherit; }

/* desktop: gentle page backdrop so the 480px column reads as a centered frame */
@media (min-width: 700px) {
  body { background: #F1EEE6; }
  .app, .onboard { box-shadow: 0 2px 24px rgba(0,0,0,0.06); }
}

/* ---------- ONBOARDING / JOIN ---------- */
.onboard {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: var(--white); max-width: 480px; margin: 0 auto;
}
.onboard-logo { font-size: 3.5rem; margin-bottom: 8px; }
.onboard h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 4px; }
.onboard p { color: var(--text-muted); margin-bottom: 28px; font-size: 0.95rem; text-align: center; }
.onboard-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px;
}
.step-indicator { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .3s; }
.step-dot.active { background: var(--gold); }
.step-dot.done { background: var(--gold-dark); }
.step-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; }

label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; margin-top: 12px; }
label.first, label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  color: var(--text); background: var(--white); transition: border-color .2s;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }

.country-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.country-btn {
  padding: 10px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; font-size: 0.85rem; text-align: center;
  transition: all .2s; color: var(--text);
}
.country-btn:hover { border-color: var(--gold); background: var(--gold-light); }
.country-btn.selected { border-color: var(--gold); background: var(--gold-light); font-weight: 600; }

.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  padding: 11px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.95rem; font-weight: 600; transition: all .2s; flex: 1;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text-muted); flex: 0 0 auto; padding: 11px 16px; }
.btn-outline:hover { border-color: var(--gold); color: var(--text); }
.btn-gold-outline { background: #fff; border: 1.5px solid var(--gold); color: var(--gold-dark); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #F09595; }
.btn-blue   { background: var(--info-bg);   color: var(--info);   border: 1px solid #85B7EB; }
.btn-gray   { background: #fff; border: 1px solid var(--border); color: var(--text-muted); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; flex: 0 0 auto; }

/* ---------- APP SHELL ---------- */
.app { display: none; max-width: 480px; margin: 0 auto; padding-bottom: 78px; background: var(--bg); min-height: 100vh; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-info { display: flex; flex-direction: column; }
.topbar-name { font-weight: 600; font-size: 1rem; }
.topbar-sub { font-size: 0.78rem; color: var(--text-muted); }
.topbar-logo { font-size: 1.5rem; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--white);
  border-top: 1px solid var(--border); display: flex; z-index: 200;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px;
  border: none; background: none; cursor: pointer; color: var(--text-muted);
  font-size: 0.68rem; gap: 3px; transition: color .2s;
}
.nav-btn.active { color: var(--gold-dark); }
.nav-icon { font-size: 1.3rem; line-height: 1; }

.page { display: none; padding: 16px; }
.page.active { display: block; }
.page-back { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }

/* ---------- CARDS / ALERTS ---------- */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .04em; }
.section-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 8px; }
.muted-center { text-align: center; color: var(--text-muted); font-size: 0.88rem; padding: 14px 0; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: 0.88rem; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #EFC57A; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #9BC86A; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #85B7EB; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #F09595; }

/* ---------- HOME ---------- */
.greeting { background: linear-gradient(135deg, var(--gold-light), #FFF8EC); border: 1px solid #F0D8A0; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.greeting h2 { font-size: 1.1rem; font-weight: 600; }
.greeting p { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.quick-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 6px; text-align: start; }
.quick-card:hover { border-color: var(--gold); background: var(--gold-light); }
.quick-icon { font-size: 1.5rem; }
.quick-label { font-size: 0.85rem; font-weight: 600; }
.quick-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- SALARY ---------- */
.salary-result { background: var(--gold-light); border: 1px solid #F0D8A0; border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-item { background: var(--white); border-radius: var(--radius-sm); padding: 10px; text-align: center; border: 1px solid var(--border); }
.result-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; }
.result-val { font-size: 1rem; font-weight: 600; }
.result-total { background: var(--gold); border-radius: var(--radius-sm); padding: 12px; text-align: center; margin-top: 8px; }
.result-total .result-label { color: rgba(255,255,255,.85); }
.result-total .result-val { color: #fff; font-size: 1.3rem; }

/* ---------- DICTIONARY ---------- */
.word-card { display: flex; justify-content: space-between; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }
.word-he { font-weight: 600; font-size: 0.95rem; }
.word-tr { font-size: 0.95rem; color: var(--text-muted); margin-top: 2px; direction: ltr; text-align: start; }
.speak-btn { background: var(--gold-light); border: 1px solid #F0D8A0; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; flex-shrink: 0; transition: background .2s; }
.speak-btn:hover { background: #F0D8A0; }
.speak-btn.no-tts { opacity: .4; }
.chips { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 0.8rem; cursor: pointer; background: var(--white); color: var(--text-muted); transition: all .2s; }
.chip.active { border-color: var(--gold); background: var(--gold-light); color: var(--gold-dark); font-weight: 600; }
.search-input { margin-bottom: 10px; }

/* ---------- HOLIDAYS ---------- */
.holiday-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.holiday-item:last-child { border-bottom: none; }
.holiday-name { font-weight: 600; font-size: 0.9rem; }
.holiday-date { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-urgent { background: var(--danger-bg); color: var(--danger); }
.badge-soon { background: var(--warn-bg); color: var(--warn); }
.badge-future { background: var(--info-bg); color: var(--info); }
.badge-past { background: #F1EFE8; color: #888780; }
.badge-gold { background: var(--gold-light); color: var(--gold-dark); }

/* ---------- DOCUMENTS ---------- */
.doc-category { margin-bottom: 16px; }
.doc-cat-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.doc-item { display: flex; justify-content: space-between; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 6px; transition: border-color .2s; }
.doc-item:hover { border-color: var(--gold); }
.doc-icon { font-size: 1.3rem; margin-inline-start: 10px; }
.doc-name { font-weight: 600; font-size: 0.9rem; }
.doc-exp { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.doc-exp.expiring { color: var(--danger); font-weight: 600; }
.doc-actions { display: flex; gap: 6px; align-items: center; }
.add-doc-btn { width: 100%; padding: 11px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--text-muted); font-size: 0.88rem; transition: all .2s; margin-top: 8px; }
.add-doc-btn:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ---------- EMERGENCY ---------- */
.emergency-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.emergency-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--radius-sm); text-decoration: none; border: none; cursor: pointer; }
.emergency-btn .e-icon { font-size: 1.4rem; }
.emergency-btn .e-num { font-size: 1.1rem; font-weight: 700; }
.emergency-btn .e-label { font-size: 0.72rem; }
.e-red { background: var(--danger-bg); color: var(--danger); }
.e-blue { background: var(--info-bg); color: var(--info); }
.e-orange { background: var(--warn-bg); color: var(--warn); }
.contact-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contact-item:last-child { border-bottom: none; }
.contact-name { font-weight: 600; font-size: 0.9rem; }
.contact-role { font-size: 0.8rem; color: var(--text-muted); }
.contact-phone { font-size: 0.88rem; color: var(--info); text-decoration: none; white-space: nowrap; }

/* ---------- RIGHTS ---------- */
.right-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.right-item:last-child { border-bottom: none; }
.right-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 3px; }
.right-desc { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- SHIFTS / MEDS ---------- */
.subtabs { display: flex; gap: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; }
.subtab { flex: 1; padding: 10px 8px; border: none; background: #fff; color: var(--text-muted); font-weight: 400; font-size: 0.85rem; cursor: pointer; }
.subtab.active { background: var(--gold-light); color: var(--gold-dark); font-weight: 700; border-bottom: 2px solid var(--gold); }
.shift-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.shift-card.mine { background: var(--gold-light); border-color: #F0D8A0; }
.shift-card.past { opacity: .6; }
.shift-name { font-weight: 700; font-size: 0.95rem; }
.shift-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.shift-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.med-row { border-bottom: 1px solid var(--border); padding: 12px 0; }
.med-row:last-child { border-bottom: none; }
.check-btn { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); background: #fff; color: var(--border); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check-btn.done { border-color: var(--gold); background: var(--gold); color: #fff; }
.given-line { font-size: 0.75rem; color: var(--gold-dark); margin-top: 4px; font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; color: var(--gold-dark); flex-shrink: 0; }

/* ---------- MARKETPLACE ---------- */
.toggle { width: 40px; height: 22px; border-radius: 11px; background: var(--border); cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--gold); }
.toggle .knob { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .2s; }
.toggle.on .knob { right: 20px; }
.stars { line-height: 1; white-space: nowrap; }
.star-on { color: var(--gold); }
.star-off { color: var(--border); }
.tag { background: var(--gold-light); color: var(--gold-dark); padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.pill { padding: 3px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.pill-green { background: var(--success-bg); color: var(--success); }
.pill-gray { background: #F1EFE8; color: #888780; }
.lang-pill { background: #F1EFE8; color: #5F5E5A; padding: 4px 12px; border-radius: 20px; font-size: 0.82rem; }
.mkt-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.mkt-progress > div { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .3s; }
.mkt-progress > div.on { background: var(--gold); }
.star-pick span { font-size: 1.8rem; cursor: pointer; }

/* ---------- BOTTOM SHEET MODAL ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; justify-content: center; align-items: flex-end; }
.modal-overlay.open { display: flex; }
.modal-sheet { background: var(--white); border-radius: var(--radius) var(--radius) 0 0; padding: 20px; width: 100%; max-width: 480px; margin: 0 auto; max-height: 88vh; overflow-y: auto; }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.modal-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.modal-close { width: 100%; padding: 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer; font-size: 0.9rem; color: var(--text-muted); margin-top: 12px; }

/* ---------- TOAST ---------- */
#toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 0.86rem; z-index: 900; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 90%; text-align: center; }
#toast.show { opacity: .95; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.spinner { text-align: center; padding: 40px; color: var(--text-muted); }
