/* =====================================================================
   תשים לרבי CRM - עיצוב הממשק (סגנון דשבורד מודרני בהיר)
   ===================================================================== */

:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --border: #eceef5;
  --border-soft: #f2f3f8;
  --text: #1f2438;
  --text-soft: #6b7280;
  --text-faint: #9ca3b4;

  --primary: #7c5cfc;
  --primary-strong: #6943f5;
  --primary-soft: #efeafe;

  --violet: #8b5cf6;
  --green: #10b981;
  --green-soft: #d8f5ea;
  --gold: #f59e0b;
  --gold-soft: #fdf0d5;
  --blue: #3b82f6;
  --blue-soft: #dce9fd;
  --pink: #ec4899;
  --pink-soft: #fbe0ee;
  --red: #ef4444;
  --red-soft: #fde2e2;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 36, 56, 0.04), 0 6px 18px rgba(31, 36, 56, 0.05);
  --shadow-md: 0 8px 28px rgba(31, 36, 56, 0.08);
  --shadow-lg: 0 18px 48px rgba(31, 36, 56, 0.18);

  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
svg { display: block; }

/* ============================ מסך התחברות ============================ */

.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1100px 520px at 80% -10%, rgba(124, 92, 252, 0.55), transparent 60%),
    radial-gradient(900px 520px at 15% 110%, rgba(236, 72, 153, 0.35), transparent 60%),
    #1c1640;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 404px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 44px 38px 30px;
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.login-logo { text-align: center; margin-bottom: 30px; }

.logo-img {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  display: block;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

.logo-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), #b06cf6);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(124, 92, 252, 0.4);
}

.login-logo h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.4px; }
.login-logo p { color: var(--text-soft); margin-top: 5px; font-size: 14px; }

.login-card label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--text-soft);
}

.login-card input { width: 100%; margin-bottom: 16px; }

.login-error {
  margin-top: 14px;
  text-align: center;
  color: var(--red);
  font-size: 13.5px;
  font-weight: 600;
}

.login-footnote {
  margin-top: 26px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}

/* ============================ מבנה כללי ============================ */

.app { display: flex; min-height: 100vh; }

/* --- סרגל צד --- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 22px;
}

.logo-dots {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #b06cf6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 9px;
  box-shadow: 0 8px 18px rgba(124, 92, 252, 0.35);
}
.logo-dots span { background: #fff; border-radius: 50%; opacity: 0.95; }
.logo-dots span:nth-child(2) { opacity: 0.6; }
.logo-dots span:nth-child(3) { opacity: 0.6; }

.sidebar-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo strong { font-size: 21px; font-weight: 800; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item svg { width: 20px; height: 20px; stroke-width: 1.9; flex-shrink: 0; }

.nav-item:hover { background: var(--border-soft); color: var(--text); }

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

/* כרטיס שדרוג בתחתית */
.upgrade-card {
  margin-top: 14px;
  background: linear-gradient(160deg, #f3effe, #fbeaf4);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
}
.upgrade-card .rocket { font-size: 26px; }
.upgrade-card strong { display: block; font-size: 14px; margin-top: 6px; }
.upgrade-card p { font-size: 11.5px; color: var(--text-soft); margin: 5px 0 11px; line-height: 1.5; }
.upgrade-card .btn { width: 100%; }

/* --- אזור ראשי --- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 30px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(244, 245, 250, 0.85);
  backdrop-filter: blur(10px);
}

.topbar-greeting { min-width: 0; }
.topbar-greeting h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; }
.topbar-greeting p { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.topbar-search {
  flex: 1;
  max-width: 420px;
  margin-inline: auto;
  position: relative;
}
.topbar-search svg {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-faint);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  border-radius: 999px;
  padding-inline-start: 44px;
  background: var(--surface);
  border-color: var(--surface);
  box-shadow: var(--shadow);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: transform 0.1s, color 0.15s;
  position: relative;
}
.icon-btn:hover { color: var(--primary); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.spinning { color: var(--primary); pointer-events: none; }
.icon-btn.spinning svg { animation: icon-spin 0.7s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.icon-btn.primary {
  background: linear-gradient(135deg, var(--primary), #9a6cfb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(124, 92, 252, 0.4);
}
.icon-btn .dot {
  position: absolute;
  top: 10px;
  inset-inline-end: 11px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--surface);
}

.avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
}
.avatar .avatar-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #b06cf6);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar span { font-size: 13.5px; font-weight: 600; }
.avatar svg { width: 15px; height: 15px; color: var(--text-faint); }

.view-container { padding: 8px 30px 44px; }

/* ============================ רכיבי טופס ============================ */

input, select, textarea {
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.14);
  background: #fff;
}

.btn {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #9a6cfb);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 92, 252, 0.34);
}
.btn-primary:hover { box-shadow: 0 9px 22px rgba(124, 92, 252, 0.46); }

.btn-outline { background: var(--surface); color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary-soft); }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbcaca; }

.btn-ghost { background: var(--surface); color: var(--primary-strong); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--primary-soft); }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ============================ כרטיסי סטטיסטיקה ============================ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 25px; height: 25px; }

.stat-card .stat-body { min-width: 0; flex: 1; }
.stat-card .stat-label { color: var(--text-soft); font-size: 13.5px; font-weight: 500; }
.stat-card .stat-value { font-size: 27px; font-weight: 800; letter-spacing: -0.6px; margin: 1px 0 4px; }

.stat-trend { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend + .stat-sub { color: var(--text-faint); font-size: 11.5px; font-weight: 500; margin-inline-start: 5px; }

.icon-violet { background: var(--primary-soft); color: var(--primary-strong); }
.icon-green { background: var(--green-soft); color: var(--green); }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.icon-gold { background: var(--gold-soft); color: var(--gold); }
.icon-pink { background: var(--pink-soft); color: var(--pink); }

/* ============================ פאנלים ============================ */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  flex-wrap: wrap;
}
.panel-header .panel-title { display: flex; align-items: center; gap: 9px; }
.panel-header h3 { font-size: 16px; font-weight: 700; }
.panel-header .count-badge {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
}
.panel-header .panel-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel-header .link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.panel-header .link:hover { text-decoration: underline; }

.panel-body { padding: 0 22px 22px; }
.panel-divider { border-top: 1px solid var(--border); }

/* ============================ טבלאות ============================ */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: right;
  padding: 13px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: #fafbfd;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 12.5px;
}
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: none; }

.empty-row { text-align: center; color: var(--text-faint); padding: 40px !important; }

/* ============================ badges ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--primary-soft); color: var(--primary-strong); }
.badge-gray { background: #eef0f6; color: var(--text-soft); }
.badge-amber { background: #fef3c7; color: #b45309; }

.tag-chip {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  margin-inline-end: 4px;
}

/* תא מתקפל לתגיות/קמפיינים בטבלת הלידים */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cell-collapse {
  display: inline-block;
}
.cell-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fafbff;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted, #475569);
  white-space: nowrap;
  user-select: none;
}
.cell-collapse > summary::-webkit-details-marker { display: none; }
.cell-collapse > summary::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.7;
}
.cell-collapse[open] > summary::after { content: '▴'; }
.cell-collapse > summary:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}
.chip-count {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  padding: 0 5px;
  font-weight: 700;
}
.chip-list-open {
  margin-top: 6px;
  max-width: 240px;
}

.panel-sub { font-size: 12px; color: var(--text-faint); font-weight: 600; }

/* פעילות אחרונה מתקפלת בדשבורד */
.activity-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.activity-collapse > summary::-webkit-details-marker { display: none; }
.activity-collapse > summary .ac-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.activity-collapse > summary .ac-label svg { width: 18px; height: 18px; }
.activity-collapse > summary .ac-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-strong);
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 999px;
}
.activity-collapse:not([open]) > summary .ac-hint::after { content: 'הצג ▼'; }
.activity-collapse[open] > summary .ac-hint::after { content: 'הסתר ▲'; }
.activity-collapse[open] > summary .ac-hint { background: #eef0f8; color: var(--text-soft); }

/* רשימת תגיות לבחירה מרובה (ייצוא לפי תגים) */
.tag-picker { display: block; }
.tag-none { font-size: 13px; color: var(--text-faint); font-weight: 600; }
.tag-none-row { border-bottom: 1px dashed var(--border); border-radius: 0; margin-bottom: 2px; }
.tag-search-input {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
.tag-search-input:focus { outline: none; border-color: var(--primary, #6366f1); }
.tag-toggle-more { margin-top: 6px; width: 100%; }
.tag-check[hidden] { display: none; }
.tag-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
  background: #fafbff;
}
.tag-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.tag-check:hover { background: #eef0f8; }
.tag-check input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
.tag-check-count {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}

/* עורך תגיות (מודאל עריכת ליד) */
.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbff;
}
.tag-chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-end: 0;
}
.tag-x {
  border: none;
  background: transparent;
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  font-weight: 700;
}
.tag-x:hover { color: var(--red); }
.muted-note { color: var(--text-soft); font-size: 12.5px; }

.tag-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-quick-btn {
  border: 1px dashed var(--border);
  background: #fff;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-quick-btn:hover { border-color: var(--primary); color: var(--primary-strong); }
.tag-quick-btn.active { background: var(--primary-soft); color: var(--primary-strong); border-style: solid; border-color: var(--primary); }

.tag-add-row { display: flex; gap: 8px; align-items: center; }
.tag-add-row input, .tag-add-row select { flex: 1; }
.tag-code-hint {
  font-size: 10px;
  opacity: 0.65;
  font-weight: 500;
  font-family: ui-monospace, monospace;
}
.tag-code-cell {
  font-size: 12px;
  background: #f3f4f8;
  padding: 2px 6px;
  border-radius: 4px;
}
.panel-desc {
  padding: 0 24px 12px;
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.55;
}
.panel-desc code {
  font-size: 12px;
  background: #f3f4f8;
  padding: 1px 5px;
  border-radius: 4px;
}
.readonly-field {
  background: #f3f4f8 !important;
  color: var(--text-soft);
  cursor: default;
}

.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: #eef0f7; overflow: hidden; min-width: 110px; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #b06cf6); transition: width 0.5s ease; }
.progress-fill.gold { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-label { font-size: 12px; color: var(--text-soft); margin-top: 5px; }

/* פילטרים */
.filters-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.filters-bar input[type="search"] { max-width: 300px; }
.filters-bar select { width: auto; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; }
.pagination .page-info { color: var(--text-soft); font-size: 13.5px; }

/* ============================ דשבורד ============================ */

.dash-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 18px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-col .panel { margin-bottom: 0; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

/* גרף קווי */
.chart-card .panel-body { padding-bottom: 14px; }
.line-chart { width: 100%; height: auto; display: block; }
.chart-wrap { position: relative; }
.chart-guide {
  position: absolute;
  top: 6%;
  bottom: 13%;
  width: 1px;
  background: rgba(124, 92, 252, 0.45);
  pointer-events: none;
  transform: translateX(-0.5px);
}
.chart-tip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  background: #1e2333;
  color: #fff;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  z-index: 5;
}
.chart-tip .ct-date { font-weight: 700; margin-bottom: 4px; opacity: 0.85; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .ct-row span:nth-of-type(1) { flex: none; }
.chart-tip .ct-row span:nth-of-type(2) { opacity: 0.8; }
.chart-tip .ct-row b { margin-inline-start: auto; padding-inline-start: 10px; }
.chart-tip .ct-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-legend { display: flex; gap: 18px; align-items: center; }
.chart-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.chart-legend .lg i { width: 22px; height: 4px; border-radius: 999px; display: inline-block; }

/* רשימת פעילות (סגנון "משימות קרובות") */
.activity-list { list-style: none; }
.activity-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
}
.activity-list li:first-child { border-top: none; }
.activity-ico {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-ico svg { width: 18px; height: 18px; }
.activity-main { flex: 1; min-width: 0; }
.activity-main .a-title { font-size: 13.5px; font-weight: 600; }
.activity-main .a-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.activity-list time { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }

/* צינור / פייפליין */
.pipeline { display: flex; gap: 14px; overflow-x: auto; padding: 4px 22px 18px; }
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 22px 18px;
}
@media (max-width: 640px) { .campaign-grid { grid-template-columns: 1fr; } }
.pipe-col {
  flex: 1 1 180px;
  max-width: 260px;
  background: #fafbfd;
  border-radius: 14px;
  padding: 12px;
}
.pipe-col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; margin-bottom: 11px;
  padding: 0 4px;
}
.pipe-col-head .count-badge { background: #fff; }
.pipe-card {
  background: var(--surface);
  border-radius: 11px;
  padding: 12px 13px;
  box-shadow: 0 1px 2px rgba(31, 36, 56, 0.05);
  margin-bottom: 9px;
  border-inline-start: 3px solid var(--primary);
}
.pipe-card.gold { border-inline-start-color: var(--gold); }
.pipe-card.green { border-inline-start-color: var(--green); }
.pipe-card.blue { border-inline-start-color: var(--blue); }
.pipe-card .pc-title { font-size: 13.5px; font-weight: 700; }
.pipe-card .pc-meta { font-size: 12px; color: var(--text-soft); margin-top: 4px; display: flex; justify-content: space-between; }
.pipe-card .pc-val { color: var(--primary-strong); font-weight: 700; }
.pipe-empty { font-size: 12.5px; color: var(--text-faint); text-align: center; padding: 14px 0; }

/* דונאט */
.donut-wrap { display: flex; align-items: center; gap: 20px; padding: 6px 22px 18px; flex-wrap: wrap; justify-content: center; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut .donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.donut .donut-center strong { font-size: 22px; font-weight: 800; }
.donut .donut-center span { font-size: 11px; color: var(--text-faint); }
.donut-legend { list-style: none; flex: 1; min-width: 150px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend .dl-name { flex: 1; color: var(--text-soft); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .dl-pct { font-weight: 700; }

/* כרטיס מצב/תזכורת */
.status-card { text-align: center; padding: 22px; }
.status-card .status-ico {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.status-card .status-ico svg { width: 28px; height: 28px; }
.status-card strong { display: block; font-size: 15px; }
.status-card p { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; }

/* ============================ מודאל ============================ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 22, 40, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 14px; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  border: none; background: #f1f3f9;
  width: 32px; height: 32px; border-radius: 9px;
  font-size: 18px; cursor: pointer; color: var(--text-soft); line-height: 1;
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-body { padding: 8px 24px 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-actions .btn { flex: 1; }
.modal-note { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.6; }
.export-section { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border, #e5e7eb); }
.export-section[hidden] { display: none; }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: 12px; padding: 22px;
  text-align: center; color: var(--text-soft);
  cursor: pointer; font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input { display: none; }
.file-drop .file-name { font-weight: 700; color: var(--primary-strong); }

/* ============================ Toast ============================ */

.toast-container { position: fixed; bottom: 24px; left: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px;
  background: #1f2438; color: #fff;
  padding: 14px 18px; border-radius: 13px;
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.3s ease;
  border-inline-start: 4px solid var(--primary);
}
.toast.success { border-inline-start-color: var(--green); }
.toast.error { border-inline-start-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================ loader ============================ */

.loader { display: flex; justify-content: center; padding: 56px; }
.loader::after {
  content: '';
  width: 36px; height: 36px; border-radius: 50%;
  border: 3.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ רספונסיב ============================ */

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    overflow-x: auto; padding: 12px;
    border-inline-start: none; border-bottom: 1px solid var(--border);
  }
  .sidebar-logo { padding: 0 10px 0 0; }
  .sidebar-nav { flex-direction: row; margin-top: 0; }
  .nav-item span:not(.nav-icon) { display: none; }
  .nav-item.active::before { display: none; }
  .upgrade-card { display: none; }
  .topbar { flex-wrap: wrap; padding: 14px 16px; }
  .topbar-search { order: 3; max-width: none; flex-basis: 100%; margin: 4px 0 0; }
  .view-container { padding: 8px 16px 40px; }
}
