/* Sistema de Diseño CSS Premium y Responsivo - InmoCRM */
/* Tipografía y Variables de Diseño */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta de Colores Corporativos INMO Business Academy (Rojo Rubí & Dorado Metálico) */
  --bg-primary: #1e0305;            /* Rojo Rubí Oscuro Principal */
  --bg-secondary: #0f0102;          /* Negro Rubí de Fondo */
  --bg-glass: rgba(43, 5, 8, 0.65); /* Fondo de Vidrio Rojo Rubí */
  --bg-glass-hover: rgba(69, 8, 12, 0.8);
  --bg-card: rgba(48, 6, 9, 0.7);   /* Tarjetas integradas */
  --border-glass: rgba(229, 192, 96, 0.12); /* Borde con toque dorado traslúcido */
  --border-glass-hover: rgba(229, 192, 96, 0.3);
  
  --text-primary: #ffffff;          /* Blanco Puro */
  --text-secondary: #e0d7d8;        /* Plata/Gris Cálido Suave */
  --text-muted: #a39596;            /* Gris Rubí Apagado */

  /* Colores de Marca y Temperaturas (Gradientes Premium) */
  --accent-gold: #e5c060;           /* Dorado Metálico */
  --accent-gold-rgb: 229, 192, 96;
  --accent-gold-gradient: linear-gradient(135deg, #e5c060 0%, #bf9a36 100%);
  
  /* Leads Calientes - Fuego Cálido (Rojo Vibrante de Marca) */
  --color-hot: #d81f26;             /* Rojo Brillante de Marca */
  --color-hot-glow: rgba(216, 31, 38, 0.4);
  --color-hot-gradient: linear-gradient(135deg, #d81f26, #b31221);
  
  /* Leads Calificados - Dorado Elegante */
  --color-qualified: #e5c060;
  --color-qualified-glow: rgba(229, 192, 96, 0.3);
  --color-qualified-gradient: linear-gradient(135deg, #e5c060, #a67c1e);

  /* Leads Fríos - Gris Metal */
  --color-cold: #7c7273;
  --color-cold-gradient: linear-gradient(135deg, #7c7273, #554d4e);
  
  /* Etapa Cerrada - Éxito Esmeralda */
  --color-success: #10b981;
  --color-success-gradient: linear-gradient(135deg, #10b981, #059669);

  /* Etapa Nueva - Púrpura Rubí */
  --color-new: #a855f7;
  --color-new-gradient: linear-gradient(135deg, #a855f7, #d81f26);

  /* Sombras y Efectos */
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.85), 0 1px 1px 0 rgba(229, 192, 96, 0.08) inset;
  --shadow-glow-hot: 0 0 20px rgba(216, 31, 38, 0.3);
  --shadow-glow-qual: 0 0 20px rgba(229, 192, 96, 0.25);
  --blur-value: 16px;
  
  /* Tipografía */
  --font-family-body: 'Inter', sans-serif;
  --font-family-title: 'Outfit', sans-serif;
}

/* Reset de Margenes e Inicialización */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
  height: 100dvh;
  display: flex;
}

/* Estilos de Barra de Scroll */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Contenedor Principal Adaptativo */
#app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* MENÚ LATERAL (ORDENADOR) */
#sidebar-menu {
  width: 280px;
  background: linear-gradient(180deg, #0b0f19 0%, #05070c 100%);
  border-right: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
}

.brand-name {
  font-family: var(--font-family-title);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.agent-profile-section {
  margin-top: auto;
  padding: 1rem 0.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  color: var(--bg-primary);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.agent-info {
  display: flex;
  flex-direction: column;
}

.agent-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.agent-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ÁREA DE CONTENIDO PRINCIPAL */
#main-viewport {
  flex-grow: 1;
  height: 100%;
  overflow-y: auto;
  background-color: var(--bg-secondary);
  padding: 2rem 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* BARRA DE NAVEGACIÓN INFERIOR (MÓVIL) */
#mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(var(--blur-value));
  -webkit-backdrop-filter: blur(var(--blur-value));
  border-top: 1px solid var(--border-glass);
  justify-content: space-around;
  align-items: center;
  padding: 0 1rem;
  z-index: 100;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
}

#mobile-bottom-bar.hidden-nav {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Ocultar barra inferior en móviles cuando un modal esté abierto */
body.modal-open #mobile-bottom-bar {
  display: none !important;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex: 1;
}

.mobile-nav-item i {
  font-size: 1.35rem;
}

.mobile-nav-item.active {
  color: var(--accent-gold);
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 24px;
  height: 3px;
  background: var(--accent-gold);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-gold);
}

/* PANTALLAS / VISTAS (SPA) */
.app-view {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: 100%;
  height: 100%;
}

.app-view.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* ENCABEZADOS DE PANTALLA */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 16px;
  flex-shrink: 0;
}

.header-title-area h1 {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-title-area p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* BOTONES PREMIUM */
.btn-primary {
  background: var(--accent-gold-gradient);
  color: var(--bg-secondary);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(229, 192, 96, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glass-hover);
}

/* PANTALLA: DASHBOARD */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-shrink: 0;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-premium);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--text-muted);
}

.kpi-card.kpi-hot::before { background: var(--color-hot-gradient); }
.kpi-card.kpi-qual::before { background: var(--color-qualified-gradient); }
.kpi-card.kpi-closed::before { background: var(--color-success-gradient); }
.kpi-card.kpi-all::before { background: var(--color-new-gradient); }

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-hover);
}

.kpi-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-all .kpi-icon-wrapper { background: rgba(139, 92, 246, 0.1); color: var(--color-new); }
.kpi-hot .kpi-icon-wrapper { background: rgba(249, 115, 22, 0.1); color: var(--color-hot); }
.kpi-qual .kpi-icon-wrapper { background: rgba(59, 130, 246, 0.1); color: var(--color-qualified); }
.kpi-closed .kpi-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: var(--font-family-title);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* SECCIONES DIVIDIDAS DEL DASHBOARD */
.dashboard-sections {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  flex-grow: 1;
  min-height: 0; /* Permite scroll interno */
}

.dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}

.panel-header h3 {
  font-family: var(--font-family-title);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-scroll-content {
  overflow-y: auto;
  flex-grow: 1;
}

/* LISTA DE TAREAS HOY (DASHBOARD) */
.dashboard-task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-task-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

.dashboard-task-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-glass-hover);
}

.dashboard-task-item.overdue {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.02);
}

.task-left-section {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-checkbox-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.task-checkbox-btn:hover {
  border-color: var(--accent-gold);
}

.dashboard-task-item.completed .task-checkbox-btn {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.task-text-info {
  display: flex;
  flex-direction: column;
}

.task-client-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-desc {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 2px 0;
}

.dashboard-task-item.completed .task-desc {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-time-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.overdue .task-time-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.task-actions-wrapper {
  display: flex;
  gap: 8px;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold);
  border-color: var(--border-glass-hover);
}

.btn-action-icon.btn-call:hover { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.btn-action-icon.btn-wa:hover { color: #10b981; background: rgba(16, 185, 129, 0.1); }

/* LISTA DE LEADS RECIENTES (DASHBOARD) */
.dashboard-recent-leads {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-lead-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-lead-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.recent-lead-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recent-lead-details {
  display: flex;
  flex-direction: column;
}

.recent-lead-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.recent-lead-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* PANTALLA: PIPELINE (KANBAN BOARD) */
.pipeline-container {
  display: flex;
  gap: 1rem;
  flex-grow: 1;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 0;
}

.kanban-column {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  background: rgba(11, 15, 25, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-column-header {
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.column-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-new .column-indicator { background: var(--color-new-gradient); }
.col-qual .column-indicator { background: var(--color-qualified-gradient); }
.col-contact .column-indicator { background: var(--color-cold-gradient); }
.col-hot .column-indicator { background: var(--color-hot-gradient); }
.col-closed .column-indicator { background: var(--color-success-gradient); }

.kanban-column-title {
  font-family: var(--font-family-title);
  font-size: 1rem;
  font-weight: 600;
}

.kanban-count-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.kanban-cards-area {
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
  min-height: 150px;
}

/* TARJETAS KANBAN (LEAD CARDS) */
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1rem;
  cursor: grab;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.lead-card:active {
  cursor: grabbing;
}

.lead-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

/* DISEÑOS DE TEMPERATURA ESPECIALES */

/* Clientes Calientes (Hot Leads) */
.lead-card.temp-caliente {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: var(--shadow-glow-hot), var(--shadow-premium);
  background: linear-gradient(180deg, rgba(22, 30, 49, 0.8) 0%, rgba(249, 115, 22, 0.05) 100%);
}

.lead-card.temp-caliente::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, transparent 50%, var(--color-hot) 50%);
  opacity: 0.15;
}

.lead-card.temp-caliente .lead-temperature-badge {
  background: var(--color-hot-gradient);
  color: #ffffff;
  animation: firePulse 2s infinite alternate;
}

/* Clientes Calificados */
.lead-card.temp-calificado {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-glow-qual), var(--shadow-premium);
  background: linear-gradient(180deg, rgba(22, 30, 49, 0.8) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.lead-card.temp-calificado .lead-temperature-badge {
  background: var(--color-qualified-gradient);
  color: #ffffff;
}

/* Clientes Fríos */
.lead-card.temp-frio .lead-temperature-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* Clientes Cerrados (Deals Won) */
.lead-card.temp-cerrado {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15), var(--shadow-premium);
  background: linear-gradient(180deg, rgba(22, 30, 49, 0.8) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.lead-card.temp-cerrado .lead-temperature-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

/* Componentes internos de la tarjeta */
.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lead-name {
  font-family: var(--font-family-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lead-temperature-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.lead-property-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lead-budget {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.lead-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.lead-tasks-indicator {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lead-tasks-indicator.tasks-due {
  color: #f87171;
  font-weight: 600;
}

.lead-quick-actions {
  display: flex;
  gap: 6px;
}

.lead-action-mini {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lead-action-mini:hover {
  background: rgba(255, 255, 255, 0.08);
}
.lead-action-mini.wa:hover { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.lead-action-mini.call:hover { color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }

/* PANTALLA: LISTA DE CLIENTES */
.search-filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  min-width: 250px;
}

.search-input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px 16px 12px 46px;
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.filter-pill {
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-family-title);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill.active {
  background: var(--accent-gold);
  color: #0b0f19;
  border-color: var(--accent-gold);
  font-weight: 600;
}

.clients-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  padding: 0.5rem;
}

/* TARJETAS EJECUTIVAS PREMIUM (PORTFOLIO CLIENT CARDS) */
.portfolio-card {
  background: linear-gradient(135deg, rgba(30, 3, 5, 0.75) 0%, rgba(15, 1, 2, 0.85) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(229, 192, 96, 0.12);
  border-radius: 20px;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.9), 0 1px 1px 0 rgba(229, 192, 96, 0.05) inset;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  height: auto;
  overflow: visible;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  border-color: rgba(229, 192, 96, 0.35);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.95), 
              0 0 25px rgba(229, 192, 96, 0.15), 
              0 1px 1px 0 rgba(229, 192, 96, 0.1) inset;
}

/* Brillos específicos según temperatura */
.portfolio-card.temp-caliente {
  border-color: rgba(216, 31, 38, 0.25);
  background: linear-gradient(135deg, rgba(43, 5, 8, 0.8) 0%, rgba(15, 1, 2, 0.85) 100%);
}

.portfolio-card.temp-caliente:hover {
  border-color: rgba(216, 31, 38, 0.5);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.95), 
              0 0 25px rgba(216, 31, 38, 0.2), 
              0 1px 1px 0 rgba(216, 31, 38, 0.15) inset;
}

.portfolio-card.temp-calificado {
  border-color: rgba(229, 192, 96, 0.25);
  background: linear-gradient(135deg, rgba(35, 15, 5, 0.75) 0%, rgba(15, 1, 2, 0.85) 100%);
}

.portfolio-card.temp-calificado:hover {
  border-color: rgba(229, 192, 96, 0.6);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.95), 
              0 0 25px rgba(229, 192, 96, 0.25), 
              0 1px 1px 0 rgba(229, 192, 96, 0.2) inset;
}

/* Cabecera de la Tarjeta */
.portfolio-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  flex-shrink: 0;
}

.portfolio-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.portfolio-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.portfolio-avatar.temp-caliente {
  background: linear-gradient(135deg, #d81f26, #b31221);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(216, 31, 38, 0.4);
}

.portfolio-avatar.temp-calificado {
  background: linear-gradient(135deg, #e5c060, #a67c1e);
  color: #0d0600;
  box-shadow: 0 0 12px rgba(229, 192, 96, 0.4);
}

.portfolio-avatar.temp-frio {
  background: linear-gradient(135deg, #7c7273, #554d4e);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Indicador de etapa en el avatar */
.portfolio-stage-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.portfolio-stage-indicator.stage-nuevo { background-color: #a855f7; }
.portfolio-stage-indicator.stage-calificado { background-color: #e5c060; }
.portfolio-stage-indicator.stage-contacto { background-color: #3b82f6; }
.portfolio-stage-indicator.stage-caliente { background-color: #d81f26; }
.portfolio-stage-indicator.stage-cerrado { background-color: #10b981; }

.portfolio-title-area {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  overflow: hidden;
}

.portfolio-name {
  font-family: var(--font-family-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.portfolio-stage-text {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portfolio-stage-text.stage-nuevo { color: #c084fc; }
.portfolio-stage-text.stage-calificado { color: #fcd34d; }
.portfolio-stage-text.stage-contacto { color: #60a5fa; }
.portfolio-stage-text.stage-caliente { color: #f87171; }
.portfolio-stage-text.stage-cerrado { color: #34d399; }

.portfolio-temp-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.portfolio-temp-badge.temp-caliente {
  background: var(--color-hot-gradient);
  color: #ffffff;
}

.portfolio-temp-badge.temp-calificado {
  background: var(--color-qualified-gradient);
  color: #ffffff;
}

.portfolio-temp-badge.temp-frio {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-temp-badge.temp-cerrado {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

/* Grilla de Metadatos */
.portfolio-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 1.25rem 0;
  flex-shrink: 0;
}

.portfolio-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.25s ease;
  overflow: hidden;
}

.portfolio-info-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(229, 192, 96, 0.15);
}

.portfolio-info-item i {
  font-size: 1rem;
  color: var(--accent-gold);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.portfolio-info-item div {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.portfolio-info-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.portfolio-info-value {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.portfolio-info-value.highlight-gold {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Divisor de Tarjeta */
.portfolio-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 192, 96, 0) 0%, rgba(229, 192, 96, 0.15) 50%, rgba(229, 192, 96, 0) 100%);
  margin: 0.5rem 0 1rem 0;
  border: none;
  flex-shrink: 0;
}

/* Pie de Tarjeta y Acciones */
.portfolio-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  flex-shrink: 0;
}

.portfolio-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.portfolio-tasks-indicator {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.portfolio-tasks-indicator.tasks-due {
  color: #f87171;
  font-weight: 600;
}

.portfolio-actions {
  display: flex;
  gap: 8px;
}

.portfolio-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-action-btn:hover {
  transform: scale(1.1);
}

.portfolio-action-btn.call:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.portfolio-action-btn.wa:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.portfolio-action-btn.view-details:hover {
  background: rgba(229, 192, 96, 0.15);
  border-color: rgba(229, 192, 96, 0.5);
  color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(229, 192, 96, 0.35);
}

/* PANTALLA: DETALLE CLIENTE / SPLIT SCREEN */
.split-view-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  flex-grow: 1;
  min-height: 0;
}

.detail-left-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  box-shadow: var(--shadow-premium);
}

.client-detail-header-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-family-title);
  color: var(--bg-primary);
  margin-bottom: 12px;
}

.detail-client-name {
  font-family: var(--font-family-title);
  font-size: 1.3rem;
  font-weight: 700;
}

.detail-stage-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  margin-top: 6px;
  text-transform: uppercase;
}

.detail-stage-tag.stage-nuevo { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.detail-stage-tag.stage-calificado { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.detail-stage-tag.stage-contacto { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.detail-stage-tag.stage-caliente { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.detail-stage-tag.stage-cerrado { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.info-fields-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-field-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-field-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.info-field-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-actions-panel {
  display: flex;
  gap: 8px;
  width: 100%;
}

.detail-actions-panel button {
  flex: 1;
}

.detail-right-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-premium);
}

.tabs-navigation {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.1);
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

.tab-btn {
  padding: 16px 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-gold);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--accent-gold);
}

.tab-content-area {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 0;
}

.tab-pane {
  display: none;
  height: 100%;
  flex-direction: column;
}

.tab-pane.active {
  display: flex;
}

/* HISTORIAL / LÍNEA DE TIEMPO (TIMELINE) */
.timeline-editor {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.timeline-input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  height: 48px;
  transition: all 0.2s ease;
}

.timeline-input:focus {
  border-color: var(--accent-gold);
  height: 80px;
}

.timeline-tree {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
  gap: 20px;
}

.timeline-tree::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-glass);
}

.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-node::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-gold);
}

.timeline-node-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-node-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* LISTA DE TAREAS INTERNA (TAB TAREAS) */
.tasks-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}

.tasks-pane-header h4 {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
}

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

/* MODALES PREMIUM */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: rgba(18, 9, 11, 0.9);
  border: 1px solid rgba(229, 192, 96, 0.22);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 192, 96, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

.modal-title {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-glass);
}

.modal-card form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
  overflow: hidden;
}

/* FORMULARIOS INTERNOS DEL MODAL */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.2rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.form-control {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.05);
}

select.form-control {
  cursor: pointer;
}

select.form-control option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* OPCIONES DE TEMPERATURA SELECCIONABLE */
.temp-selector-group {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.temp-radio-btn {
  flex: 1;
  position: relative;
}

.temp-radio-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.temp-radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.temp-radio-btn input:checked + .temp-radio-label.lbl-frio {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border-color: var(--color-cold);
}

.temp-radio-btn input:checked + .temp-radio-label.lbl-calificado {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: var(--color-qualified);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.temp-radio-btn input:checked + .temp-radio-label.lbl-caliente {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border-color: var(--color-hot);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

/* BANNER DE NOTIFICACIONES IN-APP / ALARM TRIGGER */
#alarm-banner {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 360px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--color-hot);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow-hot);
  border-radius: 18px;
  padding: 1.2rem;
  z-index: 300;
  display: none;
  opacity: 0;
  transform: translateX(50px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#alarm-banner.active {
  display: block;
  opacity: 1;
  transform: translateX(0) scale(1);
}

.alarm-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-hot);
  font-family: var(--font-family-title);
  font-weight: 700;
  margin-bottom: 8px;
}

.alarm-banner-header i {
  font-size: 1.25rem;
  animation: bellRing 1s infinite alternate;
}

.alarm-banner-body {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.alarm-banner-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ANIMACIONES */
@keyframes firePulse {
  0% { box-shadow: 0 0 5px rgba(249, 115, 22, 0.3); }
  100% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.8); }
}

@keyframes bellRing {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(15deg); }
}

/* EFECTO DRAG OVER EN KANBAN */
.kanban-cards-area.drag-over {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

/* ==========================================================================
   VISTA DE CALENDARIO Y AGENDA INTEGRADA (ESTILO LUXURY)
   ========================================================================== */

#view-calendar {
  animation: fadeIn 0.4s ease;
}

#calendar-sync-badge {
  transition: all 0.3s ease;
}

/* Celdas del Calendario */
.calendar-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  position: relative;
  width: 38px;
  height: 38px;
  margin: auto;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

/* Hover de Celdas */
.calendar-day-cell:hover:not(.selected) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(229, 192, 96, 0.15);
  box-shadow: 0 0 8px rgba(229, 192, 96, 0.1);
  transform: translateY(-1px);
}

/* Celda Hoy */
.calendar-day-cell.today {
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 10px rgba(229, 192, 96, 0.3);
  font-weight: 700;
}

/* Celda Seleccionada */
.calendar-day-cell.selected {
  background: var(--accent-gold-gradient);
  color: var(--bg-primary) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(229, 192, 96, 0.4), 0 0 8px rgba(229, 192, 96, 0.2) inset;
  transform: scale(1.05);
}

/* Punto indicador de eventos */
.calendar-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  position: absolute;
  bottom: 4px;
  transition: background 0.2s ease;
}

/* Si el día está seleccionado, el punto se pinta de color oscuro para contrastar con el fondo dorado */
.calendar-day-cell.selected .calendar-day-dot {
  background: var(--bg-primary);
}

/* Contenedor de lista de eventos */
#calendar-events-list::-webkit-scrollbar {
  width: 4px;
}

#calendar-events-list::-webkit-scrollbar-thumb {
  background: rgba(229, 192, 96, 0.2);
}

#calendar-events-list::-webkit-scrollbar-thumb:hover {
  background: rgba(229, 192, 96, 0.4);
}

/* Tarjetas de Eventos en Calendario */
.calendar-event-card {
  transition: all 0.25s ease;
}

.calendar-event-card:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: rgba(229, 192, 96, 0.3) !important;
}

/* ADAPTACIÓN MÓVIL (MEDIA QUERY DISPOSITIVOS PEQUEÑOS) */
@media (max-width: 768px) {
  body {
    display: block;
    height: auto;
  }

  .app-view {
    height: auto !important;
    min-height: 100% !important;
  }

  #app-container {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }

  /* Ocultar barra lateral en ordenadores y mostrar barra inferior */
  #sidebar-menu {
    display: none;
  }

  #mobile-bottom-bar {
    display: flex;
  }

  #main-viewport {
    padding: 1.2rem 1.2rem 130px 1.2rem; /* Espacio extra abajo para no tapar contenido (más alto en móviles para librar toolbar de Safari/Chrome) */
    height: 100%;
    box-sizing: border-box;
  }

  .view-header {
    margin-bottom: 1.5rem;
  }

  .header-title-area h1 {
    font-size: 1.7rem;
  }

  /* Grid KPIs en móvil */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
  }

  .kpi-card {
    padding: 1rem;
    gap: 10px;
  }

  .kpi-value {
    font-size: 1.4rem;
  }

  /* Secciones Dashboard en móvil */
  .dashboard-sections {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
    height: auto !important;
    max-height: none !important;
    flex: none !important;
  }

  .dashboard-panel {
    height: auto !important;
    max-height: none !important;
    flex: none !important;
    min-height: 0 !important;
  }

  /* Kanban en móvil (Scroll horizontal de columnas o visualización de barra) */
  .pipeline-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 12px;
  }

  .kanban-column {
    scroll-snap-align: start;
    min-width: 85vw;
    max-width: 85vw;
  }

  /* Optimización General de Vista Dividida (Split Screen) */
  .split-view-container {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    flex: none !important;
  }

  .detail-left-pane, .detail-right-pane {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    min-height: 0 !important;
    flex: none !important;
  }

  /* Rediseño de Encabezado Móvil Premium para Detalle */
  #view-detail .view-header {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 1.2rem !important;
    width: 100% !important;
  }

  #view-detail .view-header h2 {
    font-size: 1.3rem !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Botones de Icono de Cabecera Móvil */
  .hide-mobile {
    display: none !important;
  }

  .btn-icon-mobile {
    padding: 8px 12px !important;
    min-width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.05rem !important;
    border-radius: 12px !important;
  }

  /* Corrección del colapso de formularios y scrolls anidados */
  .tab-content-area {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 1.2rem 1.2rem 60px 1.2rem !important; /* Margen inferior amplio para librar botones de agendado en móvil */
    flex: none !important;
  }

  .tab-pane {
    height: auto !important;
    flex: none !important;
  }

  .tab-pane.active {
    display: flex !important;
  }

  .panel-scroll-content {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
  }

  /* Pestañas Horizontales Desplazables (Premium Touch Navigation) */
  .tabs-navigation {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px 12px 0 0 !important;
    display: flex !important;
    scrollbar-width: none !important; /* Firefox */
  }

  .tabs-navigation::-webkit-scrollbar {
    display: none !important; /* Ocultar scrollbar en Safari/Chrome */
  }

  .tab-btn {
    padding: 12px 16px !important;
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
  }

  .tab-btn.active::after {
    left: 16px !important;
    right: 16px !important;
  }

  /* Botones Táctiles más Anchos y Cómodos al Pulgar */
  .detail-actions-panel {
    margin-top: 5px !important;
  }

  .detail-actions-panel .btn-primary {
    padding: 14px !important;
    font-size: 0.95rem !important;
    border-radius: 14px !important;
  }

  /* Alarm banner en móviles centrado */
  #alarm-banner {
    width: auto;
    left: 16px;
    right: 16px;
    top: 16px;
  }

  /* Sobreescritura de calendario para móviles */
  .calendar-day-cell {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  #calendar-days-grid {
    min-height: 240px !important;
    gap: 6px !important;
  }
  
  #calendar-events-list {
    max-height: 350px !important;
    overflow-y: auto !important;
  }
}

/* Insignias de Temperatura de Leads (Generales y consolidadas) */
.lead-temperature-badge.temp-caliente {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
}
.lead-temperature-badge.temp-calificado {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #ffffff !important;
}
.lead-temperature-badge.temp-frio {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #9ca3af !important;
}
.lead-temperature-badge.temp-cerrado {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   SISTEMA DE DISEÑO DE LUJO - TEMA CLARO (CLARO ELEGANTE)
   ========================================================================== */

[data-theme="light"] {
  /* Paleta de Colores Mármol Calacatta & Oro */
  --bg-primary: #fdfcfc;            /* Blanco Mármol Alabastro */
  --bg-secondary: #f6efef;          /* Gris Rubí Claro muy Suave */
  --bg-glass: rgba(255, 255, 255, 0.75); /* Vidrio Templado Claro */
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 255, 255, 0.85);   /* Tarjetas Claras Glass */
  --border-glass: rgba(229, 192, 96, 0.28); /* Borde dorado más definido */
  --border-glass-hover: rgba(229, 192, 96, 0.6);
  
  --text-primary: #2b0508;          /* Texto principal rubí extremadamente oscuro */
  --text-secondary: #594446;        /* Tono medio cálido para texto secundario */
  --text-muted: #8e7577;            /* Gris rubí claro apagado */
  
  --shadow-premium: 0 10px 30px -10px rgba(43, 5, 8, 0.08), 0 1px 1px 0 rgba(229, 192, 96, 0.18) inset;
  
  /* Temperaturas e Indicadores en Claro */
  --color-cold: #6d6263;
  --color-cold-gradient: linear-gradient(135deg, #7c7273, #554d4e);
}

/* Modificaciones específicas para Tema Claro */
[data-theme="light"] body {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Scrollbar en Tema Claro */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(43, 5, 8, 0.15);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(43, 5, 8, 0.3);
}

/* Menú Lateral Claro */
[data-theme="light"] #sidebar-menu {
  background: linear-gradient(180deg, #fbf9f9 0%, #ede6e6 100%);
  border-right: 1px solid var(--border-glass);
}
[data-theme="light"] .brand-name {
  background: linear-gradient(135deg, #b38612 0%, #8c6405 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .nav-item {
  color: var(--text-secondary);
}
[data-theme="light"] .nav-item:hover {
  background: rgba(43, 5, 8, 0.04);
  color: var(--text-primary);
}
[data-theme="light"] .nav-item.active {
  background: var(--bg-card);
  color: #b38612;
  border-color: rgba(229, 192, 96, 0.45);
  box-shadow: 0 4px 20px rgba(43, 5, 8, 0.04);
}
[data-theme="light"] .agent-avatar {
  border-color: rgba(43, 5, 8, 0.1);
  color: #ffffff;
}

/* Barra de Navegación Móvil */
[data-theme="light"] #mobile-navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  border-top: 1px solid var(--border-glass) !important;
  box-shadow: 0 -4px 20px rgba(43, 5, 8, 0.03) !important;
}
[data-theme="light"] .mobile-nav-item {
  color: var(--text-secondary) !important;
}
[data-theme="light"] .mobile-nav-item.active {
  color: #b38612 !important;
}

/* Ajustes de Contraste para Inputs y Textareas */
[data-theme="light"] .form-control {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(229, 192, 96, 0.35);
  color: var(--text-primary);
}
[data-theme="light"] .form-control:focus {
  border-color: #e5c060;
  box-shadow: 0 0 10px rgba(229, 192, 96, 0.2);
  background: #ffffff;
}
[data-theme="light"] input[readonly], 
[data-theme="light"] textarea[readonly] {
  background: rgba(43, 5, 8, 0.03) !important;
  border-color: rgba(43, 5, 8, 0.06) !important;
}

/* Sobrescribir estilos inline en secciones de Ajustes (PWA) */
[data-theme="light"] #view-settings div[style*="rgba(255,255,255,0.02)"] {
  background: rgba(43, 5, 8, 0.025) !important;
  border-color: rgba(43, 5, 8, 0.06) !important;
}
[data-theme="light"] #view-settings strong[style*="color: #ffffff"],
[data-theme="light"] #view-settings strong[style*="color: rgb(255, 255, 255)"],
[data-theme="light"] #view-settings i[style*="color: #ffffff"] {
  color: var(--text-primary) !important;
}
[data-theme="light"] .mobile-move-buttons {
  border-top: 1px solid rgba(43, 5, 8, 0.06) !important;
}

/* Modificaciones de Legibilidad en Kanban e Indicadores */
[data-theme="light"] .kanban-column {
  background: rgba(43, 5, 8, 0.015);
  border: 1px dashed rgba(229, 192, 96, 0.2);
}
[data-theme="light"] .lead-card {
  box-shadow: 0 4px 15px -5px rgba(43, 5, 8, 0.05);
}
[data-theme="light"] .lead-name {
  color: var(--text-primary);
}
[data-theme="light"] .lead-property-info span {
  color: var(--text-secondary);
}

/* Contraste de Etiquetas de Etapa */
[data-theme="light"] .detail-stage-tag.stage-nuevo { background: rgba(139, 92, 246, 0.08); color: #6d28d9; }
[data-theme="light"] .detail-stage-tag.stage-calificado { background: rgba(229, 192, 96, 0.15); color: #855b00; }
[data-theme="light"] .detail-stage-tag.stage-contacto { background: rgba(59, 130, 246, 0.08); color: #1d4ed8; }
[data-theme="light"] .detail-stage-tag.stage-caliente { background: rgba(216, 31, 38, 0.08); color: #991b1b; }
[data-theme="light"] .detail-stage-tag.stage-cerrado { background: rgba(16, 185, 129, 0.08); color: #065f46; }

/* Contraste en Indicadores de Calendario */
[data-theme="light"] .calendar-event-card {
  box-shadow: 0 2px 8px rgba(43, 5, 8, 0.02) !important;
}
[data-theme="light"] .calendar-event-title {
  color: var(--text-primary) !important;
}
[data-theme="light"] .timeline-node {
  border-left: 2px solid rgba(229, 192, 96, 0.3) !important;
}
[data-theme="light"] .timeline-node-time {
  color: #b38612 !important;
}
[data-theme="light"] .timeline-node::before {
  background: #fdfcfc !important;
  border: 2px solid #e5c060 !important;
}

/* Modificaciones de KPI Cards */
[data-theme="light"] .kpi-card {
  box-shadow: 0 4px 15px rgba(43, 5, 8, 0.02) !important;
}
[data-theme="light"] .kpi-num {
  color: var(--text-primary) !important;
}

/* Modificaciones en Chats de IA */
[data-theme="light"] .chat-bubble.assistant {
  background: rgba(229, 192, 96, 0.06) !important;
  border-color: rgba(229, 192, 96, 0.2) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .chat-bubble.user {
  background: rgba(43, 5, 8, 0.04) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .whisper-banner {
  background: rgba(229, 192, 96, 0.05) !important;
  border-color: rgba(229, 192, 96, 0.25) !important;
}

/* Modal e Iconos en Claro */
[data-theme="light"] .modal-content {
  box-shadow: 0 20px 50px rgba(43, 5, 8, 0.15) !important;
}
[data-theme="light"] .close-btn {
  color: var(--text-secondary);
}
[data-theme="light"] .close-btn:hover {
  color: var(--text-primary);
}

/* Sobrescribir fondos degradados oscuros de las tarjetas ejecutivas (Portfolio) */
[data-theme="light"] .portfolio-card {
  background: var(--bg-card) !important;
  border-color: var(--border-glass) !important;
  box-shadow: var(--shadow-premium) !important;
}
[data-theme="light"] .portfolio-card.temp-caliente {
  background: rgba(216, 31, 38, 0.04) !important;
  border-color: rgba(216, 31, 38, 0.35) !important;
}
[data-theme="light"] .portfolio-card.temp-caliente:hover {
  border-color: rgba(216, 31, 38, 0.6) !important;
  box-shadow: 0 20px 40px -15px rgba(216, 31, 38, 0.12), 0 0 25px rgba(216, 31, 38, 0.1) !important;
}
[data-theme="light"] .portfolio-card.temp-calificado {
  background: rgba(229, 192, 96, 0.05) !important;
  border-color: rgba(229, 192, 96, 0.35) !important;
}
[data-theme="light"] .portfolio-card.temp-calificado:hover {
  border-color: rgba(229, 192, 96, 0.6) !important;
  box-shadow: 0 20px 40px -15px rgba(229, 192, 96, 0.12), 0 0 25px rgba(229, 192, 96, 0.1) !important;
}
[data-theme="light"] .portfolio-card.temp-cold {
  background: rgba(109, 98, 99, 0.03) !important;
  border-color: rgba(109, 98, 99, 0.25) !important;
}
[data-theme="light"] .portfolio-card.temp-cerrado {
  background: rgba(16, 185, 129, 0.04) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
[data-theme="light"] .portfolio-card.temp-cerrado:hover {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 20px 40px -15px rgba(16, 185, 129, 0.12), 0 0 25px rgba(16, 185, 129, 0.1) !important;
}
[data-theme="light"] .portfolio-info-item {
  background: rgba(43, 5, 8, 0.02) !important;
  border-color: rgba(229, 192, 96, 0.15) !important;
}
[data-theme="light"] .portfolio-divider {
  border-top: 1px solid rgba(43, 5, 8, 0.06) !important;
}
[data-theme="light"] .portfolio-action-btn {
  background: rgba(43, 5, 8, 0.03) !important;
  border-color: rgba(229, 192, 96, 0.2) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .portfolio-action-btn:hover {
  background: var(--bg-glass-hover) !important;
}

/* Insignias de Temperatura en Tema Claro */
[data-theme="light"] .lead-temperature-badge.temp-caliente {
  background: rgba(216, 31, 38, 0.08) !important;
  color: #991b1b !important;
}
[data-theme="light"] .lead-temperature-badge.temp-calificado {
  background: rgba(59, 130, 246, 0.08) !important;
  color: #1d4ed8 !important;
}
[data-theme="light"] .lead-temperature-badge.temp-frio {
  background: rgba(109, 98, 99, 0.08) !important;
  color: #594446 !important;
}
[data-theme="light"] .lead-temperature-badge.temp-cerrado {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #065f46 !important;
}

/* ==========================================
   MEJORAS ESTÉTICAS PARA ENTORNO CLARO PREMIUM
   ========================================== */

/* 1. Tablero Kanban de Mármol Blanco Alabastro */
[data-theme="light"] .kanban-column {
  background: #ffffff !important;
  border: 1px solid rgba(229, 192, 96, 0.22) !important;
  box-shadow: 0 4px 20px rgba(43, 5, 8, 0.02) !important;
  border-radius: 18px !important;
}

[data-theme="light"] .kanban-column-header {
  border-bottom: 2px solid rgba(229, 192, 96, 0.15) !important;
  padding: 1.2rem !important;
}

[data-theme="light"] .kanban-column-title {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .kanban-count-badge {
  background: rgba(43, 5, 8, 0.05) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(229, 192, 96, 0.15) !important;
}

/* 2. Tarjetas de Clientes Kanban en Claro */
[data-theme="light"] .lead-card {
  background-color: #ffffff !important;
  background-image: none !important; /* Quitar cualquier degradado de fondo oscuro */
  border: 1px solid rgba(229, 192, 96, 0.3) !important;
  box-shadow: 0 4px 15px rgba(43, 5, 8, 0.03) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .lead-card:hover {
  border-color: rgba(229, 192, 96, 0.65) !important;
  box-shadow: 0 8px 25px rgba(43, 5, 8, 0.06) !important;
}

[data-theme="light"] .lead-card.temp-caliente {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(216, 31, 38, 0.35) !important;
  box-shadow: 0 4px 15px rgba(216, 31, 38, 0.05) !important;
}

[data-theme="light"] .lead-card.temp-caliente:hover {
  border-color: rgba(216, 31, 38, 0.65) !important;
  box-shadow: 0 8px 25px rgba(216, 31, 38, 0.09) !important;
}

[data-theme="light"] .lead-card.temp-caliente::after {
  background: linear-gradient(135deg, transparent 50%, rgba(216, 31, 38, 0.25) 50%) !important;
}

[data-theme="light"] .lead-card.temp-calificado {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(229, 192, 96, 0.45) !important;
  box-shadow: 0 4px 15px rgba(229, 192, 96, 0.05) !important;
}

[data-theme="light"] .lead-card.temp-calificado:hover {
  border-color: rgba(229, 192, 96, 0.75) !important;
}

[data-theme="light"] .lead-card.temp-frio {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(109, 98, 99, 0.25) !important;
  box-shadow: 0 4px 12px rgba(109, 98, 99, 0.02) !important;
}

[data-theme="light"] .lead-card.temp-frio:hover {
  border-color: rgba(109, 98, 99, 0.45) !important;
}

[data-theme="light"] .lead-card.temp-cerrado {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05) !important;
}

[data-theme="light"] .lead-card.temp-cerrado:hover {
  border-color: rgba(16, 185, 129, 0.65) !important;
}

[data-theme="light"] .lead-card.temp-cerrado .lead-temperature-badge {
  background: var(--color-success-gradient) !important;
  color: #ffffff !important;
}

[data-theme="light"] .lead-name {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .lead-property-info {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .lead-property-info i {
  color: var(--text-muted) !important;
}

[data-theme="light"] .lead-budget {
  color: #b38612 !important; /* Dorado Metálico legible */
  font-weight: 700 !important;
}

[data-theme="light"] .lead-action-mini {
  background: rgba(43, 5, 8, 0.04) !important;
  border: 1px solid rgba(229, 192, 96, 0.18) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .lead-action-mini:hover {
  background: rgba(229, 192, 96, 0.15) !important;
  border-color: rgba(229, 192, 96, 0.45) !important;
}

/* 3. Correcciones del Asistente IA */
[data-theme="light"] #view-ai-assistant h3,
[data-theme="light"] #view-ai-assistant .panel-header h3 {
  color: var(--text-primary) !important;
}

[data-theme="light"] #view-ai-assistant .panel-header {
  border-bottom: 1px solid rgba(43, 5, 8, 0.08) !important;
}

[data-theme="light"] #ai-search-client,
[data-theme="light"] #ai-select-objective,
[data-theme="light"] #ai-select-tone,
[data-theme="light"] #ai-custom-context {
  background: #ffffff !important;
  border: 1px solid rgba(229, 192, 96, 0.35) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] #ai-search-client::placeholder,
[data-theme="light"] #ai-custom-context::placeholder {
  color: var(--text-muted) !important;
}

[data-theme="light"] #ai-btn-clear-selection {
  color: var(--text-muted) !important;
}

[data-theme="light"] #ai-client-preview-card {
  background: rgba(229, 192, 96, 0.04) !important;
  border: 1px dashed rgba(229, 192, 96, 0.3) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 15px rgba(43, 5, 8, 0.01) inset !important;
}

[data-theme="light"] #ai-client-preview-card strong {
  color: var(--text-primary) !important;
}

[data-theme="light"] #ai-preview-property {
  color: var(--text-secondary) !important;
}

[data-theme="light"] #ai-chat-console {
  background: #ffffff !important;
  border: 1px solid rgba(229, 192, 96, 0.22) !important;
  box-shadow: 0 4px 20px rgba(43, 5, 8, 0.02) inset !important;
}

/* 4. Correcciones para Mi Agenda & Calendario */
[data-theme="light"] .calendar-event-card {
  background: #ffffff !important;
  box-shadow: 0 4px 15px rgba(43, 5, 8, 0.03) !important;
}

[data-theme="light"] .calendar-event-card span,
[data-theme="light"] .calendar-event-card p {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .calendar-event-title {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

/* Celdas del Calendario Visibles */
[data-theme="light"] .calendar-day-cell {
  color: var(--text-primary) !important;
}

[data-theme="light"] .calendar-day-cell:hover:not(.selected) {
  background: rgba(43, 5, 8, 0.04) !important;
  border-color: rgba(229, 192, 96, 0.2) !important;
}

[data-theme="light"] .calendar-day-cell.selected {
  color: #ffffff !important;
  background: var(--accent-gold-gradient) !important;
  box-shadow: 0 4px 12px rgba(229, 192, 96, 0.35) !important;
}

[data-theme="light"] .calendar-day-cell.today {
  border-color: var(--accent-gold) !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

/* ==========================================
   MÓDULO DE PROPIEDADES & BOLSA INMOBILIARIA
   ========================================== */
.properties-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
}

.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: row;
  align-items: center;
  box-shadow: var(--shadow-premium);
  position: relative;
  padding: 12px;
  gap: 16px;
}

.property-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(229, 192, 96, 0.15);
}

.property-badge-shared {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  text-transform: uppercase;
  display: inline-block;
  white-space: nowrap;
}

.property-badge-private {
  background: linear-gradient(135deg, #7c7273 0%, #554d4e 100%);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
  white-space: nowrap;
}

.property-image-wrapper {
  width: 140px;
  height: 100px;
  min-width: 140px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #2b0508 0%, #0f0102 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
  transform: translateZ(0); /* Forzar recorte de esquinas redondeadas en Safari/iOS */
}

.property-row-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-row-image-placeholder {
  font-size: 1.8rem;
  color: var(--accent-gold);
}

.property-info-main {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.property-row-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.property-row-title {
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 1.1rem;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.property-row-meta-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-row-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.property-row-specs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  flex-wrap: wrap;
}

.property-spec-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.property-spec-pill i {
  color: var(--accent-gold);
}

.property-info-side {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 150px;
  text-align: right;
  padding-right: 10px;
}

.property-row-price {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-gold);
}

.property-row-agent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.property-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 140px;
  min-width: 140px;
}

.property-row-actions button,
.property-row-actions a {
  width: 100%;
  text-align: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 768px) {
  .property-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .property-image-wrapper {
    width: 100%;
    height: 160px;
    min-width: 100%;
  }
  .property-info-side {
    align-items: flex-start;
    text-align: left;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
    margin-top: 4px;
  }
  .property-row-actions {
    flex-direction: row;
    width: 100%;
    min-width: 100%;
    margin-top: 8px;
  }
}

/* Light Theme overrides for Properties */
[data-theme="light"] .property-card {
  background: #ffffff !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .property-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .property-row-title {
  color: var(--bg-primary) !important;
}

[data-theme="light"] .property-image-wrapper {
  background: #f3f4f6 !important;
}

[data-theme="light"] .property-row-image-placeholder {
  color: var(--bg-primary) !important;
}

[data-theme="light"] .property-row-address {
  color: #374151 !important;
}

[data-theme="light"] .property-spec-pill {
  border-color: #e5e7eb !important;
  background: #f9fafb !important;
  color: #4b5563 !important;
}

[data-theme="light"] .property-row-agent {
  color: #4b5563 !important;
}

/* Responsividad para Filas de Formulario en Modales (Stack en móviles) */
@media (max-width: 768px) {
  .modal-card {
    max-width: 95% !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
    margin: auto !important;
  }
  .modal-body {
    max-height: 60vh !important;
    padding: 1.2rem 1rem !important;
  }
  .modal-footer {
    padding: 0.8rem 1rem 1.2rem 1rem !important;
  }
  .modal-card .form-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .modal-card .form-row .form-group {
    width: 100% !important;
    flex: 1 1 100% !important;
    margin-bottom: 0 !important;
  }
  .modal-card .form-row .form-group input,
  .modal-card .form-row .form-group select {
    width: 100% !important;
  }
}
