/* MorLex Web — הלשונית "לקוחות" (js/clients.js, 8.00.26). בקובץ נפרד מ-app.css, עם המשתנים של app.css
   (כולל הערכה הכהה), כדי שלא ייגע בשינויים של מסכים אחרים. */
.cl-view { width: 100%; box-sizing: border-box; max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.cl-main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.cl-side, .cl-card { background: var(--panel); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 14px; }
.cl-side { position: sticky; top: calc(var(--top-h, 60px) + 12px); max-height: calc(100vh - var(--top-h, 60px) - 36px); overflow-y: auto; box-sizing: border-box; }
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cl-head h2 { margin: 0; font-size: 1rem; }
#cl-search { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
.cl-filters { display: flex; gap: 8px; margin-top: 8px; }
.cl-filters select { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; font-size: 0.875rem; }
#cl-search:focus, .cl-filters select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.cl-count { font-size: 0.8125rem; margin: 8px 0 6px; min-height: 1.2em; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-none { padding: 14px 4px; }
.cl-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: start; padding: 8px 10px; margin: 2px 0; border: 1px solid transparent;
  border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cl-item:hover { background: var(--hover); }
.cl-item.active { background: var(--accent-soft); border-color: var(--line); }
.cl-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.cl-item-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cl-item-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.8125rem; }
.cl-num { font-variant-numeric: tabular-nums; color: var(--tab-mark); font-weight: 700; }
.cl-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.cl-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--seg-bg); color: var(--text); font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.cl-badge.off { background: var(--dis-bg); color: var(--muted); }

.cl-card { min-height: 320px; }
.cl-empty { padding: 24px 8px; max-width: 60ch; }
.cl-empty h2 { margin: 0 0 8px; font-size: 1.1rem; }
.cl-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cl-card-head h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.cl-card-head h2:focus { outline: none; }
.cl-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
/* 18.11.26: בטלפון שורת הלשוניות נגללת בתוך עצמה, ולא מרחיבה את הדף */
.cl-tabs { display: flex; gap: 4px; margin: 14px 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.cl-tab { flex: none; white-space: nowrap; padding: 6px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.cl-tab:hover { color: var(--text); }
.cl-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--tab-mark); }
.cl-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
@media (max-width: 640px) { .cl-tab { padding-inline: 8px; } }
.cl-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.cl-dl dt { color: var(--muted); font-size: 0.875rem; }
.cl-dl dd > a { padding-block: 2px; }   /* 18.11.26: יעד לחיצה של 24 פיקסלים לפחות (ריפוד של קישור בשורה לא משנה את הפריסה) */
.cl-dl dd { margin: 0; overflow-wrap: anywhere; }
.cl-notes { white-space: pre-wrap; }
.cl-warn { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text); }

.cl-cases-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.cl-cases { list-style: none; margin: 0; padding: 0; }
.cl-case { padding: 10px 0; border-top: 1px solid var(--line); }
.cl-case:first-child { border-top: 0; }
.cl-case.closed { opacity: 0.75; }
.cl-case-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.cl-case-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 0.8125rem; }
.cl-case-acts { display: flex; gap: 6px; margin-top: 6px; }
.cl-log { list-style: none; margin: 0; padding: 0; }
.cl-log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.cl-log li:first-child { border-top: 0; }
.cl-log-at { font-variant-numeric: tabular-nums; }

/* הטפסים בחלון (modal מ-js/ui.js; השדות מעוצבים ב-.ed-dialog שב-app.css). רוחב קבוע, כדי שהחלון לא יצטמצם לפי התוכן */
.ed-dialog:has(.cl-form-grid) { width: min(640px, 94vw); box-sizing: border-box; }
.ed-dialog .cl-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ed-dialog .cl-form-grid[hidden] { display: none; }
.ed-dialog .cl-kind { display: flex; gap: 18px; border: 0; padding: 0; margin: 4px 0; }
.ed-dialog .cl-kind legend { float: inline-start; margin-inline-end: 12px; color: var(--muted); font-size: 0.875rem; padding: 0; }
.ed-dialog .cl-kind label { margin: 0; }
.ed-dialog .cl-textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit;
  background: var(--field); color: var(--text); resize: vertical; }
.ed-dialog .cl-textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.ed-dialog .cl-id-hint { margin: 4px 0 0; color: var(--warn); min-height: 0; }
.ed-dialog .cl-id-hint:empty { display: none; }
.cl-dups { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text); }
.cl-dups p { margin: 4px 0; }
.cl-dups ul { margin: 4px 0; padding-inline-start: 18px; }

/* שלב 2 (8.01.26): תיקיית התיק במחשב והלשונית "מסמכים" (js/clientfolders.js) */
.cl-case-folder { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 0.875rem; }
.cl-case-folder .icon { width: 16px; height: 16px; color: var(--muted); }
.cl-folder-name { font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.cl-docs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cl-docs-pick { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted); max-width: 100%; }
.cl-docs-pick select { min-width: 0; max-width: 100%; padding: 5px 8px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
.cl-docs-pick select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.cl-docs-state { padding: 4px 0; max-width: 70ch; }
.cl-docs-state .row { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-docs-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; margin-bottom: 8px; overflow-wrap: anywhere; }
.cl-docs-crumbs .linkish { font: inherit; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; }
.cl-docs-crumbs .linkish:hover { text-decoration-thickness: 2px; }
.cl-docs-up { font-weight: 600; }
.cl-docs-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cl-docs-list { list-style: none; margin: 0; padding: 0; }
.cl-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.cl-doc:first-child { border-top: 0; }
.cl-doc-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.cl-doc-name.linkish { font-size: inherit; padding: 0; color: var(--text); font-weight: 600; }
.cl-doc-name .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.cl-doc-meta { font-size: 0.8125rem; white-space: nowrap; }
.cl-doc-acts { display: flex; gap: 4px; }
.cl-relink { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text); }
.cl-relink ul { list-style: none; margin: 4px 0; padding: 0; }
.cl-relink li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; }
.cl-relink .icon, .cl-pick-item .icon { width: 16px; height: 16px; flex: none; }
.cl-pick { max-height: 50vh; overflow-y: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.cl-pick-h { margin: 8px 0 2px; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.ed-dialog label.cl-pick-item { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; padding: 4px 2px; cursor: pointer;
  overflow-wrap: anywhere; color: var(--text); font-weight: 400; font-size: 0.9375rem; }
.ed-dialog label.cl-pick-item input { flex: none; width: auto; margin: 0; }
.ed-dialog label.cl-pick-item bdi { min-width: 0; }
.ed-dialog .cl-pick + .hint, .ed-dialog .cl-pick-h + label { margin-top: 0; }
.ed-dialog:has(.cl-pick) { width: min(640px, 94vw); box-sizing: border-box; }
.ed-dialog input[type=search] { margin-top: 8px; }
.ed-dialog label.cl-pick-item:hover { background: var(--hover); }

@media (max-width: 900px) {
  .cl-main { grid-template-columns: minmax(0, 1fr); }
  .cl-side { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .cl-view { padding: 0 10px; }
  .ed-dialog .cl-form-grid { grid-template-columns: minmax(0, 1fr); }
  .cl-doc { grid-template-columns: minmax(0, 1fr) auto; }
  .cl-doc-meta { grid-column: 1; white-space: normal; }
}
/* הורדה והדפסה (8.06.26) */
.cl-print-frame { position: fixed; inset-inline-end: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.cl-path { overflow-wrap: anywhere; font-weight: 600; direction: ltr; text-align: start; }
.cl-fail-list { margin: 4px 0; padding-inline-start: 20px; max-height: 40vh; overflow-y: auto; overflow-wrap: anywhere; }
.cl-docs-tools .btn, .cl-doc-acts .btn { white-space: nowrap; }
.cl-doc-acts { flex-wrap: wrap; justify-content: flex-end; }

/* ---------- שלב 3 (8.10.26): תבניות Word, מסמכי פתיחה, הלשונית "חתימות" (js/openingdocs.js, js/casesigning.js) ---------- */
.od-tpls, .od-results, .cl-sigs { list-style: none; margin: 0; padding: 0; }
.od-tpls li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.od-tpls li:first-child, .od-results li:first-child, .cl-sig:first-child { border-top: 0; }
.od-tpl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.od-tpl-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.od-field { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--seg-bg); }
.od-pick, .ed-dialog fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; min-width: 0; }
.ed-dialog label.od-check, .od-check { display: flex; align-items: center; gap: 6px; margin: 4px 0; color: var(--text); }
.ed-dialog label.od-check input, .od-check input { width: auto; margin: 0; }
.od-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; }
.ed-dialog label.od-value { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; }
.od-found p { margin: 4px 0; }
.od-results li { padding: 8px 0; border-top: 1px solid var(--line); }
.od-results li p { margin: 4px 0; }
.od-results .row { flex-wrap: wrap; align-items: center; }
.cl-sig { padding: 10px 0; border-top: 1px solid var(--line); }
.cl-sig-state { margin-top: 4px; font-size: 0.9rem; }
.cl-sig-state.ok { color: var(--ok); }
.cl-sig-state.wait { color: var(--warn); }
.cl-sig-state.off { color: var(--muted); }

/* 12ה: שם לתיק ומסך תיק בכרטיס הלקוח */
.cl-case-open { width: 100%; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.cl-case-open strong { color: var(--accent); }
.cl-case-open:hover strong { text-decoration: underline; }
.cl-case-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cl-case-go { margin-inline-start: auto; color: var(--muted); }
.cl-cs-back { margin-bottom: 6px; }
.cl-cs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.cl-cs-head h3 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.cl-cs-head h3:focus { outline: none; }      /* המיקוד עובר לכותרת רק כדי שקורא מסך יקריא אותה; היא לא כפתור */
.cl-cs .cl-case-acts { flex-wrap: wrap; margin: 8px 0 4px; }
.cl-cs-sec { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); min-width: 0; }
.cl-cs-sec h4 { margin: 0 0 8px; font-size: 0.95rem; }
.cl-cs-summary { margin: 0; overflow-wrap: anywhere; }
.cl-cs-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 24px; }
.cl-cs-grid .cl-case-folder { margin-top: 10px; }
.cl-cs-grid .cl-cs-sec > .btn { margin-top: 10px; }
@media (max-width: 720px) {
  .cl-cs-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 16.11.26: "ייצוא לקובץ" ליד "לקוח חדש" (למנהל) */
.cl-head-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* 17.11.26: במחשב המסך נגלל בתוך עצמו (body > main), ולכן הרשימה נצמדת לראש האזור ולא במרחק של השורה העליונה –
   כך היא מתחילה באותו קו של כרטיס הלקוח. 90: הריווח והשורה התחתונה של האתר */
@media (min-width: 901px) {
  .cl-side { top: 0; max-height: calc(100dvh - var(--top-h, 60px) - 90px); }
}
