/* src/app/screens/manager.css — דשבורד "ניהול קהילה" (`/community`), העתקה של העיצוב של דן.
 *
 * 🔴 01.10 · גיל: "העיצוב של המסך הזה לא כמו בריפו של tarbutDan — אפשר לקחת ישירות את העיצובים
 *    בהעתקה מתיקייה לתיקייה". ⟹ זה ה-<style> של `legacy/community/dashboard.html`, מועתק ולא
 *    מיובא (ADR 0025: src/ אינו מייבא מ-legacy/; קוד מסך מותר להעתיק — כלל 9).
 *
 * ⚠️ מה שונה מהמקור, ולמה — שלושה דברים בלבד:
 *  ① **אין `:root`.** tokens.css הוא ההצהרה היחידה ("דף שמכריז :root משלו — הפרה"). פלטת דן
 *     יושבת ב-`src/app/dan/dan.css`, תחומה ל-`.dan` ובקידומת `--d-`, כדי לא לדרוס את `--ink` ·
 *     `--muted` · `--line` של המעטפת ושל הדיאלוגים.
 *  ② **שני אפורים הוכהו ל-AA.** `--faint` של דן (#8A968F) נותן 3.07:1 על לבן ו-`--muted` (#6B7B72)
 *     3.88:1 על רצועת הפס — ui-a11y (axe, wcag2aa) נכשל על שניהם. ⟹ #5F6E66: 5.37 על לבן · 5.07 על
 *     חול · 4.67 על הרצועה. אותו לקח כמו `--warn` ב-tokens.css (18.09).
 *  ③ **container query ולא media query.** בדן ה-main רץ ליד סרגל צד ברוחב קבוע, ושבירת הטורים לפי
 *     רוחב החלון עבדה. כאן הרוחב תלוי במעטפת (סרגל פתוח/סגור · max-w 1200), ו-`min-width:600px` של
 *     `.maincol` בדן הוא בדיוק הגלילה האופקית ש-ui-viewport תופס ב-375. ⟹ נשבר לפי רוחב `.dash`.
 */

.dash {
  /* הפלטה (`--d-*`) ב-src/app/dan/dan.css — המכל הוא `<div class="dan dash">`. */
  container: dash / inline-size;
  display: flex; flex-direction: column; gap: 20px;
  color: var(--d-text);
}
.dash [hidden] { display: none !important; }

/* ---------- כותרת ---------- */
.dash .dtop { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.dash h1 { font-size: 26px; font-weight: 600; color: var(--d-ink); letter-spacing: -.02em; margin: 0 0 4px; }
.dash .dtop .meta { font-size: 15px; color: var(--d-muted); }

/* ---------- רצועת ההתראות ---------- */
.dash .dalerts { display: flex; gap: 12px; flex-wrap: wrap; }
.dash .dalert { flex: 1; min-width: 300px; display: flex; align-items: center; gap: 12px; border-radius: 16px;
  padding: 14px 18px; font-size: 15px; line-height: 1.5; }
.dash .dalert .ic { width: 24px; height: 24px; flex: none; border-radius: 50%; font-weight: 700;
  display: grid; place-items: center; font-size: 13px; }
.dash .dalert.warn { background: var(--d-orange-soft); color: var(--d-orange-ink); }
.dash .dalert.warn .ic { background: var(--d-orange); color: #fff; font-size: 14px; }
.dash .dalert.plain { background: #fff; border: 1px solid var(--d-line); color: var(--d-body); }
.dash .dalert.plain .ic { background: #EAF2EC; color: var(--d-green); }
.dash .dalert a { color: var(--d-green); font-weight: 500; }
.dash .dalert.warn a { color: var(--d-orange-ink); text-decoration: underline; }

/* ---------- שלד הרשת ----------
   שני טורים: הרחב נושא את הנתונים, הצר את מה שדורש פעולה ("דורש את אישורך" בראשו). */
.dash .dgrid { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.dash .maincol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dash .sidecol { width: 352px; flex: none; display: flex; flex-direction: column; gap: 18px; }
.dash .duo { display: flex; gap: 18px; flex-wrap: wrap; }
.dash .duo > * { flex: 1; min-width: 300px; }
.dash .duo > .grow { flex-grow: 1.25; }

.dash .dcard { background: #fff; border-radius: 22px; padding: 26px 28px; box-shadow: var(--d-shadow);
  display: flex; flex-direction: column; gap: 20px; }
.dash .dcard--tight { gap: 16px; padding: 24px 26px; }
.dash .dcard h2 { font-size: 17px; font-weight: 600; color: var(--d-ink); margin: 0; }
.dash .cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash .cardhead a { font-size: 13.5px; font-weight: 500; color: var(--d-green); text-decoration: none; }
.dash .cardhead a:hover { color: var(--d-orange-ink); }
.dash .stat-l { font-size: 15px; color: var(--d-muted); }
.dash .big { font-size: 42px; font-weight: 600; color: var(--d-ink); letter-spacing: -.03em; line-height: 1.15; }
.dash .pill-up { font-size: 14.5px; font-weight: 500; color: var(--d-green); background: var(--d-mint); border-radius: 999px; padding: 4px 11px; }
.dash .pill-warn { font-size: 13.5px; font-weight: 500; color: var(--d-orange-ink); background: var(--d-orange-soft); border-radius: 999px; padding: 4px 11px; }
.dash .pill-mute { font-size: 12.5px; font-weight: 500; color: var(--d-muted); background: var(--d-cream2); border-radius: 999px; padding: 3px 10px; }
.dash .pill-up, .dash .pill-warn, .dash .pill-mute { white-space: nowrap; flex: none; }
.dash .dempty { color: var(--d-faint); font-size: 14.5px; }

/* `<button>` ולא `<div onclick>` — מקלדת, מיקוד וקורא-מסך מגיעים איתו בחינם. */
.dash .plainbtn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit;
  text-align: start; cursor: pointer; width: 100%; border-radius: 12px; display: block; }
.dash .plainbtn:focus-visible { outline: 2px solid var(--d-green); outline-offset: 3px; }
.dash .morelink { font-size: 13.5px; font-weight: 500; color: var(--d-green-dark); background: none; border: 0;
  padding: 0; margin: 0; font-family: inherit; cursor: pointer; text-align: start; align-self: flex-start;
  text-decoration: none; }
.dash .morelink:hover { color: var(--d-green); }
.dash .morelink:focus-visible { outline: 2px solid var(--d-green); outline-offset: 2px; border-radius: 4px; }

/* ---------- אוכלוסייה ----------
   ⚠️ רשימה ולא רשת: הפס משווה מעמדות זה לזה (מנורמל לגדול שבהם), לא חלוקה של שלם. */
.dash .popnums { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.dash .poprows { display: flex; flex-direction: column; gap: 2px; }
.dash .poprow { display: flex; align-items: center; gap: 10px; padding: 3px 4px; border-radius: 8px; }
.dash .poprows:hover .poprow { background: var(--d-cream2); }
.dash .poprow .nm { width: 150px; flex: none; font-size: 13.5px; color: var(--d-body); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.dash .poprow .pbar { flex: 1; height: 10px; background: var(--d-track); border-radius: 999px; overflow: hidden; }
.dash .poprow .pbar i { display: block; height: 100%; border-radius: 999px; }
.dash .poprow .v { width: 84px; flex: none; text-align: start; font-size: 13.5px; font-weight: 600;
  color: var(--d-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash .poprow .v em, .dash .drow .v em { color: var(--d-faint); font-weight: 400; font-style: normal; }
.dash .popkey { display: flex; gap: 16px; font-size: 12.5px; color: var(--d-muted); flex-wrap: wrap; }
.dash .popkey span { display: flex; align-items: center; gap: 6px; }
.dash .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.dash .popnote { font-size: 12.5px; color: var(--d-faint); line-height: 1.55; margin: 0; }

.dash .dtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  border-top: 1px solid var(--d-line-soft); padding-top: 16px; }
.dash .dtile { background: var(--d-cream2); border: 0; border-radius: 14px; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 3px; font-family: inherit; text-align: start; color: inherit; }
.dash .dtile .k { font-size: 12.5px; color: var(--d-faint); }
.dash .dtile .v { font-size: 16.5px; font-weight: 600; color: var(--d-ink); }
.dash button.dtile { cursor: pointer; }
.dash button.dtile:hover { background: #F4F1E7; }
.dash button.dtile:focus-visible { outline: 2px solid var(--d-green); outline-offset: 2px; }

/* ---------- פניות: דונאט ---------- */
.dash .donutwrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.dash .donut { position: relative; width: 118px; height: 118px; flex: none; display: block; }
/* ⚠️ base.css קובע `svg { width:20px; height:20px }` לכל SVG (אייקונים) — שלושת ה-SVG כאן מקבלים מידה מפורשת. */
.dash .donut svg { transform: rotate(-90deg); display: block; width: 118px; height: 118px; }
.dash .donut .mid { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; }
.dash .donut .mid b { font-size: 21px; font-weight: 600; color: var(--d-ink); letter-spacing: -.02em; }
.dash .donut .mid span { font-size: 11px; color: var(--d-faint); }
.dash .keys { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 140px; }
.dash .keys .k { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash .keys .k span { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--d-body); white-space: nowrap; }
.dash .keys .k b { font-size: 14px; font-weight: 600; color: var(--d-text); flex: none; font-variant-numeric: tabular-nums; }

/* ---------- ניצול תקציב ---------- */
.dash .brnch { display: flex; flex-direction: column; gap: 13px; }
.dash .brnch .b { display: flex; flex-direction: column; gap: 6px; }
.dash .brnch .t { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.dash .brnch .t span:first-child { color: var(--d-body); }
.dash .brnch .t span:last-child { color: var(--d-muted); flex: none; }
.dash .brnch .t.over span:last-child { color: var(--d-orange-ink); font-weight: 600; }
.dash .track { height: 9px; background: var(--d-track); border-radius: 999px; overflow: hidden; display: block; }
.dash .track i { display: block; height: 100%; background: var(--d-green); border-radius: 999px; }
.dash .track i.warn { background: var(--d-orange); }

/* ---------- עמידה בתקציב השנתי ----------
   ⚠️ הסך בשורה משלו ושני חלקיו מתחתיו — שלושה סכומי ₪ מלאים אינם נכנסים לשורה אחת. */
.dash .figures { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.dash .figures div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash .figures .whole { flex-basis: 100%; }
.dash .figures .part { flex: 1; min-width: 120px; }
.dash .figures .k { font-size: 12.5px; color: var(--d-faint); }
.dash .figures .v { font-size: 17.5px; font-weight: 600; color: var(--d-ink); font-variant-numeric: tabular-nums; }
.dash .figures .v.used { color: var(--d-green); }
.dash .figures .v.over { color: var(--d-orange-ink); }
.dash .chartlegend { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--d-muted); flex-wrap: wrap; }
.dash .chartlegend span { display: flex; align-items: center; gap: 6px; }
.dash .chartlegend i { width: 14px; height: 3px; border-radius: 2px; display: block; }
.dash .pace { display: block; overflow: visible; width: 100%; height: 124px; }
.dash .pace text { font-family: var(--font); }
.dash .hit { fill: transparent; cursor: default; }
.dash .hit:hover { fill: rgba(14,122,85,.055); }

/* ---------- דורש את אישורך ---------- */
.dash .todo { display: flex; flex-direction: column; gap: 12px; }
.dash .todo .t { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid #F4F1E7; padding-bottom: 12px; text-decoration: none; color: inherit; }
.dash .todo .t:last-child { border-bottom: 0; padding-bottom: 0; }
.dash .todo .t .n { font-size: 15px; font-weight: 500; color: var(--d-text); }
.dash .todo .t .s { font-size: 13.5px; color: var(--d-faint); }
.dash .todo a.t:hover .n { color: var(--d-green); }
.dash .todo .arrow { color: var(--d-green); flex: none; }

/* ---------- בקרוב בקהילה — הכרטיס הכהה ---------- */
.dash .soon { background: var(--d-ink); border-radius: 22px; padding: 24px 26px; display: flex;
  flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.dash .soon .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; position: relative; }
.dash .soon h2 { color: #F3F8F2; font-size: 17px; font-weight: 600; margin: 0; }
.dash .soon .hd a { font-size: 13px; color: #BFE0CE; text-decoration: none; }
.dash .soon .all { font-size: 13px; font-weight: 500; color: #BFE0CE; background: none; border: 0; padding: 0;
  margin: 0; font-family: inherit; cursor: pointer; text-align: start; align-self: flex-start; position: relative; }
.dash .soon .all:hover, .dash .soon .hd a:hover { color: #DCE9DF; }
.dash .soon .all:focus-visible, .dash .soon a:focus-visible { outline: 2px solid var(--d-green-mid); outline-offset: 3px; border-radius: 4px; }
.dash .soon svg.deco { position: absolute; bottom: 8px; left: -20px; opacity: .22; pointer-events: none; width: 320px; height: 60px; }
.dash .soon ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; position: relative; }
.dash .soon li { display: flex; gap: 12px; align-items: baseline; }
.dash .soon .d { font-size: 13.5px; font-weight: 500; color: var(--d-sand); flex: none; width: 52px; }
.dash .soon .e { font-size: 15px; color: #DCE9DF; line-height: 1.45; text-decoration: none; }
.dash .soon a.e:hover { color: #fff; }

/* ---------- תוכן הדיאלוגים (המעטפת היא kit-dialog) ---------- */
.dash .drows { display: flex; flex-direction: column; }
.dash .hrow { display: grid; gap: 10px; padding: 0 4px 8px; border-bottom: 1px solid var(--d-line);
  font-size: 12.5px; color: var(--d-faint); }
.dash .drow { display: grid; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #F4F1E7;
  grid-template-columns: 1fr auto; }
.dash .drow .n { font-size: 14px; color: var(--d-text); }
.dash .drow .v { font-size: 14px; font-weight: 600; color: var(--d-text); font-variant-numeric: tabular-nums; }
.dash .drow .when { font-size: 13.5px; font-weight: 500; color: var(--d-orange-ink); }
.dash .drow.cols3, .dash .hrow.cols3 { grid-template-columns: 1.4fr .9fr .8fr; }
.dash .drow.date { grid-template-columns: 46px 1fr; }
/* שורת מעמד שהיא קישור לרשימת האנשים (manager.js `peopleHref`) — נראית כשורה, ומגיבה כקישור. */
.dash a.drow { color: inherit; text-decoration: none; border-radius: 8px; }
.dash a.drow:hover { background: var(--d-cream2); }
.dash a.drow:hover .n { color: var(--d-green-dark); text-decoration: underline; text-underline-offset: 3px; }
.dash a.drow:focus-visible { outline: 2px solid var(--d-green); outline-offset: -2px; }
.dash .stack { display: flex; flex-direction: column; gap: 1px; }
.dash .stack .name { font-size: 14.5px; font-weight: 500; color: var(--d-text); }
.dash .stack .meta { font-size: 13px; color: var(--d-faint); }
.dash .dlgstats { display: flex; gap: 14px; border-bottom: 1px solid var(--d-line-soft); padding-bottom: 16px; margin-bottom: 16px; }
.dash .dlgstats div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dash .dlgstats .k { font-size: 13px; color: var(--d-faint); }
.dash .dlgstats .v { font-size: 19px; font-weight: 600; color: var(--d-ink); }
.dash .dlgcap { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--d-faint); padding: 0 2px 6px; }

/* ---------- טולטיפ אחד לגרף ----------
   ⚠️ מחוץ ל-`.dash` ובמחלקה משלו: `container` על `.dash` יוצר containing block ל-`position:fixed`,
   ולכן mountManager תולה אותו על <body> ולא בתוך המסך. */
.dash-tip { position: fixed; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: #103C2A; color: #F3F8F2; border-radius: 12px; padding: 10px 13px;
  font-family: var(--font); font-size: 12.5px; line-height: 1.6; box-shadow: 0 12px 34px rgba(16,42,32,.28); max-width: 250px; }
.dash-tip.on { opacity: 1; }
.dash-tip b { display: block; font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.dash-tip .r { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.dash-tip .r span:first-child { color: #9FC3AD; }
.dash-tip .r span:last-child { font-variant-numeric: tabular-nums; }
.dash-tip .note { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.14);
  color: #9FC3AD; font-size: 11.5px; white-space: normal; }

/* ---------- שבירות ---------- */
@container dash (max-width: 1000px) {
  .dash .sidecol { width: 100%; }
  .dash .maincol { flex-basis: 100%; }
}
@container dash (max-width: 700px) {
  /* ⚠️ `flex-basis:100%` ו-`min-width:0` פותרים שני דברים שונים, וצריך את שניהם (הערת דן). */
  .dash .dalert, .dash .duo > * { flex-basis: 100%; min-width: 0; }
  .dash .dcard { padding: 22px 20px; }
  .dash .dtiles { grid-template-columns: repeat(2, 1fr); }
  .dash .dtiles > * { min-width: 0; }
  .dash .poprow .nm { width: 110px; }
  .dash .poprow .v { width: auto; }
  .dash .big { font-size: 36px; }
}
