/* קבצים, מסמכי חובה והסכמים בכרטיס הליד ובמסך הטפסים (06/10/2026).
 * יורש את האסימונים של style.css (בהיר וכהה), בלי צבעים משלו חוץ מהצהוב
 * של "ממתין לשליחה ידנית", שחייב לבלוט: זו פעולה שאדם צריך לעשות. */

.ldd-host { display: grid; gap: 14px; padding-bottom: 8px; }
.ldd-hint { font-size: 12px; color: var(--ink3); }
.ldd-empty { font-size: 13px; color: var(--ink2); background: var(--surface2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 14px; }

/* ── ממתין לשליחה ידנית ── */
.ldd-manual { --y: rgba(245, 158, 11, .5); border: 1px solid var(--y); background: rgba(245, 158, 11, .10); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.ldd-manual-h { display: grid; gap: 2px; }
.ldd-manual-h b { font-size: 14px; }
.ldd-manual-h span { font-size: 12px; color: var(--ink2); }
.ldd-mrow { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.ldd-mrow.otp { border-color: var(--y); box-shadow: 0 0 0 3px rgba(245, 158, 11, .14); }
.ldd-mtop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ldd-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }
.ldd-ph { font: 500 12.5px/1 Inter, system-ui, sans-serif; color: var(--ink2); }
.ldd-otp { font: 600 30px/1.1 Inter, system-ui, sans-serif; letter-spacing: .32em; text-align: center; padding: 6px 0; color: var(--ink); }
.ldd-mtext { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 Heebo, system-ui, sans-serif; color: var(--ink2); background: var(--surface2); border-radius: 10px; padding: 8px 10px; max-height: 160px; overflow: auto; }
.ldd-mact, .ldd-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ldd-acts.top { justify-content: flex-start; }
.ldd-acts .btn svg, .ldd-uplab svg { width: 16px; height: 16px; margin-inline-end: 6px; vertical-align: -3px; }

/* ── רשימת מסמכי חובה ── */
.ldd-list { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); display: grid; gap: 10px; }
.ldd-lh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ldd-lh > b { font-size: 15px; }
.ldd-count { font-size: 13px; color: var(--ink2); }
.ldd-count b { font: 600 18px/1 Inter, system-ui, sans-serif; color: var(--won); }
.ldd-bar { height: 8px; border-radius: 99px; background: var(--surface3); overflow: hidden; }
.ldd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--won-vivid), var(--won)); border-radius: inherit; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.ldd-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ldd-items li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; border-top: 1px solid var(--line); }
.ldd-items li:first-child { border-top: 0; }
.ldd-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; margin-top: 1px; }
.ldd-items li.ok .ldd-mark { background: var(--won-vivid); border-color: var(--won-vivid); color: #fff; }
.ldd-mark svg { width: 13px; height: 13px; }
.ldd-ib { display: grid; gap: 6px; min-width: 0; }
.ldd-il { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ldd-il b { font-size: 14px; font-weight: 500; }
.ldd-il em { font-style: normal; font-size: 11px; color: var(--ink3); border: 1px solid var(--line2); border-radius: 99px; padding: 0 6px; }
.ldd-st { font-size: 12px; color: var(--ink3); margin-inline-start: auto; }
.ldd-items li.ok .ldd-st { color: var(--won); font-weight: 600; }
.ldd-items li.miss .ldd-st { color: var(--prog); font-weight: 600; }
.ldd-add { position: relative; width: 34px; height: 34px; border-radius: 10px; border: 1px dashed var(--line2); display: grid; place-items: center; font-size: 20px; color:var(--accent-ink); cursor: pointer; }
.ldd-add:hover, .ldd-add:focus-within { border-style: solid; border-color: var(--accent); background: var(--accent-t1); }
.ldd-add input, .ldd-uplab input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ldd-uplab { position: relative; overflow: hidden; }

/* ── קבצים ── */
.ldd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ldd-chips.col { flex-direction: column; }
.ldd-chip { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 4px; min-width: 0; max-width: 100%; }
.ldd-fname { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ldd-fname:hover, .ldd-fname:focus-visible { color:var(--accent-ink); text-decoration: underline; }
.ldd-fname svg { width: 15px; height: 15px; flex: none; color: var(--ink3); }
.ldd-fname i { font: 600 10px/1 Inter, system-ui, sans-serif; font-style: normal; color: var(--accent-deep); background: var(--accent-soft); border-radius: 4px; padding: 2px 4px; flex: none; }
.ldd-meta { font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldd-ic { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--ink3); flex: none; }
.ldd-ic svg { width: 15px; height: 15px; }
.ldd-ic:hover, .ldd-ic:focus-visible { background: var(--surface3); color: var(--ink); }
.ldd-ic.danger:hover { background: var(--lost-t2); color: var(--lost); }
.ldd-drop { border: 1.5px dashed var(--line2); border-radius: 14px; padding: 14px; display: grid; gap: 10px; transition: border-color .15s, background .15s; }
.ldd-drop.over { border-color: var(--accent); background: var(--accent-t1); }
.ldd-dh { display: flex; justify-content: space-between; align-items: baseline; }
.ldd-dh span { font-size: 12px; color: var(--ink3); }
.ldd-prog { font-size: 13px; color: var(--accent-deep); }
.ldd-undo { position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); z-index: 90; display: flex; gap: 12px; align-items: center; background: var(--ink); color: var(--surface); padding: 8px 8px 8px 16px; border-radius: 12px; box-shadow: var(--sh3); font-size: 14px; }

/* ── הסכמים ── */
.ldd-agrs { display: grid; gap: 10px; }
.ldd-agr { border: 1px solid var(--line); border-inline-start: 4px solid var(--new-vivid); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.ldd-agr.st-viewed { border-inline-start-color: var(--prog-vivid); }
.ldd-agr.st-signed { border-inline-start-color: var(--won-vivid); }
.ldd-agr.st-void { border-inline-start-color: var(--line2); opacity: .7; }
.ldd-agr header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ldd-agr header b { font-size: 15px; }
.ldd-pill { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 10px; background: var(--accent-t2); color: var(--accent-deep); }
.ldd-agr.st-viewed .ldd-pill { background: rgba(245, 158, 11, .16); color: var(--prog); }
.ldd-agr.st-signed .ldd-pill { background: rgba(16, 185, 129, .16); color: var(--won); }
.ldd-am { font-size: 12px; color: var(--ink3); }
.ldd-signers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ldd-signers li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; padding: 6px 8px; background: var(--surface2); border-radius: 10px; }
.ldd-sn { font-weight: 600; }
.ldd-ss { color: var(--ink2); font-size: 13px; }
.ldd-signers .btn { margin-inline-start: auto; }

/* ── חלון שליחת הסכם ── */
.ldd-pv { max-height: 34vh; overflow: auto; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.7; }
.ldd-pv mark { background: rgba(245, 158, 11, .22); color: inherit; border-radius: 4px; padding: 0 4px; border-bottom: 1px dashed var(--prog); }
.ldd-sgn { display: grid; gap: 8px; margin: 12px 0; }
.ldd-sgr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.ldd-sgr input { min-width: 0; }

/* ── ניהול ── */
.ldd-prov { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); display: grid; gap: 12px; }
.ldd-prov h4 { margin: 0; font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ldd-pg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ldd-pg label, .ldd-set label { display: grid; gap: 4px; font-size: 13px; color: var(--ink2); }
.ldd-pg label.wide { grid-column: 1 / -1; }
.ldd-map { display: grid; gap: 6px; }
.ldd-mr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ldd-chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ldd-fchip { font: inherit; font-size: 13px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink); border-radius: 99px; padding: 4px 10px; cursor: pointer; }
.ldd-fchip:hover, .ldd-fchip:focus-visible { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-t1); }
.ldd-set { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 10px 0; }
.ldd-set label { display: flex; align-items: center; gap: 6px; }
.ldd-set label input[type=number] { width: 72px; }
.ldd-set label.ck { flex-basis: 100%; }
/* שדות בתוך החלונות והטפסים של המודול: מעוצבים במפורש, כדי שבמצב כהה לא יישארו לבנים */
:is(.ldd-pg, .ldd-set, .ldd-mr, .ldd-irow, .ldd-sgr) :is(input:not([type=checkbox]), select) {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface2); border: 1px solid var(--line2);
  border-radius: 10px; padding: 8px 10px; min-height: 40px; min-width: 0;
}
:is(.ldd-pg, .ldd-set, .ldd-mr, .ldd-irow, .ldd-sgr) :is(input, select):focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ldd-ck { display: inline-flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); white-space: nowrap; cursor: pointer; }
.ldd-ck input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ldd-more { display: grid; gap: 10px; }
.ldd-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--prog); list-style: none; padding: 4px 2px; }
.ldd-more > summary::-webkit-details-marker { display: none; }
.ldd-more[open] { gap: 10px; }
.ldd-boards { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ldd-irows { display: grid; gap: 8px; }
.ldd-irow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.ldd-irow label { display: flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
.ldd-irow input[type=number] { width: 64px; }

/* חלון שנפתח מתוך כרטיס הליד ("שליחת הסכם"): בטלפון הכרטיס יושב ב-z-index 90
   (ui2.css), והחלון (60) נפתח מאחוריו ולא נראה. חלון פתוח תמיד מעל כרטיס פתוח. */
body:has(#drawer:not([hidden])) #modal:not([hidden]) { z-index: 97; }
body:has(#drawer:not([hidden])) #modalBackdrop:not([hidden]) { z-index: 96; }

@media (max-width: 760px) {
  /* חמש לשוניות בכרטיס (עם קבצים והסכמים) נכנסות ברוחב טלפון בלי גלילה */
  #drawer.d-v3 .d-tabs:has(> button[data-tab="agr"]) { margin-inline: 10px; gap: 2px; }
  #drawer.d-v3 .d-tabs:has(> button[data-tab="agr"]) > button { position: relative; padding: 9px 2px; font-size: 13px; min-width: 0; white-space: nowrap; }
  #drawer.d-v3 .d-tabs:has(> button[data-tab="agr"]) > button i { position: absolute; top: -7px; inset-inline-end: 0; font-size: 11px; line-height: 15px; padding: 0 5px; margin: 0; border-radius: 99px; background: var(--surface); box-shadow: 0 0 0 1px var(--line2); }
  .ldd-items li { grid-template-columns: 24px 1fr 44px; }
  .ldd-add { width: 44px; height: 44px; }
  .ldd-ic { width: 40px; height: 40px; }
  .ldd-chip { flex-wrap: wrap; }
  .ldd-meta { flex-basis: 100%; order: 3; padding-inline-start: 4px; }
  .ldd-pg, .ldd-mr { grid-template-columns: 1fr; }
  .ldd-sgr { grid-template-columns: 1fr; }
  .ldd-irow { grid-template-columns: 1fr auto auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .ldd-irow input[data-il] { grid-column: 1 / -1; }
  .ldd-mact .btn, .ldd-acts .btn { min-height: 44px; }
  .ldd-signers .btn { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) { .ldd-bar i, .ldd-drop { transition: none; } }

/* קישור ללקוח לטופס בכרטיס הליד (07/10/2026, SDH) */
.fl-card .fl-sub { margin: 0 0 10px; font-size: 13px; color: var(--ink2); }
.fl-pick { display: grid; gap: 8px; margin: 6px 0 12px; }
.fl-pick .btn { justify-content: flex-start; text-align: start; min-height: 44px; }
.fl-url { width: 100%; font: 13px/1.4 Inter, system-ui, sans-serif; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); margin: 6px 0 10px; }
#modal .ldd-mtext { margin-bottom: 10px; }
