/* טבלת הרשומות במסך הנהלת החשבונות, עיצוב 1a (accounting-records-table.js).
   שורה אחת לכל רשומה: טקסט שאורכו בא מהמשתמש נחתך בשלוש נקודות, והמלא
   ב-title. המידות מחבילת העיצוב, הגוונים מהקיימים בלבד (DESIGN.md), והטבלה
   עצמה היא .data-table מ-base.css.

   **הבוררים של הטבלה מתחילים ב-table.data-table.acc-records**, כי
   `table.data-table` ב-base.css קובע גודל גופן ומנצח את `.acc-records` לבד.
   בגרסה הראשונה הגדלים כאן לא חלו בכלל, והמדידות נעשו על 13 פיקסל. */

/* ─── כותרת הכרטיס ─────────────────────────────────────────────────────────── */
.acc-rec-toolbar {
    padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; border-bottom: 1px solid #e2e8f0;
}
.acc-rec-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.acc-rec-title-text { font-size: 20px; font-weight: 700; color: #1e293b; }
.acc-rec-count { font-size: 15px; color: #64748b; font-variant-numeric: tabular-nums; }
.acc-rec-chip {
    display: inline-flex; align-items: center; gap: 4px; max-width: 320px; min-width: 0;
    padding-block: 4px; padding-inline: 12px; border-radius: 999px; background: #eef2f7;
    font-size: 14px; color: #1e293b;
}
.acc-rec-chip:has(.acc-rec-chip-x) { padding-inline-end: 4px; }
/* #475569 ולא #64748b: על הרקע של התווית האפור הבהיר עובר 4.5:1, הכהה לא. */
.acc-rec-chip-key { color: #475569; flex-shrink: 0; }
.acc-rec-chip-val { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#accountingSection .acc-rec-chip-x {
    flex-shrink: 0; width: 26px; height: 26px; min-height: 0; padding: 0; border: 0; border-radius: 999px;
    background: none; color: #475569; font-size: 16px; line-height: 1; cursor: pointer;
}
#accountingSection .acc-rec-chip-x:hover { background: #e2e8f0; color: #1e293b; }

/* ─── הטבלה ────────────────────────────────────────────────────────────────── */
/* 14 ולא 15: בגופן של המערכת 14 נראה כמו 15 בגופן של העיצוב (Assistant, צר וקטן
   יותר), ובנתונים אמיתיים 15 חתך כמעט כל שם עד כרטיס של 1,700. 15 רק בכרטיס רחב מאוד. */
table.data-table.acc-records { font-size: 14px; }
table.data-table.acc-records thead th {
    padding: 10px 10px; font-size: 13px; font-weight: 600; color: #475569;
    border-bottom: 0; box-shadow: inset 0 -1px 0 #e2e8f0;
}
/* הצל רק כשיש שורות מתחת לכותרת הדביקה (_accRecSyncScrolled). */
.acc-records-wrap.is-scrolled table.data-table.acc-records thead th {
    box-shadow: inset 0 -1px 0 #e2e8f0, 0 3px 6px rgba(15, 23, 42, .12);
}
table.data-table.acc-records tbody td { padding: 10px 10px; vertical-align: middle; height: 38px; }
.acc-records tbody tr { cursor: pointer; }
.acc-records tbody tr:has(.acc-files-row-check:checked) { background: #eef2f7; }
/* בשורה שנבחרה, האפור המשני מתכהה: #64748b על הרקע שלה הוא 4.2:1. */
.acc-records tbody tr:has(.acc-files-row-check:checked) :is(.acc-rec-sub, .acc-doc-src, .exp-stage-dot-note, .acc-files-none) { color: #475569; }
.acc-records tbody tr[data-nosort] { cursor: default; }
.acc-rec-empty { padding: 20px; text-align: center; color: #64748b; }

/* הסכום בקצה העמודה, והכותרת שלו איתו. */
.acc-records th.num, .acc-records td.num { text-align: end; }
.acc-records .acc-rec-amount { font-weight: 600; color: #1e293b; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* **עמודות הטקסט מתחלקות במקום שנשאר**, לפי כמה טקסט יש בהן, ולא לפי רוחב
   קבוע: `max-width: 0` על התא מבטל את הרוחב המינימלי שהטקסט היה מכתיב, ולכן
   קטגוריה ארוכה תופסת את המקום שספק קצר השאיר, ונחתכת רק כשהשורה באמת לא
   נכנסת. העמודות של הסכום, הסטטוסים והקבצים אינן מתכווצות. מתחת לרוחב
   המינימלי הטבלה נגללת בתוך הכרטיס במקום להימעך. */
table.data-table.acc-records { min-width: 960px; }
.acc-records td.acc-rec-flex { max-width: 0; overflow: hidden; }
/* החלק של כל עמודת טקסט ברוחב נקבע ב-<colgroup>, לפי אורך הטקסט שבשורות
   המוצגות (_accRecColgroupHtml). בלי זה הדפדפן מחלק את המקום בין עמודות
   ש-max-width: 0 איפס להן את רוחב התוכן בצורה שאינה תלויה בטקסט (נמדד:
   המסמכים קיבלו 375 פיקסל, והמוסד והקטגוריה נחתכו). המסמכים אינם מתכווצים
   מתחת למה ש"יש: חשבונית מס / קבלה" צריך: min-width גובר על max-width. */
.acc-records td.acc-rec-docs { min-width: 175px; }
/* והעמודות שאינן מתכווצות לוקחות רק את מה שהתוכן שלהן צריך (`width: 1%`),
   כדי שכל המקום הפנוי ילך לטקסט ולא לרווח בתוך עמודת הסטטוס. */
.acc-records td.acc-rec-fit, .acc-records td.acc-rec-amount, .acc-records td.acc-rec-inv,
.acc-records td.acc-rec-files, .acc-records .acc-files-select-col { width: 1%; white-space: nowrap; }
.acc-rec-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-rec-name { font-weight: 600; color: #1e293b; }
.acc-rec-cat { color: #334155; }
/* inline-block ולא block: המספר נכתב משמאל לימין, ובלוק ברוחב התא היה מיישר
   אותו לשמאל, הרחק מהתאריך שמתחתיו. */
.acc-rec-inv > bdi { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.acc-rec-sub {
    display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 12px; font-weight: 400; color: #64748b;
}

/* הנהלת חשבונות: נקודה ושם השלב (expenseAccountingStageDotHtml). */
.exp-stage-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.exp-stage-dot-mark { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.exp-stage-dot-note { display: block; margin-top: 2px; font-size: 12px; color: #64748b; white-space: nowrap; }

/* תשלום */
.acc-rec-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* מסמכים: שורה לכל מה שיש, חסר, או חסר אצל הספק. **שורה אחת**, בבחירת בעלים
   מול הצילום (3.11.2026): מה שלא נכנס נחתך בשלוש נקודות, והמלא ב-title. */
.acc-doc-lines { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.acc-doc-line { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; line-height: 1.35; white-space: nowrap; }
.acc-doc-line--btn { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; line-height: 1.35; text-align: start; cursor: pointer; }
.acc-doc-line--btn:hover .acc-doc-text { text-decoration: underline; }
.acc-doc-line--btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
.acc-doc-mark {
    width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1;
}
.acc-doc-body { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acc-doc-src { color: #64748b; font-weight: 400; }
.acc-doc-text { font-weight: 500; }
.acc-doc-line--ok { color: #047857; }
.acc-doc-line--ok .acc-doc-mark { background: #d1fae5; }
.acc-doc-line--warn { color: #92400e; }
.acc-doc-line--warn .acc-doc-mark { background: #fde68a; }
.acc-doc-line--none { color: #475569; }
.acc-doc-line--none .acc-doc-mark { background: #f1f5f9; }
/* בכרטיס הספק יש מקום: השורה מלאה, בלי חיתוך. */
.acc-supplier-card .acc-doc-line { max-width: none; }
.acc-supplier-card .acc-doc-line { white-space: normal; }

/* בחירה וקבצים: תיבה בעמודה הראשונה, ועין והורדה בלי מסגרת בסוף השורה. */
.acc-records .acc-files-select-col { width: 48px; }
.acc-records .acc-files-check { width: 18px; height: 18px; }
.acc-records .acc-files-col { width: 84px; }
.acc-records .acc-file-btn { min-width: 32px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #64748b; }
.acc-records .acc-file-btn:hover { background: #eef2f7; color: #1e293b; }
.acc-records .acc-file-btn svg { width: 18px; height: 18px; stroke-width: 1.6; }

/* השורה התחתונה: כמה מוצג, והסה"כ מתחת לעמודת הסכום. דביקה, כדי שהסה"כ
   ייראה גם בלי לגלול עד הסוף. */
table.data-table.acc-records tfoot td {
    position: sticky; bottom: 0; z-index: 1; padding: 10px 12px; background: #f8fafc;
    box-shadow: inset 0 1px 0 #e2e8f0; font-size: 14px; color: #475569; white-space: nowrap;
}
.acc-records tfoot .acc-rec-foot-total { color: #1e293b; }

/* ─── לפי רוחב הכרטיס, לא החלון: סרגל הצד פתוח או מקופל משנה את המקום. ─────
   נמדד בכרומיום על הדף האמיתי (accounting-records-table.test.js מתעד את
   הנתונים): שם פעילות, ספק וקטגוריה ארוכים, סכום של שמונה ספרות, שלושה
   מוסדות, קבצים ותזכורות. 15 מכרטיס של 1,750, 14 ברוב המסכים, ו-13 מתחת
   ל-1,320. החיתוך עצמו אינו תלוי מדרגה: הוא נקבע מהמקום שנשאר (למעלה).
   מתחת לרוחב המינימלי הטבלה נגללת בתוך הכרטיס, ועמודת העין וההורדה נשארת
   צמודה לקצה עם קו מפריד, כדי שהפעולות לא ייצאו מהתצוגה. */
.acc-table-card { container-type: inline-size; }
.acc-records td.acc-rec-files, .acc-records th.acc-files-col {
    position: sticky; inset-inline-end: 0; background: #fff;
}
.acc-records th.acc-files-col { z-index: 3; background: #f8fafc; }
.acc-records tbody tr:hover td.acc-rec-files { background: #f8fafc; }
.acc-records tbody tr:has(.acc-files-row-check:checked) td.acc-rec-files { background: #eef2f7; }
.acc-records-wrap.has-hscroll td.acc-rec-files::before, .acc-records-wrap.has-hscroll th.acc-files-col::before {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 2px; background: #cbd5e1;
}
@container (min-width: 1750px) {
    table.data-table.acc-records { font-size: 15px; }
    table.data-table.acc-records thead th, table.data-table.acc-records tbody td, table.data-table.acc-records tfoot td { padding-inline: 12px; }
    .acc-rec-sub { font-size: 13px; }
    .exp-stage-dot { font-size: 14px; }
    .acc-rec-pill { font-size: 13px; }
}
@container (max-width: 1319px) {
    table.data-table.acc-records { font-size: 13px; }
    table.data-table.acc-records thead th, table.data-table.acc-records tbody td, table.data-table.acc-records tfoot td { padding-inline: 8px; }
    .acc-rec-inv > bdi { max-width: 100px; }
    .acc-doc-line, .acc-doc-line--btn { font-size: 12px; }
    .acc-records td.acc-rec-docs { min-width: 165px; }
}
@container (max-width: 1069px) {
    table.data-table.acc-records thead th, table.data-table.acc-records tbody td, table.data-table.acc-records tfoot td { padding-inline: 6px; }
    .acc-rec-inv > bdi { max-width: 80px; }
    .acc-records .acc-files-select-col { width: 36px; }
    .acc-rec-pill { padding-inline: 8px; }
}

.acc-rec-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* טלפון: מטרת מגע של 44 (DESIGN.md, נגישות). */
@media (max-width: 768px) {
    .acc-records .acc-file-btn { min-width: 44px; width: 44px; height: 44px; }
    .acc-records .acc-files-check { width: 22px; height: 22px; }
    #accountingSection .acc-rec-chip-x { width: 44px; height: 44px; }
    .acc-doc-line--btn { min-height: 44px; align-items: center; }
}
