/* ===== Design Tokens ===== */
:root {
  --bg: #08090C;
  --surface: #0E1014;
  --surface-2: #131520;
  --border: rgba(255, 255, 255, .08);
  --border-hover: rgba(255, 255, 255, .14);
  --text: #EDEFF5;
  --muted: #9BA0AA;
  --dim: #5B606B;
  --primary: #10B981;
  --primary-hover: #34D399;
  --emerald-glow: rgba(16, 185, 129, .35);
  --emerald-line: rgba(16, 185, 129, .25);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --transition: all 0.15s ease;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* steel surfaces (theme-aware) */
  --grad-primary:   linear-gradient(180deg, #FFFFFF 0%, #E6E8ED 100%);
  --grad-primary-h: linear-gradient(180deg, #FFFFFF 0%, #EFF1F5 100%);
  --primary-text:   #0A0B0E;
  --glass-card:     linear-gradient(180deg, rgba(20, 22, 32, .85), rgba(14, 16, 24, .85));
  --input-bg:       rgba(0, 0, 0, .25);
  --input-bg-h:     rgba(0, 0, 0, .35);
  --grid-line-1:    rgba(255, 255, 255, .025);
  --grid-line-2:    rgba(255, 255, 255, .015);
}

[data-theme="light"] {
  --bg:        #FAFAF9;
  --surface:   #FFFFFF;
  --surface-2: #F4F5F7;
  --border:        rgba(15, 23, 30, .08);
  --border-hover:  rgba(15, 23, 30, .14);
  --text:   #0A0B0E;
  --muted:  #5B606B;
  --dim:    #8B8F99;

  --emerald-glow: rgba(16, 185, 129, .22);
  --emerald-line: rgba(16, 185, 129, .35);

  --grad-primary:   linear-gradient(180deg, #16181E 0%, #08090C 100%);
  --grad-primary-h: linear-gradient(180deg, #1E2128 0%, #0E1015 100%);
  --primary-text:   #FAFAF9;
  --glass-card:     linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(252, 252, 250, .85));
  --input-bg:       rgba(15, 23, 30, .025);
  --input-bg-h:     rgba(15, 23, 30, .04);
  --grid-line-1: rgba(15, 23, 30, .04);
  --grid-line-2: rgba(15, 23, 30, .025);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: var(--bg); }

/* ===== LOGIN — Glass & Steel ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
/* CRITICAL: [hidden] must beat display:flex — otherwise login-screen
   stays visible after successful sign-in (display:flex wins by specificity). */
.login-screen[hidden],
#app[hidden],
[hidden] { display: none !important; }
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line-1) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-2) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 0%, transparent 80%);
  pointer-events: none;
}
.login-aurora {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.login-aurora__glow {
  position: absolute; border-radius: 50%;
  filter: blur(100px);
  opacity: .85;
  will-change: transform;
}
.login-aurora__glow--a {
  top: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: rgba(16, 185, 129, .14);
  animation: glowA 22s var(--ease) infinite;
}
.login-aurora__glow--b {
  bottom: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: rgba(99, 102, 241, .08);
  animation: glowB 28s var(--ease) infinite;
}
@keyframes glowA { 50% { transform: translate(-5%, 8%); } }
@keyframes glowB { 50% { transform: translate(8%, -4%); } }

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--glass-card);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  padding: 36px 36px 30px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 60px 120px -30px rgba(0, 0, 0, .35);
  animation: cardRise .9s var(--ease) backwards;
  z-index: 1;
}
[data-theme="light"] .login-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 60px 120px -30px rgba(15, 23, 30, .18),
    0 1px 0 rgba(15, 23, 30, .04);
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* corner brackets */
.login-card__corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--border-hover);
  pointer-events: none;
  opacity: .7;
}
.login-card__corner--tl {
  top: -8px; left: -8px;
  border-right: 0; border-bottom: 0;
}
.login-card__corner--br {
  bottom: -8px; right: -8px;
  border-left: 0; border-top: 0;
}

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  direction: ltr;
}
.login-brand svg { width: 26px; height: 26px; }

.login-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 12px;
  padding: 4px 10px;
  display: inline-block;
  background: rgba(16, 185, 129, .07);
  border: 1px solid var(--emerald-line);
  border-radius: 999px;
}
.login-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 8px;
}
.login-sub {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14.5px;
  line-height: 1.5;
}

.login-form { display: grid; gap: 16px; }
.login-field { display: block; }
.login-field__label {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
.login-card input {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.login-card input::placeholder { color: var(--dim); }
.login-card input:hover { border-color: var(--border-hover); }
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--emerald-glow);
  background: var(--input-bg-h);
}

.login-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  margin-top: 8px;
  background: var(--grad-primary);
  color: var(--primary-text);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1;
  transition: all .2s var(--ease);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 1px 2px rgba(0, 0, 0, .25),
    0 8px 24px -10px rgba(0, 0, 0, .25);
}
.login-submit svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.login-submit:hover:not(:disabled) {
  background: var(--grad-primary-h);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 2px 4px rgba(0, 0, 0, .30),
    0 16px 36px -12px rgba(0, 0, 0, .35);
}
.login-submit:hover:not(:disabled) svg { transform: translateX(-3px); }
.login-submit:active:not(:disabled) { transform: translateY(0) scale(.99); }
.login-submit:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.login-submit:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 0;
  padding: 10px 12px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 8px;
}

.login-foot {
  margin: 24px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-foot__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--emerald-glow);
  animation: footPulse 2.4s var(--ease) infinite;
  flex-shrink: 0;
}
@keyframes footPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--emerald-glow); }
  50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, .15); }
}

/* ===== TOGGLES (theme + language) ===== */
.toggles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.toggle:hover { background: var(--input-bg-h); color: var(--text); }
.toggle:active { transform: scale(.94); }
.toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle__icon { width: 15px; height: 15px; transition: opacity .25s var(--ease); }
.toggle__icon--sun { display: block; }
.toggle__icon--moon { display: none; }
[data-theme="light"] .toggle__icon--sun { display: none; }
[data-theme="light"] .toggle__icon--moon { display: block; }
.toggle__label { line-height: 1; }

/* ===== ADVANTAGES MARQUEE ===== */
.marquee {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin-top: 32px;
  overflow: hidden;
  z-index: 1;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee__edge { display: none; } /* reserved for future fade overlays if needed */

.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  animation: marquee 60s linear infinite;
  width: max-content;
}
/* RTL reverses the direction so items enter from the LEFT (Hebrew reading flow) */
[dir="rtl"] .marquee__track { animation-direction: reverse; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}
.marquee__item i {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--emerald-glow);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ===== Transitions for theme switch ===== */
html { transition: background .35s var(--ease), color .35s var(--ease); }

@media (max-width: 540px) {
  .login-card { padding: 28px 24px 24px; max-width: 100%; }
  .login-top { flex-wrap: wrap; }
  .marquee { margin-top: 24px; }
  .marquee__item { font-size: 11.5px; padding: 6px 12px; }
}


/* ===== APP SHELL ===== */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 0;
}
.brand { padding: 0 20px 24px; display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 22px; }
.brand-name { font-weight: 700; font-size: 16px; }

.nav { flex: 1; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px;
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary); color: white; }

.user-card {
  margin: 16px 12px 0; padding: 12px;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.user-name { font-weight: 600; }
.user-role { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.logout-btn {
  width: 100%; padding: 7px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; transition: var(--transition);
}
.logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ===== MAIN ===== */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 600; }
.topbar-right { display: flex; gap: 10px; align-items: center; }

.pill {
  padding: 4px 10px; font-size: 12px;
  border-radius: 999px;
  background: var(--surface-2);
}
.pill.connected { color: var(--success); background: rgba(16,185,129,0.1); }
.pill.disconnected { color: var(--danger); background: rgba(239,68,68,0.1); }

.icon-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); width: 36px; height: 36px;
  border-radius: var(--radius-sm); font-size: 16px;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--primary); }

.page-content { flex: 1; padding: 28px; overflow-y: auto; }
.loading { text-align: center; padding: 40px; color: var(--muted); }

/* ===== CARDS / TABLES ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 600; margin: 0; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-trend { font-size: 11px; margin-top: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

table.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  background: var(--surface-2);
  padding: 10px 12px; font-weight: 600; font-size: 12px;
  color: var(--muted); text-align: right; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge { padding: 2px 8px; font-size: 11px; border-radius: 999px; }
.badge.success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge.danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge.muted { background: var(--surface-2); color: var(--muted); }
.badge.primary { background: rgba(59,130,246,0.15); color: var(--primary); }

button.btn {
  padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); transition: var(--transition);
}
button.btn:hover { background: var(--surface); border-color: var(--primary); }
button.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
button.btn.primary:hover { background: var(--primary-hover); }
button.btn.danger { color: var(--danger); border-color: var(--danger); }
button.btn.danger:hover { background: var(--danger); color: white; }
button.btn.small { padding: 4px 10px; font-size: 12px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex-shrink: 0; }
.spacer { flex: 1; }

select, input.text-input {
  padding: 8px 12px; font-size: 13px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: var(--transition);
}
select:focus, input.text-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Online dot */
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.online-dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.online-dot.off { background: var(--muted); }

/* Chart container */
.chart-box { height: 280px; position: relative; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 13px; z-index: 9999; animation: slideUp 0.2s ease;
}
.toast.ok { border-color: var(--success); }
.toast.err { border-color: var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Forms */
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid textarea, .form-grid select { width: 100%; }
.form-grid textarea { padding: 8px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 90px; font-family: inherit; font-size: 13px; }

/* Empty state */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty-icon { font-size: 40px; margin-bottom: 10px; }

/* Mobile */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ===== Lead modal ===== */
.lead-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: leadFadeIn .2s var(--ease);
}
[data-theme="light"] .lead-modal-overlay { background: rgba(15, 23, 30, .25); }
@keyframes leadFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lead-modal {
  position: relative;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  background: var(--glass-card);
  backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 24px 28px 22px;
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.5);
  animation: leadRise .25s var(--ease);
}
@keyframes leadRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.lead-modal__close {
  position: absolute; top: 12px; inset-inline-end: 14px;
  width: 30px; height: 30px;
  background: transparent; border: 0; border-radius: 999px;
  color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; transition: all .15s var(--ease);
}
.lead-modal__close:hover { background: var(--glass); color: var(--text); }

.lead-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.lead-modal__head h3 { font-size: 19px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.lead-modal__head .muted-small { font-size: 12px; color: var(--muted); }

.lead-modal__section { margin-bottom: 14px; }
.lead-modal__section label {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.lead-modal__quote {
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px; line-height: 1.55;
  color: var(--text);
  max-height: 180px; overflow-y: auto;
}
.lead-modal__contacts { display: flex; flex-wrap: wrap; gap: 10px; }
.lead-modal__contacts a {
  padding: 6px 10px; background: var(--glass); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; color: var(--text);
  text-decoration: none; transition: all .15s var(--ease);
}
.lead-modal__contacts a:hover { background: var(--glass-hover); border-color: var(--border-hover); }
.lead-modal__section textarea, .lead-modal__section select {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px; font-family: inherit;
  resize: vertical;
}
.lead-modal__section textarea:focus, .lead-modal__section select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}
.lead-modal__actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.lead-modal__actions .btn {
  padding: 9px 16px; font-size: 13px;
}

/* ===== Impersonation combobox ===== */
.impersonate-combo {
  position: relative;
  display: inline-block;
  min-width: 220px;
}
.impersonate-combo input {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 13px;
  transition: all .15s var(--ease);
}
.impersonate-combo input::placeholder { color: var(--dim); }
.impersonate-combo input:hover  { border-color: var(--border-hover); }
.impersonate-combo input:focus  { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--emerald-glow); }

.impersonate-list {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 100%;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 4px;
  list-style: none;
  margin: 0;
  z-index: 200;
  box-shadow: 0 16px 48px -16px rgba(0,0,0,.5);
  animation: comboIn .15s var(--ease);
}
[data-theme="light"] .impersonate-list { box-shadow: 0 16px 48px -16px rgba(15,23,30,.18); }
@keyframes comboIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.impersonate-list li {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: background .12s var(--ease);
}
.impersonate-list li:hover,
.impersonate-list li.is-active { background: var(--input-bg-h); }
.impersonate-list li.is-current {
  background: rgba(16, 185, 129, .12);
}
.impersonate-list li em {
  font-style: normal;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}
.impersonate-list li mark {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}
.impersonate-empty {
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
  cursor: default;
}

.impersonate-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  background: linear-gradient(90deg, #F59E0B, #EC4899);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(245, 158, 11, .5);
  animation: impersonatePulse 3s var(--ease) infinite;
}
.impersonate-bar strong { font-weight: 700; }
.impersonate-eye { font-size: 14px; }
.impersonate-bar button {
  background: rgba(0, 0, 0, .25);
  color: #FFFFFF;
  border: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.impersonate-bar button:hover { background: rgba(0, 0, 0, .4); }

@keyframes impersonatePulse {
  0%, 100% { box-shadow: 0 4px 14px -4px rgba(245, 158, 11, .5); }
  50%      { box-shadow: 0 6px 20px -4px rgba(236, 72, 153, .7); }
}

/* When impersonating, paint the sidebar with a colored stripe so the admin
   NEVER forgets they're viewing as someone else. */
body.is-impersonating .sidebar {
  box-shadow: inset -4px 0 0 0 #F59E0B;
}
[dir="rtl"] body.is-impersonating .sidebar { box-shadow: inset 4px 0 0 0 #F59E0B; }
body.is-impersonating .topbar {
  background: linear-gradient(180deg, rgba(245, 158, 11, .04), transparent);
}
