/* ============================================================
   מאיה - עיצוב הממשק (שלד)
   כהה בצבעי המותג: 202239 / 896EC0 / 4A3B7A
   מובייל תחילה: נבנה לרוחב 375 ומתרחב.
   פונטים של המותג נטענים בשלב הפריסה; עד אז מחסנית מערכת.
   ============================================================ */

:root {
  --bg: #202239;          /* כחול לילה - רקע ראשי */
  --accent: #896EC0;      /* סגול לבנדר - הדגשות */
  --deep: #4A3B7A;        /* אינדיגו עמוק - משטחים */
  --surface: #2a2c4a;     /* משטח כרטיס, נגזרת בהירה מעט מהרקע */
  --text: #f2f0fa;        /* טקסט ראשי */
  --muted: #b6aed6;       /* טקסט משני */
  --ok: #6fcf97;          /* אישור */
  --radius: 14px;
}

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

html { direction: rtl; }

body {
  font-family: 'Heebo', 'Sora', -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  direction: rtl;
  text-align: right;
}

/* ---------- מעטפת עמוד ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 84px; /* מקום לסרגל הניווט התחתון */
}

h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; color: var(--muted); }

.brand-mark {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--deep);
  color: var(--text);
  min-height: 44px; /* יעד מגע נוח במובייל */
}
.btn-primary { background: var(--accent); color: #17131f; }
.btn-ghost { background: transparent; border: 1px solid var(--deep); color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- טפסים ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }

.input-wrap { position: relative; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--deep);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  direction: rtl;
  text-align: right;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* עין הסיסמה: משמאל לשדה (סוף השורה בכיוון ימין-לשמאל) */
.eye-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  line-height: 0;
}
.eye-btn:hover { color: var(--accent); }
.input-wrap input[type="password"], .input-wrap input[type="text"] { padding-left: 44px; }

/* ---------- מסך כניסה ---------- */
.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
}
.login-title { text-align: center; margin-bottom: 32px; }
.login-title .brand-mark { font-size: 2rem; display: block; margin-bottom: 8px; }
.login-error { color: #ef8e8e; font-size: 0.9rem; min-height: 1.2em; margin-bottom: 10px; }

/* ---------- צ'אט ---------- */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: var(--radius);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-user { background: var(--deep); align-self: flex-start; }   /* המשתמש: צד ימין בזרימת rtl */
.msg-maya { background: var(--surface); border: 1px solid var(--deep); align-self: flex-end; }

/* תקרת מלל בכרטיס: הקיטום נעשה בקוד, הכפתור מרחיב */
.msg .expand-btn {
  display: block;
  margin-top: 8px;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.chat-input-row {
  position: fixed;
  bottom: 64px;
  right: 0; left: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
}
.chat-input-row textarea { resize: none; height: 48px; flex: 1; }

/* ---------- יומן פעולות ---------- */
.action-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--deep);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.action-item input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.action-item .meta { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.action-item.done { opacity: 0.55; }
.action-item.done .title { text-decoration: line-through; }

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

/* ---------- לוח מגמות ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--deep);
  border-radius: var(--radius);
  padding: 14px;
}
.stat-card .num { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.stat-card .lbl { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-row .bar-label { width: 110px; font-size: 0.9rem; color: var(--muted); flex-shrink: 0; }
.bar-row .bar-track { flex: 1; background: var(--surface); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-row .bar-val { width: 34px; font-size: 0.85rem; color: var(--muted); text-align: left; }

/* ---------- סרגל ניווט תחתון ---------- */
.nav-bar {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--deep);
}
.nav-bar a {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.nav-bar a.active { color: var(--accent); }

/* ---------- הודעת דגימה (מצב הדגמה) ---------- */
.mock-note {
  background: var(--deep);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.8rem;
  margin-bottom: 14px;
  text-align: center;
}

/* ---------- מסכים רחבים ---------- */
@media (min-width: 768px) {
  .page { padding: 24px; }
  .msg { max-width: 75%; }
}
