/* ==========================================================================
   SISTEMA DE DISEÑO - PLATAFORMA INMOBILIARIA TÁI FRACCIONAMIENTO
   Estilo: Dark Luxury Glassmorphism / Modern Real Estate UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Paleta Base */
  --bg-main: #0B0F19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1F2937;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --bg-glass-strong: rgba(15, 23, 42, 0.90);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.18);

  /* Acentos de Marca */
  --brand-gold: #D4AF37;
  --brand-gold-glow: rgba(212, 175, 55, 0.25);
  --brand-primary: #3B82F6;
  --brand-primary-glow: rgba(59, 130, 246, 0.30);
  --brand-teal: #06B6D4;

  /* Estatus Comerciales */
  --status-disponible: #10B981; /* Verde Esmeralda */
  --status-disponible-glow: rgba(16, 185, 129, 0.35);
  --status-disponible-bg: rgba(16, 185, 129, 0.12);

  --status-pagado: #2563EB;     /* Azul Zafiro */
  --status-pagado-glow: rgba(37, 99, 235, 0.35);
  --status-pagado-bg: rgba(37, 99, 235, 0.12);

  --status-activo: #F59E0B;     /* Ámbar Dorado */
  --status-activo-glow: rgba(245, 158, 11, 0.35);
  --status-activo-bg: rgba(245, 158, 11, 0.12);

  --status-socios: #8B5CF6;     /* Amatista / Violeta */
  --status-socios-glow: rgba(139, 92, 246, 0.35);
  --status-socios-bg: rgba(139, 92, 246, 0.12);

  --status-pausado: #64748B;    /* Grafito Slate */
  --status-pausado-glow: rgba(100, 116, 139, 0.35);
  --status-pausado-bg: rgba(100, 116, 139, 0.12);

  /* Texto */
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverse: #030712;

  /* Sombras y Luces */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

  /* Tipografía */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button {
  font-family: inherit;
  cursor: pointer;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

/* Escala de densidad fluida para laptops y monitores estándar (1025px a 1680px):
   Permite visualizar toda la plataforma completa a 100% de zoom en Chrome sin recortes */
@media screen and (min-width: 1025px) and (max-width: 1680px) {
  html {
    font-size: 13.5px;
  }
}

@media screen and (min-width: 1681px) {
  html {
    font-size: 14.5px;
  }
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  min-height: 0;
}

/* ==========================================================================
   NAVBAR Y HEADER SUPERIOR (TOP FLEX BAR)
   ========================================================================== */
.navbar {
  position: relative;
  flex-shrink: 0;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  width: 100%;
  z-index: 2000;
  background: #0B0F19;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 1.25rem;
  padding-top: max(0px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.brand-logo-img:hover {
  transform: scale(1.04);
}

.brand-title h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title .badge-tag {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.15);
  color: var(--brand-gold);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(212, 175, 55, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-title p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Selector de Vistas / Pestañas */
.nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

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

.nav-tab-btn.active {
  color: #fff;
  background: var(--brand-primary);
  box-shadow: 0 2px 10px var(--brand-primary-glow);
}

/* Acciones en Navbar */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 220px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: rgba(0, 0, 0, 0.6);
  width: 260px;
  box-shadow: 0 0 10px var(--brand-primary-glow);
}

.search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 5;
}

.search-clear-btn:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* ==========================================================================
   DROPDOWN DE BÚSQUEDA GLOBAL
   ========================================================================== */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-width: 92vw;
  max-height: min(480px, 75vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0F172A !important;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 5000 !important;
  padding: 0.75rem;
  animation: fadeInDown 0.2s ease-out;
}

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

.search-dropdown-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem 0.35rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.4rem;
}

.search-client-group {
  background: #1E293B;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.search-client-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-client-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-gold);
}

.search-client-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.3rem;
}

.search-result-item:hover, .search-result-item:active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateX(2px);
}

.search-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-item-id {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.search-item-info {
  display: flex;
  flex-direction: column;
}

.search-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.search-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-sync {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-appearance: none;
  appearance: none;
}

.btn-sync:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-color: rgba(56, 189, 248, 0.6);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-sync.syncing .spin {
  animation: spin 1s linear infinite;
}

.btn-config {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-config:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
  background: rgba(255, 255, 255, 0.05);
}

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

/* ==========================================================================
   CONTENEDOR PRINCIPAL DE VISTAS (FLEX COLUMN FULL HEIGHT)
   ========================================================================== */
.main-container {
  flex: 1;
  height: calc(100% - 64px);
  min-height: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  position: relative;
}

.view-panel.active {
  display: flex !important;
  flex-direction: column;
}

/* ==========================================================================
   VISTA 1: MASTERPLAN INTERACTIVO (LEAFLET)
   ========================================================================== */
#view-masterplan {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  width: 100%;
  flex: 1;
  touch-action: none !important;
}

#map, #satellite-leaflet-container, .leaflet-container {
  touch-action: none !important;
}

/* Barra de Filtros Flotante del Mapa */
.map-filter-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 70px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-filter {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-body);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.select-filter:focus {
  border-color: var(--brand-primary);
}

/* Status Filter Pills */
.status-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.status-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  user-select: none;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.disponible .dot { background: var(--status-disponible); }
.status-pill.pagado .dot { background: var(--status-pagado); }
.status-pill.activo .dot { background: var(--status-activo); }
.status-pill.socios .dot { background: var(--status-socios); }
.status-pill.pausado .dot { background: var(--status-pausado); }

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.status-pill.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.status-pill.active.disponible { background: var(--status-disponible-bg); border-color: var(--status-disponible); }
.status-pill.active.pagado { background: var(--status-pagado-bg); border-color: var(--status-pagado); }
.status-pill.active.activo { background: var(--status-activo-bg); border-color: var(--status-activo); }
.status-pill.active.socios { background: var(--status-socios-bg); border-color: var(--status-socios); }
.status-pill.active.pausado { background: var(--status-pausado-bg); border-color: var(--status-pausado); }

.status-pill .count {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 700;
}

/* Herramienta Drag & Drop */
.edit-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-edit-mode {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-edit-mode:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-edit-mode.active {
  background: #DC2626;
  border-color: #EF4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  animation: pulse-border 2s infinite;
}

.btn-save-pins {
  display: none;
  background: #10B981;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 0 12px var(--status-disponible-glow);
  transition: all 0.2s ease;
}

.btn-save-pins:hover {
  background: #059669;
}

.btn-save-pins.visible {
  display: flex;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); }
}

/* Banner flotante de Modo Edición Activo */
.edit-mode-banner {
  display: none;
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #EF4444;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
}

.edit-mode-banner.visible {
  display: flex;
}

/* Barra Flotante de Modo Asignación Dinámica de Socios */
.bulk-assign-bar {
  display: none;
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 650;
  background: rgba(11, 19, 43, 0.96);
  border: 1px solid rgba(0, 230, 118, 0.4);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 230, 118, 0.2);
  align-items: center;
  gap: 0.6rem;
  backdrop-filter: blur(14px);
  max-width: 95vw;
  flex-wrap: wrap;
  justify-content: center;
  animation: slideDownAssignBar 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bulk-assign-bar.visible {
  display: flex;
}

@keyframes slideDownAssignBar {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-assign-badge {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38BDF8;
  color: #38BDF8;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.btn-bulk-action {
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-bulk-saul {
  background: rgba(0, 230, 118, 0.18);
  border-color: #00E676;
  color: #00E676;
}
.btn-bulk-saul:hover {
  background: #00E676;
  color: #064E3B;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.6);
}

.btn-bulk-pancho {
  background: rgba(249, 115, 22, 0.18);
  border-color: #F97316;
  color: #F97316;
}
.btn-bulk-pancho:hover {
  background: #F97316;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
}

.btn-bulk-clear {
  background: rgba(148, 163, 184, 0.15);
  border-color: #94A3B8;
  color: #CBD5E1;
}
.btn-bulk-clear:hover {
  background: rgba(148, 163, 184, 0.3);
  color: #FFFFFF;
}

.btn-bulk-invert {
  background: rgba(168, 85, 247, 0.18);
  border-color: #A855F7;
  color: #D8B4FE;
}
.btn-bulk-invert:hover {
  background: #A855F7;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.bulk-group-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 3px;
}

.btn-bulk-disp {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10B981;
  color: #34D399;
}
.btn-bulk-disp:hover {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
}

.btn-bulk-socios {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8B5CF6;
  color: #C4B5FD;
}
.btn-bulk-socios:hover {
  background: #8B5CF6;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
}

.btn-bulk-pausado {
  background: rgba(100, 116, 139, 0.2);
  border-color: #64748B;
  color: #CBD5E1;
}
.btn-bulk-pausado:hover {
  background: #64748B;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(100, 116, 139, 0.7);
}

.btn-bulk-save {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-weight: 800;
  border-color: #10B981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}
.btn-bulk-save:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
}

/* Contenedor del Mapa Leaflet */
#map {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 65px);
  flex: 1;
  outline: none;
  position: relative;
  z-index: 1;
  transition: background 0.3s ease;
}

/* ============================================================
   MODO PREMIUM DARK — Masterplan Ejecutivo de Alta Definición
   El plano se presenta como un documento técnico de élite:
   fondo oscuro profundo con luminosidad ambiente, mapa
   ligeramente atenuado y con contraste elevado, marco dorado.
   ============================================================ */
#map.mode-architectural {
  /* Gradiente oscuro profundo con brillo sutil en el centro */
  background: 
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(20, 30, 55, 0.95) 0%, rgba(8, 12, 25, 1) 100%);
  /* Trama de puntos finos para efecto de tablero técnico */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(20, 30, 55, 0.95) 0%, rgba(8, 12, 25, 1) 100%),
    radial-gradient(circle, rgba(56, 189, 248, 0.18) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px;
  /* Luz ambiente que emana desde el centro hacia el mapa */
  box-shadow: inset 0 0 200px rgba(0, 5, 30, 0.8);
  transition: background 0.5s ease;
}

/* El mapa: plano ejecutivo premium — NO invertido, look técnico refinado */
#map.mode-architectural .masterplan-sheet-img {
  /* Filtro preciso:
     - brightness(0.88): atenúa el blanco puro a un gris sofisticado
     - contrast(1.18): hace las líneas del plano más nítidas y definidas
     - saturate(0.60): desatura sutilmente para look técnico formal
     No se invierte: las líneas del plano siguen legibles y ordenadas */
  filter: brightness(0.88) contrast(1.18) saturate(0.60);
  border-radius: 6px;
  /* Marco multicapa: dorado + brillo cian + sombra profunda */
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.85),
    0 0 0 6px rgba(245, 158, 11, 0.10),
    0 0 0 8px rgba(56, 189, 248, 0.20),
    0 0 50px rgba(245, 158, 11, 0.12),
    0 0 100px rgba(56, 189, 248, 0.10),
    0 45px 120px rgba(0, 0, 0, 0.95);
  transition: filter 0.5s ease, box-shadow 0.5s ease;
}

/* Modo Clásico (Garantía de Regreso / Vista Original — SIN TOCAR PINES) */
#map.mode-classic {
  background-color: #080B11 !important;
  background-image: none !important;
  box-shadow: none !important;
}

#map.mode-classic .masterplan-sheet-img {
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Marca de Agua Técnica & Coordenadas Geográficas (Ecoterra, Jalisco) */
.map-watermark-coords {
  position: absolute;
  bottom: 18px;
  left: 20px;
  z-index: 999;
  background: rgba(11, 19, 43, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94A3B8;
  letter-spacing: 0.5px;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-watermark-coords:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: #38BDF8;
  color: #F8FAFC;
  transform: translateY(-2px);
}

.map-watermark-coords strong {
  color: #38BDF8;
  font-weight: 700;
}

/* Brújula / Rosa de los Vientos */
.map-compass-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  transition: transform 0.2s ease;
}

.map-compass-needle {
  font-size: 1.1rem;
  line-height: 1;
  color: #F59E0B;
}

.map-compass-label {
  font-size: 0.55rem;
  font-weight: 900;
  color: #F59E0B;
  letter-spacing: 0.5px;
  margin-top: -1px;
}

/* Botones de Cambio de Estilo en el Mapa */
.map-style-toggle-group {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.btn-style-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-style-pill:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.btn-style-pill.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Pines / Badges Circulares de Lotes en Leaflet */
.custom-lot-marker {
  overflow: visible !important;
}

.lot-pin-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.lot-pin-container:hover {
  transform: scale(1.35);
  z-index: 1000 !important;
}

.lot-pin {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  user-select: none;
  transition: all 0.15s ease;
}

/* Halo / Aura radial translúcida alrededor del lote */
.lot-pin::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.22;
  z-index: -1;
  pointer-events: none;
  transition: all 0.2s ease;
}

.lot-pin-container:hover .lot-pin::after {
  width: 46px;
  height: 46px;
  opacity: 0.38;
}

.lot-pin.disponible { background: var(--status-disponible); box-shadow: 0 0 8px var(--status-disponible-glow); }
.lot-pin.pagado     { background: var(--status-pagado);     box-shadow: 0 0 8px var(--status-pagado-glow); }
.lot-pin.activo     { background: var(--status-activo);     box-shadow: 0 0 8px var(--status-activo-glow); }
.lot-pin.socios     { background: var(--status-socios);     box-shadow: 0 0 8px var(--status-socios-glow); }
.lot-pin.pausado    { background: var(--status-pausado);    box-shadow: 0 0 8px var(--status-pausado-glow); }

/* Subgrupos de Socios: Saúl (Verde Menta Brillante) y Pancho (Naranja Vibrante) */
.lot-pin.subgrupo-saul {
  background: #00E676 !important;
  color: #064E3B !important;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.8) !important;
  border: 2px solid #FFFFFF !important;
}
.lot-pin.subgrupo-saul::after {
  border-top-color: #00E676 !important;
}

.lot-pin.subgrupo-pancho {
  background: #F97316 !important;
  color: #FFFFFF !important;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.8) !important;
  border: 2px solid #FFFFFF !important;
}
.lot-pin.subgrupo-pancho::after {
  border-top-color: #F97316 !important;
}

.lot-pin-container.draggable-mode {
  cursor: grab;
}

.lot-pin-container.draggable-mode:active {
  cursor: grabbing;
}

/* Modo Asignación Dinámica de Socios: Pines Seleccionados */
.lot-pin-container.bulk-assign-active {
  cursor: pointer !important;
}

.lot-pin-container.bulk-selected .lot-pin {
  transform: scale(1.35) !important;
  border: 3px solid #38BDF8 !important;
  box-shadow: 0 0 16px #38BDF8, 0 0 28px rgba(56, 189, 248, 0.75) !important;
  animation: pulse-bulk-selected 1.2s infinite alternate ease-in-out;
  z-index: 1000 !important;
}

.lot-pin-container.bulk-selected::before {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #38BDF8;
  color: #080D1A;
  font-size: 11px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.8);
  z-index: 1001;
  border: 1px solid #FFFFFF;
}

@keyframes pulse-bulk-selected {
  0% {
    box-shadow: 0 0 10px #38BDF8, 0 0 18px rgba(56, 189, 248, 0.5);
  }
  100% {
    box-shadow: 0 0 20px #38BDF8, 0 0 35px rgba(56, 189, 248, 0.95);
  }
}

.lot-pin-container.highlighted .lot-pin {
  transform: scale(1.4);
  border-color: #FACC15;
  box-shadow: 0 0 15px #FACC15;
  animation: pulse-lot 1.2s infinite;
}

@keyframes pulse-lot {
  0%, 100% { transform: scale(1.4); }
  50% { transform: scale(1.6); }
}

/* Tooltip Custom de Leaflet */
.leaflet-tooltip.tai-tooltip {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  line-height: 1.4;
}

.leaflet-tooltip-top:before {
  border-top-color: var(--bg-surface-elevated);
}

.tooltip-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tooltip-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
}

.tooltip-badge.disponible { background: var(--status-disponible-bg); color: var(--status-disponible); }
.tooltip-badge.pagado { background: var(--status-pagado-bg); color: var(--status-pagado); }
.tooltip-badge.activo { background: var(--status-activo-bg); color: var(--status-activo); }
.tooltip-badge.socios { background: var(--status-socios-bg); color: var(--status-socios); }
.tooltip-badge.pausado { background: var(--status-pausado-bg); color: var(--status-pausado); }

.tooltip-client {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.tooltip-price {
  font-weight: 600;
  color: var(--brand-gold);
  margin-top: 0.2rem;
}

/* Mini Leyenda Flotante */
.map-legend {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.legend-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ==========================================================================
   VISTA 2: BASE DE DATOS CRM
   ========================================================================== */
#view-crm.active,
#view-dashboard.active {
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  display: flex !important;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 1.5rem 8rem 1.5rem;
}

.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.crm-title h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.crm-title p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.crm-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-export {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-appearance: none;
  appearance: none;
}

.btn-export:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.5);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.crm-filters {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.crm-toolbar-sub {
  margin-top: 0.75rem;
}

.btn-filter-pill, .btn-sort-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-filter-pill:hover, .btn-sort-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-filter-pill.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.08));
  border-color: var(--brand-gold);
  color: var(--brand-gold);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.btn-sort-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.08));
  border-color: #38BDF8;
  color: #38BDF8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.crm-client-row {
  transition: background 0.15s ease;
}

.crm-client-row:hover {
  background: rgba(212, 175, 55, 0.04) !important;
}

/* Modo Pantalla Completa Expandida para CRM */
#view-crm.crm-fullscreen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  z-index: 9999 !important;
  background: #070B14 !important;
  padding: 0.75rem 1.25rem 1rem 1.25rem !important;
  overflow-y: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#view-crm.crm-fullscreen-mode .crm-header {
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
}

#view-crm.crm-fullscreen-mode .crm-header .crm-title p {
  display: none;
}

#view-crm.crm-fullscreen-mode .crm-filters {
  padding: 0.5rem 0.9rem;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

#view-crm.crm-fullscreen-mode .crm-toolbar-sub {
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.75rem;
}

#view-crm.crm-fullscreen-mode .crm-table-container {
  flex: 1;
  max-height: none;
}

body.crm-fullscreen-active {
  overflow: hidden !important;
}

.crm-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
  width: 100%;
}

.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.85rem;
}

.crm-table th {
  position: sticky;
  top: 0;
  z-index: 15;
  background: #0B0F19;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-glass);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.crm-table th:hover {
  color: var(--text-primary);
}

.crm-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.crm-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.crm-table .lot-badge {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.crm-table .status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}

.crm-table .status-tag.disponible { background: var(--status-disponible-bg); color: var(--status-disponible); }
.crm-table .status-tag.pagado     { background: var(--status-pagado-bg);     color: var(--status-pagado); }
.crm-table .status-tag.activo     { background: var(--status-activo-bg);     color: var(--status-activo); }
.crm-table .status-tag.socios     { background: var(--status-socios-bg);     color: var(--status-socios); }
.crm-table .status-tag.pausado    { background: var(--status-pausado-bg);    color: var(--status-pausado); }

.crm-table .currency {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

.crm-table .btn-action {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-table .btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

/* Paginación */
.crm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-glass);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-page {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   VISTA 3: MÉTRICAS Y FINANZAS (DASHBOARD)
   ========================================================================== */
#view-dashboard {
  padding: 1.5rem;
  overflow-y: auto;
  gap: 1.5rem;
}

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

.dashboard-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Grid de KPIs Superiores */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.gold::before { background: var(--brand-gold); }
.kpi-card.blue::before { background: var(--brand-primary); }
.kpi-card.green::before { background: #10B981; }
.kpi-card.purple::before { background: var(--status-socios); }
.kpi-card.teal::before { background: var(--brand-teal); }
.kpi-card.red::before { background: #EF4444; }

.kpi-card.green .kpi-value { color: #10B981 !important; }
.kpi-card.red .kpi-value { color: #EF4444 !important; }
.kpi-card.gold .kpi-value { color: var(--brand-gold) !important; }

.kpi-card .kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-card .kpi-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-card .kpi-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Gráficos del Dashboard */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

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

.chart-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  flex: 1;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Comparativa por Etapas */
.stages-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stage-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.stage-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Resumen por Manzanas */
.manzanas-summary-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==========================================================================
   MODALES (EXPEDIENTE, EDITOR, CONFIGURACIÓN)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  /* Habilitar captura táctil inmediata en MobileSafari y touch */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* Margen amplio de seguridad para evitar activar la barra de gestos de iPad/iPhone (Home Indicator) */
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 3.75rem)) !important;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-content {
  cursor: default; /* Evitar que tocar el contenido cierre el modal */
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: min(80vh, 80dvh, calc(100dvh - 120px)) !important;
  overflow-y: auto;
  overflow-x: hidden !important;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  animation: modal-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  /* Separación inferior obligatoria respecto al fondo de pantalla táctil */
  margin: auto auto max(2.75rem, calc(env(safe-area-inset-bottom) + 1.75rem)) auto !important;
}

.modal-content *,
.modal-overlay * {
  box-sizing: border-box;
}

@keyframes modal-enter {
  0% { transform: scale(0.92) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-surface, #111827);
  z-index: 30;
  flex-shrink: 0 !important;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Botón de cerrar ergonómico (44x44px estándar Apple HIG) con respuesta táctil instantánea */
.modal-close {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #CBD5E1 !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  min-width: 44px !important;
  min-height: 44px !important;
  width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  padding: 0 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.modal-close:hover,
.modal-close:active {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #EF4444 !important;
  transform: scale(0.95);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.modal-footer {
  padding: 1rem 1.5rem;
  padding-bottom: max(1.35rem, calc(env(safe-area-inset-bottom) + 1rem)) !important;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface, #111827);
  position: sticky;
  bottom: 0;
  z-index: 25;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0 !important;
}

/* Modales con mayor amplitud en pantallas medianas/grandes para no apretar datos ni cortar campos */
#modal-expediente .modal-content {
  width: min(96vw, 1080px);
  max-width: 1080px;
}

/* Realce de visibilidad en Expediente de Lote (Nombre, Lote, Medidas) */
#modal-expediente #exp-title-lote {
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  color: #FFFFFF !important;
  letter-spacing: 0.5px !important;
}

#modal-expediente #exp-mz-lote {
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  color: #38BDF8 !important;
}

#modal-expediente #exp-cliente {
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #38BDF8 !important;
  letter-spacing: 0.3px !important;
  line-height: 1.25 !important;
}

#modal-expediente #exp-superficie {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  color: #38BDF8 !important;
}

#modal-expediente #exp-dimensiones,
#modal-expediente #exp-frente,
#modal-expediente #exp-fondo {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
}

#modal-expediente #exp-col-norte,
#modal-expediente #exp-col-sur,
#modal-expediente #exp-col-oriente,
#modal-expediente #exp-col-poniente {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
}

#modal-add-payment .modal-content,
#modal-edit-lot-payment .modal-content {
  width: min(95vw, 680px);
  max-width: 680px;
}

#modal-pago-exito .modal-content {
  width: min(94vw, 540px);
  max-width: 540px;
  overflow-x: hidden !important;
}

/* Contenedores de tablas con scroll horizontal interno protegido */
.corrida-table-wrapper,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* Detalles del Expediente */
.expediente-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.expediente-section h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-width: 0;
}

.info-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  min-width: 0;
  box-sizing: border-box;
}

.info-item .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.info-item .val {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

/* Formularios en Modales */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group label,
.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-sizing: border-box;
}

.form-group input, 
.form-group select, 
.form-group textarea, 
.form-select,
.form-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  outline: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-group select,
.form-select {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.form-group select option, .form-select option {
  background-color: #0F172A;
  color: #F8FAFC;
  padding: 8px 12px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-select:focus, .form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary-glow);
}

.btn-primary {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369A1 0%, #1D4ED8 100%);
  border-color: #38BDF8;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  -webkit-appearance: none;
  appearance: none;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass-hover);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-color: var(--status-disponible); }
.toast.error   { border-color: #EF4444; }
.toast.info    { border-color: var(--brand-primary); }

@keyframes toast-in {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE — Laptops y Monitores Desktop (1025px a 1680px)
   Elimina la necesidad de hacer zoom 80% en Chrome; toda la plataforma
   (Navbar, Flujo de Caja, Masterplan, CRM y Métricas) cabe limpia y nítida.
   ========================================================================== */
@media screen and (min-width: 1025px) and (max-width: 1680px) {
  .navbar {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 0 0.85rem !important;
    gap: 0.45rem !important;
  }

  .brand-logo-img {
    height: 36px !important;
  }

  .brand-title h1 {
    font-size: 0.95rem !important;
  }

  .brand-title p {
    display: none !important;
  }

  .nav-tabs {
    padding: 2px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }

  .nav-tab-btn {
    padding: 0.32rem 0.55rem !important;
    font-size: 0.76rem !important;
    gap: 0.25rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  .nav-actions {
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }

  .nav-actions .btn-table-action,
  .nav-actions .btn-audit,
  .nav-actions .btn-recent-activity,
  .nav-actions .btn-sync,
  .nav-actions .btn-config {
    padding: 0.3rem 0.48rem !important;
    font-size: 0.72rem !important;
    height: 32px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  .search-box input {
    width: 125px !important;
    padding: 0.32rem 0.55rem 0.32rem 1.7rem !important;
    font-size: 0.75rem !important;
    height: 32px !important;
    box-sizing: border-box !important;
  }

  .search-box input:focus {
    width: 185px !important;
  }

  .search-box .search-icon {
    left: 0.55rem !important;
    font-size: 0.75rem !important;
  }

  .user-badge {
    padding: 0.2rem 0.55rem !important;
    gap: 0.35rem !important;
    height: 32px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .user-avatar {
    font-size: 0.95rem !important;
  }

  .user-name {
    font-size: 0.74rem !important;
    white-space: nowrap !important;
  }

  .user-role-title {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
  }

  /* Masterplan Floating Bar en Laptops */
  .map-filter-bar {
    top: 0.65rem !important;
    left: 0.65rem !important;
    right: 68px !important;
    padding: 0.35rem 0.7rem !important;
    gap: 0.4rem !important;
  }

  .map-filter-bar .filter-label {
    font-size: 0.7rem !important;
  }

  .map-filter-bar .select-filter {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .map-filter-bar .status-pill {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.48rem !important;
  }

  .map-filter-bar .btn-style-pill {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .map-filter-bar .btn-subg-chip {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
  }

  .map-compass-badge {
    top: 0.65rem !important;
    right: 0.65rem !important;
    width: 40px !important;
    height: 40px !important;
  }

  /* Flujo Sticky Bar en Laptops */
  .flujo-sticky-bar {
    padding: 0.5rem 1.15rem !important;
    margin: 0 -1.15rem 1rem -1.15rem !important;
    gap: 0.5rem !important;
  }

  .flujo-sticky-bar .crm-title h2 {
    font-size: 1.1rem !important;
  }

  .flujo-sticky-bar .btn-group-views {
    padding: 2px !important;
  }

  .flujo-sticky-bar .btn-flujo-mode {
    padding: 0.28rem 0.52rem !important;
    font-size: 0.73rem !important;
  }

  .flujo-sticky-bar .select-filter {
    padding: 0.28rem 0.52rem !important;
    font-size: 0.73rem !important;
  }

  .flujo-sticky-bar .btn-flujo-pill {
    padding: 0.28rem 0.52rem !important;
    font-size: 0.73rem !important;
    white-space: nowrap !important;
  }

  .flujo-sticky-bar .btn-export {
    padding: 0.28rem 0.52rem !important;
    font-size: 0.73rem !important;
    white-space: nowrap !important;
  }

  .flujo-kpi-row {
    gap: 0.6rem !important;
  }

  .flujo-kpi-row .kpi-card {
    padding: 0.6rem 0.75rem !important;
  }

  .flujo-kpi-row .kpi-value {
    font-size: 1.15rem !important;
  }

  /* CRM Filters en Laptops */
  .crm-filters {
    padding: 0.5rem 0.85rem !important;
    gap: 0.45rem !important;
  }

  .crm-filters .filter-group {
    gap: 0.35rem !important;
  }

  .crm-filters .filter-label {
    font-size: 0.7rem !important;
  }

  .crm-filters .select-filter {
    font-size: 0.75rem !important;
    padding: 0.28rem 0.5rem !important;
  }
}

/* Laptops Compactas (1025px a 1440px):
   Oculta texto largo de botones secundarios de navbar dejando los iconos y tooltips */
@media screen and (min-width: 1025px) and (max-width: 1440px) {
  .nav-actions .btn-table-action .action-label,
  .nav-actions .btn-audit .action-label {
    display: none !important;
  }
  .nav-actions .btn-table-action,
  .nav-actions .btn-audit {
    padding: 0.3rem 0.45rem !important;
  }
  .search-box input {
    width: 110px !important;
  }
  .search-box input:focus {
    width: 165px !important;
  }
  .nav-tab-btn {
    padding: 0.3rem 0.46rem !important;
    font-size: 0.73rem !important;
  }
}

/* Laptops Estrechas / 1366px y 1280px (1025px a 1300px) */
@media screen and (min-width: 1025px) and (max-width: 1300px) {
  .nav-actions .btn-recent-activity .action-label,
  .nav-actions .btn-sync .action-label {
    display: none !important;
  }
  .user-badge .user-role-title {
    display: none !important;
  }
  .nav-tab-btn {
    padding: 0.26rem 0.4rem !important;
    font-size: 0.71rem !important;
    gap: 0.2rem !important;
  }
}

/* Compatibilidad Pantallas Medianas (≤ 1200px) */
@media (max-width: 1200px) {
  .btn-recent-activity .action-label,
  .btn-sync .action-label,
  .btn-audit .action-label,
  .btn-table-action .action-label {
    display: none !important;
  }
  .btn-recent-activity,
  .btn-sync,
  .btn-audit,
  .btn-table-action {
    padding: 0.35rem 0.55rem !important;
  }
  .search-box input {
    width: 110px !important;
  }
  .search-box input:focus {
    width: 140px !important;
  }
  .user-badge {
    flex-shrink: 0 !important;
    padding: 0.25rem 0.55rem !important;
  }
  .user-badge .user-role-title {
    display: none !important;
  }
  .user-name {
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   RESPONSIVE — iPad y Tablets (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .charts-grid, .stages-summary-grid {
    grid-template-columns: 1fr;
  }

  /* Navbar: compacta en 2 filas limpias y ordenadas */
  .navbar {
    height: auto !important;
    min-height: 56px !important;
    max-height: none !important;
    padding: 0.5rem 1rem 0.45rem 1rem !important;
    padding-top: max(0.5rem, env(safe-area-inset-top)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    row-gap: 0.45rem !important;
    overflow: visible !important;
  }

  /* Fila 1 - Izquierda: Marca y Logo */
  .brand-section {
    order: 1 !important;
    flex: 0 0 auto !important;
  }
  .brand-logo-img {
    height: 32px !important;
  }
  .brand-title h1 {
    font-size: 0.95rem !important;
  }
  .brand-title p {
    display: none !important;
  }

  /* Fila 1 - Derecha: Acciones y Perfil */
  .nav-actions {
    order: 2 !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem !important;
    margin-left: auto !important;
  }
  .search-box input {
    width: 105px !important;
  }
  .search-box input:focus {
    width: 135px !important;
  }
  .user-badge {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.28rem 0.65rem !important;
    border-radius: 20px !important;
    margin-right: 0 !important;
    white-space: nowrap !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
  .user-badge .user-name {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    white-space: nowrap !important;
  }
  .user-badge .user-role-title {
    display: none !important;
  }

  /* Fila 2: Tabs ocupan fila completa y scrollean en horizontal */
  .nav-tabs {
    order: 3 !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    display: flex !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 3px !important;
    gap: 3px !important;
    scrollbar-width: none !important;
    margin-top: 0.15rem !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 10px !important;
  }
  .nav-tabs::-webkit-scrollbar { display: none !important; }

  .nav-tab-btn {
    padding: 0.45rem 0.8rem !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  /* Dropdown de búsqueda móvil: posicionado de forma adaptable */
  .search-results-dropdown {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(85vh - 80px) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.98), 0 0 0 1px rgba(56, 189, 248, 0.3) !important;
    z-index: 999999 !important;
  }

  /* Mapa */
  .map-filter-bar {
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    padding: 0.6rem 0.8rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .map-compass-badge {
    top: auto !important;
    bottom: 80px !important;
    right: 12px !important;
  }
  .filter-group {
    flex-wrap: wrap;
  }

  /* Drawer de lote ocupa pantalla completa */
  .lot-drawer {
    width: 100%;
    max-width: 100%;
  }

  /* KPIs: 2 columnas en tablet */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dashboard KPI: 2-3 columnas */
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================================
   DROPDOWNS Y FORMULARIOS — Galaxy S25 y Android / iOS
   ========================================================================== */
@media (max-width: 640px) {
  select, .select-filter, input[type="text"], input[type="number"], input[type="date"], input[type="search"] {
    font-size: 16px !important; /* Previene auto-zoom molesto en Galaxy S25 e iOS Safari */
    min-height: 40px;
  }
  
  select option, .select-filter option {
    background-color: #0F172A !important;
    color: #F8FAFC !important;
    font-size: 15px !important;
    padding: 10px 14px !important;
  }

  .search-result-item {
    padding: 12px 14px !important;
  }
}

/* ==========================================================================
   RESPONSIVE — iPhone / Móvil (≤ 640px)
   ========================================================================== */
@media (max-width: 640px) {
  /* Navbar más compacta */
  .navbar {
    padding: 0.45rem 0.85rem;
    gap: 0.4rem;
  }

  .brand-logo-img {
    height: 28px;
  }

  .brand-title h1 {
    font-size: 0.85rem;
    gap: 0.3rem;
  }

  .brand-title .badge-tag {
    display: none; /* Oculta "BETA" en móvil para ahorrar espacio */
  }

  /* Tabs: iconos + texto corto, grandes touch targets */
  .nav-tab-btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  /* Barra de acciones: solo íconos */
  .search-box {
    display: none;
  }

  /* KPIs: 2 columnas compactas */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .kpi-card {
    padding: 0.85rem 0.75rem;
  }

  .kpi-value {
    font-size: 1.1rem !important;
  }

  .kpi-label {
    font-size: 0.68rem;
  }

  /* Dashboard KPI: 2 columnas en iPhone */
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  /* Flujo sticky bar: apila verticalmente */
  .flujo-sticky-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    margin: 0 -1rem 1rem -1rem;
  }

  /* Botones de filtro de flujo: scroll horizontal */
  .flujo-filters-row,
  .flujo-sticky-bar > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .flujo-filters-row::-webkit-scrollbar,
  .flujo-sticky-bar > div::-webkit-scrollbar { display: none; }

  .btn-flujo-pill {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.6rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Tablas de flujo: texto más pequeño */
  .flujo-main-table th,
  .flujo-main-table td {
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
  }

  /* Modales en móvil y Split View de iPad: centrados y con espacio seguro sobre la barra de gestos */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: min(82vh, 82dvh) !important;
    border-radius: 16px !important;
    margin: auto auto max(2.5rem, calc(env(safe-area-inset-bottom) + 1.5rem)) auto !important;
  }

  .modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding-bottom: max(3.5rem, calc(env(safe-area-inset-bottom) + 2.5rem)) !important;
  }

  /* CRM */
  .crm-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .crm-search-box input {
    width: 100%;
  }
}

/* ==========================================================================
   RESPONSIVE — iPhone pequeño (≤ 390px, iPhone SE, Mini)
   ========================================================================== */
@media (max-width: 390px) {
  .brand-title h1 {
    font-size: 0.78rem;
  }

  .nav-tab-btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.7rem;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .kpi-card {
    padding: 0.7rem 0.6rem;
  }

  .kpi-value {
    font-size: 1rem !important;
  }
}


/* ==========================================================================
   HISTORIAL DE VERSIONES Y RESTAURACIÓN DE PINES
   ========================================================================== */
.btn-history-pins {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-history-pins:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}

.history-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-badge.preset {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.history-badge.backup {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.history-badge.current {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-restore-version {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3B82F6;
  color: #93C5FD;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-restore-version:hover {
  background: #2563EB;
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   ESTILOS PARA USUARIOS, SALA DE VENTAS, AUDITORÍA, COBRANZA Y FICHAS
   ========================================================================== */

/* 1. Botones de Barra de Navegación */
.btn-showroom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #FDE047;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-showroom:hover {
  background: linear-gradient(135deg, #EAB308, #D97706);
  color: #000;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
}

.btn-audit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #C4B5FD;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-audit:hover {
  background: #7C3AED;
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

/* Badge de Usuario Activo */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-primary);
  box-shadow: 0 0 8px rgba(0, 210, 150, 0.3);
}

.user-avatar {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role-title {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Tarjetas de Selección de Usuario */
.user-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.user-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.user-card.active {
  background: rgba(0, 210, 150, 0.12);
  border-color: var(--brand-primary);
  box-shadow: 0 0 12px rgba(0, 210, 150, 0.3);
}

.user-card-avatar {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.user-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.user-card-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* 2. Modo Sala de Ventas (Showroom) */
body.showroom-mode .edit-mode-toggle,
body.showroom-mode .edit-mode-banner,
body.showroom-mode #btn-sync,
body.showroom-mode #btn-config,
body.showroom-mode #btn-audit-modal,
body.showroom-mode .nav-tabs,
body.showroom-mode #btn-exp-edit {
  display: none !important;
}

body.showroom-mode .btn-showroom {
  background: #DC2626;
  color: #fff;
  border-color: #EF4444;
}

/* 3. Botones de WhatsApp y Ficha Técnica */
.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #25D366;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-whatsapp:hover {
  background: #1EBE5D;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.5);
  transform: translateY(-1px);
}

.btn-ficha {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3B82F6;
  color: #93C5FD;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ficha:hover {
  background: #2563EB;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

/* 4. Semáforo de Cobranza */
.semaforo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.semaforo-badge.corriente {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.semaforo-badge.vencer {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.semaforo-badge.mora {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.semaforo-badge.liquidado {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.semaforo-badge.disponible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 5. Tabla de Auditoría / Bitácora */
.audit-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.audit-table-container {
  max-height: 68vh;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  width: 100%;
}

.audit-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.audit-table th {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.7rem 0.9rem;
  color: var(--text-muted);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.audit-table th:nth-child(1) { width: 14%; }
.audit-table th:nth-child(2) { width: 11%; }
.audit-table th:nth-child(3) { width: 11%; }
.audit-table th:nth-child(4) { width: 15%; }
.audit-table th:nth-child(5) { width: 8%; }
.audit-table th:nth-child(6) { width: 41%; }

.audit-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  word-break: break-word;
}

.audit-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.audit-table td.user-cell {
  font-weight: 700;
  color: var(--text-primary);
}

.audit-table td.action-cell {
  color: var(--brand-primary);
  font-weight: 600;
}

/* 6. Ficha Técnica Comercial */
.ficha-header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
}

.ficha-logo {
  height: 48px;
}

.ficha-brand-text h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.ficha-brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ficha-badge-status {
  background: var(--status-disponible);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ficha-lot-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.2rem;
}

.ficha-lot-title h2 {
  font-size: 1.6rem;
  color: var(--brand-primary);
}

.ficha-lot-title span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ficha-lot-price {
  text-align: right;
}

.ficha-price-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ficha-price-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--status-disponible);
}

.ficha-simulator-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.ficha-simulator-panel input,
.ficha-simulator-panel select {
  background: #080D1A !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
  color: #FFFFFF !important;
  height: 38px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.ficha-simulator-panel input:focus,
.ficha-simulator-panel select:focus {
  border-color: #38BDF8 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

.sim-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #38BDF8;
  margin-bottom: 0.85rem;
}

.ficha-preset-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-chip:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: #10B981;
}

.btn-preset-chip.active {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
  border-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.btn-copy-quote {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-quote:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.btn-download-img {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-img:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #F59E0B;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* ====================================================================
   LÁMINA DE VENTA PROFESIONAL (COTIZACIÓN COMERCIAL DE ALTA GAMA)
   ==================================================================== */
.ficha-luxury-card {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: linear-gradient(145deg, #070B14 0%, #0F172A 50%, #091024 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 16px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(245, 158, 11, 0.12);
  color: #FFFFFF;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.ficha-luxury-card::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.flc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.2rem;
  margin-bottom: 1.4rem;
}

.flc-brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.flc-logo {
  height: 48px;
  object-fit: contain;
}

.flc-brand-info h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.flc-brand-info p {
  margin: 3px 0 0 0;
  font-size: 0.74rem;
  color: #94A3B8;
  letter-spacing: 0.3px;
}

.flc-badges-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.flc-badge-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.flc-badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.flc-badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

/* Hero Box del Lote & Cliente */
.flc-hero-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.flc-hero-left {
  flex: 1;
  min-width: 260px;
}

.flc-client-tag {
  font-size: 0.68rem;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flc-client-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: #FFFFFF;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

.flc-lot-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #FCD34D;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.flc-lot-etapa {
  font-size: 0.82rem;
  color: #94A3B8;
  margin-top: 2px;
}

.flc-specs-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.flc-spec-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #E2E8F0;
}

.flc-hero-right {
  text-align: right;
  min-width: 220px;
}

.flc-price-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.flc-price-main {
  font-size: 2.15rem;
  font-weight: 900;
  color: #34D399;
  letter-spacing: -0.5px;
  margin-top: 2px;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.25);
}

.flc-price-sub {
  font-size: 0.78rem;
  color: #A7F3D0;
  font-weight: 700;
  margin-top: 4px;
}

/* Grid de Financiamiento (4 Columnas) */
.flc-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.flc-finance-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flc-finance-card .f-label {
  font-size: 0.66rem;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flc-finance-card .f-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0.35rem 0 0.2rem 0;
}

.flc-finance-card .f-sub {
  font-size: 0.72rem;
  color: #64748B;
  font-weight: 600;
}

/* Tarjeta Destacada de Mensualidad */
.flc-finance-card.highlight-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.38));
  border: 2px solid #10B981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.flc-finance-card.highlight-card .f-label {
  color: #A7F3D0;
}

.flc-finance-card.highlight-card .f-val {
  color: #34D399;
  font-size: 1.35rem;
}

.flc-finance-card.highlight-card .f-sub {
  color: #D1FAE5;
}

/* Amenidades */
.flc-amenities-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
}

.flc-amenities-box h4 {
  margin: 0 0 0.65rem 0;
  font-size: 0.78rem;
  color: #FCD34D;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flc-amenities-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flc-amenities-tags span {
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  color: #E2E8F0;
  font-weight: 600;
}

/* Footer de la Lámina */
.flc-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #94A3B8;
}

.flc-footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flc-footer-right {
  text-align: right;
  font-weight: 600;
  color: #CBD5E1;
}

/* ====================================================================
   FORMATO DE IMPRESIÓN OFICIAL: FICHA TÉCNICA COMERCIAL (1 PÁGINA)
   ==================================================================== */
@page cotizacion-portrait {
  size: portrait;
  margin: 6mm 8mm;
}

.ficha-print-document {
  page: cotizacion-portrait;
}

@media print {
  body.printing-cotizacion {
    background: #FFFFFF !important;
    color: #0F172A !important;
    overflow: visible !important;
  }

  body.printing-cotizacion * {
    visibility: hidden;
  }

  body.printing-cotizacion #print-area,
  body.printing-cotizacion #print-area * {
    visibility: visible !important;
  }

  body.printing-cotizacion #print-area {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
  }

  body.printing-cotizacion .ficha-print-document {
    width: 100% !important;
    max-width: 820px !important;
    margin: 0 auto !important;
    padding: 0.3cm 0 !important;
    box-sizing: border-box !important;
  }

  body.printing-cotizacion .ficha-luxury-card {
    width: 100% !important;
    max-width: 820px !important;
    margin: 0 auto !important;
    padding: 1.4rem 1.6rem !important;
    border: 1.5px solid #0F172A !important;
    border-radius: 12px !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-cotizacion .ficha-luxury-card::before {
    display: none !important;
  }

  body.printing-cotizacion .flc-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #0F172A !important;
    padding-bottom: 0.8rem !important;
    margin-bottom: 0.9rem !important;
  }

  body.printing-cotizacion .flc-brand-group {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  body.printing-cotizacion .flc-logo {
    height: 44px !important;
    display: block !important;
  }

  body.printing-cotizacion .flc-brand-info h3 {
    margin: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    letter-spacing: 0.3px !important;
  }

  body.printing-cotizacion .flc-brand-info p {
    margin: 2px 0 0 0 !important;
    font-size: 0.74rem !important;
    color: #475569 !important;
  }

  body.printing-cotizacion .flc-badges-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 4px !important;
  }

  body.printing-cotizacion .flc-badge-pill {
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    border: 1px solid #0F172A !important;
    background: #F1F5F9 !important;
    color: #0F172A !important;
  }

  body.printing-cotizacion .flc-badge-gold {
    background: #FEF3C7 !important;
    color: #92400E !important;
    border-color: #D97706 !important;
  }

  body.printing-cotizacion .flc-badge-green {
    background: #DCFCE7 !important;
    color: #166534 !important;
    border-color: #16A34A !important;
  }

  body.printing-cotizacion .flc-hero-box {
    background: #F8FAFC !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 10px !important;
    padding: 1rem 1.2rem !important;
    margin-bottom: 0.9rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  body.printing-cotizacion .flc-client-tag {
    font-size: 0.65rem !important;
    color: #64748B !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
  }

  body.printing-cotizacion .flc-client-name {
    font-size: 1.18rem !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    margin-top: 2px !important;
  }

  body.printing-cotizacion .flc-lot-title {
    font-size: 1.55rem !important;
    font-weight: 900 !important;
    color: #B45309 !important;
    margin-top: 4px !important;
    text-shadow: none !important;
  }

  body.printing-cotizacion .flc-lot-etapa {
    font-size: 0.78rem !important;
    color: #475569 !important;
    margin-top: 2px !important;
  }

  body.printing-cotizacion .flc-specs-row {
    display: flex !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  body.printing-cotizacion .flc-spec-chip {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: #1E293B !important;
  }

  body.printing-cotizacion .flc-hero-right {
    text-align: right !important;
  }

  body.printing-cotizacion .flc-price-label {
    font-size: 0.7rem !important;
    color: #64748B !important;
    font-weight: 700 !important;
  }

  body.printing-cotizacion .flc-price-main {
    font-size: 2rem !important;
    font-weight: 900 !important;
    color: #047857 !important;
    text-shadow: none !important;
    margin-top: 2px !important;
  }

  body.printing-cotizacion .flc-price-sub {
    font-size: 0.74rem !important;
    color: #065F46 !important;
    font-weight: 700 !important;
  }

  body.printing-cotizacion .flc-finance-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 0.9rem !important;
  }

  body.printing-cotizacion .flc-finance-card {
    background: #F8FAFC !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 0.75rem 0.5rem !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  body.printing-cotizacion .flc-finance-card .f-label {
    font-size: 0.62rem !important;
    color: #64748B !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
  }

  body.printing-cotizacion .flc-finance-card .f-val {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    margin: 0.25rem 0 0.15rem 0 !important;
  }

  body.printing-cotizacion .flc-finance-card .f-sub {
    font-size: 0.68rem !important;
    color: #475569 !important;
    font-weight: 600 !important;
  }

  body.printing-cotizacion .flc-finance-card.highlight-card {
    background: #ECFDF5 !important;
    border: 2px solid #059669 !important;
  }

  body.printing-cotizacion .flc-finance-card.highlight-card .f-label {
    color: #047857 !important;
  }

  body.printing-cotizacion .flc-finance-card.highlight-card .f-val {
    color: #047857 !important;
    font-size: 1.25rem !important;
  }

  body.printing-cotizacion .flc-finance-card.highlight-card .f-sub {
    color: #065F46 !important;
  }

  body.printing-cotizacion #flc-contado-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 0.9rem !important;
  }

  body.printing-cotizacion .flc-amenities-box {
    background: #F8FAFC !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.9rem !important;
  }

  body.printing-cotizacion .flc-amenities-box h4 {
    margin: 0 0 0.45rem 0 !important;
    font-size: 0.74rem !important;
    color: #92400E !important;
    font-weight: 800 !important;
  }

  body.printing-cotizacion .flc-amenities-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  body.printing-cotizacion .flc-amenities-tags span {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 0.72rem !important;
    color: #1E293B !important;
    font-weight: 600 !important;
  }

  body.printing-cotizacion .flc-footer {
    border-top: 1.5px solid #CBD5E1 !important;
    padding-top: 0.7rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.7rem !important;
    color: #475569 !important;
  }

  body.printing-cotizacion .flc-footer-left #flc-folio {
    color: #B45309 !important;
    font-weight: 800 !important;
  }

  body.printing-cotizacion .flc-footer-right {
    text-align: right !important;
    color: #1E293B !important;
    font-weight: 600 !important;
  }

  body.printing-cotizacion .no-print {
    display: none !important;
  }
}
/* ==========================================================================
   ESTILOS PARA CLIENTES MULTI-LOTE & MAP HUD
   ========================================================================== */
.multi-lot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #FCD34D;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.client-other-lots-container {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.client-other-lots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-gold);
}

.other-lots-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.other-lot-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  user-select: none;
}

.other-lot-chip:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--brand-gold);
  transform: translateY(-2px);
}

.other-lot-chip.current {
  background: rgba(59, 130, 246, 0.25);
  border-color: #38BDF8;
  color: #38BDF8;
  font-weight: 700;
}

/* ==========================================================================
   MODO ENFOQUE DE CLIENTE EN MAPA (SLEEK FLOATING BADGE)
   ========================================================================== */
.map-focus-badge {
  position: absolute;
  top: 4.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: #0F172A;
  border: 1.5px solid #D4AF37;
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 15px rgba(212, 175, 55, 0.35);
  max-width: 92vw;
  animation: slideDownBadge 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownBadge {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.focus-badge-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #F8FAFC;
  white-space: nowrap;
}

.focus-badge-info strong {
  color: var(--brand-gold);
}

.btn-exit-focus {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #F87171;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-exit-focus:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* Multi-Pin Pulse Animation on Map */
.leaflet-marker-icon.multi-lot-pin-active {
  filter: drop-shadow(0 0 12px #D4AF37) drop-shadow(0 0 25px rgba(212, 175, 55, 0.8)) !important;
  animation: pulseMultiLot 1.5s infinite alternate !important;
  z-index: 1000 !important;
}

@keyframes pulseMultiLot {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px #D4AF37); }
  100% { transform: scale(1.3); filter: drop-shadow(0 0 20px #F59E0B) drop-shadow(0 0 35px rgba(245, 158, 11, 0.9)); }
}

/* ==========================================================================
   ESTILOS DE SCROLLBAR FLUIDO & VISIBLE
   ========================================================================== */
#view-crm::-webkit-scrollbar,
#view-dashboard::-webkit-scrollbar,
.crm-table-container::-webkit-scrollbar,
.search-results-dropdown::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

#view-crm::-webkit-scrollbar-track,
#view-dashboard::-webkit-scrollbar-track,
.crm-table-container::-webkit-scrollbar-track,
.search-results-dropdown::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 4px;
}

#view-crm::-webkit-scrollbar-thumb,
#view-dashboard::-webkit-scrollbar-thumb,
.crm-table-container::-webkit-scrollbar-thumb,
.search-results-dropdown::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #334155;
  border: 1.5px solid rgba(15, 23, 42, 0.7);
  border-radius: 6px;
}

#view-crm::-webkit-scrollbar-thumb:hover,
#view-dashboard::-webkit-scrollbar-thumb:hover,
.crm-table-container::-webkit-scrollbar-thumb:hover,
.search-results-dropdown::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #38BDF8;
}

/* ==========================================================================
   ESTILOS: MÓDULO DE FLUJO DE CAJA (INGRESOS Y EGRESOS)
   ========================================================================== */
#view-flujo .kpi-card {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

#view-flujo .kpi-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.flujo-cat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flujo-cat-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #EF4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

/* ====================================================================
   BOTONES PRINCIPALES DE ACCIÓN: INGRESOS & EGRESOS (MÁXIMA PRIORIDAD)
   ==================================================================== */
.btn-flujo-main-action {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0.62rem 1.35rem !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  overflow: hidden !important;
  text-decoration: none !important;
  vertical-align: middle !important;
}

.btn-flujo-main-action .btn-main-icon {
  font-size: 1.12rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-flujo-main-action .btn-main-label {
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
}

/* Registrar Ingreso: Verde Esmeralda Ejecutivo con Gradiente */
.btn-flujo-income {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.45) 100%) !important;
  border: 2px solid #10B981 !important;
  color: #34D399 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.btn-flujo-income:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45) 0%, rgba(5, 150, 105, 0.65) 100%) !important;
  border-color: #34D399 !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.btn-flujo-income:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Registrar Egreso: Rojo Rubí Ejecutivo con Gradiente */
.btn-flujo-expense {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.45) 100%) !important;
  border: 2px solid #EF4444 !important;
  color: #F87171 !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.btn-flujo-expense:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.65) 100%) !important;
  border-color: #F87171 !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.btn-flujo-expense:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn-flujo-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-flujo-pill:hover {
  border-color: #38BDF8;
  color: #F8FAFC;
}

.btn-flujo-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.08));
  border-color: #38BDF8;
  color: #38BDF8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Visor de comprobantes / fotos de cámara */
.lot-attachment-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.lot-attachment-card:hover {
  border-color: #38BDF8;
  transform: translateY(-1px);
}

.lot-attachment-thumb,
img.lot-attachment-thumb {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  border-radius: 6px !important;
  object-fit: cover !important;
  background: #020617 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  flex-shrink: 0 !important;
  display: block !important;
}
.btn-flujo-mode {
  -webkit-appearance: none;
  appearance: none;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  outline: none;
}

.btn-flujo-mode:hover {
  color: #FFFFFF;
  border-color: #38BDF8;
  background: rgba(30, 41, 59, 0.8);
}

.btn-flujo-mode.active {
  color: #FFFFFF;
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border-color: #38BDF8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

/* GRID DE TARJETAS KPI EN UNA SOLA FILA HORIZONTAL */
.dashboard-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  margin-bottom: 1.25rem !important;
}

@media (max-width: 1100px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  }
}

/* Modal de Desglose 1x1 (Amplio y en Pantalla Completa Horizontal) */
#modal-flujo-desglose .modal-dialog-full,
#modal-flujo-desglose .modal-content {
  max-width: 1550px !important;
  width: 96vw !important;
  height: 94vh !important;
  max-height: 94vh !important;
  background: #080D1A !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.9) !important;
}

/* Modo Pantalla Completa Total */
#modal-flujo-desglose.is-fullscreen .modal-dialog-full,
#modal-flujo-desglose.is-fullscreen .modal-content {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Columnas horizontales siempre una al lado de la otra (Entradas vs Salidas) */
.flujo-split-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.25rem !important;
  height: 100% !important;
}

.flujo-split-col {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 12px !important;
  padding: 1rem 1.25rem !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 480px !important;
}

.flujo-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.flujo-mini-table th {
  padding: 0.55rem 0.6rem;
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.95);
  position: sticky;
  top: 0;
  z-index: 2;
}

.flujo-mini-table td {
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.flujo-mini-table tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

/* BARRA DE CONTROLES ANCLADA (STICKY) EN FLUJO */
.flujo-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #090E1A;
  background: linear-gradient(180deg, rgba(9, 14, 26, 0.98) 0%, rgba(9, 14, 26, 0.94) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.85rem 1.5rem;
  margin: 0 -1.5rem 1.25rem -1.5rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Vista Avanzada Horizontal (Lado a Lado) */
.flujo-advanced-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.25rem !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 960px) {
  .flujo-advanced-grid {
    grid-template-columns: 1fr !important;
  }
}

.flujo-advanced-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.flujo-month-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
}

.flujo-month-card:hover {
  transform: translateY(-3px);
  border-color: #38BDF8 !important;
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.2);
}

.flujo-cat-row-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.flujo-cat-row-clickable:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: #EF4444 !important;
  transform: translateX(4px);
}

/* Badges de Tickets y Comprobantes de Gastos */
.flujo-ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.flujo-ticket-badge.has-ticket {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.flujo-ticket-badge.has-ticket:hover {
  background: rgba(16, 185, 129, 0.3);
  transform: scale(1.04);
}

.flujo-ticket-badge.no-ticket {
  background: rgba(148, 163, 184, 0.1);
  color: #94A3B8;
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.flujo-ticket-badge.no-ticket:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border-color: #38BDF8;
  border-style: solid;
}

/* Formatos de Documento Imprimible (Póliza de Entrega & Acta de Cierre) */
.printable-acta {
  background: #FFFFFF !important;
  color: #0F172A !important;
  padding: 2.5rem !important;
  border-radius: 8px !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
  max-width: 800px !important;
  margin: 0 auto !important;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #print-area, #print-area * {
    visibility: visible !important;
  }
  #print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}

/* ====================================================================
   ZONA DE CARGA DE COMPROBANTES Y PAGOS DIRECTOS
   ==================================================================== */
.pay-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.65);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.pay-dropzone:hover {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  font-size: 0.76rem;
  transition: background 0.15s ease;
}
.receipt-item-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-receipt-view {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38BDF8;
  color: #38BDF8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}
.btn-receipt-view:hover {
  background: #38BDF8;
  color: #0F172A;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* ==========================================================================
   CHIPS DE SUBGRUPOS (SAÚL / PANCHO / SOCIOS) & CATEGORÍAS SATÉLITE
   ========================================================================== */
.subgrupos-segmented-bar {
  scrollbar-width: none;
}
.subgrupos-segmented-bar::-webkit-scrollbar { display: none; }

.btn-subg-chip {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  outline: none;
}
.btn-subg-chip:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}
.btn-subg-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #FFFFFF;
}
.btn-subg-chip.chip-saul.active {
  background: rgba(0, 230, 118, 0.25);
  border-color: #00E676;
  color: #00E676;
}
.btn-subg-chip.chip-pancho.active {
  background: rgba(249, 115, 22, 0.25);
  border-color: #F97316;
  color: #F97316;
}
.btn-subg-chip.chip-socios.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8B5CF6;
  color: #8B5CF6;
}

/* Filtros por Categoría en Modal Satelital */
.btn-sat-cat-pill {
  transition: all 0.2s ease;
}
.btn-sat-cat-pill.active {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES EXHAUSTIVAS (HUD Y PLATAFORMA ≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .map-controls-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    overflow-x: hidden;
  }

  .map-controls-bar > div {
    max-width: 100%;
  }

  .status-filters {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .status-filters::-webkit-scrollbar { display: none; }

  .map-style-toggle-group {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .map-style-toggle-group::-webkit-scrollbar { display: none; }

  .subgrupos-segmented-bar {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .edit-mode-toggle {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .btn-style-pill, .btn-subg-chip {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Modal Satélite en móvil */
  #modal-satellite-view .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
  }

  .satellite-poi-bar {
    padding: 0.4rem 0.6rem !important;
  }
}

/* ==========================================================================
   MÓDULO: PAGOS PRIORITARIOS & CALENDARIO MENSUAL DE EGRESOS
   Estilo: Dark Luxury Glassmorphism
   ========================================================================== */
.calendar-week-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
}

.week-day-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94A3B8;
  padding: 6px 0;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.week-day-title.is-weekend {
  color: #F59E0B;
}

/* ── Calendar: Week Header ── */
.calendar-week-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.week-day-title {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.week-day-title.is-weekend {
  color: #F59E0B;
}

/* ── Calendar: Grid ── */
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

/* ── Calendar: Day Number ── */
.day-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: #CBD5E1;
  line-height: 1;
}

.day-number.today-pill {
  background: #38BDF8;
  color: #0B1120;
  font-weight: 900;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* ── Calendar: Día 1-5 tag ── */
.first-days-tag {
  font-size: 0.58rem;
  font-weight: 800;
  background: rgba(212, 175, 55, 0.2);
  color: #D4AF37;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 3px;
  padding: 1px 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ── Calendar: Day Total Badge ── */
.day-total-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
}

/* ── Calendar: + Add Button per day ── */
.btn-day-add {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10B981;
  border-radius: 4px;
  width: 18px;
  height: 18px;
  font-size: 0.8rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.calendar-day-cell:hover .btn-day-add {
  opacity: 1;
}

/* ── Pill buttons: filter + subgrupo ── */
.btn-style-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #CBD5E1;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-style-pill:hover {
  background: rgba(56,189,248,0.12);
  border-color: #38BDF8;
  color: #38BDF8;
}
.btn-style-pill.active,
.prio-filter-pill.active {
  background: rgba(56,189,248,0.22) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
  font-weight: 800 !important;
}

/* ── Subgrupo chips (Saúl, Pancho, Socios) ── */
.btn-subgrupo {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #CBD5E1;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-subgrupo:hover,
.btn-subgrupo.active {
  background: rgba(56,189,248,0.18);
  border-color: #38BDF8;
  color: #38BDF8;
  font-weight: 800;
}


.calendar-day-cell {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  min-height: 120px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.calendar-day-cell:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.calendar-day-cell.is-today {
  border: 1.5px solid #38BDF8;
  background: rgba(56, 189, 248, 0.06);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.calendar-day-cell.is-primeros-dias {
  border-left: 3px solid #F59E0B;
}

.calendar-day-cell.is-other-month {
  opacity: 0.28;
  background: rgba(15, 23, 42, 0.3);
  pointer-events: none;
}

.day-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.day-number {
  font-weight: 800;
  color: #CBD5E1;
}

.day-number.today-pill {
  background: #38BDF8;
  color: #0B132B;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.first-days-tag {
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.18);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 4px;
  border-radius: 4px;
}

.day-total-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.btn-day-add {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #CBD5E1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}

.calendar-day-cell:hover .btn-day-add {
  opacity: 1;
}

.btn-day-add:hover {
  background: #10B981;
  color: #FFFFFF;
  transform: scale(1.15);
}

.day-cell-events {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

/* Tarjeta / Chip de Pago en Calendario */
.prio-payment-chip {
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 0.72rem;
  line-height: 1.25;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.prio-payment-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.chip-row-top {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.chip-concept {
  flex: 1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFFFFF;
}

.chip-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chip-amount {
  font-weight: 800;
  font-size: 0.75rem;
}

.chip-status-text {
  font-size: 0.65rem;
  opacity: 0.85;
}

/* Variantes de Chip por Estado */
.prio-chip-pending {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FDE68A;
}
.prio-chip-pending .chip-amount {
  color: #FDE68A;
}

.prio-chip-paid {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #A7F3D0;
}
.prio-chip-paid .chip-amount {
  color: #6EE7B7;
}

.prio-chip-overdue {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #FECACA;
}
.prio-chip-overdue .chip-amount {
  color: #FCA5A5;
}

.prio-chip-critical {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid #EF4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
  color: #FFFFFF;
}

/* Badges en Tabla de Lista */
.badge-status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-status-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #6EE7B7;
  border: 1px solid #10B981;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-status-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid #EF4444;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-prio-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border: 1px solid #EF4444;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}

.badge-prio-high {
  background: rgba(249, 115, 22, 0.2);
  color: #F97316;
  border: 1px solid #F97316;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}

.badge-prio-mid {
  background: rgba(234, 179, 8, 0.2);
  color: #EAB308;
  border: 1px solid #EAB308;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-prio-low {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.tr-primeros-dias {
  background: rgba(245, 158, 11, 0.04);
  border-left: 3px solid #F59E0B;
}

.btn-table-action {
  border: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.8);
  color: #E2E8F0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38BDF8;
}

.btn-table-action.btn-pay {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10B981;
  color: #6EE7B7;
  font-weight: 700;
}

.btn-table-action.btn-pay:hover {
  background: #10B981;
  color: #FFFFFF;
}

.btn-table-action.btn-view-receipt {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38BDF8;
}

.btn-table-action.btn-delete:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
}

@media (max-width: 1024px) {
  .calendar-days-grid {
    gap: 4px;
  }
  .calendar-day-cell {
    min-height: 90px;
    padding: 4px;
  }
  .chip-concept {
    font-size: 0.65rem;
  }
  .chip-amount {
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   ACTIVIDADES RECIENTES (FEED EN VIVO) Y EDICIÓN DE PAGOS
   ========================================================================== */

/* Botón en Barra de Navegación */
.btn-recent-activity {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38BDF8;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-recent-activity:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(99, 102, 241, 0.35));
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.activity-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Drawer / Panel Desplegable */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99990;
  transition: opacity 0.3s ease;
}

.drawer-overlay.hidden {
  display: none !important;
}

.recent-activity-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 94vw;
  background: rgba(11, 17, 32, 0.98);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.85);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 1;
}

.recent-activity-drawer.hidden {
  display: none !important;
  pointer-events: none;
  transform: translateX(105%);
  opacity: 0;
}

.drawer-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.6);
}

.drawer-title-group h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-title-group p {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: #94A3B8;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.drawer-filter-bar {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.3);
}

.drawer-search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #F8FAFC;
  font-size: 0.78rem;
  padding: 0.42rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}

.drawer-search-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.drawer-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.drawer-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-pill:hover,
.drawer-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38BDF8;
  color: #38BDF8;
}

.drawer-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Tarjeta de Actividad */
.activity-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.activity-card:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.activity-user-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #F8FAFC;
}

.activity-role-pill {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

.activity-time-text {
  font-size: 0.68rem;
  color: #64748B;
  white-space: nowrap;
}

.activity-action-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.activity-action-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.activity-details-text {
  font-size: 0.76rem;
  color: #CBD5E1;
  line-height: 1.35;
}

.activity-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.3rem;
}

.btn-activity-lot {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-activity-lot:hover {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}

.drawer-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
}

.btn-receipt-edit {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #22D3EE;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-receipt-edit:hover {
  background: #0891B2;
  border-color: #0891B2;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.badge-folio-fisico {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* ── Transaction Cards (Recientes) ── */
/* ── Transaction Cards (Recientes) ── */
.txn-card {
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(11, 19, 43, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.22s ease;
  margin-bottom: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}
.txn-card:hover {
  background: linear-gradient(135deg, rgba(22, 33, 58, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.18);
}
.txn-accent { width: 5px; flex-shrink: 0; }
.txn-body { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.txn-top { display: flex; align-items: center; gap: 10px; }
.txn-icon-wrap { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.txn-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.txn-title { font-size: 0.85rem; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.txn-time { font-size: 0.7rem; color: #94A3B8; font-weight: 500; }
.txn-lot-pill { font-size: 0.72rem; font-weight: 800; background: rgba(56,189,248,0.14); color: #38BDF8; border: 1px solid rgba(56,189,248,0.35); border-radius: 6px; padding: 3px 9px; font-family: monospace; white-space: nowrap; flex-shrink: 0; letter-spacing: 0.02em; }
.txn-detail { font-size: 0.78rem; color: #CBD5E1; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.txn-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.txn-user { font-size: 0.72rem; color: #94A3B8; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-btn-lot {
  font-size: 0.74rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(56, 189, 248, 0.1) 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38BDF8;
  border-radius: 7px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-appearance: none;
  appearance: none;
}
.txn-btn-lot:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4) 0%, rgba(56, 189, 248, 0.3) 100%);
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

/* ==========================================================================
   VISTA DE PÁGINA COMPLETA: ACTIVIDAD FINANCIERA RECIENTE (#view-recientes)
   ========================================================================== */
#view-recientes {
  display: none !important;
  background: radial-gradient(ellipse at top, #0D1929 0%, #080D1A 60%, #030712 100%);
}

#view-recientes.active {
  flex: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
  position: relative !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  scroll-behavior: smooth !important;
  touch-action: pan-y !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  padding: 1.5rem 2rem 8rem 2rem !important;
  box-sizing: border-box !important;
}

#view-recientes::-webkit-scrollbar {
  width: 8px;
}
#view-recientes::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
#view-recientes::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}
#view-recientes::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
}

.recientes-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Header de la Vista Recientes */
.recientes-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(11, 19, 43, 0.9) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.recientes-hero-title h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #F8FAFC;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.recientes-hero-title p {
  font-size: 0.82rem;
  color: #94A3B8;
  margin: 0;
}

.recientes-hero-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recientes-stat-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.6rem 1.15rem;
  text-align: right;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.recientes-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.recientes-stat-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #38BDF8;
  letter-spacing: -0.01em;
}

/* Barra de Filtros y Búsqueda */
.recientes-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(11, 19, 43, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.recientes-pills-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recientes-filter-pill {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  border-radius: 9999px;
  padding: 0.42rem 1.05rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  -webkit-appearance: none;
  appearance: none;
}

.recientes-filter-pill:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(30, 41, 59, 0.85) 100%);
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.recientes-filter-pill.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35) 0%, rgba(56, 189, 248, 0.25) 100%) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.recientes-search-wrap {
  display: flex;
  align-items: center;
  background: rgba(11, 19, 43, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 0.4rem 0.85rem;
  gap: 0.5rem;
  min-width: 290px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.recientes-search-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 0.82rem;
  width: 100%;
}

.recientes-search-wrap input::placeholder {
  color: #64748B;
}

/* Grid de Tarjetas de Transacciones */
.recientes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.15rem;
  padding-bottom: 2rem;
}

@media (max-width: 640px) {
  #view-recientes {
    padding: 0.85rem 0.85rem 2.5rem;
  }
  .recientes-cards-grid {
    grid-template-columns: 1fr;
  }
  .recientes-search-wrap {
    width: 100%;
    min-width: auto;
  }
  .recientes-hero {
    padding: 1rem;
  }
}

/* ── Pagos Prioritarios: Tablero Horizontal Ejecutivo ── */
.prio-cat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.prio-cat-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38BDF8;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15);
}
.prio-cat-card.active {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.prio-board-col {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 480px;
}
.prio-board-col-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.5);
}
.prio-board-col-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.prio-board-col-sub {
  font-size: 0.72rem;
  color: #94A3B8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.prio-board-cards-list {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  overflow-y: auto;
  max-height: 620px;
}
.prio-card-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 0.75rem 0.85rem;
  transition: all 0.2s ease;
  position: relative;
}
.prio-card-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.prio-card-item.is-paid {
  border-left: 3.5px solid #10B981;
}
.prio-card-item.is-overdue {
  border-left: 3.5px solid #EF4444;
}
.prio-card-item.is-pending {
  border-left: 3.5px solid #F59E0B;
}
.prio-card-item.is-critical {
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

@media (max-width: 1200px) {
  #prio-board-columns {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 768px) {
  #prio-board-columns {
    grid-template-columns: 1fr !important;
  }
}

/* Badges para métodos de pago y personas responsables */
.badge-method-transfer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-method-cash {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-method-card {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-responsible {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

.btn-cat-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-cat-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #F8FAFC;
}

/* Quick option buttons for file attachments (iPad / Mobile / Desktop) */
.btn-picker-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #E2E8F0;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-picker-option:hover, .btn-picker-option:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #38BDF8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-picker-option span {
  font-size: 0.95rem;
}

/* Estilos de Botones de Recibos y WhatsApp */
.btn-receipt-view {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
}

.btn-receipt-view:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.btn-receipt-view:active {
  transform: scale(0.97);
}

/* ==========================================================================
   JERARQUÍA ESTRICTA DE Z-INDEX DE MODALES
   Garantiza que modales de edición (egresos/pagos) queden siempre al frente.
   ========================================================================== */
#modal-flujo-desglose {
  z-index: 50000 !important;
}
#modal-tx-detail,
#modal-corte-caja,
#modal-cierre-mes {
  z-index: 60000 !important;
}
#modal-cashflow-entry,
#modal-edit-lot-payment,
#modal-priority-payment-form {
  z-index: 2000000 !important;
}
#modal-recibo-preview,
#modal-folio-consolidado-print {
  z-index: 3500000 !important;
}
#modal-ticket-caja,
#modal-pago-exito {
  z-index: 2500000 !important;
}
#modal-image-viewer {
  z-index: 3000000 !important;
}
#modal-auth-otp {
  z-index: 5000000 !important;
}

/* ==========================================================================
   AGENDA DE PENDIENTES & CHECKLIST DIARIO (Módulo Ejecutivo Visual)
   ========================================================================== */

.agenda-main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(30, 41, 59, 0.4), transparent 60%),
              radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.6), transparent 70%);
  overflow: hidden;
  color: #F8FAFC;
}

/* Barra Sticky Superior */
.agenda-sticky-bar {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  z-index: 40;
}

.agenda-brand-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.6rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.025em;
}

.agenda-brand-title .agenda-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25));
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  font-size: 1.35rem;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

/* Botón Nuevo Pendiente Destacado */
.btn-new-task-glow {
  background: linear-gradient(135deg, #F59E0B, #EA580C);
  color: #FFFFFF;
  font-weight: 750;
  font-size: 0.92rem;
  padding: 0.6rem 1.2rem;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-new-task-glow:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
  filter: brightness(1.08);
}
.btn-new-task-glow:active {
  transform: scale(0.98);
}

/* Área Scrollable Principal */
.agenda-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.75rem 3rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Hero Card: Medidor de Avance & Motivación */
.agenda-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.35rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  flex-wrap: wrap;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.agenda-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F59E0B, #10B981, #38BDF8);
}

.agenda-hero-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.agenda-pct-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(#10B981 var(--agenda-pct, 0%), rgba(255, 255, 255, 0.08) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}
.agenda-pct-circle::after {
  content: '';
  position: absolute;
  width: 52px;
  height: 52px;
  background: #0F172A;
  border-radius: 50%;
}
.agenda-pct-text {
  position: relative;
  z-index: 2;
  font-weight: 800;
  font-size: 0.95rem;
  color: #10B981;
}

.agenda-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.agenda-hero-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.agenda-hero-sub {
  font-size: 0.88rem;
  color: #94A3B8;
  margin: 0;
}

.agenda-hero-progress-outer {
  width: 100%;
  max-width: 440px;
  height: 9px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.agenda-hero-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #10B981);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.agenda-kpis-strip {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.agenda-kpi-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 85px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.agenda-kpi-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}
.agenda-kpi-val {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}
.agenda-kpi-lbl {
  font-size: 0.72rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
  font-weight: 700;
}

/* Tira de Navegación de Días (Date Strip) */
.agenda-date-strip {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 6px;
  align-items: center;
}
.agenda-date-strip::-webkit-scrollbar {
  height: 4px;
}
.agenda-date-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.agenda-day-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #94A3B8;
  transition: all 0.2s ease;
  min-width: 65px;
  flex-shrink: 0;
  position: relative;
}
.agenda-day-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}
.agenda-day-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}
.agenda-day-dow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agenda-day-num {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
  color: #F8FAFC;
}
.agenda-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #F59E0B;
  position: absolute;
  top: 6px;
  right: 6px;
}
.agenda-day-today-tag {
  font-size: 0.58rem;
  background: #38BDF8;
  color: #0F172A;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
}

/* Filtros y Opciones de Agenda */
.agenda-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.agenda-filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.agenda-pill-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.agenda-pill-btn:hover {
  color: #FFFFFF;
  background: rgba(51, 65, 85, 0.8);
}
.agenda-pill-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border-color: #38BDF8;
  font-weight: 700;
}

/* Grupos de Secciones de Tareas */
.agenda-group-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.agenda-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.02rem;
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.25rem;
}

.agenda-group-count {
  font-size: 0.8rem;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 99px;
  color: #E2E8F0;
}

/* Cuadrícula Adaptativa para Aprovechamiento de Pantalla */
.agenda-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 1rem;
  width: 100%;
  align-items: start;
}

@media (max-width: 640px) {
  .agenda-tasks-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Tarjeta Individual de Pendiente (Checklist Card) */
.agenda-card {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--cat-color, #38BDF8);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.agenda-card:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(255, 255, 255, 0.2);
  border-left-color: var(--cat-color, #38BDF8);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.agenda-card.is-completed {
  opacity: 0.6;
  background: rgba(15, 23, 42, 0.45);
}
.agenda-card.is-completed .agenda-card-title {
  text-decoration: line-through;
  color: #94A3B8;
}

/* Checkbox Interactivo Grande */
.agenda-checkbox-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}
.agenda-checkbox-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}
.agenda-checkbox-btn:hover {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}
.agenda-card.is-completed .agenda-checkbox-btn {
  background: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Contenido de la Tarjeta */
.agenda-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.agenda-card-header-tags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.agenda-cat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cat-color, #38BDF8);
  border: 1px solid var(--cat-border, rgba(56, 189, 248, 0.3));
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.agenda-prio-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.agenda-prio-tag.urgente {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: agendaPulse 2s infinite;
}
.agenda-prio-tag.alta {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.agenda-prio-tag.media {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.agenda-prio-tag.baja {
  background: rgba(148, 163, 184, 0.15);
  color: #CBD5E1;
}

@keyframes agendaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.3); }
}

.agenda-resp-tag {
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: #E2E8F0;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.agenda-time-tag {
  font-size: 0.7rem;
  color: #FDE68A;
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 700;
}

.agenda-card-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.35;
  margin: 0.1rem 0;
  word-break: break-word;
}

.agenda-card-desc {
  font-size: 0.84rem;
  color: #94A3B8;
  line-height: 1.45;
  margin: 0;
}

/* Sub-tareas integradas */
.agenda-subtasks-box {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.agenda-subtask-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #CBD5E1;
  cursor: pointer;
  user-select: none;
}
.agenda-subtask-item:hover {
  color: #FFFFFF;
}
.agenda-subtask-item.is-done {
  text-decoration: line-through;
  color: #64748B;
}
.agenda-subtask-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}
.agenda-subtask-item.is-done .agenda-subtask-check {
  background: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

/* Acciones de la Tarjeta */
.agenda-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.btn-agenda-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-agenda-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-agenda-action.postpone:hover {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.3);
}
.btn-agenda-action.delete:hover {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Modal de Crear / Editar Tarea */
.agenda-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000000;
  padding: 1rem;
}

.agenda-modal-box {
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.agenda-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.agenda-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.agenda-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agenda-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.agenda-form-row label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agenda-form-input,
.agenda-form-textarea,
.agenda-form-select {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: #FFFFFF;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}
.agenda-form-input:focus,
.agenda-form-textarea:focus,
.agenda-form-select:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.agenda-modal-footer {
  padding: 0.85rem 1.25rem;
  padding-bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.65rem));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* ==========================================================================
   BLINDAJE DE SEGURIDAD PARA IPAD Y DISPOSITIVOS TÁCTILES (SAFARI / IOS)
   Evita que tocar el botón de Guardar active el Home Indicator o saque al usuario de Safari
   ========================================================================== */
@supports (-webkit-touch-callout: none) {
  /* Blindaje exclusivo para Safari WebKit en iPadOS / iOS */
  .modal-overlay {
    padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 3.75rem)) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal-content {
    max-height: min(78vh, 78dvh, calc(100dvh - 120px)) !important;
    margin: auto auto max(2.75rem, calc(env(safe-area-inset-bottom) + 1.75rem)) auto !important;
  }

  .modal-footer,
  #cf-entry-modal-footer {
    padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1.25rem)) !important;
    flex-shrink: 0 !important;
  }

  .modal-footer button,
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary,
  .modal-body button[type="submit"],
  #cf-btn-save-entry,
  #cf-btn-add-another-folio,
  #cf-btn-save-print-folio,
  #btn-submit-edit-payment,
  #btn-submit-payment,
  .btn-primary,
  .btn-secondary {
    min-height: 48px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
  }

  .modal-body {
    padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.75rem)) !important;
  }
}

@media (pointer: coarse), (hover: none) {
  /* Altura táctil ergonómica y eliminación de demoras/conflictos de gestos en pantallas táctiles */
  .modal-footer button,
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary,
  .modal-body button[type="submit"],
  #cf-btn-save-entry,
  #cf-btn-add-another-folio,
  #cf-btn-save-print-folio,
  #btn-submit-edit-payment,
  #btn-submit-payment,
  .btn-primary,
  .btn-secondary {
    min-height: 48px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Padding inferior de amortiguación para cualquier modal en pantallas táctiles */
  .modal-overlay {
    padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 3.75rem)) !important;
  }

  .modal-content {
    max-height: min(80vh, 80dvh, calc(100dvh - 120px)) !important;
    margin-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.5rem)) !important;
  }

  .modal-footer,
  #cf-entry-modal-footer {
    padding-bottom: max(1.4rem, calc(env(safe-area-inset-bottom) + 1.1rem)) !important;
    flex-shrink: 0 !important;
  }

  /* Espacio extra al final del cuerpo scrolleable del formulario */
  .modal-body {
    padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.75rem)) !important;
  }
}

/* ====================================================================
   BLINDAJE DE MODALES DE GRAN FORMATO Y DOCUMENTOS EJECUTIVOS
   Evita doble scroll, recorte superior o desplazamiento del encabezado
   ==================================================================== */
#modal-estado-cuenta-proveedor,
#modal-carta-finiquito,
#modal-cierre-mes,
#modal-corte-caja,
#modal-reportes-graficos,
#modal-tx-detail,
#modal-satellite-view,
#modal-proyeccion-fase2,
#modal-expediente,
#modal-client-portfolio,
#modal-ficha,
#modal-recibo-preview,
#modal-ticket-caja,
#modal-folio-consolidado-print,
#modal-audit,
#modal-pins-history,
#modal-config {
  padding: 1rem !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

#modal-estado-cuenta-proveedor .modal-content,
#modal-carta-finiquito .modal-content,
#modal-cierre-mes .modal-content,
#modal-corte-caja .modal-content,
#modal-reportes-graficos .modal-content,
#modal-tx-detail .modal-content,
#modal-satellite-view .modal-content,
#modal-proyeccion-fase2 .modal-content,
#modal-expediente .modal-content,
#modal-client-portfolio .modal-content,
#modal-ficha .modal-content,
#modal-recibo-preview .modal-content,
#modal-ticket-caja .modal-content,
#modal-folio-consolidado-print .modal-content,
#modal-audit .modal-content,
#modal-pins-history .modal-content,
#modal-edit-medidas .modal-content,
#modal-config .modal-content {
  margin: 0 auto !important;
  max-height: 94vh !important;
  max-height: 94dvh !important;
  overflow: hidden !important;
}

#modal-edit-medidas .modal-content {
  width: 96vw !important;
  max-width: 1440px !important;
  max-height: 95vh !important;
  max-height: 95dvh !important;
  height: 92vh !important;
  background: #0B132B !important;
  border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.22) !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
}

#modal-edit-medidas .modal-header {
  padding: 1.1rem 1.6rem !important;
  background: #0F172A !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0 !important;
}

#modal-edit-medidas .modal-body {
  padding: 1.25rem 1.6rem !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

#modal-edit-medidas-grid {
  display: grid !important;
  grid-template-columns: minmax(500px, 560px) 1fr !important;
  gap: 1.5rem !important;
  align-items: start !important;
}

#med-croquis-box {
  height: 480px !important;
  min-height: 440px !important;
}

@media (max-width: 1120px) {
  #modal-edit-medidas-grid {
    grid-template-columns: 1fr !important;
  }
  #med-croquis-box {
    height: 380px !important;
    min-height: 320px !important;
  }
}

@media (max-width: 768px) {
  #med-croquis-box {
    height: 260px !important;
    min-height: 220px !important;
  }
}

#modal-estado-cuenta-proveedor .modal-header,
#modal-carta-finiquito .modal-header,
#modal-cierre-mes .modal-header,
#modal-corte-caja .modal-header,
#modal-reportes-graficos .modal-header,
#modal-tx-detail .modal-header,
#modal-satellite-view .modal-header,
#modal-proyeccion-fase2 .modal-header,
#modal-expediente .modal-header,
#modal-client-portfolio .modal-header,
#modal-ficha .modal-header,
#modal-recibo-preview .modal-header,
#modal-ticket-caja .modal-header,
#modal-folio-consolidado-print .modal-header,
#modal-audit .modal-header,
#modal-pins-history .modal-header,
#modal-config .modal-header {
  flex-shrink: 0 !important;
}

#modal-corte-caja .modal-content > div:nth-child(2),
#modal-cierre-mes .modal-content > div:nth-child(2),
#modal-reportes-graficos .modal-content > div:nth-child(2),
#modal-tx-detail .modal-content > div:nth-child(2),
#modal-expediente .modal-body,
#modal-client-portfolio .modal-body,
#modal-ficha .modal-body,
#modal-recibo-preview .modal-body,
#modal-audit .modal-body,
#modal-pins-history .modal-body,
#modal-config .modal-body {
  min-height: 0 !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

/* ====================================================================
   MÓDULO DE CUENTAS POR CATEGORÍA & PROVEEDOR (PARCELARIOS, PANCHO, ETC.)
   ==================================================================== */
.cuentas-cat-card {
  user-select: none;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cuentas-cat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15);
}

.cuentas-cat-card.active {
  transform: translateY(-2px);
  border-color: #38BDF8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
}

.cuentas-month-header {
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cuentas-month-header:hover {
  background: rgba(30, 41, 59, 0.9) !important;
}

.cuentas-month-header.is-open {
  background: rgba(30, 41, 59, 0.85) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
}

/* Formato de Impresión del Estado de Cuenta */
@page estado-cuenta-landscape {
  size: A4 landscape;
  margin: 10mm 12mm;
}

.estado-cuenta-sheet-print {
  page: estado-cuenta-landscape;
}

@media print {
  body.printing-estado-cuenta {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  body.printing-estado-cuenta .modal-overlay {
    display: none !important;
  }

  body.printing-estado-cuenta #print-area,
  body.printing-estado-cuenta #print-area * {
    visibility: visible !important;
  }

  body.printing-estado-cuenta #print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    z-index: 9999999 !important;
  }

  .printable-edc-document {
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
  }

  .no-print {
    display: none !important;
  }

  .printable-edc-document table {
    page-break-inside: auto;
  }

  .printable-edc-document thead {
    display: table-header-group !important;
  }

  .printable-edc-document tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}

/* =========================================================================
   BOTÓN DE PRIORIDADES AMPLIADO & DESTACADO (EXCLUSIVO SAÚL & JESÚS)
   ========================================================================= */
#tab-pagos-prioritarios {
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  padding: 0.52rem 1.15rem !important;
  border-radius: 8px !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #FBBF24 !important;
  border: 1.5px solid rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22) !important;
  gap: 0.45rem !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  letter-spacing: 0.2px !important;
}

#tab-pagos-prioritarios:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #FEF3C7 !important;
  border-color: #F59E0B !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4) !important;
  transform: translateY(-1px) scale(1.02);
}

#tab-pagos-prioritarios.active {
  background: linear-gradient(135deg, #F59E0B, #D97706) !important;
  color: #0F172A !important;
  border-color: #F59E0B !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  font-weight: 900 !important;
}

#tab-pagos-prioritarios span:first-child {
  font-size: 1.15rem !important;
}

#tab-recuperaciones-saul {
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  padding: 0.52rem 1.15rem !important;
  border-radius: 8px !important;
  background: rgba(59, 130, 246, 0.12) !important;
  color: #60A5FA !important;
  border: 1.5px solid rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.22) !important;
  gap: 0.45rem !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  letter-spacing: 0.2px !important;
}

#tab-recuperaciones-saul:hover {
  background: rgba(59, 130, 246, 0.22) !important;
  color: #EFF6FF !important;
  border-color: #3B82F6 !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
  transform: translateY(-1px) scale(1.02);
}

#tab-recuperaciones-saul.active {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8) !important;
  color: #FFFFFF !important;
  border-color: #60A5FA !important;
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  font-weight: 900 !important;
}

#tab-recuperaciones-saul span:first-child {
  font-size: 1.15rem !important;
}

/* =========================================================================
   MÓDULO: ENTREGAS & FINIQUITOS (LOTES LIQUIDADOS & POR LIQUIDAR)
   ========================================================================= */
.entregas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.entregas-kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.entregas-table-wrapper {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  overflow: hidden;
}

.entregas-toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.76rem;
  font-weight: 700;
}

.entregas-toggle-check.checked {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.entregas-toggle-check.unchecked {
  background: rgba(239, 68, 68, 0.1);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.entregas-toggle-check:hover {
  filter: brightness(1.15);
}

.expediente-doc-chip {
  transition: all 0.15s ease;
}
.expediente-doc-chip:hover {
  filter: brightness(1.22);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* =========================================================================
   FORMATO MODIFICABLE: VALE DE ENTREGA DE DINERO (EGRESOS)
   ========================================================================= */
.vale-document-preview {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 8px;
  padding: 2.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
  line-height: 1.55;
  position: relative;
}

.vale-header-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.5px;
  text-align: center;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.vale-amount-box {
  background: #F0FDF4;
  border: 2px dashed #10B981;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin: 1.25rem 0;
}

.vale-amount-num {
  font-size: 2rem;
  font-weight: 900;
  color: #047857;
}

.vale-amount-words {
  font-size: 0.85rem;
  color: #065F46;
  font-style: italic;
  margin-top: 0.25rem;
  font-weight: 600;
}

.vale-signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 3.5rem;
  padding-top: 0.75rem;
}

.vale-sig-box {
  text-align: center;
  border-top: 1.5px solid #0F172A;
  padding-top: 0.5rem;
}

/* ====================================================================
   CARTA FINIQUITO: EDICIÓN DIRECTA EN PAPEL (ESTILO FOLIO TALONARIO)
   ==================================================================== */
.cf-editable-doc {
  cursor: text !important;
  border-radius: 4px;
  padding: 1px 4px;
  outline: none;
  border: 1px dashed transparent;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 1.2em;
}

.cf-editable-doc:hover {
  border-color: #0284C7 !important;
  background-color: rgba(2, 132, 199, 0.05) !important;
}

.cf-editable-doc:focus {
  border-color: #0284C7 !important;
  background-color: #FFFFFF !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3) !important;
}

@media print {
  .cf-editable-doc {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }
}

/* ====================================================================
   MÓDULO OFICIAL: ACTA DE ENTREGA FÍSICA Y POSESIÓN MATERIAL (8 PÁGINAS)
   ==================================================================== */
#modal-acta-entrega {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

#modal-acta-entrega.active {
  display: flex !important;
}

.acta-modal-container {
  width: 96vw;
  max-width: 1400px;
  height: 94vh;
  background: #0B132B;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.15);
}

.acta-modal-header {
  padding: 0.85rem 1.4rem;
  background: #0F172A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.acta-modal-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: #080D1A;
}

/* Panel lateral de controles */
.acta-sidebar {
  width: 380px;
  min-width: 340px;
  background: #0B132B;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

.acta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.acta-badge.entregado {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid #10B981;
}

.acta-badge.pendiente {
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
  border: 1px solid #F59E0B;
}

.acta-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acta-form-group label {
  font-size: 0.72rem;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.acta-form-group input, .acta-form-group select {
  padding: 6px 10px;
  font-size: 0.82rem;
  background: #080D1A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #FFFFFF;
  font-family: inherit;
}

.acta-form-group input:focus {
  outline: none;
  border-color: #F59E0B;
}

/* Área de visualización de hojas de papel */
.acta-preview-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #1E293B;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* Hoja física formal (21.59cm de ancho) */
.acta-sheet {
  width: 100%;
  max-width: 800px;
  min-height: 1080px;
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 3rem 3.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: "Georgia", "Times New Roman", serif;
  box-sizing: border-box;
}

.acta-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0B132B;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.acta-sheet-logo {
  height: 38px;
  object-fit: contain;
}

.acta-sheet-header-text {
  text-align: center;
  flex: 1;
}

.acta-sheet-header-text h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  color: #0B132B;
  letter-spacing: 0.5px;
}

.acta-sheet-header-text p {
  margin: 2px 0 0 0;
  font-size: 0.65rem;
  color: #64748B;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.4px;
}

.acta-sheet-folio {
  font-size: 0.72rem;
  color: #64748B;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
}

.acta-sheet-body {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #1E293B;
  outline: none;
}

.acta-sheet-body[contenteditable="true"]:focus {
  background: rgba(248, 250, 252, 0.4);
}

.acta-doc-title {
  text-align: center;
  margin-bottom: 1.5rem;
}

.acta-doc-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #0B132B;
  letter-spacing: 0.5px;
}

.acta-doc-subtitle {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  margin-top: 3px;
  letter-spacing: 0.4px;
}

.acta-section-heading {
  text-align: center;
  font-weight: 900;
  font-size: 0.88rem;
  color: #0B132B;
  margin: 1.25rem 0 0.75rem 0;
  letter-spacing: 2px;
}

.acta-paragraph {
  text-align: justify;
  margin-bottom: 0.85rem;
  text-indent: 1.5rem;
}

.acta-paragraph strong {
  color: #000000;
}

.acta-highlight-clause {
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  text-indent: 0 !important;
}

.acta-medidas-table-box {
  margin: 0.75rem 0 1rem 0;
}

.acta-table-medidas {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  border: 1px solid #CBD5E1;
}

.acta-table-medidas td {
  padding: 5px 10px;
  border: 1px solid #CBD5E1;
}

.acta-table-medidas .col-dir {
  width: 32%;
  background: #F8FAFC;
  font-weight: 700;
}

.acta-sheet-footer {
  border-top: 1px solid #E2E8F0;
  padding-top: 0.5rem;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #94A3B8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Firmas */
.acta-signatures-block {
  margin-top: 2rem;
}

.acta-sig-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.acta-sig-col {
  flex: 1;
  text-align: center;
}

.acta-sig-line {
  border-bottom: 1.5px solid #000000;
  width: 85%;
  margin: 0 auto 8px auto;
}

.acta-sig-name {
  font-weight: 800;
  font-size: 0.78rem;
  color: #0B132B;
}

.acta-sig-company {
  font-size: 0.68rem;
  color: #475569;
  font-weight: 600;
}

.acta-sig-rep {
  font-size: 0.74rem;
  margin-top: 2px;
}

.acta-sig-cargo {
  font-size: 0.68rem;
  color: #64748B;
}

/* Módulo Fotográfico de 4 Fotos (Anexo 2) */
.acta-photos-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.acta-photo-card {
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.5rem;
  background: #F8FAFC;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.acta-photo-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.acta-photo-viewport {
  height: 165px;
  border-radius: 4px;
  overflow: hidden;
  background: #FFFFFF;
  position: relative;
  border: 1px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acta-photo-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.acta-photo-overlay-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.acta-sidebar-photo-item {
  transition: border-color 0.2s ease, background 0.2s ease;
}

.acta-sidebar-photo-item:hover {
  background: rgba(30, 41, 59, 0.9) !important;
}

/* Impresión Oficial del Acta de Entrega */
@media print {
  html, body {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    background: #FFFFFF !important;
  }
  body * {
    visibility: hidden;
  }
  #modal-acta-entrega,
  #modal-acta-entrega .acta-modal-container,
  #modal-acta-entrega .acta-modal-layout,
  #modal-acta-entrega .acta-preview-area,
  #modal-acta-entrega #acta-pages-render-target,
  #modal-acta-entrega .acta-sheet,
  #modal-acta-entrega .acta-sheet * {
    visibility: visible !important;
  }
  .acta-photo-overlay-actions {
    display: none !important;
  }
  #modal-acta-entrega {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    display: block !important;
    z-index: 1 !important;
  }
  .acta-modal-container {
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    background: transparent !important;
    overflow: visible !important;
    display: block !important;
  }
  .acta-modal-layout {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    background: transparent !important;
  }
  .acta-modal-header,
  .acta-sidebar {
    display: none !important;
  }
  .acta-preview-area {
    padding: 0 !important;
    background: transparent !important;
    gap: 0 !important;
    overflow: visible !important;
    display: block !important;
    height: auto !important;
  }
  .acta-sheet {
    box-shadow: none !important;
    margin: 0 0 15px 0 !important;
    padding: 1.1cm 1.5cm !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #FFFFFF !important;
    font-size: 8.4pt !important;
    line-height: 1.30 !important;
  }
  .acta-sheet:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}

/* ==========================================================================
   VISTA: CONTROL OFICIAL DE ENTREGAS & CARTAS FINIQUITO (FULL VIEW)
   ========================================================================== */
#view-entregas {
  display: none !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
  background: var(--bg-primary);
}

#view-entregas.active {
  display: flex !important;
  flex-direction: column;
}

#view-entregas .entregas-fullview-container {
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

#view-entregas .entregas-table-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

#view-entregas .crm-table th,
#modal-entregas-finiquitos .crm-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0B132B;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

#view-entregas .crm-table td,
#modal-entregas-finiquitos .crm-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

#modal-carta-finiquito .modal-content {
  max-width: 1450px !important;
  width: 97vw !important;
  height: 96vh !important;
  max-height: 96vh !important;
}

/* ==========================================================================
   SEGURIDAD CRÍTICA: ZERO-TRUST UI LOCK (BLINDAJE TOTAL DE LOGIN & BYPASS)
   ========================================================================== */
body.body-locked-auth {
  overflow: hidden !important;
}

body.body-locked-auth #login-modal-close,
body.body-locked-auth #login-modal-cancel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

body.body-locked-auth #modal-login {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 99999999 !important;
  background: rgba(3, 7, 18, 0.97) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
}

body.body-locked-auth .navbar,
body.body-locked-auth .main-content,
body.body-locked-auth .view-panel,
body.body-locked-auth #beta-status-topbar,
body.body-locked-auth .drawer-overlay,
body.body-locked-auth .recent-activity-drawer {
  filter: blur(16px) !important;
  -webkit-filter: blur(16px) !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  opacity: 0.2 !important;
}

/* ==========================================================================
   RADAR DE COBRANZA PREVENTIVA & CALENDARIO DE PAGOS
   ========================================================================== */
#view-radar-cobranza {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
  background: var(--bg-primary);
  flex-direction: column;
}

#view-radar-cobranza.active {
  display: flex !important;
}

.radar-container {
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 3.5rem;
}

/* Barra superior de KPIs */
.radar-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.radar-kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.radar-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.radar-kpi-card.active-kpi {
  border-color: #38BDF8;
  background: rgba(14, 165, 233, 0.12);
}

.radar-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.radar-kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.radar-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.radar-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-light);
  line-height: 1.2;
  margin-top: 2px;
}

.radar-kpi-sub {
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 2px;
}

/* Barra de Filtros y Búsqueda */
.radar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.radar-filters-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.radar-pill-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.radar-pill-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #FFFFFF;
}

.radar-pill-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.radar-pill-btn.pill-vencer.active {
  background: #F59E0B;
  border-color: #FBBF24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.radar-pill-btn.pill-retraso.active {
  background: #F97316;
  border-color: #FB923C;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.radar-pill-btn.pill-corriente.active {
  background: #10B981;
  border-color: #34D399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Grid de Tarjetas del Radar */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.radar-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.radar-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.radar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.radar-card-client-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.radar-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E293B, #334155);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #38BDF8;
  flex-shrink: 0;
}

.radar-card-client-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.radar-card-client-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-card-lot-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.radar-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.radar-status-corriente {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.radar-status-vencer {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: radarBlink 2.5s infinite;
}

.radar-status-retraso {
  background: rgba(249, 115, 22, 0.15);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.radar-status-mora {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.radar-status-liquidado {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

@keyframes radarBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.radar-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  background: rgba(10, 15, 30, 0.6);
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.radar-card-metric {
  display: flex;
  flex-direction: column;
}

.radar-metric-label {
  font-size: 0.68rem;
  color: #94A3B8;
  text-transform: uppercase;
  font-weight: 600;
}

.radar-metric-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #E2E8F0;
  margin-top: 1px;
}

.radar-metric-val.highlight {
  color: #38BDF8;
}

.radar-card-due-tag {
  grid-column: span 2;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
}

.radar-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-btn-wa {
  flex: 1;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #4ADE80;
  border-radius: 6px;
  padding: 0.42rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}

.radar-btn-wa:hover {
  background: rgba(37, 211, 102, 0.25);
  border-color: #22C55E;
}

.radar-btn-exp {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
  border-radius: 6px;
  padding: 0.42rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.radar-btn-exp:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #0EA5E9;
}

/* ==========================================================================
   BULK WHATSAPP ENGINE - ESTILOS DEL ASISTENTE Y MODAL DE CAMPAÑA MASIVA
   ========================================================================== */
.bulk-wa-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bulk-wa-modal-box {
  background: #0B1120;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.bulk-wa-header {
  background: rgba(15, 23, 42, 0.95);
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bulk-wa-icon-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.25), rgba(16, 185, 129, 0.2));
  border: 1.5px solid rgba(37, 211, 102, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.bulk-wa-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 850;
  color: #FFFFFF;
}

.bulk-wa-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.76rem;
  color: #94A3B8;
}

.bulk-wa-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}
.bulk-wa-close-btn:hover {
  color: #FFFFFF;
}

.bulk-wa-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bulk-wa-kpi-bar {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bulk-wa-progress-section {
  flex: 1;
  min-width: 240px;
}

.bulk-wa-progress-outer {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.bulk-wa-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #38BDF8);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.bulk-wa-kpi-pills {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.bulk-wa-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}

.bulk-wa-pill-val {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.bulk-wa-pill-lbl {
  font-size: 0.64rem;
  color: #94A3B8;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 700;
}

.bulk-wa-active-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%);
  border: 1.5px solid rgba(37, 211, 102, 0.35);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

.bulk-wa-active-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.bulk-wa-client-name {
  font-size: 1.15rem;
  font-weight: 850;
  color: #FFFFFF;
}

.bulk-wa-lot-badge {
  font-size: 0.75rem;
  font-weight: 750;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.bulk-wa-status-tag {
  font-size: 0.7rem;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 4px;
}
.bulk-wa-status-tag.sent {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.bulk-wa-status-tag.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.bulk-wa-status-tag.nophone {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.bulk-wa-preview-box {
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem;
}

.bulk-wa-preview-text {
  font-size: 0.83rem;
  color: #E2E8F0;
  line-height: 1.5;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.bulk-wa-actions-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-wa-btn-send {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.65rem 1.4rem;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bulk-wa-btn-send:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.55);
  filter: brightness(1.08);
}

.bulk-wa-btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.65rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}
.bulk-wa-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #FFFFFF;
}

.bulk-wa-template-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.bulk-wa-template-header {
  padding: 0.65rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.bulk-wa-template-body {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 26, 0.4);
}

.bulk-wa-tag-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bulk-wa-chip {
  font-size: 0.72rem;
  font-family: monospace;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px dashed rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.bulk-wa-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-style: solid;
}

.bulk-wa-textarea {
  width: 100%;
  background: #080D1A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: #FFFFFF;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.bulk-wa-queue-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bulk-wa-queue-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-wa-filter-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}
.bulk-wa-filter-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border-color: #38BDF8;
  font-weight: 750;
}

.bulk-wa-search {
  width: 100%;
  background: #080D1A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  color: #FFFFFF;
  font-size: 0.78rem;
  outline: none;
  box-sizing: border-box;
}

.bulk-wa-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(8, 13, 26, 0.5);
}

.bulk-wa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.bulk-wa-table th {
  position: sticky;
  top: 0;
  background: #0F172A;
  color: #94A3B8;
  font-weight: 750;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.bulk-wa-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.bulk-wa-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.bulk-wa-table tr.is-current {
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid #38BDF8;
}

.bulk-wa-row-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #CBD5E1;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}

.bulk-wa-row-btn.send {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.35);
  color: #34D399;
  font-weight: 750;
}
.bulk-wa-row-btn.send:hover {
  background: #25D366;
  color: #FFFFFF;
}

.bulk-wa-footer {
  background: rgba(15, 23, 42, 0.95);
  padding: 0.85rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.bulk-wa-tool-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.bulk-wa-tool-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #FFFFFF;
}

.bulk-wa-btn-close-main {
  background: #38BDF8;
  color: #0F172A;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.bulk-wa-btn-close-main:hover {
  background: #7DD3FC;
}

/* ==========================================================================
   PORTAFOLIO DE SOCIOS - PANTALLA COMPLETA (MAXIMIZAR)
   ========================================================================== */
.portafolio-socios-card.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: #0B132B !important;
  padding: 1.5rem !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: none !important;
}

.portafolio-socios-card.fullscreen-mode .socios-table-scroll-wrap {
  flex: 1 !important;
  max-height: none !important;
  height: calc(100vh - 290px) !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   MEJORA GENERAL DE LEGIBILIDAD (ANTI-MIOPÍA / TEXTOS CLAROS Y GRANDES)
   ========================================================================== */
.kpi-value {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.receipt-item-row {
  padding: 0.75rem 1rem !important;
  gap: 0.75rem !important;
}

.receipt-item-row .receipt-title-main {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
}

.receipt-item-row .receipt-meta-sub {
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
}

.receipt-item-row .receipt-amount {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
}

.btn-receipt-filter {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-receipt-filter:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-receipt-filter.active {
  background: rgba(56, 189, 248, 0.25);
  color: #FFFFFF;
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Tablas con mejor altura de fila y tipografía nítida */
table.audit-table th {
  font-size: 0.82rem !important;
  padding: 0.65rem 0.85rem !important;
  font-weight: 800 !important;
}

table.audit-table td {
  font-size: 0.88rem !important;
  padding: 0.65rem 0.85rem !important;
}

.corrida-table th {
  font-size: 0.82rem !important;
  padding: 0.55rem 0.75rem !important;
}

.corrida-table td {
  font-size: 0.86rem !important;
  padding: 0.55rem 0.75rem !important;
}

/* Ficha Luxury Cotizador - Letra grande y legible */
.flc-big-price {
  font-size: 2.2rem !important;
  font-weight: 900 !important;
}

.flc-kpi-val {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
}

/* Transacciones recientes */
.txn-card .txn-title {
  font-size: 1rem !important;
  font-weight: 800 !important;
}

.txn-card .txn-detail {
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  color: #E2E8F0 !important;
}

.txn-card .txn-time {
  font-size: 0.8rem !important;
}

/* ==========================================================================
   RADAR DE COBRANZA - SEGMENTACIÓN Y CASOS ESPECIALES
   ========================================================================== */
.radar-status-caso-especial {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.radar-status-retraso-medio {
  background: rgba(234, 88, 12, 0.18);
  color: #FB923C;
  border: 1px solid rgba(234, 88, 12, 0.45);
}

.radar-card-caso-especial {
  border-left: 4px solid #A855F7 !important;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.55), rgba(15, 23, 42, 0.85)) !important;
}

.radar-card-retraso-medio {
  border-left: 4px solid #EA580C !important;
}

.radar-pill-btn.pill-activa.active {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border-color: #38BDF8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
}

.radar-pill-btn.pill-medio.active {
  background: linear-gradient(135deg, #EA580C, #C2410C);
  border-color: #FB923C;
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.45);
  color: #FFFFFF;
}

.radar-pill-btn.pill-mora.active {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  border-color: #F87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
  color: #FFFFFF;
}

.radar-pill-btn.pill-caso-especial.active {
  background: linear-gradient(135deg, #7E22CE, #6B21A8);
  border-color: #A855F7;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
  color: #FFFFFF;
}

.semaforo-badge.caso-especial {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.35);
}


