/* ═══════════════════════════════════════════════════════════════
   LeadSaver Admin — Premium Light Dashboard Theme
   Version 4.0 · 2026
   ═══════════════════════════════════════════════════════════════ */

/* ─── Font Imports ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Heebo:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Core Backgrounds — cool-slate ladder so white cards lift cleanly */
  --bg-main:        #f4f6fa;
  --bg-sidebar:     #f7f9fc;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f5f7fa;
  --bg-input:       #ffffff;
  --bg-elevated:    #ffffff;

  /* Accent — Premium Green Brand (rationed: primary action + active nav + focus) */
  --accent:         #017d63;
  --accent-glow:    rgba(1, 125, 99, 0.18);
  --accent-light:   rgba(1, 125, 99, 0.08);
  --accent-dark:    #016450;
  --accent-gradient: #017d63;

  /* Semantic Colors */
  --success:        #22c55e;
  --success-light:  rgba(34, 197, 94, 0.1);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.1);
  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, 0.08);
  --sky:            #38bdf8;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  --text-heading:   #0f172a;
  --text-body:      #334155;

  /* Borders — hairline, 'felt not seen' */
  --border:         rgba(15, 23, 42, 0.07);
  --border-hover:   rgba(15, 23, 42, 0.12);
  --border-strong:  #cbd5e1;
  --border-focus:   rgba(1, 125, 99, 0.40);

  /* Shadows — multi-layer, slate-tinted; assigned by role (sm rest / md hover / lg popover / xl modal) */
  --shadow-sm:      0 1px 1px rgba(16, 24, 40, 0.04), 0 2px 4px rgba(16, 24, 40, 0.05);
  --shadow-md:      0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg:      0 12px 20px -6px rgba(16, 24, 40, 0.08), 0 6px 10px -4px rgba(16, 24, 40, 0.05);
  --shadow-xl:      0 24px 48px -12px rgba(16, 24, 40, 0.18), 0 8px 16px -8px rgba(16, 24, 40, 0.10);
  --shadow-glow:    var(--shadow-sm);
  --card-top-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  /* Radii — small controls, larger surfaces */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-pill:    9999px;

  /* Spacing scale (4px base) */
  --space-1:        4px;
  --space-2:        8px;
  --space-3:        12px;
  --space-4:        16px;
  --space-5:        20px;
  --space-6:        24px;
  --space-8:        32px;

  /* Type scale + line-heights */
  --fs-xs:          12px;
  --fs-sm:          13px;
  --fs-base:        14px;
  --fs-md:          16px;
  --fs-lg:          20px;
  --fs-xl:          24px;
  --fs-2xl:         30px;
  --lh-body:        1.65;
  --lh-heading:     1.32;

  /* Font weights (graded — no blanket 700) */
  --fw-body:        400;
  --fw-medium:      500;
  --fw-semibold:    600;
  --fw-bold:        700;

  /* Transitions — faster, less bouncy */
  --transition:     0.18s cubic-bezier(0.2, 0.7, 0.3, 1);

  /* Sidebar */
  --sidebar-width:  280px;
  --sidebar-collapsed: 68px;

  /* Legacy compat vars (used by inline styles in HTML) */
  --primary:        #017d63;
  --primary-dark:   #016450;
  --primary-light:  rgba(1, 125, 99, 0.1);
  --surface:        #ffffff;
  --surface-2:      #f5f7fa;
  --bg:             #f4f6fa;
  --bg-color:       #ffffff;
  --bg-secondary:   #f5f7fa;
  --bg-hover:       #f4f6fa;
  --color-primary:  #017d63;
  --border-color:   rgba(15, 23, 42, 0.07);
  --text-color:     #0f172a;
  --text:           #0f172a;
  --color-danger:   #ef4444;
}

/* ═══ Dark Mode ═══════════════════════════════════════════════
   מופעל ע"י data-theme="dark" על <html>. דורס את משתני הצבע בלבד
   כדי לשמור על אותו עיצוב עם פלטה כהה ופרימיום. */
html[data-theme="dark"] {
  /* Surface ladder — main < sidebar < card < elevated carries elevation */
  --bg-main:        #0c1116;
  --bg-sidebar:     #10161d;
  --bg-card:        #161d26;
  --bg-card-hover:  #1d2632;
  --bg-input:       #1e2b38;
  --bg-elevated:    #202b38;

  --accent:         #1fb389;
  --accent-dark:    #17a07a;
  --accent-gradient: #1fb389;
  --accent-glow:    rgba(31, 179, 137, 0.16);
  --accent-light:   rgba(31, 179, 137, 0.14);
  --border-focus:   rgba(31, 179, 137, 0.45);

  --success-light:  rgba(34, 197, 94, 0.16);
  --warning-light:  rgba(245, 158, 11, 0.16);
  --danger-light:   rgba(239, 68, 68, 0.16);

  --text-primary:   #e9edef;
  --text-secondary: #aebac1;
  --text-muted:     #94a3b8;
  --text-heading:   #ffffff;
  --text-body:      #cfd9de;

  /* Single low-contrast hairline; cards lean on the inset ring + ladder */
  --border:         #222d39;
  --border-hover:   #2e3b49;
  --border-strong:  #2e3b49;

  /* Reserve heavy drops for true overlays; resting cards use the inset-ring recipe (L3) */
  --shadow-sm:      0 2px 4px rgba(0, 0, 0, 0.40);
  --shadow-md:      0 2px 4px rgba(0, 0, 0, 0.40), 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:      0 4px 12px rgba(0, 0, 0, 0.50), 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-xl:      0 8px 24px rgba(8, 9, 10, 0.55), 0 24px 56px rgba(0, 0, 0, 0.6);
  --card-top-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* Legacy compat vars */
  --primary:        #1fb389;
  --primary-dark:   #17a07a;
  --color-primary:  #1fb389;
  --surface:        #161d26;
  --surface-2:      #202b38;
  --bg:             #0c1116;
  --bg-color:       #161d26;
  --bg-secondary:   #202b38;
  --bg-hover:       #1d2632;
  --border-color:   #222d39;
  --text-color:     #e9edef;
  --text:           #e9edef;
}
/* מעבר חלק בין מצבים */
html[data-theme="dark"] body,
body { transition: background-color 0.3s ease, color 0.3s ease; }

/* Dark cards — crisp 'milled' inset ring + the surface ladder carry depth (Linear-style),
   instead of heavy drop shadows. Resting state only; overlays keep their drop shadows. */
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .sales-kpi-card,
html[data-theme="dark"] .crm-card,
html[data-theme="dark"] .kanban-card {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .kpi-card:hover,
html[data-theme="dark"] .sales-kpi-card:hover,
html[data-theme="dark"] .crm-card:hover,
html[data-theme="dark"] .kanban-card:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* Crisper text + tabular numerals on every metric/count so digits stop jittering */
body { text-rendering: optimizeLegibility; }
.stat-value, .kpi-value, .sales-kpi-value, .crm-col-count, .kanban-count,
.crm-card-deal, .crm-card-due, .lead-score-badge, .kpi-sub, .roi-value,
.dash-kpi-value, .funnel-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
/* Hero metrics earn a touch of optical tightening */
.stat-value, .kpi-value, .sales-kpi-value, .dash-kpi-value {
  letter-spacing: -0.02em;
}

/* Dark-mode overrides — ממוקד לאזור הדשבורד בלבד (#app-dashboard),
   כדי לתקן אלמנטים שמשתמשים בצבעים קשיחים אך אינם חלק מדף הנחיתה.
   דף הנחיתה (.landing-page) נשאר תמיד בהיר בכוונה ולא מושפע. */
html[data-theme="dark"] #app-dashboard .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
html[data-theme="dark"] #app-dashboard .btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
/* כפתורי המודלים (אישור/ביטול) שיורשים מסגנון landing */
html[data-theme="dark"] .modal-box .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
html[data-theme="dark"] .modal-box .btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
/* Light: demote dashboard/modal secondary buttons to a soft neutral fill
   (rations the brand green; kills the stale #128C7E teal outline inherited from landing). */
#app-dashboard .btn-secondary,
.modal-box .btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}
#app-dashboard .btn-secondary:hover,
.modal-box .btn-secondary:hover {
  background: var(--bg-main);
  border-color: var(--border-hover);
  color: var(--text-primary);
  box-shadow: none;
}
/* תיבות קלט כלליות בתוך הדשבורד */
html[data-theme="dark"] #app-dashboard input,
html[data-theme="dark"] #app-dashboard textarea,
html[data-theme="dark"] #app-dashboard select {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}
/* כרטיסים ואלמנטים עם רקע לבן קשיח שנותרו */
html[data-theme="dark"] #app-dashboard .card,
html[data-theme="dark"] #app-dashboard .stat-card,
html[data-theme="dark"] #app-dashboard section.card {
  background: var(--bg-card);
  border-color: var(--border);
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Heebo', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-body);
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  right: 14px;
  top: 14px;
  bottom: 14px;
  width: calc(var(--sidebar-width) - 28px);
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 20px 44px -18px rgba(16, 24, 40, 0.22);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

html[data-theme="dark"] .sidebar {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 48px -18px rgba(0, 0, 0, 0.6);
}

.sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 7px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand img {
  height: 36px;
  object-fit: contain;
}

.sidebar-brand-text h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  margin: 0;
  letter-spacing: -0.3px;
}

.sidebar-brand-text span {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 28px 8px;
  white-space: nowrap;
}

/* Sidebar nav — scoped with .sidebar so it beats the shared .tab-btn / .tab-btn.active
   rules (equal-specificity, defined later) that were silently clobbering the pill design. */
.sidebar .nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 14px;
  margin: 3px 10px;
  border: none;
  border-bottom: none;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
  background: transparent;
  box-shadow: none;
  width: calc(100% - 20px);
  text-align: right;
  font-family: 'Inter', 'Heebo', sans-serif;
  white-space: nowrap;
  position: relative;
}

.sidebar .nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  transform: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.sidebar .nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 10px 20px -8px rgba(16, 24, 40, 0.24), inset -3px 0 0 0 var(--accent);
}

.sidebar .nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-item .nav-icon {
  width: 24px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer .auth-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-footer .auth-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: none;
  padding: 0;
}

.btn-logout:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  transform: none;
  box-shadow: none;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  background: var(--accent-gradient, linear-gradient(135deg, #00a884, #25d366));
  border: none;
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 168, 132, 0.4);
}

/* האייקון תמיד לבן וברור — לא תלוי ב-currentColor/משתנים */
.sidebar-toggle svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff !important;
  display: block;
}

.sidebar-toggle:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(0, 168, 132, 0.5);
}

.sidebar-toggle:active {
  transform: scale(0.94);
}


/* ═══════════════════════════════════════════════════════════════
   MAIN WRAPPER & HEADER
   ═══════════════════════════════════════════════════════════════ */

.main-wrapper {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-right 0.3s ease;
}

.main-header {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-header h1 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 9px;
}

.main-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
}


/* ═══════════════════════════════════════════════════════════════
   TOPBAR (Legacy — kept for JS compatibility)
   ═══════════════════════════════════════════════════════════════ */

.topbar {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  gap: 16px;
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-shrink: 0;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  background: rgba(0, 168, 132, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
}

.topbar-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Tab Nav inside topbar */
.tab-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0 16px;
  font-family: 'Inter', 'Heebo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 0;
  box-shadow: none;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
  transform: none;
  box-shadow: none;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0, 168, 132, 0.05);
  transform: none;
  box-shadow: none;
}

/* Auth area in topbar */
.topbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.auth-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), 0 0 8px rgba(34, 197, 94, 0.4);
}

.auth-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Premium footer profile avatar (status dot rides its outer-bottom corner) */
.sidebar-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-avatar .auth-dot {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bg-sidebar);
}

.sidebar-avatar .auth-dot.online,
.sidebar-avatar .auth-dot.offline {
  box-shadow: none;
}

.auth-user-name {
  color: var(--text-secondary);
}

.btn-topbar {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', 'Heebo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  transform: none;
}

.btn-topbar:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: none;
  box-shadow: none;
}

/* Auth Panel (dropdown below topbar) */
.auth-panel {
  background: var(--bg-sidebar);
  padding: 14px 24px;
  display: none;
  border-top: 1px solid var(--border);
}

.auth-panel.open {
  display: block;
}

.auth-panel-inner {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  max-width: 600px;
}

.auth-panel input {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
}

.auth-panel input::placeholder {
  color: var(--text-muted);
}

.auth-panel input:focus {
  border-color: var(--accent);
  background: rgba(0, 168, 132, 0.04);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-panel label {
  color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════════════════════
   CONTAINER & PAGES
   ═══════════════════════════════════════════════════════════════ */

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}

.page {
  display: none;
  animation: pageIn 0.35s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─── Section Title ──────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  margin-top: 28px;
  line-height: 1.4;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-title:first-child {
  margin-top: 0;
}


/* ═══════════════════════════════════════════════════════════════
   GRID SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}


/* ═══════════════════════════════════════════════════════════════
   GLASSMORPHIC CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
  animation: cardEntrance 0.4s ease both;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--card-top-highlight);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.card-icon.indigo {
  background: rgba(1, 125, 99, 0.1);
  color: #017d63;
}

.card-icon.green {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.card-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.card-icon.sky {
  background: rgba(56, 189, 248, 0.1);
  color: #0284c7;
}

.card-icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', 'Heebo', sans-serif;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-input);
  box-shadow: 0 0 0 1px var(--bg-card), 0 0 0 3px var(--border-focus);
}

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
  cursor: pointer;
}

select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}


/* ═══════════════════════════════════════════════════════════════
   PREMIUM BUTTONS
   ═══════════════════════════════════════════════════════════════ */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Inter', 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), filter var(--transition);
  box-shadow: 0 1px 2px rgba(1, 125, 99, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.2s;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(1, 125, 99, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

button:hover::before {
  opacity: 1;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(1, 125, 99, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  box-shadow: none;
}

.btn-danger-outline:hover {
  background: var(--danger-light);
  box-shadow: none;
  transform: none;
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  padding: 5px 8px;
  font-size: 14px;
  box-shadow: none;
  border-radius: 6px;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.small-btn {
  background: var(--accent-gradient);
  padding: 7px 14px;
  font-size: 13px;
}

.small-btn:hover {
  background: var(--accent-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.w-100 {
  width: 100%;
}


/* ═══════════════════════════════════════════════════════════════
   BUSINESS ITEMS
   ═══════════════════════════════════════════════════════════════ */

.business-list {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.business-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-card);
  transition: all var(--transition);
}

.business-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.business-item.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.business-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.business-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.business-item-type {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.business-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════
   BADGES (Dark Theme)
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-active {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-trial {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-paused {
  background: rgba(148, 163, 184, 0.1);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge-basic {
  background: rgba(56, 189, 248, 0.1);
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-pro {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-premium {
  background: rgba(236, 72, 153, 0.08);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.15);
}

.badge-urgent {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-normal {
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.12);
}


/* ═══════════════════════════════════════════════════════════════
   SERVICE / FAQ ITEMS
   ═══════════════════════════════════════════════════════════════ */

.item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.item:hover {
  border-color: rgba(0, 168, 132, 0.2);
  background: var(--bg-card-hover);
}

.item-title {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 14px;
  margin-bottom: 6px;
}

.item-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════
   TAG LIST (Bot Settings)
   ═══════════════════════════════════════════════════════════════ */

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-body);
  transition: border-color var(--transition);
}

.tag-item:hover {
  border-color: rgba(0, 168, 132, 0.2);
}

.tag-item-text {
  flex: 1;
  line-height: 1.5;
}

.tag-item-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tag-list-rules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}


/* ═══════════════════════════════════════════════════════════════
   STATS ROW
   ═══════════════════════════════════════════════════════════════ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--card-top-highlight);
}

.stat-card.stat-urgent {
  border-color: rgba(239, 68, 68, 0.2);
}

.stat-card.stat-urgent::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card.stat-urgent .stat-value {
  color: var(--danger);
}


/* ═══════════════════════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════════════════════ */

.table-scroll {
  overflow-x: auto;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-card-hover, #f8f9fc);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-muted);
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-body);
  font-size: 14px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tr.urgent-row {
  background: rgba(239, 68, 68, 0.04);
}

.data-table tr.urgent-row:hover {
  background: rgba(239, 68, 68, 0.08);
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-size: 14px;
}

.leads-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.leads-toolbar select {
  flex: 1;
  min-width: 140px;
  margin: 0;
}


/* ═══════════════════════════════════════════════════════════════
   MODAL SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-heading);
}

.modal-close {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: none;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-card-hover, #f8f9fc);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}


/* ═══════════════════════════════════════════════════════════════
   DETAIL EXPAND ROW
   ═══════════════════════════════════════════════════════════════ */

.detail-row {
  background: var(--bg-card-hover, #f8f9fc) !important;
}

.detail-row td {
  padding: 0 !important;
}

.lead-detail-box {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 20px;
}

.detail-field {
  font-size: 13px;
}

.detail-field-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.detail-field-value {
  color: var(--text-body);
  line-height: 1.5;
  font-size: 13px;
}


/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.empty-state-icon {
  font-size: 26px;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  opacity: 1;
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

/* Skeleton loading shimmer (premium load state — use in place of "טוען…") */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: skeletonShimmer 1.3s ease-in-out infinite;
}
html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}
.skeleton-line { height: 12px; margin: 9px 0; }
.skeleton-line.sk-sm { width: 45%; }
.skeleton-line.sk-lg { width: 80%; }
@keyframes skeletonShimmer { 100% { transform: translateX(100%); } }

/* ─── Command Palette (Cmd/Ctrl + K) ─────────────────────────── */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: cmdkFade 0.15s ease;
}
@keyframes cmdkFade { from { opacity: 0; } to { opacity: 1; } }
.cmdk-panel {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: cmdkPop 0.16s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes cmdkPop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-row > svg { color: var(--text-muted); flex: none; }
.cmdk-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  padding: 0;
  font-family: inherit;
}
.cmdk-input:focus { box-shadow: none; border: none; background: transparent; outline: none; }
.cmdk-esc {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  flex: none;
}
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.cmdk-item .cmdk-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex: none;
}
.cmdk-item.active,
.cmdk-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.cmdk-item.active .cmdk-ico,
.cmdk-item:hover .cmdk-ico { color: var(--accent); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--text-muted); font-size: 14px; }


/* ═══════════════════════════════════════════════════════════════
   MISC UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

.mt-16 {
  margin-top: 16px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--danger);
}

.text-muted {
  color: var(--text-muted);
}

.text-green {
  color: var(--success) !important;
}

.text-red {
  color: var(--danger) !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header h2 {
  color: var(--text-heading);
  font-size: 24px;
  font-weight: 700;
}

.page-header p {
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  min-width: 280px;
  max-width: 460px;
  width: 90vw;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
  border: 1.5px solid transparent;
  backdrop-filter: blur(16px);
}

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

.toast-success {
  background: rgba(34, 197, 94, 0.95);
  border-color: rgba(34, 197, 94, 0.5);
  color: #ffffff;
}

.toast-error {
  background: rgba(239, 68, 68, 0.95);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  from { opacity: 1; }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}


/* ═══════════════════════════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════════════════════════ */

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════
   STATUS PAGE
   ═══════════════════════════════════════════════════════════════ */

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.pre-style {
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
  direction: ltr;
  text-align: left;
}


/* ═══════════════════════════════════════════════════════════════
   CHAT SIMULATOR PAGE
   ═══════════════════════════════════════════════════════════════ */

.simulator-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 25px;
  align-items: start;
  margin-top: 15px;
}

@media (max-width: 900px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.simulator-sidebar {
  position: sticky;
  top: 90px;
}

/* Phone frame mockup (kept WhatsApp-style) */
.phone-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.phone-mockup {
  width: 100%;
  max-width: 400px;
  height: 600px;
  background: #efeae2;
  border-radius: 36px;
  border: 12px solid #1e293b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 168, 132, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-header {
  background: #075e54;
  color: #ffffff;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.phone-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.phone-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.phone-header-name {
  font-weight: bold;
  font-size: 15px;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.phone-header-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.phone-messages {
  flex: 1;
  padding: 20px 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Chat bubble styling */
.sim-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sim-bubble-user {
  background: #d9fdd3;
  color: #111b21;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 0px;
  align-self: flex-end;
}

.sim-bubble-bot {
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 0px;
  align-self: flex-start;
}

.sim-system-bubble {
  align-self: center;
  background: rgba(0, 168, 132, 0.08);
  border: 1px solid rgba(0, 168, 132, 0.15);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
}

/* Typing bubble */
.sim-bubble-typing {
  align-self: flex-start;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  border-bottom-right-radius: 0px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.sim-dot {
  width: 6px;
  height: 6px;
  background: #8696a0;
  border-radius: 50%;
  animation: simDotBlink 1.4s infinite both;
}

.sim-dot:nth-child(2) { animation-delay: 0.2s; }
.sim-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes simDotBlink {
  0%, 100% { transform: scale(0.3); opacity: 0.3; }
  50%      { transform: scale(1);   opacity: 1; }
}

@keyframes popIn {
  from {
    transform: scale(0.8) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Chat footer input bar */
.phone-footer {
  background: #f0f2f5;
  padding: 10px 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #e3e6e8;
  z-index: 10;
}

.phone-footer input {
  flex: 1;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  color: #111b21;
}

.phone-footer input:focus {
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.phone-footer button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #00a884;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  margin: 0;
  padding: 0;
  transition: transform 0.1s ease, background 0.2s ease;
  box-shadow: none;
}

.phone-footer button:hover {
  background: #008f72;
  transform: scale(1.05);
  box-shadow: none;
}

.phone-footer button:disabled {
  background: #aebac1;
  cursor: not-allowed;
  transform: none;
}


/* ═══════════════════════════════════════════════════════════════
   WHATSAPP CONVERSATION VIEWER MODAL
   ═══════════════════════════════════════════════════════════════ */

.conv-modal-box {
  width: 100%;
  max-width: 520px;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
}

.conv-modal-box .modal-header {
  background: #075e54;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.conv-modal-box .modal-title {
  color: #ffffff;
}

.conv-modal-box .modal-close {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conv-modal-box .modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.conv-messages-area {
  width: 100%;
  max-height: 440px;
  min-height: 200px;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #efeae2 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Lead Score Badge */
.lead-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.lead-score-high {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.lead-score-mid {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.lead-score-low {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Conv summary chips */
.conv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.conv-chip strong {
  color: var(--text-heading);
}

/* View conversation button */
.btn-conv {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-conv:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}


/* ═══════════════════════════════════════════════════════════════
   PREMIUM TOOLTIPS
   ═══════════════════════════════════════════════════════════════ */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1e293b;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

[data-tooltip]::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(6px);
}


/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sidebarSlide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════
   SALES KANBAN BOARD
   ═══════════════════════════════════════════════════════════════ */

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 300px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  padding: 4px 0 8px 0;
  border-bottom: 2px solid transparent;
}

.kanban-count {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.kanban-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--card-top-highlight);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.kanban-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

.kanban-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* ── Sales KPI Dashboard ── */
.sales-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.sales-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.sales-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--card-top-highlight);
}

.sales-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.sales-kpi-card:nth-child(1)::before { background: #3b82f6; }
.sales-kpi-card:nth-child(2)::before { background: #f59e0b; }
.sales-kpi-card:nth-child(3)::before { background: #10b981; }
.sales-kpi-card:nth-child(4)::before { background: #8b5cf6; }

.sales-kpi-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sales-kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 6px;
}

.sales-kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Sales Search & Filter Bar ── */
.sales-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.sales-search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px 10px 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.sales-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sales-filter-select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 140px;
}

/* ── Today's Tasks Section ── */
.sales-today-tasks {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeInDown 0.4s ease;
}

.sales-today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sales-today-title {
  font-weight: 700;
  font-size: 15px;
  color: #fbbf24;
}

.sales-today-count {
  background: #f59e0b;
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.sales-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.sales-task-item:hover {
  box-shadow: var(--shadow-glow);
  border-color: rgba(0, 168, 132, 0.2);
}

.sales-task-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sales-task-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-heading);
}

.sales-task-phone {
  font-size: 12px;
  color: var(--text-muted);
  direction: ltr;
  unicode-bidi: embed;
}

.sales-task-actions {
  display: flex;
  gap: 6px;
}

.sales-task-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: none;
}

.sales-task-btn:hover {
  transform: scale(1.1);
  box-shadow: none;
}

.sales-task-btn-call { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.sales-task-btn-wa   { background: rgba(34, 197, 94, 0.08); color: #22c55e; }
.sales-task-btn-done { background: rgba(0, 168, 132, 0.12); color: #00a884; }

/* ── Enhanced Kanban Card ── */
.kanban-card-followup {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-weight: 600;
}

.kanban-card-followup.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.kanban-card-followup.today {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.kanban-card-followup.future {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.kanban-card-note-preview {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kanban-card-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 4px;
}

.kanban-card-quick-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.kanban-quick-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: none;
  color: var(--text-secondary);
}

.kanban-quick-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 168, 132, 0.15);
}

/* ── Drag & Drop ── */
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.kanban-col.drag-over {
  background: rgba(0, 168, 132, 0.06);
  border-color: var(--accent);
  border-style: dashed;
}

/* ── Activity Timeline ── */
.sales-timeline {
  position: relative;
  padding-right: 24px;
  max-height: 300px;
  overflow-y: auto;
}

.sales-timeline::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 10px 30px 10px 0;
  margin-bottom: 4px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: -24px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-main);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-item.note::before     { background: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.timeline-item.status::before   { background: #8b5cf6; box-shadow: 0 0 0 2px #8b5cf6; }
.timeline-item.followup::before { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }

.timeline-content {
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-heading);
  border: 1px solid var(--border);
}

.timeline-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

/* ── Sales Tab Badge ── */
.tab-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  margin-right: 6px;
  animation: pulse-badge 2s ease-in-out infinite;
}

/* ── Sales View Switcher ── */
.sales-view-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-elevated, #f1f5f9);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--border);
}

.sales-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.sales-view-btn svg {
  flex-shrink: 0;
}

.sales-view-btn:hover {
  color: var(--text-heading);
  background: rgba(0, 168, 132, 0.06);
}

.sales-view-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 168, 132, 0.12);
}

/* ── Kanban Scroll Wrapper with Arrows ── */
.kanban-scroll-wrapper {
  position: relative;
}

.kanban-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-heading);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.kanban-scroll-wrapper:hover .kanban-scroll-arrow {
  opacity: 1;
  pointer-events: auto;
}

.kanban-scroll-arrow:hover {
  background: #00a884;
  color: #ffffff;
  border-color: #00a884;
  box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.kanban-scroll-right {
  right: auto;
  left: -18px;
}

.kanban-scroll-left {
  left: auto;
  right: -18px;
}

/* ── Kanban Column Header Sticky & Color ── */
.kanban-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  padding: 8px 4px 10px 4px;
  border-bottom: 2px solid transparent;
  margin-bottom: 4px;
}

/* ── Sales Table View ── */
.sales-table-container {
  animation: fadeInUp 0.35s ease;
}

.sales-table-container .data-table {
  width: 100%;
}

.sales-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sales-th-sortable:hover {
  color: #00a884;
}

.sales-th-sortable .sort-icon {
  font-size: 11px;
  opacity: 0.4;
  margin-right: 2px;
  transition: opacity 0.2s;
}

.sales-th-sortable:hover .sort-icon {
  opacity: 1;
}

.sales-th-sortable.sort-asc .sort-icon::after { content: ' ▲'; }
.sales-th-sortable.sort-desc .sort-icon::after { content: ' ▼'; }

/* Status dot in table */
.sales-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.sales-status-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sales-status-dot[data-status="new"] { background: rgba(59,130,246,0.1); color: #3b82f6; }
.sales-status-dot[data-status="new"]::before { background: #3b82f6; }
.sales-status-dot[data-status="in_progress"] { background: rgba(245,158,11,0.1); color: #f59e0b; }
.sales-status-dot[data-status="in_progress"]::before { background: #f59e0b; }
.sales-status-dot[data-status="meeting_set"] { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.sales-status-dot[data-status="meeting_set"]::before { background: #8b5cf6; }
.sales-status-dot[data-status="waiting"] { background: rgba(100,116,139,0.1); color: #64748b; }
.sales-status-dot[data-status="waiting"]::before { background: #64748b; }
.sales-status-dot[data-status="closed_won"] { background: rgba(16,185,129,0.1); color: #10b981; }
.sales-status-dot[data-status="closed_won"]::before { background: #10b981; }
.sales-status-dot[data-status="closed_lost"] { background: rgba(239,68,68,0.1); color: #ef4444; }
.sales-status-dot[data-status="closed_lost"]::before { background: #ef4444; }
.sales-status-dot[data-status="converted"] { background: rgba(5,150,105,0.1); color: #059669; }
.sales-status-dot[data-status="converted"]::before { background: #059669; }

/* Table action buttons row */
.sales-table-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sales-table-actions .kanban-quick-btn {
  width: 30px;
  height: 30px;
}

/* Followup badge in table */
.sales-followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.sales-followup-badge.overdue { background: rgba(239,68,68,0.1); color: #ef4444; }
.sales-followup-badge.today { background: rgba(245,158,11,0.1); color: #f59e0b; }
.sales-followup-badge.future { background: rgba(34,197,94,0.1); color: #22c55e; }

/* Note preview in table */
.sales-note-cell {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   TEAM ANALYTICS DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.team-rank {
  position: absolute;
  top: -12px;
  right: 24px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); }

.team-rep-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 20px;
  margin-top: 4px;
}

.team-metric-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.team-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.team-metric:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.team-metric-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.team-metric-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
}

.team-conversion-section {
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

.team-last-active {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.team-last-active::before {
  content: '🕒';
}

/* ביצועי צוות — רספונסיביות (טאבלט/מובייל) */
@media (max-width: 768px) {
  .team-grid { gap: 16px; }
  .team-card { padding: 20px; }
  .team-rep-name { font-size: 18px; margin-bottom: 16px; }
}
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; gap: 14px; }
  .team-card { padding: 16px; }
  .team-rank { right: 16px; font-size: 12px; padding: 3px 10px; }
  .team-rep-name { font-size: 17px; }
  .team-metric-label { font-size: 13px; }
  .team-metric-value { font-size: 15px; }
  .team-conversion-section { padding: 14px; }
}


/* ═══════════════════════════════════════════════════════════════
   INBOX — WhatsApp Web Light Theme
   (Clean light design matching the admin dashboard)
   ═══════════════════════════════════════════════════════════════ */

.inbox-container {
  display: flex;
  height: 78vh;
  min-height: 550px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
  font-family: 'Segoe UI', 'Inter', 'Heebo', Helvetica, Arial, sans-serif;
}

/* ── Sidebar: Conversation List ── */
.inbox-sidebar {
  width: 380px;
  min-width: 320px;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.inbox-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.inbox-list::-webkit-scrollbar { width: 6px; }
.inbox-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
.inbox-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

.inbox-list-header {
  background: var(--bg-card-hover, #f0f2f5);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-heading);
  letter-spacing: 0.3px;
}

.inbox-list-header .inbox-search {
  flex: 1;
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input, #fff);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.inbox-list-header .inbox-search:focus {
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-color: var(--accent);
}

/* Individual conversation item */
.inbox-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.inbox-item:hover { background: var(--bg-card-hover, #f0f2f5); }
.inbox-item.active { background: var(--accent-light, #e8f5f0); }

.inbox-item-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 14px;
  flex-shrink: 0;
  color: white;
  font-size: 22px;
  box-shadow: none;
}

.inbox-item-content { flex: 1; min-width: 0; }

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.inbox-item-phone {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.inbox-item-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.inbox-item-preview {
  font-size: 13.5px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.3;
}

.inbox-item-badge {
  display: inline-block;
  background: #25d366;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-right: 6px;
}

.inbox-item-paused {
  font-size: 11px;
  color: #d97706;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Chat Area ── */
.inbox-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #efeae2;
  position: relative;
}

.inbox-chat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cpattern id='p' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Cpath d='M20 2l2 6h6l-5 4 2 6-5-4-5 4 2-6-5-4h6z' fill='%23c8b99a' opacity='.06'/%3E%3Ccircle cx='8' cy='30' r='2' fill='%23c8b99a' opacity='.04'/%3E%3Crect x='28' y='28' width='4' height='4' rx='1' fill='%23c8b99a' opacity='.04'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23p)' width='200' height='200'/%3E%3C/svg%3E");
  z-index: 0;
  pointer-events: none;
}

/* Chat Header */
.inbox-chat-header {
  background: #f0f2f5;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

.inbox-chat-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inbox-chat-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 19px;
  box-shadow: none;
}

.inbox-chat-title {
  font-weight: 500;
  color: var(--text-heading);
  font-size: 16px;
}

.inbox-chat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Toggle Bot Button */
.inbox-btn-toggle {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-btn-toggle.paused {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.inbox-btn-toggle.paused:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.inbox-btn-toggle.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.inbox-btn-toggle.active:hover {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.inbox-btn-close {
  box-shadow: none !important;
}

/* Messages Container */
.inbox-messages {
  flex: 1;
  padding: 20px 7%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
  scroll-behavior: smooth;
}

.inbox-messages::-webkit-scrollbar { width: 6px; }
.inbox-messages::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 3px; }

/* Message Bubbles */
.inbox-msg {
  position: relative;
  max-width: 65%;
  padding: 8px 10px 22px 10px;
  border-radius: 7.5px;
  font-size: 14.2px;
  line-height: 19px;
  color: var(--text-heading);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  margin-bottom: 2px;
  word-wrap: break-word;
  animation: msgFadeIn 0.25s ease-out;
}

.inbox-msg-content { display: block; }

.inbox-msg-meta {
  position: absolute;
  bottom: 5px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* User (customer) message — white bg, right side */
.inbox-msg.user {
  background: #ffffff;
  align-self: flex-start;
  border-top-right-radius: 0;
}

.inbox-msg.user::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  border-width: 0 8px 10px 0;
  border-style: solid;
  border-color: transparent transparent transparent #ffffff;
}

/* Assistant (bot/manual) message — green-light, left side */
.inbox-msg.assistant {
  background: #d9fdd3;
  align-self: flex-end;
  border-top-left-radius: 0;
}

.inbox-msg.assistant::after {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  border-width: 0 0 10px 8px;
  border-style: solid;
  border-color: transparent transparent transparent transparent;
  border-left-color: #d9fdd3;
}

.inbox-msg.assistant .inbox-msg-meta { color: rgba(0, 0, 0, 0.4); }

/* Manual message — slightly different */
.inbox-msg.manual {
  background: #c4f0c0;
  border-right: 3px solid #25d366;
}

.inbox-msg.manual::after {
  border-left-color: #c4f0c0;
}

.inbox-msg-manual-badge {
  display: inline-block;
  background: #25d366;
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Date divider */
.inbox-date-divider {
  text-align: center;
  margin: 12px 0;
}

.inbox-date-divider span {
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ── Input Area ── */
.inbox-input-area {
  background: #f0f2f5;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
  border-top: 1px solid var(--border);
}

.inbox-input-wrapper {
  flex: 1;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: none;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
}

.inbox-input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
}

.inbox-input-wrapper input::placeholder { color: var(--text-muted); }

.btn-send-wa {
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 20px;
  box-shadow: none;
}

.btn-send-wa:hover { background: #e9edef; color: #00a884; box-shadow: none; }

.btn-send-wa.send-btn {
  background: var(--accent);
  color: white;
  box-shadow: none;
}

.btn-send-wa.send-btn:hover {
  background: var(--accent-dark);
  box-shadow: none;
}

/* ── Empty State ── */
.inbox-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.inbox-empty-state .inbox-empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.inbox-empty-state h3 {
  font-size: 20px;
  color: var(--text-heading);
  margin-bottom: 8px;
  font-weight: 400;
}

.inbox-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
}

/* Inbox filter wrapper inside sidebar */
.inbox-filter-wrapper select {
  background: #ffffff !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN — ADMIN DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: var(--sidebar-collapsed);
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
  }

  .sidebar .nav-item .nav-text,
  .sidebar .nav-section-title,
  .sidebar-brand-text,
  .sidebar-footer .auth-user-name {
    display: none;
  }

  .sidebar .nav-item {
    padding: 12px 0;
    justify-content: center;
    margin: 2px 6px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 20px 8px;
  }

  .sidebar-footer {
    justify-content: center;
    padding: 12px 8px;
  }

  .main-wrapper {
    margin-right: var(--sidebar-collapsed);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: var(--sidebar-width);
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
  }

  .sidebar.active {
    transform: translateX(0);
    animation: sidebarSlide 0.3s ease;
  }

  .sidebar .nav-item .nav-text,
  .sidebar .nav-section-title,
  .sidebar-brand-text,
  .sidebar-footer .auth-user-name {
    display: unset;
  }

  .sidebar .nav-item {
    padding: 10px 24px;
    justify-content: flex-start;
    margin: 2px 8px;
  }

  .sidebar-brand {
    justify-content: flex-start;
    padding: 24px 20px 20px;
  }

  .sidebar-footer {
    justify-content: space-between;
    padding: 16px 20px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-wrapper {
    margin-right: 0;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }

  .tab-nav {
    order: 3;
    width: 100%;
    padding: 0;
    overflow-x: auto;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .grid, .grid-2, .grid-3 {
    grid-template-columns: 1fr !important;
  }

  .modal-box {
    margin: 10px;
    width: 95%;
    max-height: 90vh;
  }

  .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
  }

  .container {
    padding: 16px 14px 50px;
  }

  .card {
    padding: 20px;
  }

  .leads-toolbar {
    gap: 8px;
  }

  .leads-toolbar select {
    min-width: 110px;
  }

  /* Tables */
  .table-scroll, .table-responsive {
    overflow-x: auto;
    display: block;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th, .data-table td {
    white-space: nowrap;
    padding: 12px 10px;
  }

  /* Inbox */
  .inbox-container { flex-direction: column; height: 85vh; }
  .inbox-sidebar { width: 100%; max-height: 250px; border-left: none; border-bottom: 1px solid #222d34; }
  .inbox-msg { max-width: 85%; }

  /* Sales */
  .sales-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .sales-kpi-value { font-size: 24px; }

  .sales-filter-bar { flex-direction: column; }
  .sales-search-input { min-width: 100%; }

  .kanban-board { flex-direction: column; }
  .kanban-col { flex: 0 0 auto; width: 100%; }

  .kanban-scroll-arrow { display: none !important; }

  .sales-view-switcher { width: 100%; }
  .sales-view-btn { flex: 1; justify-content: center; }

  .sales-today-tasks { padding: 12px; }

  .sales-task-item {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CALENDAR STYLES
   ═══════════════════════════════════════════════════════════════ */

.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
}

/* Header with month label + nav arrows */
.calendar-container .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.calendar-container .calendar-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
  color: var(--text-heading) !important;
}
.cal-nav-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: none;
  border-radius: 12px;
  background: var(--accent-light, rgba(0,168,132,0.08));
  color: var(--accent, #00a884);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cal-nav-btn:hover { background: var(--accent-glow, rgba(0,168,132,0.18)); }
.cal-nav-btn:active { transform: scale(0.92); }

/* Weekday header row */
.calendar-container .calendar-days-header {
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-size: 13px;
}
.calendar-container .calendar-days-header div {
  color: var(--text-muted) !important;
  padding: 4px 0;
}

/* The grid */
.calendar-container #calendarGrid {
  background: var(--border) !important;
}

/* Each day cell */
.calendar-day {
  background: var(--bg-card, #fff);
  min-height: 104px;
  padding: 8px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.calendar-day.padded {
  background: var(--bg-card-hover, #f8fafc);
  cursor: default;
}
.calendar-day:not(.padded):hover {
  background: var(--accent-light, rgba(0,168,132,0.08));
}
.calendar-day.has-appts {
  background: linear-gradient(180deg, rgba(0,168,132,0.05), var(--bg-card, #fff));
}
.cal-day-num {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary, #111b21);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex: 0 0 auto;
}
.calendar-day.is-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.cal-day-appts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal-appt-chip {
  font-size: 11px;
  background: var(--accent, #00a884);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.cal-appt-chip strong { font-weight: 700; }
.cal-appt-more {
  font-size: 10.5px;
  color: var(--accent-dark, #008c6f);
  font-weight: 700;
  text-align: center;
}

/* ── Calendar on tablet/mobile ── */
@media (max-width: 768px) {
  .calendar-day { min-height: 76px; padding: 5px 4px; }
  .cal-day-num { font-size: 13px; width: 24px; height: 24px; }
  .calendar-container .calendar-days-header { font-size: 11px; }
  .calendar-container .calendar-header h3 { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .calendar-day { min-height: 60px; padding: 4px 2px; gap: 2px; }
  .cal-day-num { font-size: 12px; width: 22px; height: 22px; }
  /* On very small screens, show a dot instead of text chips to keep cells tidy */
  .cal-appt-chip {
    font-size: 0; /* hide text */
    padding: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin: 1px auto 0;
  }
  .cal-appt-chip strong, .cal-appt-chip span { display: none; }
  .cal-appt-more { font-size: 9px; }
  .calendar-container .calendar-days-header { font-size: 10px; }
  .calendar-container .calendar-days-header div { padding: 2px 0; }
}

/* Quota container dark theme */
#botQuotaContainer {
  color: var(--text-body);
}


/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE — COPIED EXACTLY AS-IS
   ═══════════════════════════════════════════════════════════════ */

/* ALL SECTIONS: consistent white/green WhatsApp theme */

.landing-page {
  background: #f0f2f5;
  color: #111b21;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: 'Heebo', sans-serif;
}

/* Navigation */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 60px;
  background: #ffffff;
  border-bottom: 1px solid #e9edef;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #008069, #25D366);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.landing-nav-links a {
  color: #3b4a54;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s;
}

.landing-nav-links a:hover {
  color: #128C7E;
}

/* Hero — premium dark with aurora glow */
.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 110px 60px 120px;
  gap: 60px;
  width: 100%;
  box-sizing: border-box;
  background: radial-gradient(ellipse 120% 90% at 70% -10%, #0d3b32 0%, #07211d 45%, #050d0b 100%);
  overflow: hidden;
}

/* Animated aurora glow blobs */
.hero-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 75% 20%, rgba(37, 211, 102, 0.35), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(0, 168, 132, 0.28), transparent 50%);
  filter: blur(20px);
  animation: auroraDrift 14s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate3d(-4%, 3%, 0) scale(1.12); opacity: 1; }
}

.hero-content {
  flex: 1;
  max-width: 580px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #6ee7a8;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: 56px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 22px;
  letter-spacing: -1.5px;
  color: #ffffff;
}

.text-glow {
  background: linear-gradient(to right, #25D366, #6ee7a8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-glow::after {
  display: none;
}

.hero-subtitle {
  font-size: 20px;
  color: #aebac1;
  line-height: 1.65;
  margin-bottom: 36px;
}

.hero-reassure {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  color: #aebac1;
  font-size: 14.5px;
  font-weight: 500;
}
.hero-reassure span { white-space: nowrap; }
.hero-reassure.light { color: rgba(255,255,255,0.92); justify-content: center; }

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 12px;
}

.btn-secondary {
  background: #ffffff;
  color: #128C7E;
  border: 1.5px solid #128C7E;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
}
.btn-secondary.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 12px;
}
.btn-secondary:hover {
  background: #f0f2f5;
}

/* Hero mockup — phone-like WhatsApp chat */
.hero-graphic {
  flex: 0 0 auto;
  width: 380px;
  max-width: 100%;
  background: #e5ddd5;
  border-radius: 24px;
  padding: 64px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
  z-index: 2;
}

.hero-graphic::before {
  content: '💬  LeadSaver Bot · מקליד...';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 54px;
  background: linear-gradient(135deg, #008069, #25D366);
  border-radius: 24px 24px 0 0;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.floating-chat {
  background: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 85%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  color: #111b21;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: chatIn 0.5s ease forwards;
}
.hero-graphic .floating-chat:nth-child(2) { animation-delay: 0.3s; }
.hero-graphic .floating-chat:nth-child(3) { animation-delay: 1.0s; }
.hero-graphic .floating-chat:nth-child(4) { animation-delay: 1.7s; }
.hero-graphic .floating-chat:nth-child(5) { animation-delay: 2.4s; }

@keyframes chatIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Typing dots */
.hero-typing {
  align-self: flex-start;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  opacity: 0;
  animation: chatIn 0.4s ease 2.9s forwards;
}
.hero-typing span {
  width: 7px; height: 7px;
  background: #9aa6ac;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.hero-typing span:nth-child(2) { animation-delay: 0.2s; }
.hero-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.floating-chat.bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #ffffff;
}

.floating-chat.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #dcf8c6;
}

@keyframes float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

/* ─── Scroll reveal (shared) ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Stats bar ─── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: -60px auto 0;
  padding: 32px 40px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  position: relative;
  z-index: 5;
}
.stat-block { text-align: center; }
.stat-number {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, #008069, #25D366);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}
.stat-text {
  font-size: 14px;
  color: #667781;
  margin-top: 6px;
  font-weight: 500;
}

/* ─── Problem section ─── */
.problem-section {
  padding: 90px 60px;
  background: #ffffff;
}
.problem-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.problem-sub {
  font-size: 18px;
  color: #667781;
  line-height: 1.65;
  max-width: 680px;
  margin: -34px auto 50px;
}
.problem-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.problem-card {
  background: #fff5f5;
  border: 1px solid #fde0e0;
  border-radius: 18px;
  padding: 30px 24px;
  text-align: center;
}
.problem-emoji { font-size: 38px; margin-bottom: 14px; }
.problem-card h4 { font-size: 18px; font-weight: 700; color: #111b21; margin-bottom: 8px; }
.problem-card p { color: #667781; font-size: 14.5px; line-height: 1.6; }

/* ─── How it works ─── */
.how-section {
  padding: 90px 60px;
  background: #f0f2f5;
}
.how-grid {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.how-step {
  flex: 1;
  background: #fff;
  border: 1px solid #e9edef;
  border-radius: 20px;
  padding: 36px 26px;
  text-align: center;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}
.how-step:hover { transform: translateY(-6px); box-shadow: 0 14px 36px rgba(0,168,132,0.12); }
.how-num {
  position: absolute;
  top: -16px; right: 50%;
  transform: translateX(50%);
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #008069, #25D366);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(37,211,102,0.4);
}
.how-icon { font-size: 44px; margin: 8px 0 16px; }
.how-step h3 { font-size: 19px; font-weight: 700; color: #111b21; margin-bottom: 10px; }
.how-step p { color: #667781; font-size: 14.5px; line-height: 1.6; }
.how-arrow {
  display: flex;
  align-items: center;
  font-size: 28px;
  color: #25D366;
  font-weight: 700;
}

/* Features */
.features-section {
  padding: 90px 60px;
  background: #ffffff;
  border-top: 1px solid #e9edef;
}

.section-heading {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 56px;
  color: #111b21;
  letter-spacing: -0.5px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Bento grid layout for features */
.features-grid.bento {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
}
.features-grid.bento .bento-hero {
  grid-column: span 2;
  grid-row: span 1;
}
.features-grid.bento .bento-wide {
  grid-column: span 2;
}

.feature-card {
  background: #f8fdf9;
  border: 1.5px solid #e9edef;
  padding: 40px 28px;
  border-radius: 20px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.1);
  border-color: #25D366;
}

.feature-icon {
  font-size: 46px;
  margin-bottom: 18px;
  display: block;
}

.feature-card h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111b21;
}

.feature-card p {
  color: #667781;
  line-height: 1.65;
  font-size: 15px;
}

/* Pricing */
.pricing-section {
  padding: 90px 60px;
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.pricing-card {
  background: #ffffff;
  border: 1.5px solid #e9edef;
  padding: 36px 30px;
  border-radius: 20px;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.07);
  border-color: #b7e5a0;
}

.pricing-card.popular {
  border-color: #25D366;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.12);
}

.popular-badge {
  position: absolute;
  top: -14px;
  right: 50%;
  transform: translateX(50%);
  background: linear-gradient(135deg, #128C7E, #25D366);
  color: #ffffff;
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}

.pricing-card h3 {
  font-size: 21px;
  font-weight: 700;
  color: #111b21;
  margin-bottom: 8px;
}

/* Plan tagline — short positioning line under the plan name */
.plan-tagline {
  font-size: 13px;
  font-weight: 600;
  color: #00a884;
  background: rgba(0, 168, 132, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 4px 0 6px;
  display: inline-block;
}

/* "Everything in X, plus:" highlight row */
.pricing-features li.feat-highlight {
  color: #111b21;
  font-weight: 700;
  border-bottom: 1px solid #e9edef;
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.pricing-features li.feat-highlight::before {
  content: "";
  margin-left: 0;
}

.price {
  font-size: 44px;
  font-weight: 800;
  color: #111b21;
  margin-bottom: 24px;
}

.price span {
  font-size: 16px;
  color: #667781;
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  flex: 1;
}

.pricing-features li {
  padding: 10px 0;
  color: #3b4a54;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  font-size: 15px;
}

.pricing-features li::before {
  content: "✓";
  color: #25D366;
  margin-left: 10px;
  font-weight: 700;
  font-size: 16px;
}

/* ─── Testimonials ─── */
.testimonials-section {
  padding: 90px 60px;
  background: #ffffff;
  border-top: 1px solid #e9edef;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.testimonial-card {
  background: #f8fdf9;
  border: 1px solid #e9edef;
  border-radius: 20px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.testimonial-card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(0,168,132,0.1); }
.testimonial-stars { color: #f5b50a; font-size: 17px; letter-spacing: 2px; }
.testimonial-text { color: #3b4a54; font-size: 15.5px; line-height: 1.7; flex: 1; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #008069, #25D366);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex: 0 0 44px;
}
.testimonial-name { font-weight: 700; color: #111b21; font-size: 15px; }
.testimonial-role { color: #8696a0; font-size: 13px; }

/* ─── FAQ ─── */
.faq-section {
  padding: 90px 60px;
  background: #f0f2f5;
}
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: #fff;
  border: 1px solid #e9edef;
  border-radius: 14px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 600;
  color: #111b21;
  text-align: right;
}
.faq-icon {
  flex: 0 0 auto;
  font-size: 22px;
  color: #25D366;
  font-weight: 400;
  transition: transform 0.25s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 24px;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 24px 20px; }
.faq-a p { color: #667781; font-size: 15px; line-height: 1.7; margin: 0; }

/* ─── Final CTA ─── */
.final-cta {
  position: relative;
  padding: 90px 60px;
  background: radial-gradient(ellipse 100% 100% at 50% 0%, #0d3b32 0%, #07211d 70%, #050d0b 100%);
  text-align: center;
  overflow: hidden;
}
.final-cta-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(37, 211, 102, 0.3), transparent 55%);
  filter: blur(16px);
}
.final-cta-inner { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }
.final-cta h2 {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.final-cta p {
  font-size: 18px;
  color: #aebac1;
  line-height: 1.6;
  margin-bottom: 32px;
}
.btn-cta-white {
  background: #fff;
  color: #07211d;
  border: none;
  padding: 18px 40px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.btn-cta-white:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(37,211,102,0.35); }
.btn-cta-white:active { transform: scale(0.97); }
.final-cta .hero-reassure { margin-top: 26px; }

/* Footer */
.landing-footer {
  background: #111b21;
  padding: 56px 60px;
  text-align: center;
}

.footer-content {
  max-width: 720px;
  margin: 0 auto;
}

.footer-logo {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-content p {
  color: #aebac1;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-links a {
  color: #aebac1;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #25D366;
}

/* Auth Modal */
.glass-modal {
  background: #ffffff !important;
  border: 1px solid #e9edef !important;
  color: #111b21;
  box-shadow: 0 25px 60px rgba(0,0,0,0.12) !important;
}

.glass-modal .modal-header {
  border-bottom: 1px solid #e9edef;
  background: #ffffff;
}

.glass-modal .modal-title {
  color: #111b21;
}

.glass-modal .modal-close {
  color: #667781;
}

.glass-modal .modal-close:hover {
  color: #128C7E;
  background: #f0f2f5;
}

.glass-modal label {
  color: #3b4a54;
  font-weight: 600;
}

.glass-modal input,
.glass-modal select,
.glass-modal textarea {
  background: #f0f2f5;
  border: 1px solid #e9edef;
  color: #111b21;
}

.glass-modal input:focus {
  border-color: #25D366;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #667781;
}

.auth-switch a {
  color: #128C7E;
  text-decoration: none;
  font-weight: 700;
  margin-right: 5px;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

/* ─── Google Sign-In ─────────────────────────── */
.google-auth-section {
  margin-top: 18px;
}

/* מפריד "או" אלגנטי בין הטופס לכפתור גוגל */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 16px;
  gap: 12px;
  user-select: none;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--border, #e9edef), transparent);
}

.auth-divider span {
  flex: 0 0 auto;
}

/* מרכוז כפתור גוגל הרשמי */
.google-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px; /* יעד מגע נגיש */
}

/* ─── Real-time LIVE badge (inbox) ───────────── */
.rt-live, .rt-offline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 100px;
  vertical-align: middle;
  margin-right: 4px;
}
.rt-live {
  color: #fff;
  background: var(--accent, #00a884);
  box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.5);
  animation: rtPulse 2s infinite;
}
.rt-offline {
  color: var(--text-muted, #8696a0);
  background: rgba(134, 150, 160, 0.12);
}
@keyframes rtPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(0, 168, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 168, 132, 0); }
}

/* ─── Insight bars (analytics) ───────────────── */
.insight-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 2px;
}
.insight-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.insight-bar-label {
  flex: 0 0 120px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111b21);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.insight-bar-track {
  flex: 1;
  height: 12px;
  background: var(--bg-card-hover, #f8f9fc);
  border-radius: 100px;
  overflow: hidden;
}
.insight-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-width: 4px;
}
.insight-bar-value {
  flex: 0 0 36px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark, #008c6f);
}

@media (max-width: 480px) {
  .insight-bar-label { flex-basis: 84px; font-size: 12px; }
}

/* ─── Premium confirm dialog ─────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 27, 33, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
}
.confirm-overlay.visible { opacity: 1; }
.confirm-box {
  background: var(--bg-card, #fff);
  border-radius: var(--radius-md, 16px);
  padding: 28px 26px 22px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.confirm-overlay.visible .confirm-box { transform: translateY(0) scale(1); }
.confirm-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--accent-light, rgba(0,168,132,0.08));
}
.confirm-icon.danger { background: rgba(239, 68, 68, 0.1); }
.confirm-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-heading, #111b21);
  margin: 0 0 8px;
}
.confirm-message {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary, #54656f);
  margin: 0 0 22px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm, 10px);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, filter 0.15s ease;
  min-height: 44px;
}
.confirm-btn:active { transform: scale(0.97); }
.confirm-cancel {
  background: var(--bg-card-hover, #f0f2f5);
  color: var(--text-primary, #111b21);
}
.confirm-cancel:hover { filter: brightness(0.96); }
.confirm-ok {
  background: var(--accent-gradient, linear-gradient(135deg, #00a884, #25d366));
  color: #fff;
}
.confirm-ok.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.confirm-ok:hover { filter: brightness(1.05); }

@media (max-width: 480px) {
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-box input, .confirm-btn { font-size: 16px; }
}

/* ─── Forgot password link ───────────────────── */
.auth-forgot {
  text-align: center;
  margin-top: 12px;
}
.auth-forgot a {
  color: var(--text-muted, #8696a0);
  font-size: 13px;
  text-decoration: none;
}
.auth-forgot a:hover { color: var(--accent, #00a884); text-decoration: underline; }

/* ─── Onboarding checklist banner ────────────── */
.onboarding-banner {
  background: var(--accent-light);
  border: 1px solid var(--accent, #00a884);
  border-radius: var(--radius-md, 16px);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.onboarding-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.onboarding-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-heading);
}
.onboarding-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.onboarding-dismiss:hover { color: var(--text-primary); }
.onboarding-progress {
  height: 8px;
  background: var(--bg-card-hover, #eef1f4);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
}
.onboarding-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.25,0.8,0.25,1);
}
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 18px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.onboarding-check {
  width: 20px; height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  border: 2px solid var(--border-hover, #d1d7db);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  transition: all 0.2s;
}
.onboarding-step.done { color: var(--text-primary); }
.onboarding-step.done .onboarding-check {
  background: var(--accent, #00a884);
  border-color: var(--accent, #00a884);
}
@media (max-width: 768px) {
  .onboarding-steps { grid-template-columns: 1fr; }
}

/* ─── Campaign modal ─────────────────────────── */
.campaign-info {
  background: var(--accent-light, rgba(0,168,132,0.08));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.campaign-info strong { color: var(--accent); font-size: 16px; }
.campaign-counter {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.campaign-warning {
  background: var(--warning-light, rgba(245,158,11,0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: #b45309;
  line-height: 1.6;
  margin-top: 12px;
}
html[data-theme="dark"] .campaign-warning { color: #fbbf24; }

/* ─── Header right (theme + notifications) ───── */
.main-header { justify-content: space-between; }
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card, #fff);
  color: var(--text-secondary);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.header-icon-btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); color: var(--accent); box-shadow: var(--shadow-md); }
.header-icon-btn:active { transform: scale(0.92); }
/* keep direct-child SVGs (e.g. the bell) from being shrunk to width:0 in the flex button */
.header-icon-btn svg { flex: none; }
.header-icon-btn.ring { animation: bellRing 0.6s ease; }
@keyframes bellRing {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-5deg); }
}
.notif-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card, #fff);
}
.notif-wrapper { position: relative; }
.notif-panel {
  position: absolute;
  top: 52px;
  left: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.12));
  z-index: 300;
  overflow: hidden;
  animation: notifPanelIn 0.18s ease;
}
@keyframes notifPanelIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-primary);
}
.notif-clear {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item-icon { font-size: 20px; flex: 0 0 auto; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.notif-item-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }

@media (max-width: 768px) {
  .header-icon-btn { width: 40px; height: 40px; }
  .notif-panel { position: fixed; top: 60px; left: 10px; right: 10px; width: auto; }
}

/* ─── Leads search box ───────────────────────── */
.leads-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.leads-search-icon {
  position: absolute;
  right: 12px;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}
.leads-search input {
  width: 100%;
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input, #fff);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.leads-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light, rgba(0,168,132,0.08));
}

/* ─── Lead tag badges ────────────────────────── */
.lead-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.tag-price     { background: rgba(34,197,94,0.12);  color: #15803d; }
.tag-appt      { background: rgba(0,168,132,0.12);  color: #008c6f; }
.tag-support   { background: rgba(245,158,11,0.14); color: #b45309; }
.tag-info      { background: rgba(56,189,248,0.14); color: #0369a1; }
.tag-complaint { background: rgba(239,68,68,0.12);  color: #dc2626; }
.tag-other     { background: rgba(134,150,160,0.14); color: #54656f; }

/* ─── Payment status badges & history ────────── */
.pay-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.pay-paid    { background: var(--success-light, rgba(34,197,94,0.12)); color: #15803d; }
.pay-partial { background: var(--warning-light, rgba(245,158,11,0.14)); color: #b45309; }
.pay-unpaid  { background: var(--danger-light, rgba(239,68,68,0.12)); color: #dc2626; }
html[data-theme="dark"] .pay-paid    { color: #4ade80; }
html[data-theme="dark"] .pay-partial { color: #fbbf24; }
html[data-theme="dark"] .pay-unpaid  { color: #f87171; }

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--bg-card-hover);
}
.payment-row-main { flex: 1; min-width: 0; }
.payment-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.payment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.payment-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}
.payment-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── Bulk actions bar ───────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--accent-light, rgba(0,168,132,0.08));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  animation: bulkSlideIn 0.2s ease;
}
@keyframes bulkSlideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.bulk-count { font-size: 14px; color: var(--text-primary); margin-left: 6px; }
.bulk-btn {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}
.bulk-btn:hover { border-color: var(--accent); color: var(--accent); }
.bulk-btn.bulk-danger:hover { border-color: var(--danger, #ef4444); color: var(--danger, #ef4444); }
.bulk-btn.bulk-clear { margin-right: auto; background: transparent; border: none; color: var(--text-muted); }

/* ─── Lead detail timeline ───────────────────── */
.lead-timeline {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  position: relative;
}
.timeline-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent, #00a884);
  margin-top: 3px;
  flex: 0 0 11px;
  box-shadow: 0 0 0 3px var(--accent-light, rgba(0,168,132,0.12));
}
.timeline-item.done .timeline-dot { background: var(--success, #22c55e); }
.timeline-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── Skeleton loaders ───────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-card-hover, #eef1f4);
  border-radius: 6px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skeletonShimmer 1.3s infinite;
}
/* RTL: לזרום מימין לשמאל */
html[dir="rtl"] .skeleton::after { animation-name: skeletonShimmerRtl; }
.skeleton-text { height: 14px; width: 80%; margin: 4px auto; }
.skeleton-tr td { padding: 14px 12px; }
@keyframes skeletonShimmer {
  100% { transform: translateX(100%); }
}
@keyframes skeletonShimmerRtl {
  100% { transform: translateX(100%); }
}

@media (max-width: 768px) {
  .google-auth-section {
    margin-top: 16px;
  }
  .auth-divider {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .auth-divider {
    margin: 2px 0 14px;
  }
  .google-btn-container {
    min-height: 44px;
  }
}

/* Pricing Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .pricing-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}
.switch .pricing-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}
.switch input:checked + .pricing-slider {
  background-color: #25d366;
}
.switch input:focus + .pricing-slider {
  box-shadow: 0 0 1px #25d366;
}
.switch input:checked + .pricing-slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
.switch .pricing-slider.round {
  border-radius: 34px;
}
.switch .pricing-slider.round:before {
  border-radius: 50%;
}
.price-container {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 5px;
}
.price-monthly {
  font-size: 42px;
  font-weight: 800;
  color: #111b21;
}
.price-monthly .currency {
  font-size: 24px;
  vertical-align: super;
  margin-left: 2px;
}
.price-monthly .period {
  font-size: 16px;
  color: #667781;
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE RESPONSIVE — COPIED EXACTLY
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .hero-title {
    font-size: 44px;
  }
  .features-grid.bento { grid-template-columns: repeat(2, 1fr); }
  .features-grid.bento .bento-hero,
  .features-grid.bento .bento-wide { grid-column: span 2; }
}

@media (max-width: 768px) {
  /* Landing Page specific — keep logo + CTA on one tidy row */
  .landing-nav {
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
  }
  .landing-nav-links { gap: 16px; }
  .landing-nav-links a[href="#features"] { display: none; } /* save room on small screens */

  .hero-section {
    flex-direction: column;
    padding: 70px 22px 80px;
    text-align: center;
    min-height: auto;
    gap: 36px;
  }

  .hero-content {
    padding-right: 0;
    margin-bottom: 0;
    max-width: 100%;
  }

  .hero-badge { font-size: 12.5px; }

  .hero-title {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 16.5px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-buttons button {
    width: 100%;
    padding: 16px 24px; /* ≥44px touch target */
  }

  .hero-reassure { justify-content: center; }

  /* Chat mockup: auto height so all bubbles fit, centered */
  .hero-graphic {
    height: auto;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    align-items: stretch;
  }

  .floating-chat {
    max-width: 88%;
    font-size: 14px;
    padding: 11px 15px;
  }

  .features-section, .pricing-section,
  .problem-section, .how-section,
  .testimonials-section, .faq-section, .final-cta {
    padding: 56px 20px;
  }

  .section-heading {
    font-size: 28px;
    margin-bottom: 40px;
  }

  /* Stats: 2x2 on tablet/mobile */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 12px;
    margin: -40px 16px 0;
    padding: 28px 20px;
  }
  .stat-number { font-size: 32px; }

  /* Problem & how-it-works stack */
  .problem-cards { grid-template-columns: 1fr; }
  .how-grid { flex-direction: column; }
  .how-arrow { transform: rotate(-90deg); padding: 4px 0; }

  /* Bento → single column */
  .features-grid.bento { grid-template-columns: 1fr; }
  .features-grid.bento .bento-hero,
  .features-grid.bento .bento-wide { grid-column: span 1; }

  /* Testimonials stack */
  .testimonials-grid { grid-template-columns: 1fr; }

  .final-cta h2 { font-size: 30px; }
  .final-cta p { font-size: 16px; }

  .landing-footer {
    padding: 40px 20px;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .hero-section { padding: 60px 18px 70px; }
  .hero-title {
    font-size: 29px;
  }
  .hero-subtitle { font-size: 15.5px; margin-bottom: 28px; }
  .hero-graphic { padding: 60px 12px 14px; }

  .section-heading {
    font-size: 23px;
    margin-bottom: 32px;
  }

  /* Stats stay 2x2 but tighter; smaller numbers so suffix fits */
  .stats-bar { gap: 20px 8px; padding: 24px 14px; border-radius: 18px; }
  .stat-number { font-size: 27px; }
  .stat-text { font-size: 12.5px; }

  .problem-sub { font-size: 16px; margin-top: -22px; margin-bottom: 36px; }
  .how-icon { font-size: 38px; }
  .how-step { padding: 30px 22px; }

  .pricing-card {
    padding: 25px;
  }

  .price, .price-monthly {
    font-size: 36px;
  }

  .testimonial-card { padding: 24px 20px; }

  .hero-reassure { gap: 8px 14px; font-size: 12.5px; }
  .faq-q { font-size: 14.5px; padding: 15px 16px; }
  .faq-a p { font-size: 14px; }
  .final-cta { padding: 64px 20px; }
  .final-cta h2 { font-size: 25px; }
  .btn-cta-white { width: 100%; padding: 16px 24px; font-size: 16.5px; }
}


/* ═══════════════════════════════════════════════════════════════
   SMART ALERTS
   ═══════════════════════════════════════════════════════════════ */

#smartAlertsContainer > div,
#billingAlertsBar > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-body);
}


/* ═══════════════════════════════════════════════════════════════
   FINAL POLISH — Micro-detail refinements
   ═══════════════════════════════════════════════════════════════ */

/* Landing page buttons inside the admin panel override fix */
.landing-page button {
  box-shadow: none;
}

.landing-page button:hover {
  box-shadow: none;
}

.landing-page .btn-primary {
  background: linear-gradient(135deg, #008069, #25D366);
  color: #ffffff;
}

.landing-page .btn-primary:hover {
  background: linear-gradient(135deg, #006d5a, #1fb854);
}

/* Ensure admin panel btn-primary in landing context is green */
.landing-page .landing-nav-links .btn-primary {
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* Glass modal fixes for landing */
.glass-modal .modal-footer {
  background: #f8f9fa;
  border-top-color: #e9edef;
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — COMPREHENSIVE ENHANCEMENTS
   Added at the end for correct specificity cascade.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Sidebar Overlay ───────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Only show overlay on mobile where sidebar slides over content */
@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }
}


/* ─── 2–10. Mobile: 768px and below ────────────────────────── */
@media (max-width: 768px) {

  /* ── 9. Better Scrolling ── */
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* ── 3. Prevent iOS Zoom on Inputs ── */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* ── 2. Improve Touch Targets ── */
  .kanban-quick-btn {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }

  .btn-icon {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }

  .nav-item {
    padding: 14px 24px 14px 16px;
  }

  /* ── 4. Stack Grids on Mobile ── */
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* ── 6. Mobile-Friendly Main Header ── */
  .main-header {
    padding: 10px 14px;
    min-height: 50px;
  }

  .main-header h1 {
    font-size: 15px;
  }

  .sidebar-toggle {
    display: flex;
  }

  /* ── 7. Inbox on Mobile ── */
  .inbox-container {
    height: calc(100vh - 120px);
    min-height: auto;
    flex-direction: column;
  }

  .inbox-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 45vh;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  .inbox-chat {
    flex: 1;
    width: 100%;
    min-height: 0;
  }

  .inbox-msg {
    max-width: 88%;
  }

  /* ── 10. Mobile Form Improvements ── */
  input, select, textarea {
    width: 100%;
    box-sizing: border-box;
  }

  button, .btn-primary, .btn-secondary, .btn-danger-outline, .small-btn {
    min-height: 44px;
  }

  .sales-filter-bar {
    flex-direction: column;
    gap: 10px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
}


/* ─── 480px and below — Extra-small screens ────────────────── */
@media (max-width: 480px) {

  /* ── 5. Reduce Spacing on Small Screens ── */
  .container {
    padding: 12px 12px 50px;
  }

  .card {
    padding: 16px;
  }

  .modal-box {
    max-width: 95%;
    margin: 10px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .page-header h2 {
    font-size: 18px;
  }

  .main-header h1 {
    font-size: 16px;
  }

  /* KPI values smaller on very small screens */
  .sales-kpi-value {
    font-size: 24px;
  }

  /* Sales KPI: 1 column on small phones */
  .sales-kpi-row {
    grid-template-columns: 1fr;
  }

  /* Tighter nav items */
  .nav-item {
    padding: 12px 18px 12px 12px;
    font-size: 14px;
  }

  /* Inbox further adjustments */
  .inbox-sidebar {
    max-height: 40vh;
  }

  .inbox-list-header {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* ══════════════════════════════════════════════════════════════
   ROI CARD — כמה כסף הבוט מייצר ללקוח
   ══════════════════════════════════════════════════════════════ */
.roi-card {
  background: var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 22px;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.roi-card::before {
  content: "";
  position: absolute;
  top: -40%;
  inset-inline-start: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}
.roi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}
.roi-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.roi-card-sub {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}
.roi-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  color: #00875f;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.roi-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.roi-tile {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.roi-tile-primary {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.3);
}
.roi-tile-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.roi-tile-primary .roi-tile-value {
  font-size: 32px;
}
.roi-tile-label {
  font-size: 12.5px;
  opacity: 0.9;
  margin-top: 6px;
  line-height: 1.35;
}
.roi-footer {
  position: relative;
  z-index: 1;
  margin-top: 16px;
}
.roi-setup {
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.roi-setup-text {
  display: block;
  font-size: 13.5px;
  margin-bottom: 10px;
  opacity: 0.95;
}
.roi-setup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.roi-setup-row input {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #111b21;
  background: #ffffff;
}
.roi-currency {
  font-size: 18px;
  font-weight: 700;
}
.roi-save-btn {
  background: #111b21;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.roi-save-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}
.roi-edit-link {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.roi-edit-link:hover {
  background: rgba(255, 255, 255, 0.25);
}
.roi-edit-link strong {
  font-weight: 700;
}

@media (max-width: 768px) {
  .roi-grid { grid-template-columns: 1fr; }
  .roi-card-top { flex-direction: column; }
  .roi-tile-value { font-size: 26px; }
  .roi-tile-primary .roi-tile-value { font-size: 28px; }
}

/* ══════════════════════════════════════════════════════════════
   LANDING: Interactive Demo Bot + ROI Calculator
   ══════════════════════════════════════════════════════════════ */
.demo-section, .roi-calc-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 70px 20px;
  text-align: center;
}
.demo-sub {
  color: var(--text-secondary, #8696a0);
  font-size: 17px;
  margin: 12px auto 32px;
  max-width: 560px;
  line-height: 1.6;
}
.demo-chat-card {
  background: #0b141a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: right;
}
.demo-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #1f2c33;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.demo-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-gradient, linear-gradient(135deg, #00a884, #25d366));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.demo-chat-name { color: #e9edef; font-weight: 700; font-size: 15px; }
.demo-chat-status { color: #00d76f; font-size: 12px; }
.demo-chat-messages {
  padding: 20px 16px;
  height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0b141a;
}
.demo-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.demo-bubble.bot {
  align-self: flex-start;
  background: #1f2c33;
  color: #e9edef;
  border-bottom-right-radius: 4px;
}
.demo-bubble.user {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-bottom-left-radius: 4px;
}
.demo-typing-bubble { display: flex; gap: 4px; align-items: center; }
.demo-typing-bubble span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #8696a0; display: inline-block;
  animation: demoTyping 1.2s infinite ease-in-out;
}
.demo-typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.demo-typing-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes demoTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.demo-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #1f2c33;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.demo-chat-input input {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14.5px;
  background: #2a3942;
  color: #e9edef;
  outline: none;
}
.demo-chat-input input::placeholder { color: #8696a0; }
.demo-chat-input button {
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--accent, #00a884);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.demo-chat-input button:hover { opacity: 0.9; }
.demo-chat-input button:disabled { opacity: 0.5; cursor: default; }

/* ROI Calculator */
.roi-calc-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  text-align: right;
}
.roi-calc-inputs {
  background: var(--bg-card, #fff);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.roi-calc-field label {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary, #54656f);
  margin-bottom: 6px;
  font-weight: 600;
}
.roi-calc-field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #e9edef);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading, #111b21);
  background: var(--bg-card-hover, #f8f9fc);
}
.roi-calc-result {
  background: linear-gradient(160deg, #00a884, #007a60);
  color: #fff;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.roi-calc-lost-label { font-size: 14px; opacity: 0.9; }
.roi-calc-lost { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.roi-calc-lost-sub { font-size: 13px; opacity: 0.85; margin-bottom: 14px; }
.roi-calc-gain { font-size: 14.5px; line-height: 1.5; margin-bottom: 14px; }
.roi-calc-gain strong { font-size: 17px; }

@media (max-width: 768px) {
  .roi-calc-card { grid-template-columns: 1fr; }
  .roi-calc-lost { font-size: 38px; }
  .demo-chat-messages { height: 300px; }
}

/* Onboarding AI shortcut */
.onboarding-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary, #54656f);
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Inbox chat (WhatsApp dark theme)
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .inbox-chat { background: #0b141a; }
html[data-theme="dark"] .inbox-chat::before { opacity: 0.12; }
html[data-theme="dark"] .inbox-chat-header { background: #202c33; }
html[data-theme="dark"] .inbox-input-area { background: #202c33; }
html[data-theme="dark"] .inbox-input-wrapper { background: #2a3942; border-color: #2a3942; }
html[data-theme="dark"] .btn-send-wa:hover { background: #2a3942; }

/* Incoming (customer) bubble */
html[data-theme="dark"] .inbox-msg.user { background: #202c33; }
html[data-theme="dark"] .inbox-msg.user::after { border-color: transparent transparent transparent #202c33; }

/* Outgoing (bot) bubble */
html[data-theme="dark"] .inbox-msg.assistant { background: #005c4b; }
html[data-theme="dark"] .inbox-msg.assistant::after { border-left-color: #005c4b; }
html[data-theme="dark"] .inbox-msg.assistant .inbox-msg-meta { color: rgba(233, 237, 239, 0.55); }

/* Manual (human) bubble */
html[data-theme="dark"] .inbox-msg.manual { background: #0a6b57; }
html[data-theme="dark"] .inbox-msg.manual::after { border-left-color: #0a6b57; }

/* Date divider + scrollbar */
html[data-theme="dark"] .inbox-date-divider span { background: #182229; color: #8696a0; box-shadow: none; }
html[data-theme="dark"] .inbox-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }

/* ══════════════════════════════════════════════════════════════
   LEADS TABLE — status pills (visible in light + dark) + compact rows
   ══════════════════════════════════════════════════════════════ */
.status-select {
  border: none;
  outline: none;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 999px;
  padding: 5px 12px;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  max-width: 150px;
}
/* רשימת האפשרויות הנפתחת — קריאה בשני המצבים */
.status-select option {
  background: var(--bg-card);
  color: var(--text-heading);
  font-weight: 600;
}
.status-new        { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.status-progress   { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.status-success    { background: rgba(16, 185, 129, 0.18); color: #047857; }
.status-irrelevant { background: rgba(239, 68, 68, 0.15);  color: #dc2626; }

html[data-theme="dark"] .status-new        { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
html[data-theme="dark"] .status-progress   { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
html[data-theme="dark"] .status-success    { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
html[data-theme="dark"] .status-irrelevant { background: rgba(239, 68, 68, 0.22);  color: #fca5a5; }

/* טבלת לידים קומפקטית יותר — כל העמודות נכנסות יפה */
#leadsTable th,
#leadsTable td { padding: 11px 12px; }
#leadsTable td { font-size: 13.5px; }

/* ══════════════════════════════════════════════════════════════
   PWA SAFE AREAS — keeps buttons clear of the notch / status bar /
   home indicator when installed as an app (viewport-fit=cover).
   env(safe-area-inset-*) is 0 on devices without insets, so this is
   a no-op there. Scoped to mobile so desktop is unaffected.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Top app header — push the hamburger / bell / theme buttons below the status bar */
  .main-header {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-right: calc(14px + env(safe-area-inset-right));
    padding-left: calc(14px + env(safe-area-inset-left));
  }

  /* Side menu — top logo/close and bottom logout clear of system UI */
  .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Notifications panel drops below the status bar */
  .notif-panel {
    top: calc(56px + env(safe-area-inset-top)) !important;
  }

  /* Inbox message input clears the home indicator */
  .inbox-input-area {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  /* Bottom of page content clears the home indicator */
  .main-wrapper {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ══════════════════════════════════════════════════════════════
   מרכז שליטה (Overview) — KPIs, בריאות, צמיחה, איכות בוט, משימות, ציר זמן
   ══════════════════════════════════════════════════════════════ */

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}
.kpi-card:nth-child(4n+1)::before { background: #3b82f6; }
.kpi-card:nth-child(4n+2)::before { background: #f59e0b; }
.kpi-card:nth-child(4n+3)::before { background: var(--accent); }
.kpi-card:nth-child(4n+4)::before { background: #8b5cf6; }
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: var(--shadow-md), var(--card-top-highlight); }
.kpi-label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* Health dot (businesses list + overview table) */
.health-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* Growth / MRR */
.growth-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.growth-stat-val { font-size: 20px; font-weight: 700; }
.growth-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.growth-bars { display: flex; flex-direction: column; gap: 8px; }
.growth-bar-row { display: flex; align-items: center; gap: 10px; }
.growth-bar-label { width: 46px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.growth-bar-track { flex: 1; height: 10px; background: var(--bg-hover); border-radius: 6px; overflow: hidden; }
.growth-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.growth-bar-val { width: 78px; text-align: left; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; direction: ltr; }
.growth-caption { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* Bot quality */
.bq-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.bq-stat { background: var(--bg-secondary); border-radius: 10px; padding: 12px 6px; }
.bq-stat-val { font-size: 24px; font-weight: 700; }
.bq-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.bq-list-title { font-size: 13px; font-weight: 700; color: var(--text-heading); margin: 14px 0 6px; }
.bq-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bq-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 8px 10px; background: var(--bg-secondary); border-radius: 8px; }
.bq-q { color: var(--text-secondary); }
.bq-biz { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

/* Action items */
.action-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.action-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-secondary); border-radius: 10px; border: 1px solid var(--border); }
.action-item:hover { background: var(--bg-hover); }
.action-icon { font-size: 18px; flex-shrink: 0; }
.action-text { flex: 1; font-size: 14px; color: var(--text-heading); }
.action-go { color: var(--text-muted); font-size: 20px; font-weight: 700; }

/* Tasks */
.task-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-add-row input[type="text"], .task-add-row input:not([type]) { flex: 1; min-width: 160px; }
.task-add-row input[type="date"] { width: 150px; }
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-secondary); border-radius: 10px; }
.task-item input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary); }
.task-title { flex: 1; font-size: 14px; color: var(--text-heading); }
.task-item.done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-due { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.task-due.overdue { color: #ef4444; font-weight: 700; }
.task-biz { font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.task-del { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .6; padding: 2px; }
.task-del:hover { opacity: 1; }

/* Business timeline (modal) — שמות ייחודיים כדי לא להתנגש בטיימליין המכירות */
.biz-tl { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.biz-tl-item { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.biz-tl-item:last-child { border-bottom: none; }
.biz-tl-icon { font-size: 18px; flex-shrink: 0; width: 26px; text-align: center; }
.biz-tl-body { flex: 1; }
.biz-tl-desc { font-size: 14px; color: var(--text-heading); line-height: 1.4; }
.biz-tl-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* AI costs & profitability */
.cost-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.cost-summary > div { background: var(--bg-secondary); border-radius: 10px; padding: 14px 10px; text-align: center; }
.cost-sum-val { font-size: 22px; font-weight: 700; }
.cost-sum-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.live-badge {
  font-size: 11px; font-weight: 700; color: #10b981;
  background: rgba(16,185,129,0.12); border-radius: 20px;
  padding: 2px 8px; margin-inline-start: 6px; vertical-align: middle;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* תמונות עיצוב לשירות (גלריה בעמוד הגדרות בוט) */
.svc-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: flex-start; }
.svc-thumb { position: relative; width: 90px; }
.svc-thumb img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.svc-thumb-cap { width: 90px; margin-top: 4px; font-size: 11px; padding: 3px 5px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text); }
.svc-thumb-del { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: #ef4444; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.svc-add-img { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 90px; height: 90px; border: 2px dashed var(--border); border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--text-muted); text-align: center; padding: 6px; transition: border-color .15s, color .15s; }
.svc-add-img:hover { border-color: var(--primary); color: var(--primary); }
.svc-images-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
@media (max-width: 480px) {
  .svc-thumb, .svc-thumb-cap, .svc-add-img { width: 78px; }
  .svc-thumb img, .svc-add-img { width: 78px; height: 78px; }
  .svc-thumb-cap { font-size: 16px; } /* 16px במובייל למניעת זום אוטומטי ב-iOS */
}

/* מנוע מכירות AI — כרטיסי פוטנציאליים */
.se-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.se-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.se-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.se-type { font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; }
.se-status { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); font-weight: 600; font-size: 13px; cursor: pointer; }
.se-meta { font-size: 12px; color: var(--text-secondary); margin: 8px 0; }
.se-meta a { color: var(--primary); }
.se-msg { font-size: 14px; color: var(--text-heading); background: var(--bg-secondary); border-radius: 10px; padding: 10px 12px; line-height: 1.5; white-space: pre-wrap; }
.se-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.se-send { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 8px 14px; font-size: 14px; margin: 0; }
.se-nophone { font-size: 12px; color: var(--text-muted); }
@media (max-width: 480px) {
  .se-card-head { flex-direction: column; align-items: flex-start; }
  .se-status { font-size: 16px; }
  .se-send { flex: 1; justify-content: center; }
}

/* מסך "ממתין" (pending) — מסתיר את הסיידבר/תפריט; התוכן ברוחב מלא */
#app-dashboard.pending-mode .sidebar { display: none; }
#app-dashboard.pending-mode .main-wrapper { margin-right: 0; }
#app-dashboard.pending-mode .sidebar-toggle { display: none !important; }

/* Overview responsive */
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 24px; }
  .growth-stats { grid-template-columns: repeat(2, 1fr); }
  .bq-stats { grid-template-columns: repeat(3, 1fr); }
  .growth-bar-label { width: 40px; }
  .growth-bar-val { width: 64px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cost-summary { gap: 8px; }
  .cost-sum-val { font-size: 18px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-value { font-size: 21px; }
  .kpi-label { font-size: 12px; }
  .task-add-row input[type="date"] { width: 100%; }
  .task-add-row { gap: 6px; }
  .bq-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .bq-biz { font-size: 10px; }
  /* קלט 16px במובייל כדי שה-iOS לא יזום אוטומטית */
  .task-add-row input, #timelineNoteInput, #onbBusinessName, #onbBusinessType, #onbOwnerPhone, #onbWelcome { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   CRM Pro — Kanban board, lead card drawer, source attribution
   משתמש במשתני ה-theme כדי לתמוך אוטומטית ב-dark mode ובעיצוב הפרימיום
   ═══════════════════════════════════════════════════════════════ */

/* ─── Leads Hub — מתג תצוגה (לוח / רשימה / אנליטיקה) ─── */
.leads-view-switch {
  display: flex;
  gap: 6px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 18px;
  width: fit-content;
}
.lv-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.lv-btn:hover { color: var(--text-primary); }
.lv-btn.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.leads-view { animation: pageIn 0.3s ease; }
@media (max-width: 768px) {
  .leads-view-switch { width: 100%; }
  .lv-btn { flex: 1; min-height: 44px; padding: 9px 6px; }
}

/* ─── Google Calendar — תגיות סטטוס בעמוד היומן ─── */
.gcal-status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gcal-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.gcal-pill.gcal-on { background: var(--accent-light); color: var(--accent-dark); }
.gcal-pill.gcal-off { background: var(--bg-card-hover); color: var(--text-muted); }
.gcal-btn { padding: 7px 14px !important; font-size: 13px !important; }
@media (max-width: 768px) { .gcal-btn { min-height: 44px; } }

/* ─── Toolbar ─── */
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}
.crm-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.crm-search,
.crm-source-filter {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition);
}
.crm-search { min-width: 240px; }
.crm-search:focus,
.crm-source-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* ─── Source attribution strip ─── */
.crm-source-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.crm-source-stats:empty { display: none; }
.crm-src-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  min-width: 150px;
}
.crm-src-name { font-weight: 700; color: var(--text-heading); font-size: 13px; margin-bottom: 4px; }
.crm-src-nums { font-size: 12px; color: var(--text-secondary); }
.crm-src-total { color: var(--accent); font-weight: 700; }
.crm-src-won { color: var(--success); font-weight: 700; }

/* ─── Kanban board ─── */
.crm-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 14px;
  align-items: flex-start;
  min-height: 300px;
}
.crm-col {
  flex: 0 0 300px;
  width: 300px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 230px);
  transition: background var(--transition), box-shadow var(--transition);
}
.crm-col.crm-col-over { background: var(--accent-light); box-shadow: inset 0 0 0 2px var(--accent); }
.crm-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}
.crm-col-title { font-weight: 600; color: var(--text-secondary); font-size: 14px; }
.crm-col-count {
  background: var(--bg-main);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.crm-col-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.crm-col-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 18px 0; }

/* ─── Lead card ─── */
.crm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm), var(--card-top-highlight);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.crm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--card-top-highlight); border-color: var(--border-hover); }
.crm-card.dragging { opacity: 0.5; }
.crm-card-top { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.crm-card-name { font-weight: 600; color: var(--text-heading); font-size: 14px; margin: 4px 0 2px; }
.crm-card-svc { font-size: 13px; color: var(--text-secondary); }
.crm-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.crm-card-source {
  font-size: 11px;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.crm-card-urgent { font-size: 13px; }
.crm-tag {
  font-size: 11px;
  background: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ─── Temperature badges ─── */
.crm-temp { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.crm-temp-hot  { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.crm-temp-warm { background: var(--warning-light); color: var(--warning); }
.crm-temp-cold { background: rgba(56, 189, 248, 0.12); color: var(--sky); }

/* ─── Lead card drawer ─── */
.crm-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1200;
  display: flex;
  justify-content: flex-start; /* drawer on the left, away from RTL sidebar */
}
.crm-drawer {
  position: relative;
  width: 480px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: crmDrawerIn 0.22s ease;
  overflow: hidden;
}
@keyframes crmDrawerIn { from { transform: translateX(-30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.crm-drawer-x {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
}
.crm-drawer-x:hover { background: var(--danger-light); color: var(--danger); }
.crm-drawer-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.crm-dh-name { font-size: 20px; font-weight: 700; color: var(--text-heading); }
.crm-dh-sub { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.crm-dh-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.crm-dh-phone { direction: ltr; unicode-bidi: embed; }
.crm-wa-link {
  background: var(--accent-gradient);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.crm-drawer-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.crm-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.crm-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-light); }
.crm-drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* ─── Drawer: forms / sections ─── */
.crm-form-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.crm-cf-section { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.crm-sec-title { font-weight: 700; color: var(--text-heading); font-size: 13px; margin-bottom: 8px; }

/* ─── Drawer: notes ─── */
.crm-note-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.crm-note-add textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.crm-note-add button { align-self: flex-end; }
.crm-notes-list { display: flex; flex-direction: column; gap: 10px; }
.crm-note {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.crm-note-text { color: var(--text-primary); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.crm-note-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.crm-note-del { border: none; background: transparent; cursor: pointer; font-size: 14px; opacity: 0.7; }
.crm-note-del:hover { opacity: 1; }

/* ─── Drawer: timeline ─── */
.crm-timeline { display: flex; flex-direction: column; gap: 10px; }
.crm-tl-item { border-right: 3px solid var(--accent); background: var(--bg-card-hover); border-radius: var(--radius-sm); padding: 10px 12px; }
.crm-tl-date { font-weight: 700; color: var(--text-heading); font-size: 14px; }
.crm-tl-status { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.crm-tl-notes { font-size: 13px; color: var(--text-body); margin-top: 4px; }

/* ─── Drawer: conversation ─── */
.crm-convo {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  max-height: 60vh;
  overflow-y: auto;
}
/* תצוגת שיחת וואטסאפ בתוך כרטיס הליד — מאמץ את רקע ובועות הסימולטור */
.crm-convo-chat {
  max-height: none;
  min-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ─── Drawer: AI insights ─── */
.crm-ai-block { display: flex; flex-direction: column; gap: 12px; }
.crm-ai-row { display: flex; gap: 8px; align-items: center; }
.crm-ai-card {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}
.crm-ai-label { font-weight: 700; color: var(--accent-dark); font-size: 13px; margin-bottom: 4px; }

/* ─── Custom fields modal ─── */
.crm-cf-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.crm-cf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.crm-cf-label { font-weight: 600; color: var(--text-primary); flex: 1; }
.crm-cf-type { font-size: 11px; color: var(--text-muted); background: var(--bg-main); padding: 2px 8px; border-radius: 999px; }
.crm-cf-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.crm-cf-add input {
  flex: 1;
  min-width: 140px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}
.crm-cf-add select {
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
}

/* ─── Responsive: tablet ─── */
@media (max-width: 768px) {
  .crm-toolbar { flex-direction: column; align-items: stretch; }
  .crm-toolbar-filters { margin-right: 0; }
  .crm-search { min-width: 0; flex: 1; }
  .crm-col { flex: 0 0 82vw; width: 82vw; max-height: none; }
  .crm-board { min-height: 200px; }
  .crm-drawer { width: 100%; max-width: 100%; }
  /* קלט 16px במובייל כדי שה-iOS לא יזום אוטומטית */
  .crm-search, .crm-source-filter,
  .crm-note-add textarea, .crm-cf-add input, .crm-cf-add select,
  .crm-drawer-body input, .crm-drawer-body textarea, .crm-drawer-body select { font-size: 16px; }
  /* יעדי מגע ≥44px */
  .crm-tab-btn, .crm-toolbar-filters button, .crm-note-del, .crm-drawer-x { min-height: 44px; }
  .crm-note-del { min-width: 44px; }
}

/* ─── Responsive: phone ─── */
@media (max-width: 480px) {
  .crm-col { flex: 0 0 88vw; width: 88vw; }
  .crm-dh-name { font-size: 18px; }
  .crm-drawer-tabs { gap: 2px; }
  .crm-tab-btn { padding: 8px 9px; font-size: 12px; }
  .crm-src-chip { min-width: 130px; flex: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   CRM v2 — פילטרים מהירים, תאריך חזרה, מענה AI, סיפור הליד
   ═══════════════════════════════════════════════════════════════ */
.crm-quick-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.crm-chip {
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 100px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s ease;
}
.crm-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.crm-chip.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.crm-chip-count { background: var(--bg-main); border-radius: 100px; padding: 0 7px; font-size: 11px; min-width: 18px; text-align: center; }
.crm-chip.active .crm-chip-count { background: var(--accent); color: #fff; }
.crm-chip.crm-chip-alert { color: var(--danger); border-color: rgba(239,68,68,0.4); }
.crm-chip.crm-chip-alert.active { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

.crm-card-due { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; }
.crm-due-overdue { background: var(--danger-light); color: var(--danger); }
.crm-due-today { background: var(--warning-light); color: var(--warning); }
.crm-card-deal { font-size: 11px; font-weight: 700; color: var(--accent); margin-inline-start: auto; }

.crm-draft-box { margin-top: 12px; }
.crm-draft { background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; }
.crm-draft-text { width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font: inherit; font-size: 14px; resize: vertical; background: var(--bg-card); color: var(--text-primary); }
.crm-draft-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.crm-draft-actions .btn-secondary { text-decoration: none; }
.crm-draft-alt { margin-top: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.crm-story { display: flex; flex-direction: column; padding: 6px 4px; }
.crm-story-item { display: flex; gap: 12px; position: relative; padding: 0 0 16px; }
.crm-story-item::before { content: ""; position: absolute; inset-inline-start: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.crm-story-item:last-child::before { display: none; }
.crm-story-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-card); flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1; }
.crm-story-content { flex: 1; }
.crm-story-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.crm-story-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── רכישות (Purchases) בכרטיס הליד ─── */
.crm-purchases { padding: 4px 2px; }
.crm-purchase-total { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.crm-purchase-total strong { color: var(--accent); font-size: 18px; }
.crm-purchase-add { background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; margin-bottom: 14px; }
.crm-purchase-add button { margin-top: 8px; }
.crm-purchase { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--bg-card); }
.crm-purchase-main { display: flex; align-items: center; gap: 10px; }
.crm-purchase-amt { font-weight: 700; color: var(--accent); }
.crm-purchase-prod { font-size: 13px; color: var(--text-primary); }
.crm-purchase-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.crm-purchase-meta .crm-note-del { margin-inline-start: auto; }

/* ─── Dashboard (KPI + משפך לפי שלב) בראש הבורד ─── */
.crm-dashboard { margin: 4px 0 14px; display: grid; grid-template-columns: 1fr; gap: 12px; }
.crm-dashboard:empty { display: none; }
.crm-dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.crm-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.crm-kpi-val { font-size: 22px; font-weight: 700; color: var(--text-heading); line-height: 1.1; }
.crm-kpi-lbl { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.crm-kpi-rev .crm-kpi-val { color: var(--accent); }
.crm-dash-funnel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.crm-fn-row { display: flex; align-items: center; gap: 10px; }
.crm-fn-label { font-size: 12px; color: var(--text-secondary); width: 110px; flex-shrink: 0; text-align: start; }
.crm-fn-bar { flex: 1; height: 10px; background: var(--bg-main); border-radius: 100px; overflow: hidden; }
.crm-fn-fill { display: block; height: 100%; border-radius: 100px; min-width: 2px; transition: width .3s ease; }
.crm-fn-count { font-size: 13px; font-weight: 700; color: var(--text-primary); width: 36px; text-align: end; flex-shrink: 0; }
@media (max-width: 768px) {
  .crm-dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .crm-fn-label { width: 84px; }
}

/* ─── AI Business Analyst — "שאל את העסק שלך" ─── */
.crm-ask { margin: 0 0 14px; }
.crm-ask-row { display: flex; gap: 8px; }
.crm-ask-input { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font: inherit; font-size: 14px; background: var(--bg-card); color: var(--text-primary); }
.crm-ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--border-focus); }
.crm-ask-answer { display: none; margin-top: 10px; background: var(--accent-light); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.crm-ask-text { font-size: 14px; color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }

/* ─── סטטוס מפורט (sub-status) — צ'יפ צבעוני בקלף ─── */
.crm-card-substatus { margin: 4px 0 0; }
.crm-sub-chip { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px; border: 1px solid; }

/* ─── משימות פר-ליד (Tasks) ─── */
.crm-tasks { padding: 4px 2px; }
.crm-task-add { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.crm-task-add #crmTaskTitle { flex: 1; min-width: 150px; }
.crm-task-add input { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; font-size: 14px; background: var(--bg-card); color: var(--text-primary); }
.crm-task-add input:focus { outline: none; border-color: var(--accent); }
.crm-task { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--bg-card); }
.crm-task-check { display: flex; align-items: center; padding-top: 1px; }
.crm-task-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.crm-task-body { flex: 1; }
.crm-task-title { font-size: 14px; color: var(--text-primary); line-height: 1.4; }
.crm-task-done .crm-task-title { text-decoration: line-through; color: var(--text-muted); }
.crm-task-due { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.crm-task-due.crm-task-overdue { color: var(--danger); font-weight: 700; }
.crm-task-due.crm-task-today { color: var(--warning); font-weight: 700; }
.crm-task .crm-note-del { margin-inline-start: auto; }

/* ══════════════════════════════════════════════════════════════
   MOBILE POLISH PASS (v=55) — נספח בסוף הקובץ כדי לנצח בקסקייד.
   class-safe בלבד (כללים חדשים / restyle למחלקות קיימות, ללא שינוי שמות).
   מטרה: ניווט נוח בטלפון לבעלי עסקים. RTL + dark נשמרים.
   ══════════════════════════════════════════════════════════════ */

/* drawer RTL — אנימציית כניסה מהקצה הימני (הקיימת היא LTR וגרמה ל-flicker) */
@keyframes sidebarSlideRTL { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* כפתור "חזרה" ב-Inbox — מוסתר בדסקטופ, מופיע רק במובייל */
.inbox-back-btn { display: none; }

/* המבורגר בולט גם ב-dark */
html[data-theme="dark"] .sidebar-toggle { box-shadow: 0 6px 16px rgba(1, 125, 99, 0.6); }

@media (max-width: 768px) {
  /* ── ניווט: drawer + המבורגר נקי-notch ── */
  .sidebar.active { animation: sidebarSlideRTL 0.3s ease; }
  .sidebar-toggle {
    top: calc(14px + env(safe-area-inset-top));
    right: calc(14px + env(safe-area-inset-right));
  }

  /* ── הדר: כפתורי אייקון 44px + פאנל התראות נפתח מימין (RTL) ── */
  .header-icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 2px; }
  .notif-panel { right: 10px; left: auto; width: auto; max-width: calc(100vw - 20px); }
  .main-header { min-height: 56px; gap: 8px; }

  /* ── KPI: כל שורת הסטטיסטיקות לעמודה אחת (גם כשיש inline grid כמו בחיוב) ── */
  .stats-row { grid-template-columns: 1fr !important; }

  /* ── סרגל לידים: היפוך לעמודה, שדות מלאי-רוחב ── */
  .leads-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .leads-toolbar select { min-width: 0; width: 100%; }
  .leads-toolbar button { width: 100%; min-height: 44px; }
  .leads-search { max-width: 100%; min-width: 0; }

  /* ── Inbox: פאנל-יחיד (רשימה או צ'אט) עם כפתור חזרה ── */
  .inbox-sidebar { max-height: none; }
  .inbox-container.inbox-chat-open .inbox-sidebar { display: none; }
  .inbox-container.inbox-chat-open .inbox-chat { flex: 1; }
  .inbox-back-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    margin-inline-end: 2px; padding: 0;
    border: none; background: transparent; color: inherit;
    border-radius: 50%; cursor: pointer; flex: none;
  }
  .inbox-btn-toggle { padding: 10px 16px; min-height: 44px; }
  .inbox-btn-close { min-height: 44px; padding: 10px 14px; }

  /* ── CRM drawer: כפתור סגירה 44px + טאבים בגלילה אופקית ── */
  .crm-drawer-x { width: 44px; height: 44px; top: 16px; left: 16px; font-size: 18px; }
  .crm-drawer-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .crm-drawer-tabs::-webkit-scrollbar { display: none; }
  .crm-tab-btn { flex: 0 0 auto; }
  .crm-src-chip { min-width: 0; flex: 0 0 calc(50% - 5px); }

  /* ── מודאל: כפתורי footer בעמודה, מלאי-רוחב (הראשי בתחתית — נגיש לאגודל) ── */
  .modal-footer { flex-direction: column-reverse; gap: 8px; }
  .modal-footer button { width: 100%; min-height: 44px; }

  /* ── טאבים: יעד מגע 44px ── */
  .tab-btn { min-height: 44px; }
}

@media (max-width: 480px) {
  /* drawer צר יותר בטלפונים קטנים */
  .sidebar { --sidebar-width: 260px; }
  .sidebar .nav-item { padding: 10px 16px; margin: 2px 6px; }

  /* כותרת עמוד בולטת מעל תוכן */
  .main-header h1 { font-size: 18px; font-weight: 700; }

  /* KPI קומפקטי כשמתקפל ל-1 עמודה */
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 24px; }
  .stat-icon { width: 24px; height: 24px; margin-bottom: 8px; }

  /* טבלאות: צפיפות מופחתת אך קריאה */
  .data-table { font-size: 12px; }
  .data-table th { font-size: 11px; }
  .data-table td { padding: 10px 8px; }

  /* טפסים קומפקטיים */
  .form-group { margin-bottom: 10px; }
  textarea { min-height: 60px; }

  /* Command palette נוח למגע */
  .cmdk-overlay { padding: 8vh 12px 12px; }
  .cmdk-item { padding: 12px 10px; min-height: 44px; }

  /* CRM source chips מלאי-רוחב */
  .crm-src-chip { flex: 0 0 100%; }
}
