/* ==========================================================================
   SCALE CRM - Design System
   Marca: dorado champagne + grafito + crema editorial
   ========================================================================== */

:root {
  /* Colores marca */
  --scale-bg:           #FAFAF7;  /* Fondo app (crema muy sutil) */
  --scale-surface:      #FFFFFF;  /* Cards, modales */
  --scale-graphite:     #0A0A0A;  /* Sidebar, headers oscuros */
  --scale-graphite-2:   #1A1A1A;  /* Variante para hover */
  --scale-text:         #0A0A0A;  /* Texto principal */
  --scale-text-2:       #4A4A4A;  /* Texto secundario */
  --scale-text-3:       #8A8A8A;  /* Texto terciario / hints */
  --scale-text-cream:   #FAFAF7;  /* Texto sobre fondos oscuros */

  --scale-gold:         #B8946A;  /* Dorado champagne (acento) */
  --scale-gold-light:   #D4B896;  /* Dorado claro (hover claros) */
  --scale-gold-dark:    #A07F58;  /* Dorado oscuro (active) */
  --scale-gold-soft:    #F5EFE5;  /* Dorado suave (backgrounds sutiles) */

  --scale-border:       #E8E5DD;  /* Bordes cálidos */
  --scale-border-2:     #DCD7CC;  /* Bordes hover */

  --scale-success:      #5C8D5C;  /* Verde sobrio */
  --scale-warning:      #C99850;  /* Ámbar elegante */
  --scale-danger:       #C46B5B;  /* Rojo coral */
  --scale-info:         #6B8DAD;  /* Azul polvo */

  /* Sombras cálidas */
  --scale-shadow-sm:  0 1px 2px rgba(184, 148, 106, 0.05);
  --scale-shadow:     0 2px 8px rgba(184, 148, 106, 0.08);
  --scale-shadow-md:  0 4px 16px rgba(10, 10, 10, 0.06);
  --scale-shadow-lg:  0 12px 32px rgba(10, 10, 10, 0.10);

  /* Tipografías */
  --scale-font-serif:  'Fraunces', Georgia, serif;
  --scale-font-sans:   'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radios */
  --scale-r-sm:  6px;
  --scale-r:     10px;
  --scale-r-lg:  14px;
  --scale-r-xl:  20px;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--scale-font-sans);
  background: var(--scale-bg);
  color: var(--scale-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

h1, h2, h3, h4 {
  font-family: var(--scale-font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   Componentes utilitarios Scale
   ========================================================================== */

.scale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--scale-font-sans);
  border: none;
  border-radius: var(--scale-r);
  cursor: pointer;
  transition: all 180ms ease-in-out;
  text-decoration: none;
  white-space: nowrap;
}

.scale-btn-primary {
  background: var(--scale-graphite);
  color: var(--scale-text-cream);
}
.scale-btn-primary:hover {
  background: var(--scale-graphite-2);
  box-shadow: var(--scale-shadow-md);
}

.scale-btn-gold {
  background: var(--scale-gold);
  color: var(--scale-text-cream);
}
.scale-btn-gold:hover {
  background: var(--scale-gold-dark);
  box-shadow: var(--scale-shadow-md);
}

.scale-btn-ghost {
  background: transparent;
  color: var(--scale-text);
  border: 1px solid var(--scale-border);
}
.scale-btn-ghost:hover {
  background: var(--scale-gold-soft);
  border-color: var(--scale-gold);
}

.scale-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: var(--scale-font-sans);
  background: var(--scale-surface);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  color: var(--scale-text);
  transition: border-color 150ms, box-shadow 150ms;
}
.scale-input:focus {
  outline: none;
  border-color: var(--scale-gold);
  box-shadow: 0 0 0 3px var(--scale-gold-soft);
}

.scale-card {
  background: var(--scale-surface);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r-lg);
  padding: 1.25rem;
  transition: box-shadow 200ms, border-color 200ms;
}
.scale-card:hover {
  box-shadow: var(--scale-shadow);
  border-color: var(--scale-border-2);
}

.scale-divider {
  height: 1px;
  background: var(--scale-border);
  margin: 1rem 0;
}

/* Acento dorado: subrayado debajo de pestañas o titulares */
.scale-gold-underline {
  position: relative;
  padding-bottom: 6px;
}
.scale-gold-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--scale-gold);
}

/* Tag/badge sobrio */
.scale-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--scale-gold-soft);
  color: var(--scale-gold-dark);
  font-weight: 500;
}

/* Scrollbar elegante */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scale-border-2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--scale-text-3); }

/* Animación de entrada para modales/cards */
@keyframes scale-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.scale-fade-in { animation: scale-fade-in 200ms ease-out; }

/* ==========================================================================
   Modal lateral
   ========================================================================== */

[x-cloak] { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.modal-panel {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--scale-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--scale-shadow-lg);
  animation: scale-slide-in 220ms ease-out;
  overflow: hidden;
}

@keyframes scale-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--scale-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--scale-surface);
}

.modal-eyebrow {
  margin: 0 0 4px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--scale-text-3);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.4rem;
  font-family: var(--scale-font-serif);
  font-weight: 500;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--scale-text-3);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: var(--scale-r);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 150ms;
}
.modal-close:hover {
  background: var(--scale-bg);
  color: var(--scale-text);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--scale-text-2);
}

.modal-hint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--scale-text-3);
  font-weight: 400;
}

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

.modal-error {
  background: rgba(196, 107, 91, 0.08);
  color: var(--scale-danger);
  border: 1px solid rgba(196, 107, 91, 0.2);
  padding: 10px 14px;
  border-radius: var(--scale-r);
  font-size: 0.875rem;
}

.modal-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--scale-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

textarea.scale-input {
  font-family: var(--scale-font-sans);
  resize: vertical;
  min-height: 80px;
}

select.scale-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ==========================================================================
   Modal de detalle del lead
   ========================================================================== */

.modal-panel-wide {
  max-width: 560px;
}

.detail-tags-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.detail-value {
  font-family: var(--scale-font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--scale-gold-dark);
}

.detail-stage-pill {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--scale-graphite);
  color: var(--scale-text-cream);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--scale-border);
  padding: 0 1.5rem;
  background: var(--scale-surface);
}

.detail-tab {
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--scale-text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 150ms;
  font-family: var(--scale-font-sans);
}
.detail-tab:hover {
  color: var(--scale-text);
}
.detail-tab.active {
  color: var(--scale-text);
  border-bottom-color: var(--scale-gold);
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--scale-border);
}

.timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
}

.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--scale-gold);
  border: 2px solid var(--scale-surface);
  margin-top: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 1px var(--scale-border);
}

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

.timeline-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--scale-text);
  line-height: 1.4;
}

.timeline-time {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--scale-text-3);
}

.timeline-empty,
.notes-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--scale-text-3);
  font-size: 0.875rem;
}

/* Notas */
.note-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--scale-border);
  margin-bottom: 0.5rem;
}
.note-composer textarea {
  width: 100%;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-item {
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-left: 3px solid var(--scale-gold);
  border-radius: var(--scale-r);
  padding: 12px 14px;
}

.note-content {
  margin: 0 0 6px;
  font-size: 0.875rem;
  color: var(--scale-text);
  line-height: 1.45;
  white-space: pre-wrap;
}

.note-meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--scale-text-3);
}

/* ==========================================================================
   Modal Nuevo Usuario - estilos especificos
   ========================================================================== */

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  max-height: 180px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--scale-text);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--scale-gold);
  cursor: pointer;
}

/* Bloque de exito (contrasena temporal) */
.success-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.success-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--scale-text);
}

.success-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--scale-text-2);
  line-height: 1.4;
}

.pwd-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--scale-graphite);
  border-radius: var(--scale-r);
  justify-content: space-between;
}

.pwd-box code {
  font-family: monospace;
  font-size: 1rem;
  color: var(--scale-gold-light);
  letter-spacing: 0.05em;
  word-break: break-all;
  flex: 1;
}

.success-info {
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: var(--scale-text-2);
}

.success-info p {
  margin: 0;
  padding: 3px 0;
}

.success-info strong {
  color: var(--scale-text);
  margin-right: 6px;
}

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

/* Tag de unidad de negocio (con border de color) */
.unit-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--scale-bg);
  color: var(--scale-text);
  border: 1px solid var(--scale-gold);
  font-weight: 500;
}

/* ==========================================================================
   Modal Detalle Usuario
   ========================================================================== */

.user-detail-email {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--scale-text-2);
}

.modal-success {
  background: #E8F5E9;
  color: #2E7D32;
  padding: 10px 14px;
  border-radius: var(--scale-r);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--scale-font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--scale-text);
  margin: 0 0 12px;
}

.empty-mini {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--scale-text-3);
  font-size: 0.85rem;
}

/* Bloque de info para roles especiales (org_admin, viewer) */
.info-block {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--scale-bg);
  border-radius: var(--scale-r);
  border: 1px dashed var(--scale-border);
}

.info-icon {
  font-size: 2rem;
  margin: 0 0 8px;
}

.info-title {
  font-family: var(--scale-font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--scale-text);
  margin: 0 0 6px;
}

.info-desc {
  font-size: 0.85rem;
  color: var(--scale-text-2);
  margin: 0;
  line-height: 1.4;
}

/* Lista de teams en el modal */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-left: 3px solid var(--scale-gold);
  border-radius: var(--scale-r);
}

.team-item-info { flex: 1; min-width: 0; }
.team-item-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--scale-text);
}
.team-item-meta {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--scale-text-3);
}

/* Lista "A cargo de" - clickeable */
.managed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.managed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  cursor: pointer;
  transition: all 150ms;
}

.managed-item:hover {
  border-color: var(--scale-gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.managed-item-info { flex: 1; min-width: 0; }
.managed-item-name {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--scale-text);
}

.managed-arrow {
  color: var(--scale-text-3);
  font-size: 1rem;
}

.modal-back {
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  color: var(--scale-text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 150ms;
  flex-shrink: 0;
  margin-right: 4px;
}

.modal-back:hover {
  background: var(--scale-graphite);
  color: var(--scale-text-cream);
  border-color: var(--scale-graphite);
}

/* ==========================================================================
   Barra de filtros (search + dropdowns)
   ========================================================================== */

.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-search {
  flex: 1;
  min-width: 240px;
}

.filters-search .scale-input {
  width: 100%;
}

.filters-selects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  min-width: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A7A77' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.filter-clear {
  background: transparent !important;
  color: var(--scale-gold-dark) !important;
  border-color: transparent !important;
  font-style: italic;
}

.filter-clear:hover {
  background: var(--scale-gold-soft) !important;
  border-color: var(--scale-gold-soft) !important;
}

@media (max-width: 768px) {
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-search { min-width: 100%; }
  .filter-select { min-width: 100%; }
}

/* Color picker para unidades */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--scale-border);
  cursor: pointer;
  transition: all 150ms;
  padding: 0;
  flex-shrink: 0;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: var(--scale-text);
}

.color-swatch.active {
  border-color: var(--scale-graphite);
  box-shadow: 0 0 0 2px var(--scale-graphite), 0 0 0 4px transparent;
  transform: scale(1.05);
}

/* Divider con texto en medio para secciones del modal */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  color: var(--scale-text-3);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--scale-border);
}

/* Code block para mostrar el payload del webhook */
.code-block {
  background: var(--scale-graphite);
  color: var(--scale-text-cream);
  padding: 14px 16px;
  border-radius: var(--scale-r);
  font-family: monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
}

.code-block span {
  color: var(--scale-gold-light);
}

/* Stats grid del tab estadisticas */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1rem;
}

.stat-box {
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  padding: 18px;
  text-align: center;
}

.stat-num {
  font-family: var(--scale-font-serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--scale-text);
  margin: 0;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--scale-text-3);
  letter-spacing: 0.04em;
  margin: 6px 0 0;
  text-transform: uppercase;
}

.stats-info {
  background: var(--scale-bg);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  padding: 14px 16px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--scale-border);
}

.stat-row:last-child { border-bottom: none; }
.stat-row-label { color: var(--scale-text-2); }
.stat-row-value { color: var(--scale-text); font-weight: 500; }

/* ==========================================================================
   Organization Switcher (sidebar, solo agency)
   ========================================================================== */

.org-switcher {
  margin: 8px 4px 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(250, 250, 247, 0.08);
  border-bottom: 1px solid rgba(250, 250, 247, 0.08);
}

.org-switcher-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.4);
  margin-bottom: 6px;
  padding: 0 4px;
}

.org-switcher-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(250, 250, 247, 0.05);
  border: 1px solid rgba(250, 250, 247, 0.1);
  color: var(--scale-text-cream);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23B8946A' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: all 150ms;
}

.org-switcher-select:hover {
  background-color: rgba(250, 250, 247, 0.08);
  border-color: var(--scale-gold);
}

.org-switcher-select:focus {
  outline: none;
  border-color: var(--scale-gold);
  box-shadow: 0 0 0 2px rgba(184, 148, 106, 0.2);
}

.org-switcher-select option {
  background: var(--scale-graphite);
  color: var(--scale-text-cream);
}

/* ==========================================================================
   Bot qualification badges en lead cards
   ========================================================================== */

.lead-card {
  position: relative;
  transition: all 200ms;
}

/* Badge en esquina superior derecha */
.bot-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.95rem;
  line-height: 1;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* HOT: borde lateral rojo */
.lead-card.lead-card-bot-hot {
  border-left: 4px solid #B03030;
  background: linear-gradient(to right, rgba(176, 48, 48, 0.04), transparent 30%);
}
.lead-card.lead-card-bot-hot:hover {
  border-color: #B03030;
  box-shadow: 0 4px 12px rgba(176, 48, 48, 0.12);
}

/* WARM: borde lateral naranja */
.lead-card.lead-card-bot-warm {
  border-left: 4px solid #C77D4A;
  background: linear-gradient(to right, rgba(199, 125, 74, 0.04), transparent 30%);
}
.lead-card.lead-card-bot-warm:hover {
  border-color: #C77D4A;
  box-shadow: 0 4px 12px rgba(199, 125, 74, 0.12);
}

/* COLD: borde lateral azul */
.lead-card.lead-card-bot-cold {
  border-left: 4px solid #4A6D8C;
  background: linear-gradient(to right, rgba(74, 109, 140, 0.04), transparent 30%);
}
.lead-card.lead-card-bot-cold:hover {
  border-color: #4A6D8C;
  box-shadow: 0 4px 12px rgba(74, 109, 140, 0.12);
}

/* SPAM: borde lateral gris */
.lead-card.lead-card-bot-spam {
  border-left: 4px solid #888;
  opacity: 0.7;
}
.lead-card.lead-card-bot-spam:hover {
  opacity: 1;
}

/* Pequena animacion de entrada para los badges */
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.bot-badge-hot {
  animation: badgePulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Filtros de fecha en Reportes
   ========================================================================== */

.date-filters {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--scale-surface);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-r);
  margin-bottom: 1.25rem;
}

.date-filters-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.date-preset {
  background: transparent;
  border: 1px solid var(--scale-border);
  color: var(--scale-text-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms;
}

.date-preset:hover {
  background: var(--scale-gold-soft);
  border-color: var(--scale-gold);
  color: var(--scale-text);
}

.date-preset.active {
  background: var(--scale-graphite);
  border-color: var(--scale-graphite);
  color: var(--scale-text-cream);
}

.date-filters-custom {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.date-input {
  width: auto;
  min-width: 140px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.date-sep {
  color: var(--scale-text-3);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .date-filters-custom { margin-left: 0; width: 100%; }
  .date-input { flex: 1; min-width: 0; }
}

/* ==========================================================================
   Indicador de auto-sincronización
   ========================================================================== */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--scale-text-3);
  letter-spacing: 0.02em;
  padding: 0 8px;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5C8D5C;
  box-shadow: 0 0 0 0 rgba(92, 141, 92, 0.4);
  animation: sync-pulse 2s infinite;
}

@keyframes sync-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 141, 92, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(92, 141, 92, 0); }
}
