:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e8eaed;
  --border-strong: #d8dbe0;
  --text: #1d2029;
  --text-soft: #616b7a;
  --text-faint: #657082;
  --brand: #dc5f3b;          /* טרקוטה */
  --brand-dark: #c44e2d;
  --brand-soft: #fdeee8;
  --red: #c73840;
  --blue: #2f6feb;
  --green: #16a34a;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 34px rgba(16,24,40,.16);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; }

/* ───────── כפתורים ───────── */
.btn {
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent; border-radius: 9px;
  padding: 9px 16px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand, #fff); box-shadow: 0 2px 6px rgba(220,95,59,.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.btn-ghost:hover { background: #eef0f3; color: var(--text); }
.btn-danger { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger:hover { background: #fdecec; }
.btn-block { width: 100%; }

/* ───────── מסך התחברות ───────── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  /* הרקע נשלט מההגדרות (עיצוב מסך ההתחברות) — ברירת מחדל: צבע המותג */
  background: linear-gradient(135deg, var(--login-bg1, #dc5f3b) 0%, var(--login-bg2, #e8895f) 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface); width: 100%; max-width: 380px;
  padding: 36px 32px; border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px;
}
.login-logo { font-size: 27px; font-weight: 900; color: var(--brand); text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-sub { text-align: center; color: var(--text-soft); margin-bottom: 8px; }
.logo-dot { width: 14px; height: 14px; border-radius: 5px; background: var(--brand); display: inline-block; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: var(--text-soft); }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 11px;
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,95,59,.15); }
textarea { resize: vertical; }
.form-error { background: #fdecec; color: var(--red); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 500; }

/* ───────── פריסה ───────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* סרגל צד */
.sidebar {
  width: 264px; min-width: 264px; height: 100vh;
  background: var(--surface); border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.side-logo { font-size: 21px; font-weight: 900; color: var(--brand);
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 14px; }
.side-search { position: relative; margin-bottom: 12px; }
.side-search input { padding-inline-start: 34px; background: var(--bg); border-color: transparent; }
.side-search input:focus { background: var(--surface); }
.search-ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .5; }

.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  background: transparent; border: none; border-radius: 9px; padding: 10px 12px;
  font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; margin-bottom: 2px;
}
.nav-item:hover { background: #f1f2f4; }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-ic { font-size: 15px; }

.side-section { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 6px; }
.side-section-title { font-size: 11.5px; font-weight: 700; color: var(--text-faint); letter-spacing: .04em; }
.side-add {
  width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-faint); font-size: 17px; line-height: 1; cursor: pointer;
}
.side-add:hover { background: #f1f2f4; color: var(--brand); }

.side-projects { list-style: none; display: flex; flex-direction: column; }
.project-item {
  display: flex; align-items: center; gap: 10px; border-radius: 9px; padding: 9px 12px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 1px;
  background: transparent; border: none; width: 100%; text-align: start; font-family: inherit;
}
.project-item:hover { background: #f1f2f4; }
.project-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.project-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.project-item .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .p-count { font-size: 12px; color: var(--text-faint); font-weight: 700; }

/* תיקיות בסרגל הצד */
.folder-head {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none;
  cursor: pointer; font-family: inherit; text-align: start; color: var(--text-soft);
  padding: 7px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 800; min-height: 34px;
}
.folder-head:hover { background: #f1f2f4; color: var(--text); }
.folder-caret { font-size: 9px; transition: transform .15s; width: 10px; flex-shrink: 0; }
.folder.collapsed .folder-caret { transform: rotate(-90deg); }
.folder.collapsed .folder-body { display: none; }
.folder-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 11.5px; color: var(--text-faint); font-weight: 700; }
.folder-body .project-item { padding-inline-start: 24px; }
.folder-empty { padding: 5px 10px 5px 24px; font-size: 12px; color: var(--text-faint); }
.folder-sep { padding: 10px 10px 4px; font-size: 11px; font-weight: 800; color: var(--text-faint); }
.se-count { font-size: 12px; color: var(--text-faint); font-weight: 600; white-space: nowrap; }

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 4px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.side-user-info { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.side-user-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font-size: 11.5px; color: var(--text-faint); }
.side-logout { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-soft); font-size: 16px; cursor: pointer; }
.side-logout:hover { background: #fdecec; color: var(--red); border-color: #f3caca; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ───────── אזור ראשי ───────── */
.main { flex: 1; overflow-y: auto; padding: 30px 36px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.page-title { font-size: 27px; font-weight: 800; }
.page-sub { color: var(--text-faint); font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.greeting { font-size: 27px; font-weight: 800; }
.greeting span { color: var(--brand); }

/* כפתורי סינון (גלולות) */
.filter-row { display: flex; align-items: center; gap: 12px; margin: 20px 0 22px; flex-wrap: wrap; }
.filter-row .pills { margin: 0; flex: 1; }
.assignee-filter { width: auto; min-width: 160px; padding: 7px 12px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; flex-shrink: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 22px; }
.pill {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: all .12s;
}
.pill:hover { border-color: var(--text-faint); }
.pill.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand, #fff); }
.pill .pill-dot { width: 8px; height: 8px; border-radius: 50%; }
.pill .pill-count { background: rgba(0,0,0,.08); border-radius: 10px; padding: 0 7px; font-size: 11.5px; }
.pill.active .pill-count { background: rgba(0,0,0,.18); }

/* ───────── יומן ───────── */
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; }
.cal-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.cal-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-arrow, .cal-today {
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  font-family: inherit; border-radius: 9px; color: var(--text-soft); font-weight: 700;
  min-height: 36px; min-width: 36px; font-size: 15px;
}
.cal-today { padding: 0 12px; font-size: 12.5px; }
.cal-arrow:hover, .cal-today:hover { border-color: var(--brand); color: var(--brand-dark); }
.cal-title { flex: 1; font-size: 15.5px; font-weight: 800; }
.cal-modes { flex-shrink: 0; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend-item b { color: var(--text-faint); font-weight: 800; }

.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border); background: #fafbfc; }
.cal-dow > div { padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 800; color: var(--text-faint); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day .cal-grid, .calendar.cal-day .cal-grid { grid-template-columns: 1fr; }
.cal-cell { min-height: 106px; border-inline-start: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n) { border-inline-start: none; }
.cal-cell.outside { background: #fbfcfd; }
.cal-cell.outside .cal-day-num { color: var(--text-faint); opacity: .5; }
.cal-cell.today { background: var(--brand-soft); }
.cal-cell.today .cal-day-num { color: var(--brand-dark); font-weight: 900; }
.cal-cell.solo { min-height: 240px; border-inline-start: none; }
.cal-day-num { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-soft); padding: 0 2px; }
.cal-day-num-txt { font: inherit; color: inherit; }
button.cal-day-num-txt { border: none; background: none; cursor: pointer; padding: 2px 5px; border-radius: 6px; }
button.cal-day-num-txt:hover { background: rgba(0,0,0,.07); color: var(--text); }
.cal-day-count { background: #eef0f3; border-radius: 10px; padding: 0 6px; font-size: 10.5px; font-weight: 800; }
.cal-day-body { display: flex; flex-direction: column; gap: 3px; overflow: hidden; min-width: 0; }
.calendar.cal-month .cal-cell { cursor: pointer; }

.cal-chip {
  display: flex; align-items: center; gap: 5px; width: 100%; cursor: pointer; font-family: inherit;
  border: none; border-radius: 6px; padding: 4px 7px; font-size: 11.5px; font-weight: 600;
  text-align: start; color: var(--text); background: #f2f4f7;
  border-inline-start: 3px solid var(--chip); min-height: 26px; min-width: 0;
}
/* בלי זה הטקסט לא מתכווץ מתחת לרוחב התוכן והצ׳יפ גולש מהתא */
.cal-chip-txt { min-width: 0; flex: 1; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  .cal-chip { background: color-mix(in srgb, var(--chip) 13%, #fff); }
  .cal-chip:hover { background: color-mix(in srgb, var(--chip) 24%, #fff); }
}
.cal-chip:hover { background: #e8eaee; }
.cal-chip.done { opacity: .5; }
.cal-chip.done .cal-chip-txt { text-decoration: line-through; }
.cal-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cal-flag { flex-shrink: 0; font-size: 10px; }
.cal-empty { color: var(--text-faint); font-size: 13px; padding: 14px 4px; }
.cal-note { padding: 10px 16px; font-size: 12.5px; color: var(--text-faint); background: #fafbfc; }

/* טאבים במסך פרויקט */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 4px; }
.tab {
  border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--text-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 42px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* טבלת מסמכים */
.doc-table { display: flex; flex-direction: column; }
.doc-row {
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border);
}
.doc-row:last-child { border-bottom: none; }
.doc-link { color: var(--brand-dark); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.doc-link:hover { text-decoration: underline; }
.doc-url { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.add-doc-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.add-doc-form input[name=label] { flex: 1 1 160px; }
.add-doc-form input[name=url] { flex: 2 1 220px; direction: ltr; }

/* ───────── משימות קבועות: חודש, הרכב הלקוח, רשימת תיוג ───────── */
.recurring-wrap { margin-top: 16px; max-width: 760px; }

/* ── הפאנל הנעוץ בראש אזור המשימות ──
   מובחן בכוונה מרשימת המשימות: גוון מותג, פס מבליט בצד, וכותרת שמקפלת/פותחת */
.rc-pin {
  margin-top: 14px;
  border: 1px solid #f0d9cf;
  border-inline-start: 4px solid var(--brand);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdf5f1, var(--surface) 70px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rc-pin-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; text-align: start;
}
.rc-pin-head:hover .rc-pin-title { color: var(--brand-dark); }
.rc-pin-title { font-weight: 800; color: var(--text); transition: color .15s; }
.rc-pin-sub { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.rc-pin-sub.all-done { color: #0f7b4f; }
.rc-pin-caret { margin-inline-start: auto; color: var(--text-faint); transition: transform .15s; }
.rc-pin.collapsed .rc-pin-caret { transform: rotate(90deg); }
.rc-pin-body { padding: 0 14px 14px; }
.rc-pin .recurring-wrap { margin-top: 0; max-width: none; }
.rc-pin .empty-state { padding: 18px 12px; }

.rc-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.rc-month { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.rc-past { font-size: 11.5px; font-weight: 700; color: #9a6b00; background: #fdf3dd; border-radius: 20px; padding: 2px 9px; }
.rc-bar-side { display: flex; align-items: center; gap: 10px; }
.rc-progress { font-size: 12.5px; font-weight: 700; color: var(--text-soft); background: #eef0f3; border-radius: 20px; padding: 3px 11px; }
.rc-progress.all-done { color: #0f7b4f; background: #e6f6ee; }
.btn.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.cal-today[disabled] { opacity: .45; cursor: default; }

/* ── פאנל הרכב הלקוח ── */
.rc-composition {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.rcomp-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.rcomp-list { display: flex; flex-direction: column; margin: 10px 0; }
.rcomp-row {
  display: flex; align-items: center; gap: 12px; padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.rcomp-row:last-child { border-bottom: none; }
.rcomp-check { flex: 1; flex-direction: row; align-items: center; gap: 9px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text); }
.rcomp-row.on .rcomp-check { color: var(--brand-dark); }
.rcomp-check input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; flex: none; }
.rcomp-qty { width: 74px; flex: none; text-align: center; }
.rcomp-qty:disabled { opacity: .4; }
.rcomp-copy { padding-top: 12px; border-top: 1px dashed var(--border); margin-bottom: 10px; }
.rcomp-copy .filter-sel { flex-direction: row; align-items: center; gap: 8px; }
.rcomp-copy select { max-width: 240px; }
.link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--brand-dark);
  font-weight: 700; text-decoration: underline; cursor: pointer; }

/* סעיפים של שירות בהרכב — מקוננים מתחת לשירות */
.rcomp-head { display: flex; align-items: center; gap: 12px; }
.rcomp-sub { display: flex; flex-direction: column; gap: 2px; padding: 6px 28px 2px 0; }
.rcomp-subrow { flex-direction: row; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-soft); }
.rcomp-subrow input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex: none; }
.rcomp-kind { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* ── קטלוג בהגדרות: שירות + סעיפים ── */
.svc-block { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 8px; }
.svc-block:last-child { border-bottom: none; margin-bottom: 0; }
.svc-kind { flex: 0 1 190px; font-size: 12.5px; }
.svc-items { padding: 4px 22px 0 0; display: flex; flex-direction: column; gap: 4px; }
.svc-item { display: flex; align-items: center; gap: 8px; }
.svc-bullet { color: var(--text-faint); }
.svc-add-item { display: flex; gap: 6px; margin-top: 2px; }
.svc-add-item input { flex: 1 1 auto; font-size: 13px; }

/* ── רשימת החודש ── */
.rc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.rc-group:last-child { margin-bottom: 0; }
.rc-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--border);
}
.rc-group-name { font-size: 13.5px; font-weight: 700; }
.rc-group-count { font-size: 12px; font-weight: 700; color: var(--text-soft);
  background: #eef0f3; border-radius: 20px; padding: 1px 9px; }
.rc-group-count.all-done { color: #0f7b4f; background: #e6f6ee; }

/* שם חופשי לשורה — נראה כמו טקסט עד שנוגעים בו */
.rc-title {
  flex: 1 1 200px; min-width: 0; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 4px 8px; font: inherit; font-weight: 600; color: inherit;
}
.rc-title::placeholder { font-weight: 500; color: var(--text-faint); }
.rc-title:hover { border-color: var(--border); }
.rc-title:focus { border-color: var(--brand); background: var(--surface); outline: none; }
.rc-row.done .rc-title { text-decoration: line-through; color: var(--text-faint); }

.rc-list {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.rc-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--border);
}
.rc-row:first-child { border-top: none; }
.rc-row:hover { background: #fafbfc; }
.rc-row .check { width: 20px; height: 20px; margin-top: 1px; }
.rc-main { min-width: 0; }
.rc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-label { font-weight: 600; overflow-wrap: anywhere; }
.rc-row.done .rc-label { text-decoration: line-through; color: var(--text-faint); }
.rc-seq { color: var(--text-faint); font-weight: 700; }
.rc-link { font-size: 12.5px; font-weight: 700; color: var(--brand-dark); text-decoration: none;
  background: #f1f2f4; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.rc-link:hover { text-decoration: underline; }
.rc-note { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; line-height: 1.5; overflow-wrap: anywhere; }

/* כפתור "+ קישור" דהוי כברירת מחדל ומתחדד בריחוף — נשאר גלוי כדי שיהיה ברור שהוא שם,
   בלי הרעש של תיבת קלט ריקה בכל שורה */
.rc-edit-btn {
  background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  color: var(--text-faint); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 4px 9px; white-space: nowrap; opacity: .45; transition: opacity .12s;
}
.rc-row:hover .rc-edit-btn, .rc-edit-btn:focus-visible { opacity: 1; }
.rc-edit-btn:hover { background: #f1f2f4; color: var(--text); border-color: var(--border); }

.rc-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.rc-edit input[name=url] { flex: 2 1 220px; direction: ltr; }
.rc-edit input[name=note] { flex: 2 1 170px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.es-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* בקרת תצוגה — שורה אחת: מצב תצוגה, היקף, וכפתור המסננים */
.view-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0 14px; }
.filters-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; min-height: 40px;
}
.filters-btn:hover { border-color: var(--text-faint); color: var(--text); }
.filters-btn.has-active { border-color: var(--brand); color: var(--brand-dark); }
.filters-btn .filters-caret { font-size: 10px; transition: transform .15s; }
.filters-btn.open .filters-caret { transform: rotate(180deg); }
.filters-badge { background: var(--brand); color: var(--on-brand, #fff); border-radius: 20px;
  padding: 0 7px; font-size: 11.5px; font-weight: 800; }
.filters-clear {
  border: none; background: none; cursor: pointer; font-family: inherit;
  color: var(--text-faint); font-size: 12.5px; font-weight: 700; text-decoration: underline;
  padding: 8px 4px; min-height: 40px;
}
.filters-clear:hover { color: var(--red); }

/* מגירת המסננים */
.filters-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px 6px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.filter-label { flex: 0 0 58px; font-size: 12px; font-weight: 800; color: var(--text-faint); padding-top: 8px; }
.filters-panel .pills { margin: 0; flex: 1; }
.filter-selects { gap: 14px; flex-wrap: wrap; }
.filter-sel { display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  font-weight: 800; color: var(--text-faint); margin: 0; }
.filter-sel select { width: auto; min-width: 128px; padding: 7px 11px; font-size: 13px;
  font-weight: 600; color: var(--text); border-radius: 9px; }

/* מסנן סטטוס דו-קומתי — קבוצות הסוג למעלה, הסטטוסים של הקבוצה שנבחרה מתחת */
.status-filter { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.status-filter .pills { margin: 0; }
.status-sub {
  background: var(--bg); border: 1px dashed var(--border-strong);
  border-radius: 12px; padding: 8px 10px;
}
.status-sub .pill { padding: 5px 12px; font-size: 12.5px; }
.status-sub-hint { font-size: 12px; font-weight: 600; color: var(--text-faint); }

/* עמודת דחיפות */
.t-priority {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 7px; padding: 4px 9px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; width: fit-content; white-space: nowrap;
}
.pri-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.t-priority.pri-normal, .t-priority.pri-low { opacity: .72; }

/* בקרת תצוגה — מתגי היקף וקיבוץ */
.seg { display: inline-flex; background: #eef0f3; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn {
  border: none; background: transparent; color: var(--text-soft); cursor: pointer;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 700;
  font-family: inherit; transition: all .12s; min-height: 34px;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* קבוצת אדם בתצוגה "לפי אנשים" */
.you-tag { background: var(--brand-soft); color: var(--brand-dark); border-radius: 6px;
  padding: 1px 7px; font-size: 11px; font-weight: 700; }
.grp-open { color: var(--text-faint); font-size: 12px; font-weight: 600; margin-inline-start: 2px; }
.group-title .mini-avatar { width: 26px; height: 26px; font-size: 11px; }

/* פילוח זמן בתוך כל אדם */
.subgroup + .subgroup { margin-top: 2px; }
.subgroup-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px 6px 16px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  color: var(--text-faint); background: #fafbfc; border-top: 1px solid var(--border);
}
.subgroup-count { background: #eef0f3; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.subgroup.p-overdue .subgroup-title { color: var(--red); }
.subgroup.p-today .subgroup-title { color: var(--brand); }
.subgroup.p-week .subgroup-title { color: var(--blue); }
.subgroup .task-row:first-of-type { border-top: none; }

/* הוספה מהירה */
.quick-add {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 11px; padding: 8px 12px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.quick-add .qa-plus { color: var(--brand); font-size: 20px; font-weight: 700; }
.quick-add input[type=text] { border: none; padding: 6px 2px; box-shadow: none; }
.quick-add input[type=text]:focus { box-shadow: none; }
.quick-add input[type=date] { width: auto; border-color: var(--border); color: var(--text-soft); }

/* ───────── טבלת משימות ───────── */
.task-table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.table-head {
  display: grid; grid-template-columns: 34px minmax(140px, 1.25fr) 118px 104px 118px 108px 116px 40px; gap: 9px; align-items: center;
  padding: 11px 16px; font-size: 12px; font-weight: 700; color: var(--text-faint);
  border-bottom: 1px solid var(--border); background: #fafbfc;
}

.group { border-bottom: 1px solid var(--border); }
.group:last-child { border-bottom: none; }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px; cursor: pointer; user-select: none;
  font-weight: 700; font-size: 13.5px;
}
.group-head:hover { background: #fafbfc; }
.group-caret { font-size: 10px; color: var(--text-faint); transition: transform .15s; width: 12px; }
.group.collapsed .group-caret { transform: rotate(-90deg); }
.group-count { background: #eef0f3; color: var(--text-soft); border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 700; }
.group.g-overdue .group-title { color: var(--red); }
.group.g-upcoming .group-title { color: var(--blue); }
.group.collapsed .group-body { display: none; }

.task-row {
  display: grid; grid-template-columns: 34px minmax(140px, 1.25fr) 118px 104px 118px 108px 116px 40px; gap: 9px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--border); position: relative;
}
.task-row:hover { background: #fafbfc; }
.group-body .task-row:first-child { border-top: 1px dashed var(--border); }

/* תצוגת "רשימה" — שורות ישירות תחת הטבלה, בלי כותרת קבוצה מעליהן */
.task-table > .task-row:first-of-type { border-top: none; }
.flat-empty { padding: 22px 16px; text-align: center; color: var(--text-faint); font-size: 13.5px; }

/* במסך פרויקט עמודת "פרויקט" מיותרת — אותו ערך בכל שורה. מסתירים ומצמצמים את הרשת. */
.task-table.no-project .table-head,
.task-table.no-project .task-row {
  grid-template-columns: 34px minmax(140px, 1.25fr) 118px 104px 108px 116px 40px;
}
.task-table.no-project .th-project,
.task-table.no-project .t-project { display: none; }

/* עיגול השלמה */
.check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; transition: all .12s; flex-shrink: 0;
}
.check:hover { border-color: var(--green); }
.check.done { background: var(--green); border-color: var(--green); }

.t-title { font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.t-title:hover { color: var(--brand); }
.task-row.done .t-title { text-decoration: line-through; color: var(--text-faint); }
.t-desc-ic { font-size: 11px; opacity: .5; margin-inline-start: 4px; }
.t-recur-ic { font-size: 11px; margin-inline-start: 4px; opacity: .85; }
.t-internal-ic { font-size: 11px; margin-inline-start: 4px; opacity: .6; }
.t-flag { font-size: 13px; font-weight: 700; }
.recurrence-hint { font-size: 12.5px; color: var(--text-soft); background: #f6f7f9; border-radius: 8px; padding: 9px 12px; line-height: 1.55; }

.t-project { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border-radius: 20px; padding: 3px 10px; background: #f1f2f4; width: fit-content; }
.t-project.empty { color: var(--text-faint); background: transparent; }
.t-project .project-dot { width: 8px; height: 8px; }

.t-status { display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; cursor: pointer; text-align: center;
  border-radius: 6px; padding: 3px 8px; width: 100%; max-width: 104px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.group-title .status-dot { width: 10px; height: 10px; }
.group-title { display: inline-flex; align-items: center; gap: 8px; }

.t-due { font-size: 13px; color: var(--text-soft); font-weight: 600; cursor: pointer; border-radius: 7px; padding: 3px 8px; width: fit-content; }
.t-due:hover { background: #eef0f3; }
.t-due.overdue { color: var(--red); }
.t-due.today { color: var(--brand-dark); font-weight: 700; }
.t-due.empty { color: var(--text-faint); }

.t-assignee { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-soft); font-weight: 600;
  cursor: pointer; border-radius: 8px; padding: 3px 6px; width: fit-content; }
.t-assignee:hover { background: #eef0f3; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.t-assignee.empty .mini-avatar { background: #d5d9df; color: #7a828e; }

.t-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
.task-row:hover .t-actions { opacity: 1; }
.row-btn { width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent; cursor: pointer;
  color: var(--text-faint); font-size: 14px; }
.row-btn:hover { background: #eef0f3; color: var(--text); }
.row-btn.del:hover { background: #fdecec; color: var(--red); }

.inline-input { padding: 4px 8px; font-size: 13px; }

.empty-state { text-align: center; color: var(--text-faint); padding: 60px 20px; }
.empty-state .es-emoji { font-size: 40px; display: block; margin-bottom: 10px; }

/* ───────── הגדרות ───────── */
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.settings-grid .card.span-2 { grid-column: 1 / -1; }

/* כרטיסי הגדרות מתקפלים — שורת כותרת קומפקטית, התוכן נפתח בקליק */
.se-card .card-head { cursor: pointer; user-select: none; border-radius: 14px 14px 0 0; transition: background .12s; }
.se-card .card-head:hover { background: var(--bg); }
.se-card.collapsed .card-head { border-bottom: none; border-radius: 14px; }
.se-card.collapsed .card-body { display: none; }
.se-head-side { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.se-meta { color: var(--text-faint); font-size: 12.5px; font-weight: 600; }
.se-caret { font-size: 11px; color: var(--text-faint); transition: transform .15s; }
.se-card.collapsed .se-caret { transform: rotate(-90deg); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.card-body { padding: 16px 20px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; row-gap: 8px; }
.user-row:last-child { border-bottom: none; }
.user-meta { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-width: 130px; }
.user-meta .u-name { font-weight: 700; }
.user-meta .u-email { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: .03em; flex-shrink: 0; }
.role-admin { background: var(--brand-soft); color: var(--brand-dark); }
.role-member { background: #eef0f3; color: var(--text-soft); }
.user-row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.icon-btn { background: transparent; border: 1px solid var(--border-strong); border-radius: 7px; padding: 5px 9px;
  cursor: pointer; font-size: 12.5px; color: var(--text-soft); }
.icon-btn:hover { background: #eef0f3; color: var(--text); }
.icon-btn.danger:hover { background: #fdecec; color: var(--red); border-color: #f3caca; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.add-user-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.add-user-form .form-row { display: flex; gap: 10px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.favicon-row { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.favicon-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.favicon-preview { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--border); background: #fff; object-fit: contain; padding: 3px; }
.favicon-pick { cursor: pointer; }
.color-hex { font-size: 12.5px; color: var(--text-soft); font-family: monospace; text-transform: uppercase; }
.status-editor { margin-top: 6px; }
.se-title { font-size: 12px; font-weight: 700; color: var(--text-faint); margin-bottom: 10px; }
.se-hint { font-size: 12px; color: var(--text-faint); margin-bottom: 12px; line-height: 1.5; }
.se-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-weight: 600; }
.se-row input[type=color] { width: 34px; height: 32px; flex-shrink: 0; padding: 2px; }
.se-label { flex: 1; padding: 6px 9px; font-weight: 600; min-width: 0; }
.se-type { width: 86px; flex-shrink: 0; padding: 6px 8px; }

/* שורת הכותרות של עורך הסטטוסים — מיישרת מול העמודות של כל שורה */
.se-head { display: flex; gap: 8px; padding-bottom: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-faint); }
.se-head-color { width: 34px; flex-shrink: 0; }
.se-head-label { flex: 1; padding: 0 9px; min-width: 0; }
.se-head-type { width: 86px; flex-shrink: 0; }
.se-head-del { width: 34px; flex-shrink: 0; }
.add-status-form { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.add-status-form input[type=color] { width: 40px; height: 38px; flex-shrink: 0; }
.add-status-form input[type=text] { flex: 1; }
.add-status-form select { width: auto; }

/* בחירת פרויקטים ללקוח */
.client-projects { padding: 4px 0; }
.cp-title { font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; }
.check-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.check-pill:hover { border-color: var(--brand); }
.check-pill input { width: auto; margin: 0; accent-color: var(--brand); }
.check-pill .project-dot { width: 9px; height: 9px; }
/* בלוק ההסתרה בעריכת משתמש + תקציר "לא רואה" בשורת המשתמש */
.cp-sub { font-size: 12px; color: var(--text-faint); margin: 8px 0 6px; }
.u-hidden-tag { font-size: 12px; color: #92400e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-client { background: #e0f2fe; color: #0369a1; }
.role-supplier { background: #fef3c7; color: #92400e; }

/* ───────── חלוניות ───────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,24,31,.5); display: flex; align-items: center;
  justify-content: center; padding: 20px; z-index: 100; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-sm { max-width: 420px; }

/* ── חלונית צד (drawer) הנפתחת משמאל ── */
.drawer-overlay { justify-content: flex-start; align-items: stretch; padding: 0; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  height: 100vh; max-height: 100vh; width: 460px; max-width: 92vw;
  border-radius: 0; box-shadow: var(--shadow-lg); animation: drawer-in .22s ease;
}
@keyframes drawer-in { from { transform: translateX(-100%); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close { background: transparent; border: none; font-size: 17px; cursor: pointer; color: var(--text-soft);
  width: 30px; height: 30px; border-radius: 6px; }
.modal-close:hover { background: #eef0f3; color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.spacer { flex: 1; }
.autosave-hint { font-size: 12.5px; color: var(--text-faint); font-weight: 600; transition: color .2s; }
.autosave-hint.saved { color: var(--green); }
.form-row { display: flex; gap: 12px; }
.form-row > label { flex: 1; }
input[type=color] { padding: 3px; height: 40px; width: 48px; cursor: pointer; }

/* ───────── טוסט ───────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2029; color: #fff;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 200; animation: toast-in .2s ease; }
.toast.err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ───────── רספונסיבי ───────── */
/* כפתור תפריט, רקע כהה וכפתור צף — מוסתרים בדסקטופ, מופיעים בנייד */
.mobile-menu-btn {
  display: none; position: fixed; top: 14px; inset-inline-end: 14px; z-index: 95;
  align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 19px; cursor: pointer; box-shadow: var(--shadow); color: var(--text);
}
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 89; background: rgba(16,24,40,.45);
}
.fab {
  display: none; position: fixed; bottom: 22px; inset-inline-start: 20px; z-index: 88;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: var(--on-brand, #fff); font-size: 30px; font-weight: 400;
  line-height: 1; box-shadow: var(--shadow-lg); align-items: center; justify-content: center;
  padding-bottom: 4px;
}
.fab:active { transform: scale(.94); }

/* ───────── נייד: שורות המשימות הופכות לכרטיסים ───────── */
@media (max-width: 860px) {
  .settings-grid { grid-template-columns: 1fr; }

  /* משימות קבועות — בנייד אין ריחוף, אז כפתור הקישור תמיד גלוי */
  .rc-bar { justify-content: center; }
  .rc-bar-side { flex: 1 1 100%; justify-content: center; }
  .rc-edit-btn { opacity: 1; }
  .rc-edit input, .rc-edit .btn { flex: 1 1 100%; }
  .rcomp-copy .filter-sel { flex-direction: column; align-items: stretch; }
  .rcomp-copy select { max-width: none; }
  .main { padding: 22px 16px 96px; }
  .page-head { padding-inline-end: 54px; }   /* מקום לכפתור התפריט */

  /* גלולות הסינון נגללות אופקית בשורה אחת במקום לתפוס חצי מסך */
  .pills {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-inline: -16px; padding-inline: 16px; padding-bottom: 2px;
  }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; white-space: nowrap; }
  .filter-row { gap: 8px; margin: 14px 0 16px; }
  .filter-row .pills { flex: 1 1 100%; }
  .assignee-filter { width: 100%; min-height: 42px; }
  .seg-btn { white-space: nowrap; }

  /* מסמכים בנייד — הכתובת המלאה יורדת, שם המסמך נשאר כקישור */
  .doc-row { grid-template-columns: 1fr auto; }
  .doc-url { display: none; }
  .add-doc-form input { flex: 1 1 100%; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; }

  .table-head { display: none; }
  .task-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas:
      "check title    actions"
      "check project  due"
      "check assignee status"
      "check priority priority";
    gap: 8px 10px; padding: 13px 14px; align-items: center;
  }
  /* גובר על רשת הדסקטופ של no-project — מדיה קוורי לא מוסיף ספציפיות */
  .task-table.no-project .task-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .task-row .check     { grid-area: check; align-self: start; margin-top: 2px; }
  .task-row .t-title   { grid-area: title; white-space: normal; overflow: visible; line-height: 1.4; }
  .task-row .t-actions { grid-area: actions; opacity: 1; align-self: start; }
  .task-row .t-project { grid-area: project; justify-self: start; }
  .task-row .t-due     { grid-area: due;      justify-self: end; }
  .task-row .t-assignee{ grid-area: assignee; justify-self: start; }
  .task-row .t-status  { grid-area: status;   justify-self: end; }
  .task-row .t-priority{ grid-area: priority; justify-self: start; }
  /* דחיפות רגילה/נמוכה היא ברירת המחדל — לא מציגים אותה בכרטיס כדי לא להעמיס */
  .task-row .t-priority.pri-normal, .task-row .t-priority.pri-low { display: none; }

  /* מגירת המסננים — תוויות מעל במקום לצד */
  .filter-group { flex-direction: column; gap: 6px; }
  .filter-label { flex: none; padding-top: 0; }
  .filter-sel { flex-direction: column; align-items: stretch; gap: 4px; flex: 1 1 130px; }
  .filter-sel select { width: 100%; min-height: 42px; }
  .filters-panel { padding: 12px 12px 4px; }

  /* יומן */
  .cal-title { flex: 1 1 100%; order: -1; font-size: 14.5px; }
  .cal-modes { flex: 1; }
  .cal-modes .seg-btn { flex: 1; }
  .cal-cell { min-height: 74px; padding: 4px; }
  .cal-cell.solo { min-height: 200px; }
  .cal-legend { font-size: 11.5px; gap: 4px 12px; }

  /* בתצוגת חודש בנייד אין מקום לכותרות — הצ׳יפים הופכים לנקודות,
     ולחיצה על היום פותחת אותו בתצוגת יום מלאה */
  .calendar.cal-month .cal-day-body { flex-direction: row; flex-wrap: wrap; gap: 3px; padding: 0 2px; }
  .calendar.cal-month .cal-chip {
    width: 8px; height: 8px; min-height: 0; min-width: 0; padding: 0; gap: 0;
    border: none; border-radius: 50%; background: var(--chip); overflow: hidden;
  }
  .calendar.cal-month .cal-chip .cal-chip-txt,
  .calendar.cal-month .cal-chip .cal-dot,
  .calendar.cal-month .cal-chip .cal-flag { display: none; }
  .calendar.cal-month .cal-chip.done { opacity: .35; }
  .calendar.cal-month .cal-day-num { font-size: 11.5px; }

  /* בשבוע/יום הצ׳יפים נשארים עם טקסט */
  .calendar.cal-week .cal-chip, .calendar.cal-day .cal-chip { font-size: 10.5px; padding: 3px 5px; min-height: 24px; }

  /* יעדי מגע — לפחות 44px לכל אלמנט אינטראקטיבי */
  .check { width: 26px; height: 26px; }
  .row-btn { width: 40px; height: 40px; font-size: 16px; }
  .t-due, .t-assignee, .t-status, .t-project { min-height: 34px; padding-block: 7px; }
  .seg-btn { min-height: 40px; padding: 9px 16px; }
  .pill { padding: 9px 14px; }
  .project-item, .folder-head, .nav-item { min-height: 44px; }
}

@media (max-width: 680px) {
  /* RTL: inline-start = הצד הימני — משם המגירה נפתחת */
  .sidebar {
    position: fixed; z-index: 90; top: 0; bottom: 0; inset-inline-start: 0;
    transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-flex; }
  .fab { display: inline-flex; }
  .sidebar-backdrop:not([hidden]) { display: block; }
  body.nav-open { overflow: hidden; }
  .view-controls .seg { flex: 1; }
  .view-controls .seg-btn { flex: 1; }
  .page-head { margin-bottom: 10px; }
  .greeting, .page-title { font-size: 22px; }
  /* הכפתור הצף מחליף את "משימה חדשה" בראש העמוד */
  .page-head [data-act="new-task"] { display: none; }
}

/* מסכים צרים במיוחד — הכפתור הראשי יורד לשורה נפרדת ברוחב מלא */
@media (max-width: 420px) {
  .page-head > .btn { width: 100%; }
  .quick-add { flex-wrap: wrap; }
  .quick-add input[type=date] { width: 100%; }
}

/* ───────── נגישות: מיקוד מקלדת ───────── */
:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ───────── התחברות רב-שלבית: עין לסיסמה, קוד אימות, שכחתי סיסמה ───────── */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-inline-end: 40px; }
.pw-eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--text-faint); padding: 5px 6px; border-radius: 7px;
}
.pw-eye:hover { background: #eef0f3; color: var(--text); }
.login-title { font-size: 20px; font-weight: 800; text-align: center; color: var(--text); }
.login-forgot { align-self: center; font-size: 13px; margin-top: 2px; }
.code-input {
  text-align: center; direction: ltr; font-size: 22px; font-weight: 700; letter-spacing: 8px;
}
.code-actions { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.code-actions .link-btn:disabled { color: var(--text-faint); cursor: default; }
.login-card .se-hint { font-size: 12px; color: var(--text-faint); }

/* ───────── תגובות במשימה (צ'אט קטן עם תיוגים) ───────── */
.comments-sec { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.comments-head { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.comments-count { color: var(--text-faint); font-weight: 600; font-size: 12.5px; }
.comments-list { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding: 2px; }
.comment { display: flex; gap: 8px; }
.comment .mini-avatar { flex-shrink: 0; margin-top: 2px; }
.comment-main { background: var(--bg); border-radius: 10px; padding: 8px 11px; flex: 1; min-width: 0; }
.comment.mine .comment-main { background: var(--brand-soft); }
.comment-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-faint); margin-bottom: 2px; }
.comment-meta b { color: var(--text); font-size: 12.5px; }
.comment-del {
  margin-inline-start: auto; background: none; border: 0; color: var(--text-faint);
  cursor: pointer; border-radius: 5px; padding: 1px 5px; font-size: 12px;
}
.comment-del:hover { color: var(--red); background: #fdecec; }
.comment-body { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.mention { color: var(--brand-dark); font-weight: 700; background: var(--brand-soft); border-radius: 5px; padding: 0 3px; }
.comment-composer { position: relative; display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.comment-composer textarea { flex: 1; resize: none; min-height: 40px; }
.mention-menu {
  position: absolute; bottom: 100%; inset-inline-start: 0; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 200px; overflow-y: auto; min-width: 200px; z-index: 40; padding: 4px;
}
.mention-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: start;
  background: none; border: 0; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13.5px;
}
.mention-opt:hover, .mention-opt.active { background: var(--brand-soft); }

/* אינדיקטור תגובות בשורת משימה */
.t-comm-ic { font-size: 11px; color: var(--text-faint); margin-inline-start: 4px; white-space: nowrap; }

/* ───────── שורת משימה במצב לקוח (צפייה בלבד) ───────── */
/* עיגול השלמה לא-לחיץ — שומר על יישור הרשת של הטבלה */
.check.ghost { cursor: default; border-color: var(--border); }
.check.ghost:hover { border-color: var(--border); }
.check.ghost.done { background: var(--green); border-color: var(--green); }
.t-status.static, .t-priority.static, .t-due.static, .t-assignee.static { cursor: default; }

/* ───────────────────────── כרטיס וואטסאפ בהגדרות ───────────────────────── */
.wa-status {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.wa-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wa-dot.ok   { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.wa-dot.wait { background: #d99a12; box-shadow: 0 0 0 3px rgba(217,154,18,.15); }
.wa-dot.off  { background: var(--border-strong); }

.wa-error {
  background: #fdecec; color: var(--red); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
}

.wa-pair { margin-bottom: 10px; }

/* קוד ההתאמה — גדול ומרווח, כי מקלידים אותו מהמסך אל הטלפון */
.wa-code-box {
  background: var(--brand-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.wa-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: 3px;
  color: var(--brand-dark); text-align: center; direction: ltr; margin-bottom: 10px;
}
.wa-steps { margin: 0; padding-inline-start: 18px; color: var(--text-soft); font-size: 13px; line-height: 1.9; }

.wa-help {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  color: var(--text-soft); font-size: 13px; line-height: 1.8;
}
.wa-example {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin: 8px 0; color: var(--text); font-weight: 500;
}
.wa-legend { margin-top: 8px; color: var(--text-faint); font-size: 12.5px; }
.wa-logout { margin-top: 12px; }
