/* מה עושים? - עיצוב */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #2b2440;
  --muted: #6f6a80;
  --brand: #ff6b5e;
  --brand-dark: #e8503f;
  --accent: #5b8def;
  --green: #37b877;
  --gold: #f2a541;
  --border: #e7e0d4;
  --shadow: 0 2px 12px rgba(43, 36, 64, .08);
  --shadow-lg: 0 10px 30px rgba(43, 36, 64, .16);
  --radius: 16px;
  --free: #e6f7ee;
  --free-ink: #1d7a4c;
}

[data-theme="dark"] {
  --bg: #17142a;
  --surface: #221e3a;
  --surface-2: #2b2647;
  --ink: #f0edfa;
  --muted: #a8a2c0;
  --brand: #ff7a6e;
  --brand-dark: #ff6b5e;
  --border: #37325a;
  --shadow: 0 2px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
  --free: #1c3b2c;
  --free-ink: #6fdca6;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Rubik", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }

/* ===== Header ===== */
header {
  background: linear-gradient(135deg, var(--brand) 0%, #ff9068 100%);
  color: #fff;
  padding: 14px 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
}

.logo .mark {
  background: #fff;
  border-radius: 12px;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.logo small { display: block; font-size: .72rem; font-weight: 400; opacity: .92; line-height: 1.2; }

.head-actions { display: flex; gap: 8px; }

.icon-btn {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 12px;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.32); }

/* ===== Tabs ===== */
nav.tabs {
  display: flex;
  gap: 4px;
  max-width: 1080px;
  margin: 12px auto 0;
}

.tab-btn {
  flex: 1;
  border: none;
  background: rgba(255,255,255,.14);
  color: #fff;
  padding: 11px 8px 13px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .2s;
  position: relative;
}
.tab-btn:hover { background: rgba(255,255,255,.26); }
.tab-btn.active { background: var(--bg); color: var(--ink); font-weight: 700; }
.tab-btn .badge {
  background: var(--gold);
  color: #4a3208;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 20px;
}

main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 80px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .25s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ===== Section titles ===== */
h2.section-title {
  font-size: 1.3rem;
  margin: 4px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-sub { color: var(--muted); font-size: .92rem; margin: -10px 0 16px; }

/* ===== Filters ===== */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.filter-row:last-child { margin-bottom: 0; }

.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); }

select, input[type="text"], input[type="time"], input[type="date"], input[type="search"] {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color .2s;
  width: 100%;
}
select:focus, input:focus { outline: none; border-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: .88rem;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip:hover { border-color: var(--brand); }
.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.chip.free-chip.on { background: var(--green); border-color: var(--green); }

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .92rem;
}

.link-btn { background: none; border: none; color: var(--accent); font-size: .9rem; text-decoration: underline; }

/* ===== Event cards ===== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 0;
}

.event-emoji {
  font-size: 2rem;
  background: var(--surface-2);
  width: 54px; height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.event-date-chip {
  text-align: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 6px 12px;
  line-height: 1.25;
}
.event-date-chip .d { font-weight: 700; font-size: 1.05rem; }
.event-date-chip .t { font-size: .78rem; color: var(--muted); }

.event-body { padding: 10px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.event-body h3 { font-size: 1.05rem; line-height: 1.3; }

.event-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .84rem; }
.event-meta span { display: inline-flex; align-items: center; gap: 4px; }

.event-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

.price-tag { font-weight: 700; font-size: .95rem; }
.price-tag.free { background: var(--free); color: var(--free-ink); border-radius: 99px; padding: 2px 11px; font-size: .84rem; }

.tag-cat {
  font-size: .78rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 99px;
  padding: 2px 10px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty-state .big { font-size: 3rem; margin-bottom: 10px; }

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: .95rem;
  font-weight: 600;
  transition: transform .12s, filter .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--border); }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-danger-ghost { background: none; border: none; color: #d05555; font-size: .85rem; text-decoration: underline; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 40, .55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 20px 26px;
  animation: slideUp .28s ease;
  position: relative;
}

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 22px; }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--surface-2);
  border: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  font-size: 1rem;
  color: var(--muted);
}

.modal h3 { font-size: 1.25rem; margin-bottom: 4px; padding-left: 40px; }
.modal .modal-emoji { font-size: 2.6rem; margin-bottom: 8px; }

.detail-rows { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.detail-rows .row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .92rem;
}
.detail-rows .row .ic { flex-shrink: 0; }

.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 140px; }

/* ===== Form modal ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.kid-select { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-pick {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 7px 13px;
  font-size: .92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.kid-pick.on { border-color: var(--kc, var(--brand)); background: color-mix(in srgb, var(--kc, var(--brand)) 14%, var(--surface)); font-weight: 600; }

/* ===== Schedule board ===== */
.kids-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.kid-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-right: 5px solid var(--kc, var(--brand));
  border-radius: 12px;
  padding: 7px 12px;
  font-size: .92rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.kid-chip button { background: none; border: none; color: var(--muted); font-size: .8rem; padding: 0 2px; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

@media (max-width: 860px) { .week-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .week-grid { grid-template-columns: 1fr; } }

.day-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-col.today-col { border-color: var(--brand); border-width: 2px; }

.day-head {
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.day-head .today-mark { font-size: .68rem; background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 8px; }

.slot {
  border-radius: 10px;
  padding: 7px 9px;
  font-size: .82rem;
  line-height: 1.35;
  background: color-mix(in srgb, var(--kc, var(--accent)) 13%, var(--surface));
  border-right: 4px solid var(--kc, var(--accent));
  cursor: pointer;
  transition: transform .12s;
  position: relative;
}
.slot:hover { transform: translateX(-2px); }
.slot .s-time { font-weight: 700; }
.slot .s-kid { color: var(--muted); font-size: .76rem; display: flex; align-items: center; gap: 4px; }
.slot.event-slot { border-right-style: double; border-right-width: 5px; }
.slot .s-conflict {
  color: #c0392b;
  font-size: .74rem;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

.day-empty { color: var(--muted); font-size: .78rem; text-align: center; padding: 10px 0; opacity: .7; }

.board-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

/* ===== Today panel ===== */
.today-hero {
  background: linear-gradient(135deg, var(--accent), #7ab0ff);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.today-hero h2 { font-size: 1.35rem; margin-bottom: 2px; }
.today-hero .date-line { opacity: .92; font-size: .95rem; }

.timeline { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.timeline-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  align-items: center;
}
.timeline-item .tl-time {
  font-weight: 700;
  font-size: 1.02rem;
  min-width: 52px;
  text-align: center;
  color: var(--brand-dark);
}
.timeline-item .tl-body { flex: 1; }
.timeline-item .tl-body .tl-title { font-weight: 600; }
.timeline-item .tl-body .tl-sub { color: var(--muted); font-size: .84rem; }
.timeline-item .tl-kid {
  font-size: .8rem;
  border-radius: 99px;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--kc, var(--accent)) 16%, var(--surface));
  border: 1.5px solid var(--kc, var(--accent));
  white-space: nowrap;
}
.timeline-item.past { opacity: .5; }

.upcoming-strip { display: flex; flex-direction: column; gap: 10px; }

/* ===== Toast ===== */
#toast {
  position: fixed;
  bottom: 20px;
  right: 50%;
  transform: translateX(50%) translateY(80px);
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  padding: 11px 20px;
  font-size: .92rem;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: all .3s;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}
#toast.show { transform: translateX(50%) translateY(0); opacity: 1; }

/* ===== Footer ===== */
footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--border);
  margin-top: 30px;
}

/* ===== Print (weekly board) ===== */
@media print {
  header, .filters, .board-actions, .kids-bar button, footer, #toast, .fab { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .tab-panel { display: none !important; }
  #panel-board { display: block !important; }
  .week-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .day-col { break-inside: avoid; border: 1px solid #bbb; min-height: auto; }
  .slot { border: 1px solid #ccc; border-right: 4px solid #888; }
}
