/* src/app/screens/manager-home.css — הדף הראשי של מנהל הקהילה (`/community`), העיצוב של 21.10 (docs/specs/manager-home-redesign.md).
 *
 * 🔴 **תחום ל-`.dash.mh` בלבד.** `manager.css` משותף ל-12 מסכים (המזכירות · המרפאה · סידור העבודה · דיווח השעות), ולכן הסגנון
 *    החדש יושב כאן, ולא שם. המכל עדיין `.dan.dash` — הוא נותן את רקע החול ואת מיפוי הפלטה (`ui-refresh.css`).
 * 🔴 **הפלטה (docs/specs/palette-sea-sand.md §1–2), כמו בבית התושב:** ירוק-ים (`teal-600`) לכפתורים, קישורים, כותרות ומצב נבחר ·
 *    רקע `sand-200` וכרטיסים `sand-50` עם מסגרת `sand-300` · טקסט בדיו · חמרה **רק** להתראות ולתגיות (5%) · צבע תחום רק בתוך התחום
 *    (קטגוריית האירוע; כרטיס התקציב בצבעי הכספים, כמו `.finance-summary` ב-ui-refresh.css).
 *    עד 21.10 ההדגשה הייתה חמרה כהה, לפי צילום היעד (הכרעה 7). גיל: "לא שמרת על הפלטת צבעים שלנו" ⟹ ירוק-ים. צבעים מהטוקנים בלבד.
 * ⭐ **container query ולא media query** — כמו `manager.css`: הרוחב תלוי בסיידבר, ו-375 נבדק ב-ui-viewport.
 */

.dash.mh {
  --mh-accent: var(--teal-600);         /* ראשי: כפתור · קישור · כותרת · נבחר */
  --mh-accent-soft: var(--teal-50);
  --mh-alert: var(--clay-dark);          /* חמרה: התראות ותגיות בלבד */
  --mh-alert-soft: var(--clay-tint-50);  /* + clay-dark = 5.09:1 (palette-sea-sand §4) */
  container: mh / inline-size;
  gap: 24px;
}

/* ---------- פתיחה ---------- */
.mh-hello { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mh-avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mh-accent); color: var(--sand-50);   /* כמו אווטאר האדם בסיידבר */
  font-size: var(--fs-h2); font-weight: 600;
}
.mh-hello-txt { min-width: 0; }
.dash.mh .mh-hello h1 { font-size: var(--fs-h1); font-weight: 600; color: var(--mh-accent); margin: 0; letter-spacing: -.01em; }
.mh-hello-txt p { margin: 2px 0 0; font-size: var(--fs-body); color: var(--sand-700); }
.mh-date { margin: 0 0 0 0; margin-inline-start: auto; font-size: var(--fs-small); color: var(--sand-700); }

/* ---------- כרטיס ---------- */
.mh-card {
  background: var(--sand-50); border: 1px solid var(--sand-300); border-radius: var(--r-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.mh-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--sand-300); }
.mh-head h2 { margin: 0; font-size: var(--fs-h2); font-weight: 600; color: var(--mh-accent); }
.mh-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--mh-accent-soft); color: var(--mh-accent); }
.mh-ic svg { width: 22px; height: 22px; }
.mh-ic--alert { background: var(--mh-alert-soft); color: var(--mh-alert); }
.mh-ic--finance { background: var(--dom-finance-bg); color: var(--dom-finance-base); }
.mh-aside { margin-inline-start: auto; font-size: var(--fs-small); color: var(--sand-700); }
.mh-headlink { margin-inline-start: auto; min-height: 44px; display: flex; align-items: center; font-size: var(--fs-small); font-weight: 600; color: var(--mh-accent); }
.mh-count {
  margin-inline-start: auto; min-width: 30px; height: 30px; padding: 0 10px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--mh-alert-soft); color: var(--mh-alert);   /* מונה התראות — כמו בסיידבר */
  font-size: var(--fs-small); font-weight: 700;
}
.mh-empty { margin: 0; color: var(--sand-700); font-size: var(--fs-small); }
.mh-status:empty { display: none; }
.mh-status { margin: 0; font-size: var(--fs-td); color: var(--sand-700); }

.mh-btn {
  margin-top: auto; min-height: 48px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--mh-accent); background: var(--mh-accent); color: var(--sand-50);
  font-size: var(--fs-body); font-weight: 700; text-decoration: none;
}
.mh-btn--ghost { background: transparent; color: var(--mh-accent); }   /* משני: מסגרת ירוק-ים (palette-sea-sand §3) */
.mh-btn:hover { background: var(--teal-700); border-color: var(--teal-700); color: var(--sand-50); }
.mh-btn:focus-visible, .mh a:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }

/* ---------- אירועים ---------- */
.mh-filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mh-branch-filter { position: relative; }
.mh-branch-filter summary, .mh-filter-toggle {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--sand-300); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 7px; background: var(--sand-50); color: var(--sea-ink);
  font-size: var(--fs-small); font-weight: 600; cursor: pointer;
}
.mh-branch-filter summary { list-style: none; }
.mh-branch-filter summary::-webkit-details-marker { display: none; }
.mh-branch-filter summary::after { content: '⌄'; color: var(--mh-accent); font-size: var(--fs-body); }
.mh-branch-filter[open] summary, .mh-filter-toggle:has(input:checked) { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-800); }
.mh-filter-toggle input { margin: 0; accent-color: var(--teal-600); width: 17px; height: 17px; }
.mh-filter-note { margin-inline-start: auto; font-size: var(--fs-th); color: var(--sand-700); }
.mh-branch-panel {
  position: absolute; z-index: 8; inset-inline-start: 0; top: calc(100% + 6px);
  width: min(320px, 80vw); max-height: 320px; overflow-y: auto; padding: 12px;
  background: var(--sand-50); border: 1px solid var(--sand-300); border-radius: var(--r-sm); box-shadow: var(--d-shadow-hi);
}
.mh-branch-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--sand-300); font-size: var(--fs-small); }
.mh-branch-actions button { min-height: 44px; border: 0; background: transparent; color: var(--mh-accent); font: inherit; font-weight: 700; cursor: pointer; }
.mh-branch-list { display: flex; flex-direction: column; }
.mh-branch-list label { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: var(--fs-small); }
.mh-branch-list input { accent-color: var(--teal-600); width: 18px; height: 18px; }
.mh-branch-filter summary:focus-visible, .mh-filter-toggle:focus-within, .mh-branch-actions button:focus-visible, .mh-branch-list label:focus-within { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.mh-ev-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.mh-week { display: flex; flex-direction: column; min-width: 0; padding-inline-start: 32px; border-inline-start: 1px solid var(--sand-300); }
.mh-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.mh-subhead h3 { margin: 0; font-size: var(--fs-h3); font-weight: 600; color: var(--mh-accent); }
.mh-subhead span { font-size: var(--fs-small); color: var(--sand-700); }

.mh-ev {
  padding: 12px 0; border-bottom: 1px solid var(--sand-300); color: inherit;
}
.mh-ev:last-of-type { border-bottom: 0; }
.mh-ev:hover .mh-ev-info b { color: var(--mh-accent); }
.mh-ev-main { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; color: inherit; text-decoration: none; }
.mh-ev-info { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.mh-ev-info b { font-size: var(--fs-h3); color: var(--sea-ink); overflow-wrap: anywhere; }
.mh-ev-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mh-ev-cat { background: var(--rd-bg); color: var(--rd-text); font-size: var(--fs-th); font-weight: 600; border-radius: var(--r-pill); padding: 2px 10px; }
.mh-ev-state { border: 1px solid var(--sand-300); color: var(--sand-700); border-radius: var(--r-pill); padding: 2px 9px; font-size: var(--fs-th); font-weight: 700; }
.mh-ev-state.is-draft { background: var(--mh-alert-soft); color: var(--mh-alert); border-color: var(--mh-alert); }
.mh-ev-notice { display: inline-flex; align-items: center; min-height: 40px; color: var(--mh-accent); font-size: var(--fs-small); font-weight: 600; }
.mh-ev-meta { font-size: var(--fs-td); color: var(--sand-700); }
.mh-ev-date {
  width: 56px; height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--rd-bg); color: var(--rd-text);   /* כמו אריח התאריך בבית התושב: גוון הקטגוריה */
}
.mh-ev-date b { font-size: var(--fs-h1); font-weight: 600; line-height: 1; }
.mh-ev-date span { font-size: var(--fs-th); }
.mh-more { margin-top: 10px; min-height: 44px; display: flex; align-items: center; font-size: var(--fs-small); font-weight: 600; color: var(--mh-accent); }
.mh-day-items { list-style: none; margin: 0; padding: 0; }
.mh-day-items li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--sand-300); }
.mh-day-items li a { min-height: 40px; display: flex; flex-direction: column; justify-content: center; color: var(--mh-accent); }
.mh-day-items li a span { color: var(--sand-700); font-size: var(--fs-small); }

/* הלוח המשותף (home-dashboard.js::renderCalendar, `titles`) — מותאם לכרטיס הרחב */
.mh .rd-calendar-controls { margin: 0 0 12px; }
.mh .rd-calendar-controls h3 { font-size: var(--fs-h3); font-weight: 600; }
.mh .rd-calendar-body { flex-direction: column; align-items: stretch; gap: 10px; }
.mh .rd-day { min-height: 78px; justify-content: flex-start; padding: 6px 3px; gap: 4px; }
.mh .rd-day--today > span:first-child { background: var(--mh-accent); color: var(--sand-50); }
.mh .rd-day--events:hover { background: var(--teal-50); }
.mh .rd-chips { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; }
.mh .rd-chip {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  background: var(--rd-bg); color: var(--rd-text); border-radius: 6px; padding: 2px 4px;
  font-size: var(--fs-caption); font-weight: 600; line-height: 1.3; text-align: center;
}
.mh .rd-more { font-size: var(--fs-caption); color: var(--sand-700); }
.dash.mh .rd-legend { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-td); color: var(--sand-700); }

/* ---------- השורה התחתונה ---------- */
.mh-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }

.mh-tasks { display: flex; flex-direction: column; }
.mh-task {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 0;
  border-bottom: 1px solid var(--sand-300); color: inherit; text-decoration: none;
}
.mh-task:last-child { border-bottom: 0; }
.mh-task-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mh-task-txt b { font-size: var(--fs-body); font-weight: 600; color: var(--sea-ink); line-height: 1.45; }
.mh-task-txt span { font-size: var(--fs-td); color: var(--sand-700); }
.mh-task:hover .mh-task-txt b { text-decoration: underline; }
.mh-arrow { color: var(--mh-accent); flex: none; }
.mh-late { flex: none; padding: 2px 10px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: var(--fs-th); font-weight: 700; }

.mh-branches { display: flex; flex-direction: column; }
.mh-branch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
  border-bottom: 1px solid var(--sand-300); color: var(--sea-ink); text-decoration: none; font-size: var(--fs-body); font-weight: 600;
}
.mh-branch:last-child { border-bottom: 0; }
.mh-branch:hover span:first-child { text-decoration: underline; }
.mh-num {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--sand-200); color: var(--sea-ink); font-size: var(--fs-small); font-weight: 700;   /* מונה רגיל — כמו בסיידבר; לא התראה */
}

.mh-gauge { position: relative; width: 240px; max-width: 100%; margin: 4px auto 0; }
.mh-gauge svg { display: block; width: 100%; height: auto; }
.mh-g-track, .mh-g-fill { fill: none; stroke-width: 20; stroke-linecap: round; }
.mh-g-track { stroke: var(--sand-300); }
.mh-g-fill { stroke: var(--dom-finance-base); }   /* כרטיס התקציב בצבעי הכספים (ui-refresh.css · .finance-summary) */
.mh-g-fill.is-over { stroke: var(--warn); }
.mh-g-tick { stroke: var(--sea-ink); stroke-width: 3; stroke-linecap: round; }
.mh-g-mid { position: absolute; inset: 46% 0 0; display: flex; flex-direction: column; align-items: center; }
.mh-g-mid b { font-size: var(--fs-h1); font-weight: 700; color: var(--sea-ink); line-height: 1.1; }
.mh-g-mid span { font-size: var(--fs-td); color: var(--sand-700); }
.mh-g-scale { width: 240px; max-width: 100%; margin: -6px auto 0; display: flex; justify-content: space-between; font-size: var(--fs-th); color: var(--sand-700); }
.mh-pace { margin: 0; text-align: center; font-size: var(--fs-td); color: var(--sand-800); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.mh-pace.is-over { color: var(--warn); }
.mh-tickkey { width: 3px; height: 14px; border-radius: 2px; background: var(--sea-ink); }
.mh-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mh-figs > div { background: var(--sand-100); border-radius: var(--r-sm); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mh-figs span { font-size: var(--fs-small); color: var(--sand-700); }
.mh-figs b { font-size: var(--fs-h2); font-weight: 700; color: var(--sea-ink); }
.mh-figs .mh-figs-used { background: var(--dom-finance-bg); }
.mh-figs .mh-figs-used span, .mh-figs .mh-figs-used b { color: var(--dom-finance-ink); }

/* ---------- משימות לטיפול (`/community/tasks`, community-tasks.js) ---------- */
.mh-pagehead { display: flex; align-items: center; gap: 12px; }
.dash.mh .mh-pagehead h1 { margin: 0; font-size: var(--fs-h1); font-weight: 600; color: var(--mh-accent); }
.mh-pagehead .mh-count { margin-inline-start: 0; }
.mh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mh-chip {
  min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--sand-300); background: var(--sand-50); color: var(--sea-ink); font-size: var(--fs-small); font-weight: 600; text-decoration: none;
}
.mh-chip.is-on { background: var(--mh-accent); border-color: var(--mh-accent); color: var(--sand-50); }
.mh-chip-n { font-weight: 700; }
.mh-warn { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: var(--fs-small); }
.mh-tasks--page .mh-task { border-bottom-color: var(--sand-300); }
.mh-kind { flex: none; min-width: 52px; text-align: center; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-th); font-weight: 700; }
.mh-kind--approval { background: var(--teal-50); color: var(--teal-800); }
.mh-kind--alert { background: var(--mh-alert-soft); color: var(--mh-alert); }

/* ---------- רוחב ---------- */
@container mh (max-width: 900px) {
  .mh-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-budget { grid-column: 1 / -1; }
}
@container mh (max-width: 860px) {
  .mh-ev-grid { grid-template-columns: minmax(0, 1fr); }
  .mh-week { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--sand-300); padding-top: 16px; }
}
@container mh (max-width: 640px) {
  .mh-row { grid-template-columns: minmax(0, 1fr); }
  .mh-card { padding: 18px; }
  .mh-head { flex-wrap: wrap; }
  .mh-headlink { width: 100%; margin-inline-start: 0; }
  .mh-filterbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-branch-filter summary, .mh-filter-toggle { width: 100%; justify-content: center; text-align: center; }
  .mh-filter-note { grid-column: 1 / -1; margin-inline-start: 0; }
  .mh-date { margin-inline-start: 0; flex-basis: 100%; }
  .mh .rd-day { min-height: 54px; }
  .mh .rd-holiday { display: none; }   /* שם החג נשאר בתווית הנגישות של התא (renderCalendar) */
  /* בתא צר אין מקום לשם — האירוע חוזר להיות נקודה בצבע הקטגוריה. */
  .mh .rd-chips { flex-direction: row; justify-content: center; }
  .mh .rd-chip { display: block; width: 8px; height: 8px; padding: 0; border-radius: 50%; overflow: hidden; color: transparent; background: var(--rd-base); }
  .mh-ev-date { width: 48px; height: 54px; }
}
.dash.mh .mh-work-notice { display: flex; flex-direction: row; align-items: center; gap: 14px; border-inline-start: 4px solid var(--teal-600); text-decoration: none; }
.dash.mh .mh-work-notice:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 3px; }
