/* EleForm Public — Marketer Dashboard (RTL/Persian) */
:root {
  --efp-bg:      #f1f5f9;
  --efp-card:    #ffffff;
  --efp-border:  #e2e8f0;
  --efp-text:    #1e293b;
  --efp-muted:   #64748b;
  --efp-radius:  14px;
  --efp-shadow:  0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);
  --efp-shadow-md: 0 4px 16px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; }

.efp-wrap {
  direction: rtl;
  font-family: 'Tahoma','IRANSans',Tahoma,Arial,sans-serif;
  color: var(--efp-text);
  background: var(--efp-bg);
  min-height: 100vh;
  padding: 0 0 40px;
}

/* ── Header ── */
.efp-header {
  background: var(--efp-card);
  border-bottom: 1px solid var(--efp-border);
  margin-bottom: 24px;
  box-shadow: var(--efp-shadow);
}
.efp-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.efp-avatar {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  flex-shrink: 0;
}
.efp-header-text { flex: 1; min-width: 0; }
.efp-header-text h1 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.efp-header-text p  { margin: 4px 0 0; font-size: .82rem; color: var(--efp-muted); }
.efp-header-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */
.efp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: .875rem;
  font-weight: 600; cursor: pointer; border: 1.5px solid currentColor;
  text-decoration: none; transition: all .15s;
  font-family: inherit;
}
.efp-btn-outline { background: transparent; }
.efp-btn-outline:hover { opacity: .75; }
.efp-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Content max-width ── */
.efp-kpi-grid, .efp-card, .efp-charts-row {
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}

/* ── KPI ── */
.efp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  padding-top: 0;
}
.efp-kpi {
  background: var(--efp-card);
  border-radius: var(--efp-radius);
  padding: 20px 18px;
  box-shadow: var(--efp-shadow);
  border: 1px solid var(--efp-border);
  transition: box-shadow .15s;
}
.efp-kpi:hover { box-shadow: var(--efp-shadow-md); }
.efp-kpi-val   { font-size: 2rem; font-weight: 800; line-height: 1; }
.efp-kpi-label { font-size: .78rem; color: var(--efp-muted); margin-top: 6px; }

/* ── Card ── */
.efp-card {
  background: var(--efp-card);
  border-radius: var(--efp-radius);
  box-shadow: var(--efp-shadow);
  border: 1px solid var(--efp-border);
  margin-bottom: 20px;
  overflow: hidden;
}
.efp-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--efp-border);
  flex-wrap: wrap; gap: 10px;
}
.efp-card-head h3 { margin: 0; font-size: .95rem; font-weight: 700; display: flex; align-items: center; }
.efp-head-right   { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Goal bar ── */
.efp-goal-body     { padding: 16px 20px; }
.efp-goal-bar-wrap { margin-bottom: 10px; }
.efp-goal-bar      { height: 28px; border-radius: 14px; overflow: hidden; position: relative; }
.efp-goal-fill     { height: 100%; border-radius: 14px; transition: width 1s ease; display: flex; align-items: center; justify-content: flex-end; padding-left: 10px; }
.efp-goal-fill span { font-size: .78rem; font-weight: 700; color: #fff; }
.efp-goal-numbers  { display: flex; justify-content: space-between; font-size: .82rem; color: var(--efp-muted); }

/* ── Charts ── */
.efp-charts-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding-right: 20px; padding-left: 20px;
  max-width: 1200px; margin: 0 auto 20px;
}
.efp-chart-card    { flex: 2; padding: 16px 20px; min-width: 0; }
.efp-chart-sm      { flex: 1; padding: 16px 20px; }

/* ── Table ── */
.efp-table-wrap { overflow-x: auto; }
.efp-table {
  width: 100%; border-collapse: collapse; font-size: .85rem;
}
.efp-table th {
  background: #f8fafc; padding: 10px 14px;
  text-align: right; font-weight: 600;
  color: var(--efp-muted); font-size: .76rem;
  text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--efp-border); white-space: nowrap;
}
.efp-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.efp-table tbody tr:last-child td { border-bottom: none; }
.efp-table tbody tr:hover td { background: #fafbfd; }
.efp-table tbody tr.efp-new { animation: efp-flash .5s ease; }
@keyframes efp-flash { from { background: #eff6ff; } to { background: transparent; } }

/* ── Misc ── */
.efp-dot  { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; vertical-align: middle; flex-shrink: 0; }
.efp-tag  { background: #f1f5f9; border-radius: 6px; padding: 3px 8px; font-size: .76rem; color: var(--efp-muted); }
.efp-phone { font-family: 'Courier New',monospace; font-weight: 600; direction: ltr; text-align: right; letter-spacing: .05em; }
.efp-time  { font-size: .8rem; color: var(--efp-muted); white-space: nowrap; }
.efp-badge-count { background: #f1f5f9; border: 1px solid var(--efp-border); border-radius: 20px; padding: 4px 12px; font-size: .78rem; font-weight: 600; color: var(--efp-muted); white-space: nowrap; }
.efp-conv  { font-weight: 600; padding: 2px 6px; border-radius: 5px; font-size: .8rem; }
.efp-conv.good { background: #dcfce7; color: #15803d; }
.efp-conv.avg  { background: #fef9c3; color: #92400e; }
.efp-conv.low  { background: #fee2e2; color: #b91c1c; }

/* ── Progress bar inline ── */
.efp-bar      { display: inline-block; width: 60px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; vertical-align: middle; margin-left: 6px; }
.efp-bar-fill { height: 100%; border-radius: 3px; }
.efp-bar-pct  { font-size: .75rem; color: var(--efp-muted); }

/* ── Form chips ── */
.efp-form-chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.efp-form-chip  { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--efp-border); border-radius: 8px; padding: 8px 14px; }
.efp-form-name  { font-size: .84rem; font-weight: 600; }
.efp-form-cnt   { border-radius: 20px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }

/* ── Live badge ── */
.efp-live-badge { display: inline-flex; align-items: center; gap: 6px; background: #dcfce7; color: #15803d; border-radius: 20px; padding: 5px 12px; font-size: .78rem; font-weight: 600; }
.efp-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; position: relative; }
.efp-pulse::before { content: ''; position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; border-radius: 50%; background: rgba(16,185,129,.3); animation: efp-pulse 1.4s infinite; }
@keyframes efp-pulse { 0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.6);opacity:0} }

/* ── Inputs ── */
.efp-input { border: 1px solid var(--efp-border); border-radius: 8px; padding: 7px 10px; font-size: .82rem; font-family: inherit; background: var(--efp-card); color: var(--efp-text); }
.efp-input:focus { outline: none; border-color: #6366f1; }
.efp-input-sm { max-width: 140px; }

/* ── Error ── */
.efp-error { color: #b91c1c; background: #fee2e2; padding: 12px 16px; border-radius: 8px; font-size: .9rem; }

/* ── Toast ── */
.efp-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e293b; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: .85rem; opacity: 0; transition: all .3s; z-index: 9999; direction: rtl; font-family: Tahoma,sans-serif; pointer-events: none; }
.efp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .efp-kpi-grid { grid-template-columns: 1fr 1fr; }
  .efp-charts-row { flex-direction: column; }
  .efp-chart-card, .efp-chart-sm { flex: unset; width: 100%; }
  .efp-header-inner { flex-wrap: wrap; }
  .efp-input-sm { max-width: 110px; }
}
@media (max-width: 480px) {
  .efp-kpi-grid { grid-template-columns: 1fr; }
  .efp-kpi-val { font-size: 1.6rem; }
  .efp-head-right { width: 100%; }
  .efp-header-actions { width: 100%; }
}

/* ── Login form ── */
.efp-login-wrap {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--efp-bg);
}
.efp-login-box {
  background: var(--efp-card); border-radius: 18px;
  box-shadow: var(--efp-shadow-md); padding: 40px 36px;
  width: 100%; max-width: 400px; text-align: center;
  border: 1px solid var(--efp-border);
}
.efp-login-logo {
  width: 60px; height: 60px; background: #6366f115; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.efp-login-logo svg { width: 30px; height: 30px; fill: #6366f1; }
.efp-login-box h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 700; }
.efp-login-box p  { margin: 0 0 24px; font-size: .85rem; color: var(--efp-muted); }
.efp-login-field  { text-align: right; margin-bottom: 16px; }
.efp-login-field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.efp-login-input  {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--efp-border);
  border-radius: 10px; font-size: .9rem; font-family: inherit;
  transition: border .15s; background: var(--efp-bg);
}
.efp-login-input:focus { outline: none; border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.efp-pw-wrap { position: relative; }
.efp-pw-wrap .efp-login-input { padding-left: 42px; }
.efp-toggle-pw {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--efp-muted); padding: 4px;
  display: flex; align-items: center;
}
.efp-toggle-pw svg { width: 18px; height: 18px; fill: currentColor; }
.efp-login-btn {
  width: 100%; padding: 12px; background: #6366f1; color: #fff;
  border: none; border-radius: 10px; font-size: .95rem; font-weight: 700;
  cursor: pointer; margin-top: 8px; font-family: inherit; transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.efp-login-btn:hover { background: #4f46e5; }
.efp-login-btn:disabled { opacity: .7; cursor: not-allowed; }
.efp-login-error {
  background: #fee2e2; color: #b91c1c; border-radius: 8px;
  padding: 10px 14px; font-size: .83rem; margin-bottom: 14px;
  border: 1px solid #fecaca; text-align: right;
}

/* ── Logout link ── */
.efp-logout-link { font-size: .8rem; color: var(--efp-muted); text-decoration: none; }
.efp-logout-link:hover { color: #ef4444; }
