@font-face { font-family:'Heebo'; font-weight:400 800; src:url('fonts/font-4.woff2') format('woff2'); unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+FB1D-FB4F; }
@font-face { font-family:'Heebo'; font-weight:400 800; src:url('fonts/font-8.woff2') format('woff2'); unicode-range:U+0000-00FF,U+2000-206F,U+2190-2193,U+2212; }
@font-face { font-family:'Frank Ruhl Libre'; font-weight:500 700; src:url('fonts/font-1.woff2') format('woff2'); unicode-range:U+0590-05FF,U+20AA,U+FB1D-FB4F; }
:root {
  --blue:#1f5fa8; --blue-dark:#17497f; --ink:#16202e; --green:#2f8f4e; --red:#b23c3c;
  --amber:#a2560a; --amber-bg:#fdf3e4; --green-bg:#e7f5ec; --red-bg:#fae4eb;
  --bg:#f1f4f8; --line:#e4e9f0; --line-soft:#eef2f7; --muted:#55637a; --faint:#8593a5;
  --purple:#5b52d5; --purple-bg:#f4f2ff; --purple-line:#d9d6f6;
  --focus:#1f5fa8;
  /* קו התחתית של דפוס ה-drill-down (`.lnk`) — ראו הסעיף בהמשך */
  --lnk-line:#9db8d6;
  /* מפל הפונטים: עברית ולטינית מ-Heebo; כל תו סמל שנשאר בטקסט (↻ Σ ✓ ▂▅ …)
     נופל לפונט סמלים ידוע במקום לבחירה אקראית של מערכת ההפעלה. אייקון חדש
     נכתב כ-<Icon> (SVG inline) ולא כתו יוניקוד — ראו src/lib/components/Icon.svelte. */
  --font-ui:'Heebo',"Segoe UI","Noto Sans Hebrew",Arial,
            "Segoe UI Symbol","Apple Symbols","Noto Sans Symbols 2","DejaVu Sans",sans-serif;

  /* ======================= סולם השכבות (z-index) =======================
     באג 2026-08-26: הלשונית "התאם עמודות", שורות הראש הדביקות של הלוח
     וכפתור העזרה צפו **מעל תפריט הניווט** בטלפון — כל אחד מהם נשא מספר
     z-index שנקבע בנפרד במסך שלו, ואף אחד מהם לא הכיר את המספר של התפריט.
     מכאן והלאה יש **סולם אחד**, מוגדר כאן, וכל שכבה במערכת מצטטת ממנו:

        0– 9   תוכן רגיל בתוך המסך
       10–39   שכבות דביקות בתוך טבלה (ראש, שורות סיכום, עמודה נעוצה)
       40–59   שכבות של המסך (תפריטים, פופאוברים, פקדים צפים)
       60–69   **הניווט הראשי — תמיד מעל כל שכבות המסך**
       70–71   תפריטי הקשר צפים מעל הניווט
       72–89   מודאלים ודיאלוגים (מכסים גם את הניווט)
       90+     טוסטים

     הכלל: אף קובץ לא כותב מספר z-index חשוף. מי שצריך שכבה חדשה מוסיף
     טוקן כאן, בתוך הטווח המתאים. */
  --z-content: 1;
  --z-table-head: 12;        /* שורת כותרת דביקה בטבלה רגילה */
  --z-board-subhead: 14;     /* שורות "סיכום"/"ארגזים" כשהן אינן דבוקות (טלפון) */
  --z-board-head: 22;        /* ראש הלוח + שורות "סיכום"/"ארגזים" */
  --z-table-pin: 32;         /* עמודה נעוצה בגלילה אופקית */
  --z-screen-scrim: 40;      /* רקע-לחיצה של תפריט מסך */
  --z-screen-menu: 41;       /* תפריט / פופאובר של המסך */
  --z-screen-float: 42;      /* פקד צף של המסך (לשונית, עזרה, סרגל פעולות) */
  --z-screen-top-scrim: 46;  /* תפריט הקשר — מעל שאר תפריטי המסך */
  --z-screen-top: 47;
  --z-nav-scrim: 60;
  /* ‏(62 היה `--z-nav-menu`, המגה-תפריט של ה-☰. הוא הוסר ב-30/08 — ה-☰
     מקפל היום את סרגל הצד ואינו פותח תפריט. המספר נשאר פנוי בכוונה.) */
  --z-nav-bar: 64;
  --z-nav-drop: 66;
  /* מעטפת הלשוניות (סרגל צד + רצועה) — הכרום החיצוני ביותר של האתר, ולכן
     היא יושבת בקצה העליון של טווח הניווט: מעל הסרגל העליון של המסך (64)
     ומעל הפאנלים הצפים שלו (66), אבל מתחת למודאלים (72+). */
  --z-ws-side: 63;
  --z-ws-strip: 65;
  --z-ws-drawer-scrim: 67;
  --z-ws-drawer: 68;
  --z-context-menu-scrim: 70;
  --z-context-menu: 71;
  --z-modal: 72;
  --z-dialog: 74;            /* דיאלוג שנפתח מתוך מודאל */
  --z-confirm: 76;           /* אישור שנפתח מתוך דיאלוג */
  --z-toast: 95;

  /* גובה הסרגל העליון בפועל. `TopBar` מודד ומעדכן אותו; ברירת המחדל היא
     ההערכה הישנה (3rem) לרגע שלפני המדידה ולעמודים שאין בהם סרגל. */
  --topbar-h: 3rem;
}
body { background:var(--bg); color:var(--ink); font-family:var(--font-ui); font-size:14px; line-height:1.5; }
a { color: var(--blue); }

/* ============================ מצבי מגע ומקלדת ============================
   הרף (PLAN.md): ממשק אמיתי מגיב למגע ומראה למשתמש המקלדת איפה הוא נמצא.
   הכללים כאן הם רצפה גלובלית — מסך שמגדיר לעצמו מצב עשיר יותר גובר עליהם. */

a:hover { text-decoration: underline; text-underline-offset: .18em; }

a:hover,
button:not(:disabled):hover,
summary:hover,
[role="button"]:not([aria-disabled="true"]):hover,
label:has(> input[type="checkbox"]):hover,
label:has(> input[type="radio"]):hover { filter: brightness(.96); }

button:not(:disabled):active,
[role="button"]:not([aria-disabled="true"]):active { transform: translateY(.5px); }

button, [role="button"], a, summary { transition: filter .12s ease, background-color .12s ease, border-color .12s ease; }

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover, textarea:hover { border-color: #c9d4e2; }

/* שורת טבלה מגיבה בלי לדרוס צבע רקע שהמסך קבע לשורה (חריגה, נבחר, מודגש):
   שכבת background-image מונחת מעל ה-background-color הקיים. ה-!important
   דרוש כי קיצור `background:` בסגנון המסך מאפס את שכבת התמונה. */
tbody tr:hover > td, tbody tr:hover > th {
  background-image: linear-gradient(rgba(31,95,168,.06), rgba(31,95,168,.06)) !important;
}

/* טבעת מיקוד גלויה בכל מקום. ה-!important הוא מכוון: הוא מבטל
   `outline:none` נקודתי במסכים, שהופך ניווט מקלדת לבלתי-נראה. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus) !important;
  outline-offset: 2px;
  border-radius: 6px;
}
::selection { background: #cfe0f4; color: var(--ink); }

/* ======================= דפוס ה-drill-down (`.lnk`) =======================
   שם, מספר או סכום בטבלה שאפשר לצלול לתוכו. **הכרעת המשתמש (2026-08-24):
   להשאיר קישורים** — הדפוס נשאר, אבל הוא מוגדר כאן פעם אחת כדי שיהיה זהה
   בכל 15 המסכים שמשתמשים בו (לפני כן כל מסך הגדיר אותו מחדש, בלי hover
   מוגדר בכלל). מסך שצריך גודל או משקל אחר מוסיף רק אותם. */
.lnk {
  border: none; background: none; padding: 0; font: inherit; font-weight: 600;
  text-align: right; color: var(--blue); cursor: pointer;
  border-bottom: 1px dashed var(--lnk-line);
  text-decoration: none;
}
.lnk:hover, .lnk:focus-visible {
  color: var(--blue-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--blue-dark);
  text-decoration: none;
}

/* ============================ גלילה אופקית ============================
   טבלה רחבה חייבת לרמוז שיש לה המשך — פס גלילה דק אך גלוי. */
* { scrollbar-width: thin; scrollbar-color: #c3cede transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c3cede; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #a9b8cc; }
*::-webkit-scrollbar-track { background: transparent; }

/* שורות שהוסתרו על ידי הסינון המהיר שבסרגל העליון */
[data-pagetools-hidden] { display: none !important; }

/* ============================ הדפסה ============================ */
@media print {
  header, nav, .scrim { display: none !important; }
  body { background: #fff; }
  a { color: inherit; text-decoration: none; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
}

/* Office inline print (document-print.js printDocument, QA 31/10): the sheet is printed from the open page; on screen
   the host is hidden, in print only the host shows. */
.inline-print-host { display:none; }
@media print {
  html.printing-inline body > *:not(.inline-print-host) { display:none !important; }
  html.printing-inline .inline-print-host { display:block; }
}

/* Shared document window (QA 31/10): one look for every document type — header, banners, line table, totals row and
   action bar. Used by components/documents/*, ServerDocuments, the documents preview and the customer card. */
.doc-sub { margin:-.4rem 0 .6rem; color:var(--muted); font-size:.92rem; display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
.doc-banner { margin:0 0 .6rem; padding:.4rem .7rem; border-radius:8px; font-weight:600; font-size:.88rem; display:flex; gap:.4rem; align-items:center; }
.doc-banner.pilot { border:1px solid #a2560a; color:#a2560a; background:#fff8ef; }
.doc-banner.cancelled { border:1px solid var(--red); color:var(--red); background:var(--red-bg); }
.doc-banner.info { border:1px solid var(--line); color:var(--muted); background:#f7f9fc; font-weight:500; }
.doc-table { width:100%; border-collapse:collapse; margin:.4rem 0; font-size:.9rem; }
.doc-table th { background:#eef2f7; color:#55637a; font-size:.75rem; font-weight:700; padding:.5rem .6rem; text-align:right; }
.doc-table td { padding:.45rem .6rem; border-bottom:1px solid #eef1f5; text-align:right; vertical-align:middle; }
.doc-table td.num, .doc-table th.num { text-align:left; direction:ltr; unicode-bidi:isolate; font-variant-numeric:tabular-nums; white-space:nowrap; }
.doc-table td small { display:block; color:#8593a5; font-size:.72rem; }
.doc-table td input { width:6rem; font:inherit; border:1px solid var(--line); border-radius:6px; padding:.25rem .35rem; }
.doc-table tfoot th, .doc-table tfoot td { font-weight:800; border-top:2px solid #17212b; border-bottom:none; background:#f7f9fc; }
.doc-note { font-size:.78rem; color:#8593a5; margin:.4rem 0; line-height:1.6; }
.doc-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.9rem; padding-top:.75rem; border-top:1px solid #eef1f5; align-items:center; }
.doc-actions .spacer { flex:1; }
.doc-btn { display:inline-flex; align-items:center; gap:.4rem; font:inherit; font-size:.88rem; font-weight:600; padding:.45rem .9rem; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--ink, #17212b); cursor:pointer; }
.doc-btn:hover:not(:disabled) { background:#f2f4f7; }
.doc-btn:disabled { opacity:.45; cursor:not-allowed; }
.doc-btn.primary { background:var(--blue); border-color:var(--blue); color:#fff; }
.doc-btn.primary:hover:not(:disabled) { filter:brightness(1.08); background:var(--blue); }
.doc-btn.danger { color:var(--red); border-color:var(--red-bg); }
.doc-btn.danger:hover:not(:disabled) { background:var(--red-bg); }
.doc-state-cancelled { display:inline-flex; align-items:center; gap:.25rem; color:var(--red); background:var(--red-bg); font-weight:700; font-size:.75rem; border-radius:999px; padding:.12rem .55rem; }
