/* دعوة تعبئة ملف الموظف الشامل — زر الصفحة والنافذة */
.efi-launcher { position: relative; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; }
.efi-lock { overflow: hidden; }

.efi-btn {
  border: 1px solid transparent; border-radius: 12px; padding: 8px 14px; font: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.4; white-space: nowrap;
}
.efi-btn:disabled { opacity: .5; cursor: not-allowed; }
.efi-btn-primary { background: #4338ca; color: #fff; }
.efi-btn-primary:hover:not(:disabled) { background: #3730a3; }
.efi-btn-soft { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.efi-btn-ghost { background: #fff; color: #334155; border-color: #e2e8f0; }
.efi-btn-ghost:hover:not(:disabled) { background: #f8fafc; }
.efi-btn-whatsapp { background: #16a34a; color: #fff; }
.efi-btn-whatsapp:hover:not(:disabled) { background: #15803d; }

.efi-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.efi-dialog {
  width: min(980px, 100%); max-height: calc(100vh - 32px); background: #f8fafc; border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); direction: rtl; color: #0f172a;
}
.efi-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; background: #fff; }
.efi-head h3 { margin: 0; font-size: 1.15rem; font-weight: 900; }
.efi-close { border: 0; background: #f1f5f9; border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.efi-tabs { display: flex; gap: 4px; padding: 0 18px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.efi-tabs button {
  border: 0; background: none; font: inherit; font-weight: 800; padding: 10px 14px; cursor: pointer; color: #64748b;
  border-bottom: 3px solid transparent;
}
.efi-tabs button.is-active { color: #4338ca; border-bottom-color: #4338ca; }
.efi-body { overflow-y: auto; padding: 16px 18px 18px; display: grid; gap: 12px; align-content: start; }

.efi-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.efi-steps button {
  width: 100%; border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 8px 10px; font: inherit;
  font-weight: 800; font-size: .88rem; cursor: pointer; display: flex; align-items: center; gap: 8px; color: #475569;
}
.efi-steps button.is-active { border-color: #4338ca; background: #eef2ff; color: #3730a3; }
.efi-step-num { width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; }
.efi-steps button.is-active .efi-step-num { background: #4338ca; color: #fff; }
.efi-chip { margin-inline-start: auto; background: #4338ca; color: #fff; border-radius: 999px; padding: 0 8px; font-size: .75rem; }

.efi-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.efi-panel h4 { margin: 0; font-size: .98rem; font-weight: 900; }
.efi-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.efi-between { justify-content: space-between; }
.efi-muted { color: #64748b; font-size: .85rem; margin: 0; font-weight: 500; }
.efi-input, .efi-panel select {
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .92rem; background: #fff; color: inherit;
  flex: 1 1 200px; min-width: 0;
}
.efi-panel select { flex: 0 1 auto; }
.efi-input:focus, .efi-panel select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
textarea.efi-input { width: 100%; resize: vertical; }
.efi-template { min-height: 220px; line-height: 1.8; }

.efi-list { max-height: 360px; overflow-y: auto; display: grid; gap: 6px; padding: 2px; }
.efi-person {
  display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; cursor: pointer; background: #fff;
}
.efi-person.is-selected { border-color: #a5b4fc; background: #f5f7ff; }
.efi-person.has-issue { border-color: #fca5a5; background: #fef2f2; }
.efi-person input { width: 18px; height: 18px; accent-color: #4338ca; flex-shrink: 0; }
.efi-person-main { display: grid; flex: 1; min-width: 0; }
.efi-person-main small { color: #64748b; font-size: .8rem; }
.efi-phone { font-size: .82rem; color: #475569; }
.efi-phone.is-missing { color: #b91c1c; font-weight: 700; }
.efi-issue { color: #b91c1c !important; font-weight: 700; }

.efi-groups { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.efi-group { border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 4px; }
.efi-group legend { font-weight: 900; color: #4338ca; padding: 0 6px; font-size: .9rem; }
.efi-checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.efi-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.efi-check input { width: 17px; height: 17px; accent-color: #4338ca; }
.efi-check.is-custom { color: #4338ca; font-weight: 700; }
.efi-grid2 { grid-template-columns: 1fr 1fr; align-items: end; }
.efi-span { grid-column: 1 / -1; }
.efi-field { display: grid; gap: 4px; font-weight: 700; font-size: .88rem; }

.efi-placeholders { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.efi-placeholders button { border: 1px dashed #a5b4fc; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.efi-preview summary { cursor: pointer; font-weight: 700; color: #4338ca; font-size: .88rem; }
.efi-preview pre { white-space: pre-wrap; font: inherit; font-size: .88rem; background: #ecfdf5; border-radius: 12px; padding: 12px; margin: 8px 0 0; }
.efi-summary { margin: 0; background: #f0fdf4; border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.efi-alert { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
.efi-alert ul { margin: 6px 0 0; padding-inline-start: 18px; }
.efi-progress { background: #eef2ff; color: #3730a3; border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: .9rem; }
.efi-footer { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.efi-empty { text-align: center; color: #64748b; padding: 24px; margin: 0; }

.efi-links { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.efi-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.efi-link-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: #f1f5f9; border-radius: 8px; padding: 4px 8px; font-size: .78rem; }

.efi-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.efi-stat { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 8px 10px; font: inherit; cursor: pointer; display: grid; text-align: start; }
.efi-stat span { font-size: .8rem; color: #64748b; font-weight: 700; }
.efi-stat strong { font-size: 1.4rem; font-weight: 900; }
.efi-stat.is-active { outline: 2px solid #4338ca; }
.efi-log { display: grid; gap: 8px; }
.efi-inv { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.efi-inv-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.efi-inv-head > div { display: grid; }
.efi-inv-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .82rem; color: #475569; }
.efi-badge { border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.efi-badge.is-pending, .efi-stat.is-pending strong { color: #b45309; }
.efi-badge.is-pending { background: #fffbeb; }
.efi-badge.is-ok, .efi-stat.is-ok strong { color: #047857; }
.efi-badge.is-ok { background: #ecfdf5; }
.efi-badge.is-muted { background: #f1f5f9; color: #64748b; }
.efi-submitted { border-top: 1px dashed #e2e8f0; padding-top: 8px; display: grid; gap: 8px; }
.efi-submitted dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.efi-submitted dt { font-size: .78rem; color: #64748b; }
.efi-submitted dd { margin: 0; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; white-space: pre-line; }
.efi-files { margin: 0; padding-inline-start: 18px; font-size: .88rem; display: grid; gap: 4px; }
.efi-files a { color: #4338ca; }

.efi-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2100; background: #0f172a; color: #fff;
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px);
}
.efi-toast.is-error { background: #b91c1c; }

@media (max-width: 640px) {
  .efi-overlay { padding: 0; align-items: stretch; }
  .efi-dialog { max-height: 100vh; border-radius: 0; }
  .efi-steps { grid-template-columns: 1fr; }
  .efi-grid2 { grid-template-columns: 1fr; }
  .efi-stats { grid-template-columns: repeat(2, 1fr); }
  .efi-footer .efi-row { width: 100%; }
  .efi-footer .efi-btn { flex: 1; justify-content: center; white-space: normal; }
}
