/* לפי העיצוב המאושר: עיצוב\היום שלי - מאושר.png */
:root {
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --text: #2B2B2B;
  --muted: #6B6B6B;
  --olive: #4A5D3F;
  --olive-dark: #3B4B32;
  --red: #C0392B;
  --red-soft: #F6DAD6;
  --amber: #F7D774;
  --amber-text: #6B4E00;
  --bluegray: #DCE5EE;
  --bluegray-text: #34495E;
  --gray-chip: #ECECEC;
  --line: #E8E2D8;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Assistant', 'Heebo', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.app { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }

/* ראש הדף */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.title h1 { margin: 0; font-size: 30px; font-weight: 800; }
.date { color: var(--muted); font-size: 15px; }
.top-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.save-state { font-size: 14px; color: var(--olive); white-space: nowrap; }
.save-state.saving { color: var(--muted); }
.save-state.failed { color: var(--red); font-weight: 700; }
.viewer { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 12px; font-weight: 600; min-height: 44px; }
.viewer select { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }

/* כפתורים */
.btn { font: inherit; font-weight: 700; border-radius: 12px; min-height: 44px; padding: 8px 18px; cursor: pointer; border: 2px solid var(--olive); }
.btn.primary { background: var(--olive); color: #fff; }
.btn.primary:hover { background: var(--olive-dark); }
.btn.outline { background: #fff; color: var(--olive); }
.btn.wide { width: 100%; font-size: 20px; min-height: 56px; margin-bottom: 20px; }
.btn:focus-visible, .tab:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #9DB38C; outline-offset: 2px; }

.banner { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.banner p { margin: 0 0 12px; }

/* חלקים */
.section { margin-bottom: 22px; }
.section h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; margin: 0 0 10px; }
.section h2 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.section h2 .count { font-weight: 700; color: var(--text); font-size: 20px; }
.section h3 { font-size: 16px; margin: 12px 0 8px; color: var(--muted); }
.empty { color: var(--muted); background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin: 0; }

/* כרטיס משימה */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 14px 16px; margin-bottom: 12px; }
.card.late { border-right: 4px solid var(--red); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-size: 18px; font-weight: 700; margin: 0; }
.meta { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.chip.s-open { background: var(--gray-chip); color: #444; }
.chip.s-progress { background: var(--bluegray); color: var(--bluegray-text); }
.chip.s-waiting { background: var(--amber); color: var(--amber-text); }
.chip.late { background: var(--red); color: #fff; }
.chip.urgent { background: var(--red-soft); color: var(--red); }
.last-note { margin: 4px 0 0; font-size: 15px; }
.card-actions { display: flex; gap: 10px; margin-top: 12px; }
.card-actions .btn { flex: 1; max-width: 260px; }

/* תפריט תחתון */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 5; }
.tab { flex: 1; font: inherit; font-size: 14px; background: none; border: 0; padding: 8px 4px 10px; color: #444; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; border-top: 3px solid transparent; }
.tab .ico { font-size: 20px; filter: grayscale(1); }
.tab.active { color: var(--olive); font-weight: 800; border-top-color: var(--olive); }

/* הודעה קופצת */
.toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); background: #2B2B2B; color: #fff;
  padding: 10px 18px; border-radius: 12px; z-index: 10; max-width: 90vw; text-align: center; }
.toast.error { background: var(--red); }

/* חלונות */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog form { padding: 18px; }
dialog h2 { margin: 0 0 12px; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; margin-bottom: 12px; flex: 1; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; padding: 10px; border: 1px solid #CFC8BC; border-radius: 10px; background: #fff; min-height: 44px; }
.row { display: flex; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.req, .error { color: var(--red); }
.error { font-size: 14px; font-weight: 700; min-height: 0; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 10px; margin-top: 8px; }
.actions .btn { flex: 1; }

/* פרטי משימה */
.card { cursor: pointer; }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
dialog.details { width: min(640px, calc(100vw - 16px)); }
.details-inner { padding: 18px; }
.details-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.details-head h2 { margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.detail-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.log { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.log .when { color: var(--muted); font-size: 13px; display: block; }

/* היסטוריה */
.search { width: 100%; font: inherit; padding: 12px; border: 1px solid #CFC8BC; border-radius: 12px; background: #fff; min-height: 44px; margin-bottom: 16px; }
.card.closed { opacity: .92; }
.chip.s-done { background: #DDEBD3; color: var(--olive-dark); }
.chip.s-cancelled { background: var(--gray-chip); color: #555; text-decoration: line-through; }

/* משימות קבועות */
.btn.add-rule { width: 100%; margin-bottom: 16px; }
.chip.r-active { background: #DDEBD3; color: var(--olive-dark); }
.chip.r-stopped { background: var(--gray-chip); color: #555; }
.card.rule { cursor: default; }
.card.rule.stopped { opacity: .75; }

/* כניסה */
.login { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.login h1 { font-size: 30px; font-weight: 800; margin: 0 0 24px; }
.login .field input { font-size: 18px; text-align: left; }
.login-message { font-size: 17px; line-height: 1.5; }
.login-message.error { color: var(--red); font-weight: 700; }
.login-message.ok { color: var(--olive-dark); font-weight: 700; }
.link-btn { font: inherit; font-size: 14px; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 4px; }
.btn.remove-sample { width: 100%; margin-top: 8px; }

@media (max-width: 420px) {
  .row { flex-direction: column; gap: 0; }
  .title h1 { font-size: 26px; }
}
