/* Scoped to avoid theme overrides */
.anna-leadbot-root {
  --anna-gradient: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%);
  --anna-gradient-light: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #60a5fa 100%);
  box-sizing: border-box;
}
.anna-leadbot-root *,
.anna-leadbot-root *::before,
.anna-leadbot-root *::after {
  box-sizing: border-box;
}

.anna-leadbot-root .anna-leadbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 60px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  transition: transform 0.2s, box-shadow 0.2s;
}

.anna-leadbot-root .anna-leadbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

.anna-leadbot-root .anna-leadbot-bubble.hidden {
  display: none;
}

.anna-bubble-icon {
  font-size: 18px;
  font-weight: 600;
  color: white;
  line-height: 1;
}

.anna-leadbot-root .anna-leadbot-window {
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  transition: opacity 0.2s, transform 0.2s;
}

.anna-leadbot-root .anna-leadbot-window.minimized {
  display: none;
}

.anna-leadbot-root #anna-chat-header {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anna-header-title { display: flex; flex-direction: column; gap: 2px; }
.anna-header-name { font-weight: bold; font-size: 18px; line-height: 1.2; }
.anna-header-subtitle { font-size: 12px; opacity: 0.9; font-weight: 400; }

.anna-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: white;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.anna-close-btn:hover { background: rgba(0,0,0,0.4); }

.anna-leadbot-root #anna-chat-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  background: #ffffff !important;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}

.anna-leadbot-root #anna-privacy-consent {
  text-align: center;
  padding: 24px 16px;
  background: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

#anna-privacy-consent p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

#anna-privacy-consent.hidden { display: none; }

#anna-lead-form-wrap.hidden { display: none; }

#anna-lead-form-wrap { padding: 12px 0; }

.anna-leadbot-root .anna-lead-form-box {
  background: #ffffff !important;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.2);
  width: 100%;
}

.anna-leadbot-root .anna-lead-form-header {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  color: white;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
}

.anna-lead-form-body {
  padding: 20px;
  min-width: 0;
}

.anna-form-field {
  margin-bottom: 14px;
  min-width: 0;
}

.anna-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
  overflow: visible;
  white-space: normal;
}

.anna-form-field .required { color: #ef4444; }
.anna-form-field .optional { font-weight: 400; color: #9ca3af; }

.anna-form-field input,
.anna-form-field select {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.anna-form-field input:focus,
.anna-form-field select:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.anna-form-field select { background: #fff; cursor: pointer; }

.anna-btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--anna-gradient-light);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.anna-btn-submit:hover { opacity: 0.95; transform: scale(1.01); }
.anna-btn-submit:active { transform: scale(0.99); }

.anna-btn-gradient {
  background: var(--anna-gradient-light);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.anna-btn-gradient:hover { opacity: 0.95; transform: scale(1.02); }
.anna-btn-gradient:active { transform: scale(0.98); }

#anna-chat-messages { display: none; }
#anna-chat-messages.visible { display: block; }

.anna-row {
  display: flex;
  align-items: flex-end;
  margin: 10px 0;
}

.anna-row.bot { justify-content: flex-start; }
.anna-row.user { justify-content: flex-end; }

.anna-msg {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.5;
}

.anna-msg.bot {
  background: #f3f4f6;
  color: #374151;
  border-bottom-left-radius: 6px;
}

.anna-msg.user {
  background: var(--anna-gradient);
  color: white;
  border-bottom-right-radius: 6px;
}

.anna-msg.typing {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: #6b7280;
  font-style: italic;
}

.anna-msg.typing .anna-typing-text {
  margin-right: 2px;
}

.anna-msg.typing .anna-dot {
  animation: anna-blink 1s infinite;
  font-style: normal;
  font-weight: 700;
}

.anna-msg.typing .anna-dot:nth-child(3) { animation-delay: 0.2s; }
.anna-msg.typing .anna-dot:nth-child(4) { animation-delay: 0.4s; }

@keyframes anna-blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.3; }
}

.anna-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  background: var(--anna-gradient);
}

.anna-leadbot-root #anna-chat-footer {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
}

.anna-footer-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

#anna-userInput {
  flex: 1;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

#anna-userInput:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#anna-userInput:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

#anna-sendBtn {
  min-width: 70px;
  padding: 10px 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.anna-btn-exit {
  width: 100%;
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.anna-btn-exit:hover {
  background: #e5e7eb;
  color: #1f2937;
  border-color: #d1d5db;
}

#anna-chat-footer.hidden { display: none; }

/* Force button visibility and clickability - override WordPress theme styles */
.anna-leadbot-root .anna-btn-gradient,
.anna-leadbot-root .anna-btn-submit,
.anna-leadbot-root #anna-sendBtn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #60a5fa 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
.anna-leadbot-root .anna-btn-gradient:hover,
.anna-leadbot-root .anna-btn-submit:hover,
.anna-leadbot-root #anna-sendBtn:hover {
  opacity: 0.95 !important;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
}
.anna-leadbot-root .anna-btn-exit {
  background: #e5e7eb !important;
  color: #374151 !important;
  border: 2px solid #d1d5db !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
.anna-leadbot-root .anna-btn-exit:hover {
  background: #d1d5db !important;
  color: #1f2937 !important;
  border-color: #9ca3af !important;
}
.anna-leadbot-root .anna-close-btn {
  background: rgba(0,0,0,0.3) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.anna-leadbot-root #anna-chat-bubble {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Responsive - mobile */
@media (max-width: 480px) {
  .anna-leadbot-root .anna-leadbot-window {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    height: 85vh;
    max-height: 500px;
  }
  .anna-leadbot-root .anna-leadbot-bubble {
    right: 10px;
    bottom: 10px;
  }
  .anna-leadbot-root #anna-chat-body {
    padding: 12px 16px;
  }
  .anna-lead-form-body {
    padding: 16px;
  }
}


.leads-admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(34, 124, 188, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(16, 185, 129, 0.16), transparent 26rem),
    linear-gradient(180deg, #f7fbff 0%, #eef6fb 48%, #f8fafc 100%);
}

.leads-login-main,
.leads-admin-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.leads-login-card {
  max-width: 440px;
  margin: 6vh auto 0;
  padding: 2rem;
  border: 1px solid rgba(34, 124, 188, 0.14);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(15, 35, 56, 0.12);
}

.leads-login-logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 0 1rem;
}

.leads-login-card h1,
.leads-admin-header h1 {
  margin: 0 0 0.45rem;
  color: #0f2338;
  font-family: var(--font-heading);
}

.leads-admin-header h1 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: #fff;
}

.leads-login-card p,
.leads-admin-header p {
  margin: 0 0 1.25rem;
  color: #64748b;
}

.leads-admin-header p {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
}

.leads-login-card form {
  display: grid;
  gap: 1rem;
}

.leads-login-card label {
  display: grid;
  gap: 0.35rem;
  color: #334155;
  font-weight: 800;
}

.leads-login-card input {
  border: 1px solid #dbe7f1;
  border-radius: 12px;
  font: inherit;
  padding: 0.75rem 0.85rem;
}

.leads-login-card button,
.leads-admin-logout,
.leads-admin-export,
.lead-card__actions a,
.lead-card__actions button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #227cbc 0%, #1a5f96 55%, #0f7669 100%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0.72rem 1rem;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 35, 56, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leads-login-card button:hover,
.leads-admin-logout:hover,
.leads-admin-export:hover,
.lead-card__actions a:hover,
.lead-card__actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 35, 56, 0.2);
}

.leads-login-error {
  padding: 0.75rem;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b !important;
}

.leads-login-hint {
  margin-top: 1rem !important;
  font-size: 0.85rem;
}

.leads-admin-header {
  position: relative;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(15, 35, 56, 0.96) 0%, rgba(26, 95, 150, 0.94) 54%, rgba(15, 118, 105, 0.92) 100%);
  box-shadow: 0 24px 70px rgba(15, 35, 56, 0.22);
}

.leads-admin-header::before {
  content: "";
  position: absolute;
  inset: -40% auto auto 45%;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  pointer-events: none;
}

.leads-admin-header > * {
  position: relative;
  z-index: 1;
}

.leads-admin-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.leads-admin-kicker {
  margin: 0 0 0.35rem !important;
  color: #99f6e4 !important;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leads-admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e0f2fe;
  font-size: 0.82rem;
  font-weight: 800;
}

.leads-admin-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
}

.leads-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: -0.25rem 0 1.25rem;
}

.leads-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 44px rgba(15, 35, 56, 0.1);
  backdrop-filter: blur(16px);
}

.leads-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: #334155;
  font-weight: 800;
}

.leads-toolbar input,
.leads-toolbar select {
  width: 100%;
  border: 1px solid rgba(34, 124, 188, 0.16);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  padding: 0.85rem 0.95rem;
  box-shadow: inset 0 1px 0 rgba(15, 35, 56, 0.03);
}

.leads-stats article,
.lead-card {
  border: 1px solid rgba(34, 124, 188, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(15, 35, 56, 0.08);
}

.leads-stats article {
  position: relative;
  overflow: hidden;
  padding: 1.3rem 1.25rem;
}

.leads-stats article::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2.5rem;
  width: 6rem;
  height: 6rem;
  border-radius: 999px;
  background: rgba(34, 124, 188, 0.08);
}

.leads-stats strong {
  display: block;
  color: #0f2338;
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.leads-stats span {
  color: #64748b;
  font-weight: 700;
}

.leads-list {
  display: grid;
  gap: 1.15rem;
}

.lead-card {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
}

.lead-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #227cbc, #10b981);
}

.lead-card__top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.lead-card h2 {
  margin: 0 0 0.2rem;
  color: #0f2338;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.lead-card p {
  margin: 0;
  color: #64748b;
}

.lead-card__date {
  font-size: 0.9rem;
}

.lead-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lead-card__actions button {
  background: #b91c1c;
}

.lead-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.lead-fields div {
  padding: 0.85rem;
  border: 1px solid rgba(15, 35, 56, 0.04);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.lead-fields dt {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-fields dd {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.lead-message {
  margin-top: 1rem !important;
  padding: 1rem 1.1rem;
  border-left: 4px solid #227cbc;
  border-radius: 16px;
  background: #f8fafc;
  color: #334155 !important;
}

.lead-conversation {
  margin-top: 1rem;
  border: 1px solid rgba(15, 35, 56, 0.06);
  border-radius: 16px;
  background: #f8fafc;
  padding: 1rem 1.1rem;
}

.lead-conversation summary {
  cursor: pointer;
  color: #0f2338;
  font-weight: 900;
}

.lead-conversation ol {
  display: grid;
  gap: 0.65rem;
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: #334155;
}

@media (max-width: 800px) {
  .leads-admin-header,
  .lead-card__top {
    flex-direction: column;
  }

  .leads-admin-header {
    align-items: flex-start;
    border-radius: 24px;
  }

  .leads-admin-header__actions {
    justify-content: flex-start;
  }

  .leads-stats,
  .lead-fields,
  .leads-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .leads-stats,
  .lead-fields,
  .leads-toolbar {
    grid-template-columns: 1fr;
  }
}

