:root {
  --bg: #0e1117;
  --surface: #171c26;
  --surface-2: #1f2633;
  --border: #2a3242;
  --text: #e8ecf3;
  --muted: #97a1b3;
  --accent: #5eb0ff;
  --accent-strong: #2f8fe8;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }

/* ----- ניווט עליון ----- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: var(--muted); padding: 0.2rem 0.4rem; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar .soon { color: #5a6478; cursor: default; font-size: 0.9rem; }
.topbar .soon::after { content: " ·"; color: #3a4356; }
.logout { margin-inline-start: auto; }
.logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.logout-btn:hover { color: var(--text); }

main { max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* ----- כרטיסים ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.card h2 { font-size: 1.1rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

.hero { margin-bottom: 1.75rem; }
.hero h1 { font-size: 1.8rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty { margin-top: 2rem; text-align: center; }
.error { color: #ff8080; margin-top: 0.5rem; }
.link { font-size: 0.9rem; }

.home-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
}
.soon-card { background: linear-gradient(135deg, var(--surface), #1a2233); }

/* ----- כפתורים, צ'יפים, טפסים ----- */
.btn {
  display: inline-block;
  background: var(--accent-strong);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--accent); }

.chip {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.1rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}
.chip-active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: 0.75rem; align-items: center; }

label { display: block; margin-bottom: 0.9rem; color: var(--muted); font-size: 0.9rem; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-size: 1rem;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-strong); border-color: transparent; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.search input { width: 220px; margin-top: 0; }

.add-form { margin-bottom: 1.5rem; }
.add-form summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.add-form form { margin-top: 1rem; }

/* ----- ציר זמן ----- */
.timeline { position: relative; padding-inline-start: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.35rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
  position: absolute;
  inset-inline-start: -1.5rem;
  top: 1.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

.event-list { list-style: none; }
.event-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.event-list li:last-child { border-bottom: none; }
.event-list .small { margin-inline-start: auto; }

/* ----- גלריה ----- */
.year-block { margin-bottom: 2rem; }
.year-block h2 { margin-bottom: 0.75rem; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}
.photo-grid img:hover { transform: scale(1.03); }

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ----- יומן ----- */
.entry-list { display: flex; flex-direction: column; gap: 1rem; }
.card.entry { color: var(--text); display: block; }
.card.entry:hover { border-color: var(--accent-strong); }
.entry-full h1 { margin: 0.25rem 0 1rem; }
.entry-body { margin-bottom: 1.5rem; }
.entry-body p { margin-bottom: 0.8rem; }

/* ----- משימות ----- */
.add-inline { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.add-inline input[type="text"] { flex: 1; min-width: 200px; margin-top: 0; }
.add-inline .inline-date { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0; }
.add-inline .inline-date input { width: auto; margin-top: 0; }

.task-list { display: flex; flex-direction: column; gap: 0.6rem; }
.card.task { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1.1rem; }
.card.task.overdue { border-color: #a04040; }
.task-body { flex: 1; display: flex; flex-direction: column; }
.task-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: none;
  color: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}
.task-check:hover { background: var(--accent-strong); color: #fff; }
.task-done-mark { color: #5dbb63; font-weight: 700; width: 28px; text-align: center; }
.card.task.done { opacity: 0.6; }
.task-delete {
  background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 0.9rem;
}
.task-delete:hover { color: #ff8080; }
.done-section { margin-top: 1.5rem; }
.done-section summary { cursor: pointer; margin-bottom: 0.75rem; }

/* ----- הוצאות ----- */
.month-nav { display: flex; align-items: center; gap: 0.9rem; }
.big-number { font-size: 2.2rem; font-weight: 800; margin: 0.25rem 0; }
.cat-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem; }
.cat-label { width: 84px; font-size: 0.88rem; color: var(--muted); }
.cat-bar-track { flex: 1; background: var(--surface-2); border-radius: 999px; height: 10px; overflow: hidden; }
.cat-bar { background: var(--accent-strong); height: 100%; border-radius: 999px; }
.cat-amount { min-width: 64px; text-align: left; font-size: 0.88rem; }
.expense-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }
.expense-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 1.1rem; }
.expense-note { flex: 1; }

/* ----- התחברות ----- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-card h1 { margin-bottom: 0.25rem; }
.login-card .muted { margin-bottom: 1.5rem; }
.login-card input { text-align: center; }
.login-card button { width: 100%; margin-top: 1rem; }
