/* ============================================================================
   א.מ-בק — מודולים: חשבוניות, מסמכים, ספקים, פרויקטים, משתמשים
   נטען אחרי style.css ומרחיב את מערכת העיצוב.
   ============================================================================ */

.money-strong { font-weight: 600; font-size: 14.5px; }
.money-muted { color: var(--text-2); }

/* ============================ סינון וחיפוש ============================ */
.filters { padding: 14px 16px; margin-bottom: 14px; }
.filters-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-search { position: relative; flex: 1; min-width: 250px; }
.filter-search > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 12.5px; pointer-events: none; }
.filter-search input {
  width: 100%; height: 38px; padding: 0 34px 0 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.filter-search input::placeholder { color: var(--text-3); }
.filter-search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
.filter-search .clear-x { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 26px; height: 26px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.filter-search .clear-x:hover { background: var(--line-2); color: var(--text); }

.seg-wrap { display: flex; align-items: center; gap: 9px; margin-inline-start: auto; }
.seg-label { font-size: 12.5px; font-weight: 500; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg-label i { display: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button { padding: 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--text-2); border-radius: 4px; transition: all .14s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); font-weight: 600; }

.filters-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 11px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.filters-adv.hidden { display: none; }
.f-field { display: flex; flex-direction: column; gap: 5px; }
.f-field label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.f-field input, .f-field select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; font-size: 13.5px; }
.f-field input:focus, .f-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.date-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.preset { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: all .14s; }
.preset:hover { border-color: #CDD1D7; color: var(--text); }
.preset.active { background: var(--text); border-color: var(--text); color: #fff; }

/* ============================ סרגל תוצאות ============================ */
.result-bar { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.rb-item { display: flex; flex-direction: column; line-height: 1.3; }
.rb-item small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.rb-item b { font-size: 16px; font-weight: 600; font-family: var(--mono); letter-spacing: -.01em; margin-top: 1px; }
.rb-sep { width: 1px; height: 28px; background: var(--line); }
.rb-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

/* ============================ טבלת רשומות ============================ */
.inv-row { cursor: pointer; transition: background .12s; }
.inv-row:hover { background: var(--surface-2); }
.inv-row.is-new { animation: rowFlash 1.8s ease; }
@keyframes rowFlash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.inv-num { font-family: var(--mono); font-weight: 500; font-size: 13px; display: block; direction: ltr; unicode-bidi: isolate; text-align: start; }
.inv-sub { color: var(--text-3); font-size: 12px; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort i { font-size: 9px; margin-inline-start: 4px; opacity: .4; }
.th-sort.on i { opacity: 1; color: var(--accent); }
.has-file { color: var(--text-2); font-size: 14px; }
.no-file { color: #D0D4DA; font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 14px; border-top: 1px solid var(--line-2); }
.pager button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; font-weight: 500; font-size: 12.5px; color: var(--text-2); font-family: var(--mono); }
.pager button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.pager button.active { background: var(--text); color: #fff; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pg-info { color: var(--text-3); font-size: 12px; margin-inline: 8px; }

/* ============================ קבוצות ============================ */
.group-card { margin-bottom: 12px; overflow: hidden; }
.group-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line-2); text-align: start; transition: background .14s; }
.group-head:hover { background: var(--surface-2); }
.group-caret { font-size: 10px; color: var(--text-3); transition: transform .2s; }
.group-card.collapsed .group-caret { transform: rotate(-90deg); }
.group-card.collapsed .group-body { display: none; }
.group-card.collapsed .group-head { border-bottom: none; }
.group-ic { width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.group-title { font-size: 14px; font-weight: 600; }
.group-sums { margin-inline-start: auto; display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.group-sums b { color: var(--text); font-weight: 600; }
.group-open, .group-open b { color: var(--warn); }

/* ============================ העלאה ============================ */
.upload-grid { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
  padding: 24px 18px; text-align: center; cursor: pointer; transition: all .16s;
  display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--text-2);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); border-style: solid; }
.dz-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: var(--shadow-1); }
.dropzone b { font-size: 14px; font-weight: 500; color: var(--text); }
.dropzone small { color: var(--text-3); font-size: 12.5px; }
.dz-picked { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); }
.dz-picked .file-mini-icon { width: 36px; height: 36px; }
.dz-picked-info { flex: 1; min-width: 0; }
.dz-picked-info b { display: block; font-size: 13px; font-weight: 500; direction: ltr; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-picked-info small { color: var(--text-3); font-size: 11.5px; }

.calc-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 15px; }
.calc-row { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 0; font-size: 13.5px; gap: 14px; }
.calc-row span { color: var(--text-2); }
.calc-total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 15px; }
.calc-total span { color: var(--text); font-weight: 600; }
.calc-total .money { font-weight: 600; }
.calc-pay b { color: var(--ok); }

.note-card { display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.55; }
.note-card > i { font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.note-card b { display: block; margin-bottom: 2px; font-weight: 600; }
.note-info { background: var(--info-soft); color: #1F4E96; }   .note-info > i { color: var(--info); }
.note-warn { background: var(--warn-soft); color: #8A5312; }   .note-warn > i { color: var(--warn); }
.note-danger { background: var(--bad-soft); color: #9A2B23; } .note-danger > i { color: var(--bad); }
.note-ok { background: var(--ok-soft); color: #14603B; }      .note-ok > i { color: var(--ok); }
.note-slot { display: block; }
.note-slot:not(:empty) { margin-top: 10px; }

.approve-box { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: var(--radius); padding: 13px 15px; }
.approve-box.locked { border-color: var(--line); background: var(--surface-2); }
.approve-check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.approve-check input { width: 17px; height: 17px; accent-color: var(--ok); margin-top: 2px; flex-shrink: 0; }
.approve-check b { display: block; font-size: 14px; margin-bottom: 2px; font-weight: 600; }
.approve-check small { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }

/* ============================ קליטה אוטומטית ============================ */
.form-row-4 { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr 1fr; gap: 13px; }
.form-group.is-auto .form-input, .form-group.is-auto .form-select, .form-group.is-auto .form-textarea { border-color: var(--accent); background: #F4FAF8; }
.form-group.is-guess .form-input, .form-group.is-guess .form-select, .form-group.is-guess .form-textarea { border-color: var(--warn); background: #FFFBF3; }
.form-group.is-auto .form-label::after, .form-group.is-guess .form-label::after {
  content: 'נקלט'; margin-inline-start: 7px; font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
}
.form-group.is-guess .form-label::after { content: 'לאימות'; background: var(--warn-soft); color: var(--warn); }
.extract-box { display: flex; gap: 11px; align-items: flex-start; margin-top: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.extract-box > i { font-size: 15px; margin-top: 2px; flex-shrink: 0; }
.extract-box b { display: block; font-weight: 600; }
.extract-box small { display: block; color: var(--text-2); margin-top: 2px; }
.extract-box.working { background: var(--surface-2); color: var(--text-2); }
.extract-box.working > i { color: var(--accent); }
.extract-box.done { background: var(--accent-soft); color: #0B5A4E; }
.extract-box.done > i { color: var(--accent); }
.extract-box.failed { background: var(--warn-soft); color: #8A5312; }
.extract-box.failed > i { color: var(--warn); }
.extract-sup { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(15, 123, 108, .18); font-size: 12.5px; }
.extract-note { margin-top: 7px; font-size: 12.5px; color: #8A5312; }
.extract-note i { color: var(--warn); margin-inline-end: 4px; }
.extract-legend { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
@media (max-width: 900px) { .form-row-4 { grid-template-columns: 1fr 1fr; } }

/* ספק חדש בתוך טופס החשבונית */
.newsup-box { margin-top: 10px; padding: 12px 14px 2px; border: 1px dashed var(--accent); border-radius: var(--radius); background: #F7FBFA; }
.newsup-head { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.newsup-box .form-group { margin-bottom: 10px; }

/* ============================ דף כניסה: לוגו מלא ============================ */
.login-lockup { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-lockup .logo-mark { margin: 0; width: 46px; height: 46px; }
.login-wordmark { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); white-space: nowrap; }
.login-card-head p { margin-top: 10px; }

/* ============================ עורך מסמכים ============================ */
#pe-root { position: fixed; inset: 0; z-index: 1500; background: var(--bg); display: none; flex-direction: column; }
#pe-root.open { display: flex; }
.pe-top { display: flex; align-items: center; gap: 16px; padding: 0 18px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.pe-title { flex: 1; min-width: 0; line-height: 1.25; }
.pe-title b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-title small { color: var(--text-3); font-size: 12px; }
.pe-zoom { display: flex; align-items: center; gap: 2px; }
.pe-zoom span { font-family: var(--mono); font-size: 12.5px; min-width: 44px; text-align: center; color: var(--text-2); }
.pe-top-actions { display: flex; align-items: center; gap: 6px; }
.pe-body { flex: 1; display: flex; min-height: 0; }
.pe-tools { width: 176px; flex-shrink: 0; background: var(--surface); border-inline-end: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.pe-tools-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); margin: 4px 4px 6px; }
.pe-tool { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text-2); text-align: start; transition: background .12s, color .12s; }
.pe-tool i { width: 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.pe-tool:hover { background: var(--surface-2); color: var(--text); }
.pe-tool.active { background: var(--accent-soft); color: var(--accent); }
.pe-tool.active i { color: var(--accent); }
.pe-tool-assets { margin-top: 8px; border: 1px dashed var(--accent); color: var(--accent); }
.pe-tool-assets i { color: var(--accent); }
.pe-tool-assets:hover { background: var(--accent-soft); color: var(--accent); }
.pe-tools-hint { font-size: 12px; color: var(--text-3); line-height: 1.5; padding: 8px 4px 4px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.pe-props { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pe-prop-row { display: flex; align-items: center; gap: 4px; }
.pe-prop-row span { font-family: var(--mono); font-size: 12.5px; min-width: 26px; text-align: center; }
.pe-prop-row .icon-btn { font-size: 12px; font-weight: 600; width: 30px; height: 30px; }
.pe-colors { gap: 6px; padding: 2px 4px; }
.pe-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.pe-stage { flex: 1; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pe-stage.placing .pe-page { cursor: crosshair; }
.pe-loading { color: var(--text-2); font-size: 14px; padding: 40px; }
.pe-page { position: relative; background: #fff; box-shadow: 0 2px 14px rgba(20, 22, 26, .12); flex-shrink: 0; }
.pe-page canvas { display: block; }
.pe-layer { position: absolute; inset: 0; }
.pe-pagenum { position: absolute; top: -20px; inset-inline-start: 0; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.pe-item { position: absolute; border: 1px dashed transparent; cursor: move; user-select: none; touch-action: none; }
.pe-item:hover { border-color: rgba(15, 123, 108, .5); }
.pe-item.selected { border-color: var(--accent); border-style: solid; }
.pe-item img { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; }
.pe-text { min-height: 1.3em; line-height: 1.3; padding: 4px; outline: none; white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-weight: 500; cursor: text; }
.pe-item.selected .pe-text { cursor: text; }
.pe-handle { position: absolute; bottom: -6px; inset-inline-start: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.pe-x { position: absolute; top: -12px; inset-inline-end: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-1); }
.pe-item.selected .pe-handle, .pe-item.selected .pe-x { display: flex; }

/* חתימה וחותמת */
.sa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.sa-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sa-head b { display: block; font-size: 14px; font-weight: 600; }
.sa-head small { color: var(--text-3); font-size: 12px; }
.sa-preview { min-height: 72px; background: repeating-conic-gradient(#f1f2f4 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; padding: 8px; }
.sa-preview img { max-height: 90px; max-width: 100%; }
.sa-preview span { color: var(--text-3); font-size: 12.5px; }
.sa-pad { width: 100%; height: 110px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }
.sa-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) { .sa-grid { grid-template-columns: 1fr; } .pe-tools { width: 64px; } .pe-tool span, .pe-tools-label, .pe-tools-hint { display: none; } }

/* ============================ תקציב ============================ */
.budget-box { padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.budget-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; }
.budget-head b { font-size: 13px; font-weight: 600; }
.budget-head small { color: var(--text-3); font-size: 12px; white-space: nowrap; font-family: var(--mono); }
.budget-bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; display: flex; }
.budget-fill { height: 100%; transition: width .4s ease; }
.bf-used { background: var(--accent); }
.bf-pending { background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 3px, #E0A64B 3px, #E0A64B 6px); }
.bf-over { background: var(--bad); }
.budget-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--text-3); }
.budget-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ============================ מגירה — מודולים ============================ */
.drawer-wide { width: min(640px, 97vw); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 13px 16px; }
.kv { min-width: 0; }
.kv small { display: block; color: var(--text-3); font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.kv b { font-size: 13.5px; font-weight: 500; word-break: break-word; }

.amount-panel { background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; }
.ap-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 13.5px; color: var(--text-2); gap: 14px; }
.ap-row .money { color: var(--text); }
.ap-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 16px; font-weight: 600; color: var(--text); }
.ap-pay { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 8px; }
.ap-pay b { color: var(--ok); font-weight: 600; }

.file-viewer { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.file-viewer-img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); display: block; }
.drawer-foot-actions { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line-2); padding: 12px 24px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }

/* ============================ כרטיסי ישות ============================ */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.entity-card { display: flex; flex-direction: column; gap: 13px; transition: border-color .14s, box-shadow .14s; }
.entity-card:hover { border-color: #CDD1D7; box-shadow: 0 2px 8px rgba(20, 22, 26, .06); }
.entity-head { display: flex; align-items: center; gap: 11px; }
.entity-ic { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.entity-head-txt { flex: 1; min-width: 0; }
.entity-head-txt b { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.entity-head-txt small { color: var(--text-3); font-size: 12px; display: block; font-family: var(--mono); }
.entity-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 4px; }
.entity-stats small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 500; margin-bottom: 2px; }
.entity-stats b { font-size: 13.5px; font-weight: 600; font-family: var(--mono); }
.entity-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; border-top: 1px solid var(--line-2); }

/* ============================ דשבורד ============================ */
.aging-list { display: flex; flex-direction: column; gap: 9px; }
.aging-row { display: flex; align-items: center; gap: 11px; }
.aging-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); min-width: 90px; }
.aging-track { flex: 1; height: 8px; background: var(--line-2); overflow: hidden; border-radius: 99px; }
.aging-fill { height: 100%; transition: width .45s ease; min-width: 2px; border-radius: 99px; }
.aging-val { font-size: 12.5px; font-weight: 500; min-width: 92px; text-align: end; font-family: var(--mono); }

.type-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.type-tile { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: start; transition: border-color .14s, background .14s; }
.type-tile:hover { border-color: #CDD1D7; background: var(--surface-2); }
.type-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; }
.type-txt { flex: 1; min-width: 0; }
.type-txt b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-txt small { color: var(--text-3); font-size: 11.5px; }
.type-sum { font-size: 13px; font-weight: 600; white-space: nowrap; }

.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: var(--surface-2); }
.mini-main { flex: 1; min-width: 0; }
.mini-main b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-main small { color: var(--text-3); font-size: 12px; }
.mini-end { text-align: end; white-space: nowrap; }

/* ============================ דוחות ותזרים ============================ */
.seg-badge { display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-family: var(--mono); line-height: 17px; margin-inline-start: 4px; }
.matrix th, .matrix td { white-space: nowrap; text-align: start; }
.matrix th .col-code { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); font-weight: 500; margin-bottom: 1px; }
.matrix .sticky-col { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 190px; box-shadow: -1px 0 0 var(--line-2) inset; }
.matrix thead .sticky-col { background: var(--surface); }
.matrix tfoot td { border-top: 1px solid var(--line); border-bottom: none; background: var(--surface-2); font-weight: 600; }
.matrix tfoot .sticky-col { background: var(--surface-2); }
.matrix .col-total { background: var(--surface-2); font-weight: 600; }
.matrix .cell-empty { color: #D0D4DA; }
.cell-pending { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--warn); margin-top: 2px; direction: ltr; }
.row-overdue td { background: var(--bad-soft); }
.row-overdue .sticky-col, .row-overdue .col-total { background: #F7DFDC; }
.row-click { cursor: pointer; }
.row-click:hover td { filter: brightness(.98); }
.matrix-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.txt-bad { color: var(--bad); }

/* ============================ ניהול משתמשים ============================ */
.role-list { display: flex; flex-direction: column; }
.role-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.role-row:last-child { border-bottom: none; }

/* ============================ כללי ============================ */
.inline-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 500; border: 1px solid var(--line-2); }
.inline-tag i { font-size: 9.5px; }
.link-btn { color: var(--accent); font-weight: 500; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.hint { color: var(--text-3); font-size: 12px; margin-top: 5px; display: block; line-height: 1.5; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.card-tight { padding: 0; overflow: hidden; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head .card-title { margin-bottom: 0; }

.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid-4 .stat-card { cursor: pointer; }

@media (max-width: 1250px) { .stats-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .upload-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .grid-2, .grid-3, .form-row-3, .form-row { grid-template-columns: 1fr; }
  .stats-grid-4 { grid-template-columns: 1fr 1fr; }
  .drawer-wide { width: 100%; }
  .seg-wrap { margin-inline-start: 0; width: 100%; }
  .rb-sep { display: none; }
}

/* ---------- תיק פרויקט ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.crumb:hover { color: var(--accent); }
.crumb i { font-size: 11px; }
.page-title .badge { font-size: 12px; margin-inline-start: 4px; vertical-align: middle; }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.ptab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .14s, border-color .14s; }
.ptab i { font-size: 12px; color: var(--text-3); }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.ptab.active i { color: var(--text); }
.ptab .chip-count { margin-inline-start: 2px; }
.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head b { font-size: 13.5px; font-weight: 600; }
.card-head small { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.pv-search { position: relative; margin-bottom: 14px; max-width: 420px; }
.pv-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 12.5px; pointer-events: none; }
.pv-search .form-input { padding-inline-start: 34px; }
.row-accepted td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
[dir="rtl"] .row-accepted td:first-child { box-shadow: inset -3px 0 0 var(--ok); }
.cmp-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.cmp-row { display: grid; grid-template-columns: 200px 1fr 130px; align-items: center; gap: 14px; }
.cmp-name b { display: block; font-size: 13px; font-weight: 500; }
.cmp-name small { color: var(--text-3); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cmp-fill { height: 100%; background: var(--text-3); border-radius: 99px; }
.cmp-fill.is-accepted { background: var(--ok); }
.cmp-val { text-align: end; font-weight: 600; font-size: 13.5px; }
.cmp-val small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }
@media (max-width: 1100px) { .stats-grid-5 { grid-template-columns: repeat(3, 1fr); } .two-col { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .stats-grid-5 { grid-template-columns: 1fr 1fr; } .cmp-row { grid-template-columns: 1fr; gap: 4px; } .cmp-val { text-align: start; } }

/* ============================================================
   מערכת החתימות — אימות זהות ובדיקת אמינות
   ============================================================ */
.sig-auth-intro { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.sig-auth-err {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--bad-soft); color: var(--bad); font-size: 12.5px;
}
.sig-note { color: var(--text-2); font-size: 12.5px; line-height: 1.6; margin: 14px 0 0; }
.sig-note.sig-bad { color: var(--bad); }

.sig-verdict {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: 12px; border: 1px solid transparent;
}
.sig-verdict i { font-size: 24px; flex: none; margin-top: 2px; }
.sig-verdict strong { display: block; font-size: 15px; margin-bottom: 4px; }
.sig-verdict span { font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.sig-verdict-ok   { background: var(--ok-soft); border-color: var(--ok); }
.sig-verdict-ok i, .sig-verdict-ok strong { color: var(--ok); }
.sig-verdict-bad  { background: var(--bad-soft); border-color: var(--bad); }
.sig-verdict-bad i, .sig-verdict-bad strong { color: var(--bad); }
.sig-verdict-none { background: var(--surface-2); border-color: var(--border); }
.sig-verdict-none i, .sig-verdict-none strong { color: var(--text-2); }

.sig-checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 2px; }
.sig-checks li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border-radius: 8px; background: var(--surface-2);
}
.sig-checks li i { flex: none; margin-top: 3px; font-size: 12px; }
.sig-checks li.ok i  { color: var(--ok); }
.sig-checks li.bad i { color: var(--bad); }
.sig-checks li strong { display: block; font-size: 13px; font-weight: 600; }
.sig-checks li span { font-size: 12px; color: var(--text-2); }
.sig-checks li.bad strong { color: var(--bad); }

.sig-meta { margin-top: 16px; display: grid; gap: 8px; }
.sig-meta > div { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sig-meta span { color: var(--text-3); flex: none; min-width: 90px; }
.sig-meta code {
  font-family: var(--mono); direction: ltr; unicode-bidi: embed;
  background: var(--surface-2); padding: 3px 8px; border-radius: 6px; font-size: 12px;
}
.sig-meta code.sig-hash { font-size: 10.5px; word-break: break-all; }

/* מקור הקריאה — שכבת טקסט מדויקת מול OCR על סריקה */
.extract-src { display: block; margin-top: 4px; color: var(--text-3); font-size: 11.5px; }
.extract-src.warn { color: var(--warn); }

/* ============================================================
   ספריית חתימות, חותמות ותבניות
   ============================================================ */
.sa-tabs { margin-bottom: 14px; }
.sa-tabs button i { margin-inline-end: 5px; font-size: 11px; }
.sa-empty { text-align: center; color: var(--text-3); padding: 24px 0; }
.sa-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sa-lib-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sa-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 8px; background: var(--surface); text-align: start;
}
.sa-card.is-default { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring); }
.sa-card > b { font-size: 13px; font-weight: 600; }
.sa-card .sa-preview { min-height: 84px; }
.sa-card .sa-preview img { max-height: 72px; }
.sa-name { padding: 5px 8px; font-size: 13px; }
.sa-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sa-default-badge { font-size: 11.5px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.sa-add {
  align-items: center; justify-content: center; min-height: 150px; cursor: pointer;
  border-style: dashed; color: var(--text-2); font-size: 13px; transition: all .14s;
}
.sa-add i { font-size: 18px; }
.sa-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* display:flex גובר על ברירת המחדל של [hidden] — צריך להחזיר אותה במפורש */
.sa-new[hidden] { display: none; }
.sa-new { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.sa-new-head { display: flex; align-items: center; gap: 10px; }
.sa-new-head b { white-space: nowrap; font-size: 13.5px; }
.sa-new .sa-pad { height: 140px; }
.sa-tip { color: var(--text-3); font-size: 12px; }

/* בחירה מתוך העורך */
.sa-pick-card { cursor: pointer; transition: all .14s; }
.sa-pick-card:hover { border-color: var(--accent); background: var(--accent-soft); }

/* תבניות */
.sa-tpl-canvas { max-width: 100%; max-height: 120px; height: auto; }
.sa-card .sa-tpl-prev { min-height: 110px; }
.sa-tpl-editor {
  margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; background: var(--surface-2);
}
.sa-tpl-fields { display: flex; flex-direction: column; gap: 4px; }
.sa-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sa-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sa-suggest .chip { font-size: 11.5px; padding: 3px 9px; }
.sa-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 6px 0 10px; font-size: 13px; }
.sa-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sa-tpl-side { display: flex; flex-direction: column; gap: 6px; }
.sa-tpl-live { min-height: 160px; flex: 1; }
@media (max-width: 760px) { .sa-tpl-editor, .sa-row2 { grid-template-columns: 1fr; } }
