/* =========================================================
   AdminFPO - Estilos (diseño original del dashboard)
   Nota: este proyecto perdió el archivo styles.css en disco.
   Este archivo restaura el look&feel esperado por los módulos
   en /public/modules y los scripts en /public/*.js
   ========================================================= */

:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 64px;
  --navbar-height: 60px;
  --sidebar-bg: #0f172a;

  --bg: #f5f7fb;
    --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-soft: #eef2f7;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --primary-color: #3b82f6;
  --primary-600: #2563eb;
  --danger: #ef4444;
  --success: #16a34a;
  --warning: #f59e0b;

  --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
    color: var(--text-primary);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ==================== LAYOUT ==================== */
.app-layout {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg, #0f172a);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width 0.25s ease;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}
.sidebar-toggle {
  display: none;
  position: absolute;
  right: -40px;
  top: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--sidebar-bg);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 201;
  transition: background 0.2s;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,0.15);
}
.sidebar-toggle-icon {
  width: 20px;
  height: 20px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-user .user-info,
.sidebar.collapsed .nav-link-text {
  display: none !important;
}
.sidebar.collapsed .submenu {
  display: none !important;
}
.sidebar.collapsed .submenu.active {
  display: block !important;
  position: fixed;
  left: var(--sidebar-collapsed-width);
  top: 0;
  bottom: 0;
  width: 200px;
  background: var(--sidebar-bg);
  padding: 12px 0;
  box-shadow: 4px 0 12px rgba(0,0,0,0.15);
  z-index: 199;
}
.sidebar.collapsed .submenu.active a {
  padding: 10px 16px;
  margin: 2px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar.collapsed .submenu.active .nav-link-text {
  display: inline !important;
}
.sidebar.collapsed .sidebar-header {
  padding: 16px 0;
  justify-content: center;
}
.sidebar.collapsed .sidebar-user {
  padding: 12px 0;
  justify-content: center;
}
.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
  margin: 2px 4px;
}
.sidebar.collapsed .nav-link .nav-icon {
  margin: 0;
}

.sidebar-header {
  padding: 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar-user {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
  color: #fff;
}

.sidebar-user .user-info { min-width: 0; }
.sidebar-user .user-info .name {
    font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-info .role {
  font-size: 12px;
  color: rgba(229, 231, 235, 0.75);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
  padding: 12px 0;
  overflow: auto;
  overflow-x: hidden;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Scrollbar sutil y profesional para el sidebar (WebKit) */
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
.sidebar-nav::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.35);
}

.sidebar-nav.loaded { opacity: 1; }

/* Ocultar menú hasta aplicar filtro de permisos (evita parpadeo) */
.sidebar-nav.nav-filtering {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.sidebar-nav:not(.nav-filtering) {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.nav-item { list-style: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 2px 8px;
  border-radius: 8px;
  color: rgba(229, 231, 235, 0.92);
  font-size: 13px;
  transition: all 0.15s ease;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-link.active .nav-icon { opacity: 1; }

.nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: translateX(3px);
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.22);
  color: #fff;
}

.submenu {
    display: none;
  padding: 4px 0 8px 0;
}

.submenu.active { display: block; }

.submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
  padding: 8px 14px;
  margin: 2px 14px 2px 20px;
  border-radius: 6px;
  color: rgba(229, 231, 235, 0.82);
  font-size: 12px;
}

.submenu a:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.submenu a.active {
    background: var(--primary-color);
  color: #fff;
}

/* Main area */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.navbar {
  height: var(--navbar-height);
  background: var(--bg-white);
    padding: 12px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
  position: sticky;
  top: 0;
  z-index: 150;
    }
    
    .navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-icon.navbar-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-icon.navbar-sidebar-toggle:hover {
  background: var(--bg);
}
.btn-icon.navbar-sidebar-toggle svg {
  width: 20px;
  height: 20px;
}
.navbar-left h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-softphone-block {
  display: none;
  align-items: center;
  gap: 8px;
}
.navbar-softphone-block:not([hidden]) {
  display: flex;
}
.navbar-softphone-ext {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-softphone-ext.navbar-softphone-ext--active {
  color: #16a34a;
}
.btn-icon.navbar-softphone-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-icon.navbar-softphone-toggle:hover {
  background: var(--bg);
}
.btn-icon.navbar-softphone-toggle.sp-nav-active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.btn-icon.navbar-softphone-toggle svg {
  width: 20px;
  height: 20px;
}

.navbar-avisos {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-aviso {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: nav-aviso-in .35s ease;
}
.nav-aviso[hidden] { display: none !important; }
.nav-aviso svg { width: 20px; height: 20px; position: relative; z-index: 1; }
.nav-aviso--wa {
  background: linear-gradient(160deg, #3ddc84, #128c7e);
  animation: nav-aviso-in .35s ease, nav-aviso-glow-wa 2.2s ease-out infinite;
}
.nav-aviso--mail {
  background: linear-gradient(160deg, #60a5fa, #1d4ed8);
  animation: nav-aviso-in .35s ease, nav-aviso-glow-mail 2.5s ease-out infinite;
}
.nav-aviso::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  background-size: 220% 100%;
  animation: nav-aviso-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}
.nav-aviso-count {
  position: absolute;
  top: -6px;
  right: -7px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  animation: nav-aviso-badge 1.8s ease-in-out infinite;
}
.nav-aviso--ping .nav-aviso-count { animation: nav-aviso-pop .45s ease; }
@keyframes nav-aviso-in {
  from { opacity: 0; transform: translateY(-6px) scale(.86); }
  to { opacity: 1; transform: none; }
}
@keyframes nav-aviso-glow-wa {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@keyframes nav-aviso-glow-mail {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .5); }
  70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
@keyframes nav-aviso-shine {
  0%, 55% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}
@keyframes nav-aviso-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes nav-aviso-pop {
  0% { transform: scale(.55); }
  60% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-aviso,
  .nav-aviso::after,
  .nav-aviso-count { animation: none; }
}

.sp-navbar-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #1e293b;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
}
.sp-nav-mini-num {
  min-width: 72px;
  max-width: 160px;
  width: 120px;
  padding: 3px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.sp-nav-mini-num::placeholder {
  color: rgba(148, 163, 184, 0.8);
  font-weight: 500;
}
.sp-nav-mini-num:hover,
.sp-nav-mini-num:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(99, 102, 241, 0.55);
}
.sp-nav-mini-timer {
  font-weight: 600;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.sp-nav-mini-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.sp-nav-mini-btn:hover {
  background: rgba(255,255,255,.25);
}
.sp-nav-mini-btn--hangup {
  background: #ef4444;
}
.sp-nav-mini-btn--hangup:hover {
  background: #dc2626;
}
.sp-nav-mini-btn--back {
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  min-width: 28px;
}
.sp-nav-mini-btn--call {
  background: #22c55e;
  color: #fff;
}
.sp-nav-mini-btn--call:hover {
  background: #16a34a;
}
.sp-nav-mini-btn--close {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}
.sp-nav-mini-btn.sp-nav-mute-active {
  background: #ef4444;
}

/* Navbar user dropdown - diseño profesional */
.navbar-user-dropdown {
  position: relative;
}
.navbar-user-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.navbar-user-trigger:hover {
  background: var(--bg);
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.navbar-user-dropdown.open .navbar-user-trigger {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.navbar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.navbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}
.navbar-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-primary);
}
.navbar-user-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.navbar-user-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.navbar-user-dropdown.open .navbar-user-chevron {
  transform: rotate(180deg);
}
.navbar-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 0;
  z-index: 300;
  overflow: hidden;
  animation: navbar-user-menu-in 0.2s ease;
}
@keyframes navbar-user-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.navbar-user-menu[hidden] {
  display: none;
}
.navbar-user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-white) 100%);
}
.navbar-user-menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.navbar-user-menu-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.navbar-user-menu-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.navbar-user-menu-role {
  font-size: 12px;
  color: var(--text-secondary);
}
.navbar-user-menu-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 0 12px;
}
.navbar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: all 0.15s ease;
}
.navbar-user-menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.navbar-user-menu-item:hover {
  background: var(--bg);
}
.navbar-user-menu-item:hover svg {
  color: var(--primary-color);
}
.navbar-user-menu-item--logout:hover {
  background: #fef2f2;
  color: #b91c1c;
}
.navbar-user-menu-item--logout:hover svg {
  color: #b91c1c;
}
@media (max-width: 480px) {
  .navbar-user-info { display: none; }
  .navbar-user-trigger { padding: 8px 10px; }
}

.content {
  padding: 18px 22px;
    flex: 1;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ==================== BOTONES ==================== */
.btn-primary, .btn-secondary, .btn-danger {
    border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
    font-size: 13px;
  font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }

.btn-secondary { background: #f3f4f6; color: #111827; border-color: #e5e7eb; }
.btn-secondary:hover { background: #e5e7eb; }

.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.btn-danger:hover { background: #fecaca; }

.btn-sm { padding: 6px 10px; border-radius: 8px; font-size: 12px; }

/* ==================== FORM CONTROLS ==================== */
.form-group { margin-bottom: 14px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 6px; }
.form-help { display:block; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.required { color: #ef4444; }

.form-input, .form-select, .form-textarea {
    width: 100%;
  padding: 10px 12px;
    border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
    font-size: 13px;
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* ==================== MÓDULOS ==================== */
.module { display: none; }
.module.active { display: block; }

/* Que la cabecera sticky del listado Gestión no quede recortada por el contenedor del módulo */
#moduleContainer.card {
  overflow: visible;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
        gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.module-header h2 {
    margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.module-content { padding: 16px; }

/* Inicio */
.welcome-section {
    padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(99,102,241,0.08) 100%);
  border: 1px solid rgba(59,130,246,0.16);
    margin-bottom: 16px;
}
.welcome-section h2 { margin: 0 0 6px; font-size: 18px; }
.welcome-section p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.welcome-date { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

.dashboard-section { margin-bottom: 24px; }
/* Oculta secciones del inicio hasta aplicar filtro de permisos (evita parpadeo) */
.inicio-filter-pending { visibility: hidden; }
.dashboard-section-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.stats-grid {
    display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
    align-items: center;
}
.stat-icon {
  width: 42px;
  height: 42px;
    border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-content h3 { margin: 0; font-size: 13px; color: var(--text-secondary); font-weight: 650; }
.stat-number { margin: 2px 0 0; font-size: 18px; font-weight: 750; }
.stat-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.stat-card-clickable { cursor: pointer; transition: box-shadow 0.2s, transform 0.15s; }
.stat-card-clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stats-grid-dashboard { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.quick-links-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-primary); text-decoration: none; transition: all 0.2s; }
.quick-link:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.quick-link-icon { font-size: 18px; }

.user-info-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.user-info-card h2 { margin: 0 0 12px; font-size: 15px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
}
.info-item label { display:block; font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.info-item span { font-size: 13px; color: var(--text-primary); font-weight: 600; }

.badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 4px 10px;
  border-radius: 999px;
    font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #f3f4f6;
}
.badge.si { background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.25); color: #166534; }
.badge.no { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.25); color: #991b1b; }
.badge-success { background: rgba(22,163,74,.15); border-color: rgba(22,163,74,.3); color: #166534; }

/* ==================== PERFILES (modal) ==================== */
.perfil-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}
.perfil-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.perfil-modal-content {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.perfil-modal-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
}
.perfil-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}
.btn-close-modal {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-close-modal:hover { background: #f3f4f6; }
.btn-close-modal svg { width: 18px; height: 18px; }
.perfil-modal-body {
  padding: 14px;
  overflow: auto;
}

/* ==================== MODALES (genérico) ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 950;
}
.modal-content {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}
.modal-body { padding: 14px; }

/* Modal Gestionar Mensajes Predeterminados - layout profesional */
.modal-manage-messages {
  max-width: 1000px;
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-add-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.btn-add-message svg { width: 16px; height: 16px; }
.modal-manage-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.manage-messages-sidebar {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}
.manage-messages-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  min-height: 280px;
  max-height: 520px;
}
.manage-list-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.manage-list-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.manage-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  background: #fff;
}
.manage-list-item:hover {
  background: #f8fafc;
  border-color: var(--border);
}
.manage-list-item.selected {
  background: #eff6ff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}
.manage-list-item-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.manage-list-item-body {
  flex: 1;
  min-width: 0;
}
.manage-list-item-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manage-list-item-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manage-messages-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.manage-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
}
.manage-detail-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  margin-bottom: 16px;
}
.manage-detail-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.manage-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-height: 280px;
  max-height: 520px;
}
.manage-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.manage-detail-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.detail-type-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text-secondary);
}
.manage-detail-category {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.manage-detail-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}
.detail-media-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: contain;
  margin: 12px 0;
}
.detail-media-video, .detail-media-audio {
  margin: 12px 0;
}
.detail-media-video video {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
}
.detail-media-audio audio {
  width: 100%;
  height: 40px;
}
.detail-media-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0;
}
.detail-media-file .file-icon { font-size: 24px; }
.manage-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-edit-detail, .btn-delete-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}
.btn-edit-detail svg, .btn-delete-detail svg { width: 16px; height: 16px; }
.btn-delete-detail { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.btn-delete-detail:hover { background: #fecaca; }

/* Modal Agregar/Editar Mensaje Predeterminado - scroll cuando hay imagen */
.modal-edit-quick-message {
  max-width: 500px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-edit-quick-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.modal-edit-quick-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  min-height: 0;
}
.modal-edit-quick-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.btn-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-close:hover { background: #f3f4f6; }
.btn-close svg { width: 18px; height: 18px; }

/* Botones formato WhatsApp (negrita, cursiva, etc.) */
.btn-format-whatsapp,
.btn-format-whatsapp-plantilla {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-format-whatsapp:hover,
.btn-format-whatsapp-plantilla:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

/* ==================== BOTONES extra ==================== */
.btn-success { background: rgba(22,163,74,.12); color: #166534; border-color: rgba(22,163,74,.25); }
.btn-success:hover { background: rgba(22,163,74,.18); }
.btn-warning { background: rgba(245,158,11,.12); color: #92400e; border-color: rgba(245,158,11,.25); }
.btn-warning:hover { background: rgba(245,158,11,.18); }

/* ==================== WHATSAPP (sesiones) ==================== */
.header-actions { display:flex; align-items:center; gap:8px; }

.wa-actions {
  margin-bottom: 12px;
  text-align: center;
  padding: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.wa-action-btn {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  min-width: 220px;
  justify-content: center;
}
.wa-action-btn svg {
  width: 16px;
  height: 16px;
}

.sessions-limit-badge {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
}

.sesiones-limit-info {
  color: var(--text-muted, #64748b);
  font-weight: 500;
  font-size: 13px;
}
.sesiones-limit-info .sesiones-limit-tiene {
  color: var(--text-primary, #1e293b);
  font-weight: 600;
}
.sesiones-limit-info .sesiones-limit-quedan {
  color: #059669;
  font-weight: 600;
}
.sesiones-limit-info .sesiones-limit-total {
  color: #6366f1;
  font-weight: 600;
}

/* Bots module */
.bots-notification { position: fixed; bottom: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; z-index: 9999; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0; transition: opacity 0.3s; }
.bots-notification.show { opacity: 1; }
.bots-notification.success { background: #10b981; color: #fff; }
.bots-notification.error { background: #ef4444; color: #fff; }
.bots-notification.info { background: #3b82f6; color: #fff; }
.bot-config-section { margin-top: 16px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.bot-config-section h4 { margin: 0 0 10px; font-size: 14px; }
.bot-config-section h4 small { font-weight: 400; color: #64748b; }
.triggers-list, .flujo-nodos { display: flex; flex-direction: column; gap: 8px; }
.trigger-item, .menu-opcion-item, .flujo-nodo, .bot-data-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; }
.bot-data-key, .bot-data-value { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.btn-remove-data { flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: none; background: #fee2e2; color: #dc2626; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; }
.trigger-item.drag-over, .flujo-nodo.drag-over { border-color: #25D366; background: #f0fdf4; }
.trigger-drag, .nodo-drag { cursor: grab; color: #94a3b8; font-size: 14px; user-select: none; }
.trigger-palabra, .trigger-respuesta, .opcion-texto, .opcion-respuesta, .nodo-input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.opcion-num { width: 50px; padding: 6px; border: 1px solid #e2e8f0; border-radius: 6px; text-align: center; }
.trigger-arrow { color: #25D366; font-weight: 700; }
.btn-remove-trigger, .btn-remove-opcion { flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: none; background: #fee2e2; color: #dc2626; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; }
.btn-remove-trigger:hover, .btn-remove-opcion:hover { background: #fecaca; }
.asignaciones-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.asignacion-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.asignacion-group small { display: block; margin-top: 4px; color: #64748b; font-size: 11px; }
.flujo-nodo.nodo-trigger .nodo-label { color: #f59e0b; }
.flujo-nodo.nodo-respuesta .nodo-label { color: #10b981; }
.flujo-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.sessions-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}
.sessions-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 750;
  color: var(--text-primary);
}

.tabs-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.tab-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .12s ease;
}
.tab-button:hover { background: #f3f4f6; }
.tab-button.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.tab-badge {
  background: #f3f4f6;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.sessions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
}
.session-report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.session-report-summary {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.session-report-table-wrap {
  max-height: min(62vh, 640px);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.session-report-table td {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
}
.session-report-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.session-list-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.session-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
}
.session-list-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.session-list-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.session-list-name strong { font-size: 13px; }
.session-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--text-secondary);
}
.session-status.connected { background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.25); color:#166534; }
.session-status.qr_ready { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.25); color:#1d4ed8; }
.session-status.connecting,
.session-status.reconnecting { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); color:#92400e; }
.session-status.disconnected,
.session-status.saved { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.22); color:#991b1b; }
.session-status.unknown { background: #f3f4f6; border-color: #e5e7eb; color: #4b5563; }
.session-status.situacion-activa { background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.25); color:#166534; }
.session-status.situacion-inactiva { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); color:#92400e; }
.session-status.situacion-bloqueada { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.22); color:#991b1b; }
.session-user-row--ok td { background: rgba(22, 163, 74, 0.12); }
.session-user-row--off td { background: rgba(239, 68, 68, 0.10); }
.session-report-sort {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 750;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.session-report-sort.is-sorted::after {
  content: ' \25B2';
  font-size: 10px;
}
.session-report-sort.is-sorted.is-desc::after {
  content: ' \25BC';
}
.session-report-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.session-report-pager button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.session-report-pager button.is-current {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.session-report-qr {
  white-space: nowrap;
}
.report-qr-modal {
  z-index: 1200;
}
.report-qr-modal-content {
  width: min(440px, calc(100vw - 32px));
}
.report-qr-modal .qr-image {
  max-width: 280px;
  height: auto;
  border-radius: 12px;
}

.session-list-details {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.session-detail-item {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}
.session-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 240px;
}
.session-list-actions .btn-sm {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}
.session-list-actions .btn-sm svg { width: 16px; height: 16px; }
.session-list-actions .btn-sm span { display:none; }
@media (min-width: 1100px) {
  .session-list-actions .btn-sm span { display:inline; }
}

.no-sessions {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 22px 14px;
  color: var(--text-secondary);
  text-align: center;
  background: #fafafa;
}
.no-sessions svg { width: 42px; height: 42px; opacity: .45; margin: 0 auto 10px; display:block; }
.no-sessions p { margin: 0; font-weight: 650; }

.qr-panel {
  margin-top: 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.qr-panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
.qr-panel-header h3 { margin:0; font-size: 14px; font-weight: 750; }
.qr-panel-body { padding: 14px; }
.qr-status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #fafafa;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 10px;
}
.qr-container {
  border: 1px dashed var(--border);
  background: #fafafa;
  border-radius: 14px;
  padding: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 280px;
}

/* Listas (modal WhatsApp) */
.wa-list-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.wa-list-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
}

/* Tablas */
.table-wrapper { overflow: auto; }
.data-table, .report-table, .usuarios-table {
    width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.data-table th, .data-table td,
.report-table th, .report-table td,
.usuarios-table th, .usuarios-table td {
        padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
        font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
.data-table th, .report-table th, .usuarios-table th {
  color: var(--text-secondary);
  font-weight: 750;
    font-size: 12px;
  background: #fafafa;
  position: sticky;
        top: 0;
  z-index: 1;
}

/* ==================== CHAT (base) ==================== */
    #module-chat {
        position: fixed;
  top: var(--navbar-height);
  left: var(--sidebar-width);
        right: 0;
        bottom: 0;
  z-index: 1;
  background: #fff;
  overflow: hidden;
}
#module-chat.module.active {
  display: flex;
  flex-direction: column;
}

.chat-container {
  display: flex;
  flex: 1;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
    .chat-sidebar {
  width: 360px;
  flex: 0 0 360px;
  border-right: 1px solid var(--border);
  display:flex;
    flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-main {
  flex: 1;
  display:flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
    justify-content: space-between;
  flex-shrink: 0;
}
.chat-header h3 { margin: 0; font-size: 14px; font-weight: 750; }
.chat-header-actions { display:flex; gap: 6px; }
.btn-refresh, .btn-new-chat, .btn-manage-messages {
  width: 34px; height: 34px;
    border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
    cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-refresh:hover, .btn-new-chat:hover, .btn-manage-messages:hover { background:#f3f4f6; }
.btn-refresh svg, .btn-new-chat svg, .btn-manage-messages svg { width: 18px; height: 18px; }

/* Área lista: buscador + scroll de ítems */
.chats-list-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chats-list-stack .chats-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.chats-list-stack .chat-search-container--list {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}
.chats-list {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.no-chats { padding: 22px 14px; color: var(--text-secondary); text-align:center; }

/* ==================== CHAT (mejorado) ==================== */
.session-selector {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
}
.session-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.session-selector label {
  font-size: 12px;
  font-weight: 750;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.session-selector select,
.session-selector-row .form-select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 0;
}
.session-selector-row {
  position: relative;
}
.session-selector-row .session-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  flex: 0 0 auto;
  pointer-events: none;
}
.session-select-face {
  position: relative;
  flex: 1;
  min-width: 0;
}
.session-select-btn {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 8px 28px 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-select-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  pointer-events: none;
}
.session-select-btn:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.session-select-btn strong,
.session-select-item strong {
  font-weight: 800;
}
.session-select-menu {
  position: fixed;
  z-index: 4000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}
.session-select-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  color: var(--text-primary);
}
.session-select-item:hover,
.session-select-item.is-selected {
  background: rgba(18, 140, 126, 0.1);
}

/* Tarjeta “tu perfil” (foto de la sesión WhatsApp), inspirada en WhatsApp Web */
.session-profile-card {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 140, 126, 0.06) 0%, transparent 100%);
}
/* Dentro del bloque “Sesión:” (sidebar): sin doble borde inferior */
.session-selector .session-profile-card {
  padding: 10px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-bottom: none;
}
/* Versión compacta cuando el panel está activo (.is-visible) */
.session-selector .session-profile-card.is-visible {
  padding: 6px 0 2px;
  margin-top: 2px;
}
.session-profile-card.is-visible {
  display: block !important;
  padding: 6px 10px 8px;
}
.session-profile-card.is-visible .session-profile-card-inner {
  gap: 8px;
}
.session-profile-card.is-visible .session-profile-avatar-btn {
  width: 40px;
  height: 40px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.session-profile-card.is-visible .session-profile-avatar-fallback svg {
  width: 22px;
  height: 22px;
}
.session-profile-card.is-visible .session-profile-camera-badge {
  width: 17px;
  height: 17px;
  right: -1px;
  bottom: -1px;
}
.session-profile-card.is-visible .session-profile-camera-badge svg {
  width: 9px;
  height: 9px;
}
.session-profile-card.is-visible .session-profile-meta {
  gap: 0;
}
.session-profile-card.is-visible .session-profile-label {
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}
.session-profile-card.is-visible .session-profile-hint {
  font-size: 10px;
  line-height: 1.25;
}
.session-profile-card.is-visible .session-profile-actions {
  margin-top: 4px;
}
.session-profile-card.is-visible .btn-session-profile-secondary {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.session-profile-card.is-visible .btn-session-profile-secondary svg {
  width: 12px;
  height: 12px;
}
.session-profile-bot-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 0 2px;
  border-top: 1px solid var(--border);
}
.session-selector .session-profile-card .session-profile-bot-row {
  margin-top: 6px;
  padding-top: 6px;
}
.session-profile-bot-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}
.session-profile-bot-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--text, #111b21);
}
.session-profile-bot-desc {
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted, #667781);
}
.session-profile-bot-toggle {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #128c7e;
}
.session-profile-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-profile-avatar-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  background: #dfe5e7;
  color: #54656f;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.session-profile-avatar-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.session-profile-avatar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.session-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.session-profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.session-profile-avatar-fallback svg {
  width: 28px;
  height: 28px;
  opacity: 0.85;
}
.session-profile-camera-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  pointer-events: none;
}
.session-profile-camera-badge svg {
  width: 12px;
  height: 12px;
}
.session-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.session-profile-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}
.session-profile-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.session-profile-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.btn-session-profile-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-session-profile-secondary svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.btn-session-profile-secondary:hover:not(:disabled) {
  background: #f3f4f6;
  color: var(--text-primary);
}
.btn-session-profile-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-filter-tabs {
  padding: 5px 8px 4px;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.chat-filter-tab {
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 3px 8px 3px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chat-filter-tab svg {
  width: 12px;
  height: 12px;
  opacity: 0.72;
  flex-shrink: 0;
}
.chat-filter-tab:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-primary);
}
.chat-filter-tab:hover svg {
  opacity: 0.9;
}
.chat-filter-tab.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--text-primary);
  font-weight: 650;
}
.chat-filter-tab.active svg {
  opacity: 1;
  color: #059669;
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.chat-search-container {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
/* Buscador pegado a #chatsList: compacto y poco intrusivo */
.chat-search-container--list {
  flex-shrink: 0;
  padding: 5px 8px 4px;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
}
.chat-search-container--list .chat-search-wrapper {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-search-container--list:focus-within .chat-search-wrapper {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.chat-search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.chat-search-container--list .chat-search-icon {
  left: 8px;
  width: 13px;
  height: 13px;
  opacity: 0.65;
}
.chat-search-input {
  width: 100%;
  padding: 8px 34px 8px 32px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  font-size: 13px;
}
.chat-search-container--list .chat-search-input {
  padding: 5px 28px 5px 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  color: var(--text-primary);
}
.chat-search-container--list .chat-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}
.chat-search-container--list .chat-search-input:focus {
  box-shadow: none;
}
.chat-search-input:focus {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}
.btn-clear-search {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-clear-search--compact {
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.85;
}
.btn-clear-search--compact:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}
.btn-clear-search--compact svg {
  width: 14px;
  height: 14px;
}
.btn-clear-search:hover { background: #f3f4f6; }
.btn-clear-search svg { width: 16px; height: 16px; }

.chat-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s ease;
}
.chat-item:hover { background: #f3f4f6; }
.chat-item.active {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.20);
}
.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #eef2ff;
  border: 1px solid var(--border-soft);
  display:flex;
  align-items:center;
  justify-content:center;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-info { flex: 1; min-width: 0; }
.chat-name-wrapper { display:flex; justify-content: space-between; align-items:flex-start; gap: 8px; }
.chat-name {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.favorite-indicator { margin-right: 6px; }
.chat-name-actions { display:flex; gap: 6px; align-items:center; }
.btn-toggle-favorite, .btn-edit-chat-name {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-toggle-favorite:hover, .btn-edit-chat-name:hover { background: #f3f4f6; }
.btn-toggle-favorite svg, .btn-edit-chat-name svg { width: 16px; height: 16px; }
.chat-last-message {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-meta {
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.chat-time { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.chat-placeholder {
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  background: radial-gradient(1200px 600px at 40% 20%, rgba(16,185,129,.07), transparent 60%),
              radial-gradient(1000px 500px at 80% 60%, rgba(59,130,246,.06), transparent 55%),
              #fff;
}
.placeholder-content {
  text-align: center;
  max-width: 420px;
  padding: 18px;
  color: var(--text-secondary);
}
.placeholder-content svg { width: 54px; height: 54px; opacity: .45; margin: 0 auto 10px; display:block; }
.placeholder-content h3 { margin: 0 0 6px; color: var(--text-primary); font-size: 16px; font-weight: 800; }
.placeholder-content p { margin: 0; font-size: 13px; }

.chat-header-active {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}
.chat-contact-info { display:flex; align-items:center; gap: 10px; min-width: 0; }
.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #eef2ff;
  flex: 0 0 auto;
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-details { min-width:0; }
.contact-details h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-details p { margin: 3px 0 0; font-size: 12px; color: var(--text-secondary); }
.contact-phone-line {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.contact-account-line {
  margin: 2px 0 0;
  font-size: 11px;
  color: #0f766e;
  font-weight: 700;
  line-height: 1.3;
}
.contact-avatar--clickable { cursor: zoom-in; }
.contact-avatar--clickable img { cursor: zoom-in; }
.chat-title-stack { min-width: 0; flex: 1; }
.chat-list-phone {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 3px 0 0;
  line-height: 1.25;
  font-weight: 600;
}
.chat-list-client {
  font-size: 11px;
  color: #0f766e;
  font-weight: 700;
  margin: 2px 0 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-avatar-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.contact-avatar-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.72);
  backdrop-filter: blur(4px);
}
.contact-avatar-preview-content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 480px);
  max-height: 92vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  background: #111;
}
.contact-avatar-preview-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
}
.contact-avatar-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.contact-avatar-preview-close:hover { background: rgba(0,0,0,0.75); }
.chat-actions { display:flex; gap: 6px; }
.btn-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-action:hover { background: #f3f4f6; }
.btn-action svg { width: 18px; height: 18px; }

.chat-header-active,
.chat-input-container {
  flex-shrink: 0;
}
.chat-placeholder {
  min-height: 0;
  overflow: auto;
}
.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  display: block;
  position: relative;
}
.chat-messages-drop-overlay {
  position: absolute;
  inset: 8px;
  z-index: 40;
  border-radius: 14px;
  border: 2px dashed rgba(37, 211, 102, 0.55);
  background: rgba(37, 211, 102, 0.1);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}
.chat-messages--drag-over .chat-messages-drop-overlay {
  display: flex;
}
.chat-messages-drop-hint {
  font-size: 15px;
  font-weight: 800;
  color: #128c7e;
  max-width: 280px;
  line-height: 1.35;
}
.chat-messages-drop-hint small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.messages-container {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Evitar que los mensajes se estiren a todo el ancho */
  align-items: flex-start;
}
.message {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Usar el ancho útil del panel de chat (estilo WhatsApp) */
  max-width: min(72%, 560px);
  width: fit-content;
  min-width: 0;
  margin: 0;
}
.message.sent { align-self: flex-end; align-items: flex-end; }
.message.received { align-self: flex-start; align-items: flex-start; }
/* Mensajes con audio: contenedor proporcional */
.message:has(.message-bubble--audio) {
  max-width: 300px;
}
.message:has(.message-media),
.message:has(.message-file) {
  width: auto;
  min-width: min(200px, 90%);
  max-width: min(75%, 420px);
}
.message-sender {
  font-size: 12px;
  font-weight: 600;
  color: #128c7e;
  margin-left: 6px;
  margin-right: 6px;
  margin-bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
}
.message-sender-name {
  font-weight: 600;
  color: #128c7e;
}
.message-sender-phone {
  font-weight: 500;
  font-size: 11px;
  color: #667781;
}
.message-bubble {
  /* Crece con el texto hasta el max del mensaje; no forzar saltos por letra */
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 13px;
}
.message-bubble:has(.message-media),
.message-bubble:has(.message-file) {
  width: 100%;
  max-width: 100%;
  padding: 4px;
}
.message-bubble.whatsapp-formatted-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}
.message.sent .message-bubble {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
}
.message-footer {
  display:flex;
  justify-content: flex-end;
  gap: 4px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 2px;
  margin-top: 0;
  line-height: 1.2;
}
.message.received .message-footer {
  justify-content: flex-start;
}
.message-footer .message-time { white-space: nowrap; }
.message-status { font-size: 11px; letter-spacing: -0.5px; }
.btn-delete-msg {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.55;
}
.btn-delete-msg:hover { opacity: 1; }
.message-deleted-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.message-deleted-wrap .message-deleted-x {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 2;
}
.message--deleted .message-deleted-body {
  opacity: 0.72;
}
.message--deleted .message-bubble {
  border: 1px dashed #e0b4b4 !important;
}
.message-deleted-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.message-empty-placeholder {
  color: #9ca3af;
  font-style: italic;
}
#btnDeleteChat svg { width: 18px; height: 18px; }
.btn-delete-chat-list {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  padding: 2px;
  opacity: 0.45;
  display: inline-flex;
  align-items: center;
}
.btn-delete-chat-list:hover { opacity: 1; }
.btn-delete-chat-list svg { width: 14px; height: 14px; }
.message-date-separator {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 12px 0 8px;
  clear: both;
  box-sizing: border-box;
}
.message-date-separator span {
  background: rgba(225, 231, 236, 0.95);
  color: #54656f;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  text-transform: capitalize;
  line-height: 1.2;
}
.message-status.enviado,
.message-status.sent,
.message-status.pendiente,
.message-status.sending {
    color: #8696a0;
}
/* Recibos tipo WhatsApp: entregado gris, leído azul */
.message-status.entregado,
.message-status.delivered {
    color: #8696a0;
}
.message-status.leido,
.message-status.read {
    color: #53bdeb;
}
.chat-header-active--group .contact-status,
.contact-name--group + .contact-status {
    color: #059669;
}
.group-avatar {
    background: #10b981;
}
.group-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #059669;
    font-size: 12px;
}
.message-media .image-container { position: relative; }

/* Imágenes: ancho fijo visible (evita burbuja vacía por colapso flex) */
.message-media {
  --chat-media-max: 280px;
  display: block;
  width: min(var(--chat-media-max), 100%);
  max-width: 100%;
  line-height: 0;
}
.message-media .image-container {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #e8eef3;
  min-height: 120px;
}
.message-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  display: block;
  vertical-align: top;
  background: #e8eef3;
}
.image-caption { margin: 6px 8px 4px; font-size: 12px; color: var(--text-secondary); line-height: 1.3; }

/* Overlays en previsualización (evita que agreguen altura) */
.image-container { position: relative; }
.image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.media-download-overlay {
  position: absolute;
  right: 8px;
  bottom: 8px;
  opacity: 0;
  transition: opacity .12s ease;
}
.image-container:hover .image-overlay,
.image-container:hover .media-download-overlay {
  opacity: 1;
}

/* Previsualizaciones multimedia (evitar “gigantes” en histórico) */
.media-placeholder {
  display: inline-block;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  color: #64748b;
  font-size: 12px;
  margin: 0;
  line-height: 1.2;
}
.custom-video-player {
  width: min(230px, 100%);
  max-width: 230px;
}
/* ===== NOTA DE VOZ - ESTILO PROFESIONAL (WhatsApp/Telegram) ===== */
.voice-note-player {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 180px;
  max-width: 260px;
  padding: 1px 3px;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
}
.voice-note-player .custom-audio-element {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.voice-note-play {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: none;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.voice-note-play:hover {
  background: #059669;
  transform: scale(1.03);
}
.voice-note-play:active {
  transform: scale(0.97);
}
.voice-note-play svg {
  width: 11px;
  height: 11px;
}
.voice-note-play .play-icon { margin-left: 2px; }
.voice-note-bar {
  flex: 1;
  min-width: 40px;
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}
.voice-note-progress {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s;
}
.voice-note-time {
  font-size: 10px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
}
.voice-note-current { color: #10b981; font-weight: 600; }
.voice-note-sep { margin: 0 2px; opacity: 0.6; }
.voice-note-download {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.voice-note-download:hover {
  background: rgba(0,0,0,0.06);
  color: #10b981;
}
.voice-note-download svg {
  width: 11px;
  height: 11px;
}
.voice-note-placeholder {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}
/* Mensaje enviado: tono verde sutil */
.message.sent .voice-note-player {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.12);
}
.message.sent .voice-note-bar {
  background: rgba(16, 185, 129, 0.15);
}
/* Burbuja compacta para audio - mínimo espacio, sin espacios extra */
.message-bubble--audio {
  padding: 1px 2px !important;
  max-width: 280px !important;
  width: fit-content !important;
  display: block !important;
  line-height: 1 !important;
  min-height: 0 !important;
  white-space: nowrap;
  font-size: 0;
}
.message-bubble--audio > * {
  font-size: 12px;
}

/* Video, documento: eliminar espacios por whitespace en HTML */
.message-bubble:has(.message-media),
.message-bubble:has(.message-file) {
  font-size: 0;
}
.message-bubble:has(.message-media) > .message-media,
.message-bubble:has(.message-file) > .message-file,
.message-bubble:has(.message-media) > .image-caption,
.message-bubble:has(.message-file) > .message-file-caption,
.message-bubble:has(.message-media) > p,
.message-bubble:has(.message-file) > p {
  font-size: 12px;
  line-height: 1.3;
}
.message-bubble--audio .message-audio {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1;
  display: block;
  min-height: 0;
}
.message-bubble--audio .voice-note-player {
  line-height: 1;
  margin: 0;
}
.message-audio {
  display: block;
  margin: 0;
  padding: 0;
}
/* Compatibilidad con diseño antiguo */
.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  max-width: 200px;
}
.message-audio .audio-controls { display: flex; align-items: center; gap: 6px; }
.message-audio .audio-btn-play {
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%;
  background: #10b981; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.message-audio .audio-progress-container { flex: 1; min-width: 0; }
.message-audio .audio-progress-bar {
  height: 4px; background: rgba(0,0,0,0.1); border-radius: 2px; cursor: pointer; overflow: hidden;
}
.message-audio .audio-progress {
  height: 100%; background: #10b981; border-radius: 2px; width: 0%;
}
.message-audio .audio-time { font-size: 11px; color: #64748b; }
.message-audio .btn-download-media {
  width: 24px; height: 24px; border: none; border-radius: 6px;
  background: transparent; color: #64748b; cursor: pointer;
}
.custom-video-player {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #0b1220;
}
.custom-video-element {
  width: 100%;
  max-height: 170px;
  display: block;
  object-fit: cover;
  background: #0b1220;
}

.message-file {
  max-width: min(380px, 100%);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.message-file .file-icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--text-secondary); }
.message-file-info { min-width: 0; }
.message-file-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.message-file-size { font-size: 11px; color: var(--text-muted); }
.btn-download-file {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-download-file:hover { background:#f3f4f6; }
.btn-download-file svg { width: 16px; height: 16px; }

.message-file-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-input-container {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
}
.chat-paste-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
}
.chat-paste-preview--sending {
  opacity: 0.65;
  pointer-events: none;
}
.chat-paste-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}
.chat-paste-preview-clear {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #64748b;
  padding: 0 4px;
}
.chat-paste-preview-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.chat-paste-item {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
}
.chat-paste-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
  display: block;
}
.chat-paste-file {
  width: 84px;
  height: 84px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-align: center;
  padding: 6px;
  word-break: break-word;
  overflow: hidden;
}
.chat-paste-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  line-height: 18px;
  font-size: 14px;
  padding: 0;
}
.chat-paste-name {
  margin-top: 4px;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-input-wrapper {
  display:flex;
  align-items: flex-end;
  gap: 8px;
}
.btn-attach, .btn-quick-messages, .btn-emoji {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-attach:hover, .btn-quick-messages:hover, .btn-emoji:hover { background: #f3f4f6; }
.btn-attach svg, .btn-quick-messages svg, .btn-emoji svg { width: 18px; height: 18px; }
.message-input-wrapper {
  flex: 1;
  display:flex;
  align-items:flex-end;
  gap: 6px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 6px 8px;
  background: #fff;
}
.message-input {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  font-size: 13px;
  min-height: 24px;
  max-height: 140px;
  line-height: 1.35;
  background: transparent;
  cursor: text;
  position: relative;
  z-index: 1;
  -webkit-user-select: text;
  user-select: text;
}
.chat-quote-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 12px 0;
  padding: 8px 10px;
  background: #f0fdf4;
  border: 0;
  border-left: 4px solid #059669;
  border-radius: 8px;
}
.chat-quote-copy { flex: 1; min-width: 0; }
.chat-quote-author { font-size: 12px; font-weight: 600; color: #059669; }
.chat-quote-bar-text { font-size: 13px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btnCancelQuote {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 4px;
}
.chat-thread-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 12px 0;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.chat-thread-search input { flex: 1; border: 0; outline: none; font-size: 14px; }
.chat-more-menu, .chat-members-panel, .emoji-panel {
  margin: 0 12px;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.emoji-panel { position: absolute; bottom: 46px; right: 8px; width: 220px; z-index: 5; }
.message-input-wrapper { position: relative; }
.emoji-panel button, .chat-more-menu button, .chat-members-panel button {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 6px 8px;
  width: 100%;
  font-size: 14px;
}
.emoji-panel button { width: auto; font-size: 20px; }
.message { position: relative; }
.message-hover-tools {
  display: none;
  position: absolute;
  top: -14px;
  z-index: 5;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 2px 4px;
}
.message.sent .message-hover-tools { right: 8px; }
.message.received .message-hover-tools { left: 8px; }
.message:hover .message-hover-tools,
.message-hover-tools.is-open { display: flex; }
@media (hover: none) {
  .message-hover-tools { display: flex; }
  .message-hover-tools .message-react-bar { display: none; }
  .message-hover-tools.is-open .message-react-bar { display: flex; }
}
.message-react-trigger { display: none; }
.message-react-bar { display: flex; }
.message-react-bar button,
.message-chevron {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 999px;
}
.message-react-bar button:hover,
.message-chevron:hover { background: #f3f4f6; }
.message-context-menu {
  position: absolute;
  top: 32px;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px;
  z-index: 6;
}
.message.sent .message-context-menu { right: 0; }
.message.received .message-context-menu { left: 0; }
.message-context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}
.message-context-menu button:hover { background: #f3f4f6; }
.message-quote {
  border-left: 3px solid #059669;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0 0 4px 0;
}
.message-quote-author { font-size: 12px; font-weight: 600; color: #059669; }
.message-quote-text { font-size: 12px; color: #4b5563; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.message-forwarded { font-size: 12px; font-style: italic; color: #667781; margin-bottom: 2px; }
.message-bubble { position: relative; }
.message-reaction-badge {
  position: absolute;
  left: 6px;
  right: auto;
  top: calc(100% + 16px);
  bottom: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
}
.message.sent .message-reaction-badge {
  left: auto;
  right: 6px;
}
.message:has(.message-reaction-badge) {
  margin-bottom: 26px;
}
.message:has(.message-reaction-badge) .message-footer {
  position: relative;
  z-index: 3;
}
.wa-forward-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wa-forward-modal {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wa-forward-head, .wa-forward-foot {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wa-forward-head { font-weight: 600; border-bottom: 1px solid #e5e7eb; }
.wa-forward-foot { border-top: 1px solid #e5e7eb; }
.wa-forward-search { margin: 8px 14px; }
.wa-forward-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.wa-forward-list { overflow: auto; flex: 1; }
.wa-forward-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  cursor: pointer;
  text-align: left;
}
.wa-forward-row.is-on { background: #f0fdf4; }
.wa-forward-check {
  width: 18px;
  height: 18px;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  flex: 0 0 18px;
}
.wa-forward-row.is-on .wa-forward-check { background: #059669; border-color: #059669; }
.wa-forward-send, .wa-forward-close {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.wa-forward-send { background: #059669; color: #fff; }
.wa-forward-send:disabled { opacity: 0.45; cursor: default; }
.wa-forward-close { background: transparent; color: #374151; }
.whatsapp-formatted-text a { color: #1d4ed8; text-decoration: underline; }
.message-location a, .message-contact a { color: #1d4ed8; }
.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #10b981;
  color: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-send:hover { background: #059669; }
.btn-send svg { width: 18px; height: 18px; }

/* Botón de nota de voz */
.btn-voice-record {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-voice-record:hover { background: #f3f4f6; }
.btn-voice-record.recording {
  background: #fee2e2;
  border-color: #ef4444;
  animation: pulse-recording 1.5s ease-in-out infinite;
}
@keyframes pulse-recording {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.btn-voice-record svg { width: 18px; height: 18px; }

/* Panel de grabación de voz */
.voice-recording-panel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
}
.voice-recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: blink-recording 1s ease-in-out infinite;
}
@keyframes blink-recording {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}
.voice-recording-duration {
  font-weight: 600;
  font-size: 14px;
  color: #991b1b;
  min-width: 36px;
}
.voice-recording-hint {
  font-size: 12px;
  color: #b91c1c;
  flex: 1;
}
.btn-cancel-recording {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #fca5a5;
  background: #fff;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-cancel-recording:hover {
  background: #fee2e2;
}
.btn-cancel-recording svg { width: 14px; height: 14px; }

.btn-send-recording {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-send-recording:hover { background: #059669; }
.btn-send-recording:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-send-recording svg { width: 14px; height: 14px; }

.quick-messages-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 10px;
}
.quick-messages-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  gap: 8px;
}
.quick-messages-header h4 { margin: 0; font-size: 13px; font-weight: 900; }
.btn-close-panel {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-close-panel:hover { background: #f3f4f6; }
.btn-close-panel svg { width: 16px; height: 16px; }
.quick-messages-search { padding: 10px 12px; border-bottom: 1px solid var(--border); position: relative; }
.quick-messages-search-input {
  width: 100%;
  padding: 8px 34px 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  font-size: 13px;
}
.btn-clear-search-quick {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-clear-search-quick:hover { background:#f3f4f6; }
.btn-clear-search-quick svg { width: 16px; height: 16px; }
.quick-messages-list { max-height: 220px; overflow:auto; padding: 8px; }
.quick-message-category { padding: 8px 10px; font-size: 11px; font-weight: 900; color: var(--text-muted); text-transform: uppercase; }
.quick-message-item {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.quick-message-item:hover { background:#f9fafb; }
.quick-message-title { font-weight: 900; font-size: 12px; color: var(--text-primary); }
.quick-message-text { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.quick-message-type-badge {
  display:inline-flex;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-secondary);
}
.btn-use-message {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-use-message:hover { background:#f3f4f6; }

/* ==================== MENSAJES PREDETERMINADOS (MODAL SELECTOR) ==================== */
.quick-picker-modal,
#manageQuickMessagesModal,
#editQuickMessageModal {
  z-index: 12100;
}
.quick-picker-modal .qm-modal-content {
  max-width: 920px;
  width: min(920px, calc(100vw - 28px));
}
.quick-picker-modal .qm-modal-header h3 {
  font-size: 14px;
  font-weight: 950;
}
.qm-modal-body { padding: 14px; }
.qm-toolbar {
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
}
.qm-search { flex: 1; }
.qm-search-input {
  width: 100%;
  border-radius: 12px;
}
.qm-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
  min-height: 420px;
}
.qm-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  padding: 10px;
  max-height: 520px;
}
.qm-category {
  padding: 10px 10px 6px;
  font-size: 11px;
  font-weight: 950;
  color: var(--text-muted);
  text-transform: uppercase;
}
.qm-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.qm-item:hover { background:#f9fafb; }
.qm-item.selected {
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.qm-item-title { font-weight: 950; font-size: 12px; color: var(--text-primary); }
.qm-item-text { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.qm-muted { color: var(--text-muted); }
.qm-item-meta { margin-top: 8px; display:flex; gap: 6px; flex-wrap: wrap; }
.qm-pill {
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 950;
  color: var(--text-secondary);
}
.qm-pill-soft { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.qm-item-action {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
}
.qm-item-action svg { width: 16px; height: 16px; }

.qm-preview {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  padding: 12px;
  max-height: 520px;
}
.qm-preview-empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #fbfbfd;
}
.qm-preview-card { display:flex; flex-direction: column; gap: 10px; }
.qm-preview-title { font-weight: 950; font-size: 13px; }
.qm-preview-meta { display:flex; gap: 6px; flex-wrap: wrap; }
.qm-preview-text {
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
}
.qm-preview-media { border-radius: 14px; overflow: hidden; border: 1px solid var(--border-soft); background:#0b1220; }
.qm-preview-image { width: 100%; max-height: 320px; object-fit: contain; background:#0b1220; display:block; }
.qm-preview-video { width: 100%; max-height: 320px; background:#0b1220; display:block; }
.qm-preview-audio { width: 100%; }
.qm-preview-file { padding: 10px; background: #f1f5f9; border-radius: 12px; }

.qm-modal-footer {
  display:flex;
  justify-content:flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.qm-empty { padding: 16px; color: var(--text-secondary); }
.qm-empty-title { font-weight: 950; color: var(--text-primary); margin-bottom: 4px; }
.qm-empty-actions { margin-top: 10px; }

@media (max-width: 900px) {
  .qm-grid { grid-template-columns: 1fr; }
  .qm-list, .qm-preview { max-height: 44vh; }
}

/* Close button usado en algunos modales del chat */
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { background:#f3f4f6; }

/* ==================== ICONOS (ajustes globales) ==================== */
/* Icono de zoom sobre imágenes (chat y otros módulos) */
.zoom-icon {
  width: 14px !important;
  height: 14px !important;
}

/* Iconos de descarga en overlays (chat/media) */
.btn-download-media svg {
  width: 14px !important;
  height: 14px !important;
}
.btn-download-media {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-download-media:hover {
  background: rgba(0,0,0,0.48);
}

/* ==================== BARRA DE FILTROS (Malla / Eficiencia) ==================== */
.report-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 18px;
}
.report-filters-bar .filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
  min-width: 150px;
}
.report-filters-bar .filter-item--date {
  flex: 0 1 160px;
  min-width: 140px;
}
.report-filters-bar label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.report-filters-bar .form-select,
.report-filters-bar .form-input {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
}

/* Selectores legacy (eficiencia) */
.eficiencia-selectors {
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 18px;
}
.eficiencia-selectors .selectors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.eficiencia-selectors .selectors-row:last-child {
  margin-bottom: 0;
}
.eficiencia-selectors .selector-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 140px;
}
.eficiencia-selectors label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.eficiencia-selectors .form-select,
.eficiencia-selectors .form-input {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
}

/* ==================== KPI CARDS ==================== */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}
.kpi-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.kpi-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
  white-space: nowrap;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

/* ==================== CHARTS ==================== */
.charts-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chart-card h3,
.chart-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 12px 0;
}
.chart-card canvas {
  max-height: 300px;
}

/* ==================== REPORT LOADING ==================== */
.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
}
.report-loading p {
  margin-top: 14px;
  font-size: 14px;
}
.loader-big {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary-color, #3b82f6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== DATA TABLE (Reportes) ==================== */
.table-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}
.table-container h3 {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 12px 0;
}
.table-wrapper {
  overflow-x: auto;
}
.data-table, .report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th, .report-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td, .report-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.data-table tr:hover, .report-table tr:hover {
  background: #f8fafc;
}

/* ==================== EFICIENCIA: Results / Data Section ==================== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.results-header h3 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
}
.results-info {
  font-size: 12px;
  color: #64748b;
}
.data-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}
.data-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 12px 0;
}
.data-table-container {
  overflow-x: auto;
}

/* Efficiency badges */
.efficiency-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.efficiency-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.efficiency-chip.efficiency-high { background: #dcfce7; color: #166534; }
.efficiency-chip.efficiency-medium { background: #fef3c7; color: #92400e; }
.efficiency-chip.efficiency-low { background: #fee2e2; color: #991b1b; }
.efficiency-value { font-weight: 600; }
.efficiency-value.efficiency-high { color: #16a34a; }
.efficiency-value.efficiency-medium { color: #d97706; }
.efficiency-value.efficiency-low { color: #dc2626; }

/* ==================== MÓDULO CEDENTES ==================== */
.cedente-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: 500px;
}
.cedente-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cedente-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.cedente-panel .panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.cedente-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.cedente-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.cedente-item:hover { background: #f1f5f9; }
.cedente-item.active {
  background: #eff6ff;
  border-color: #3b82f6;
}
.cedente-item.inactive { opacity: 0.55; }
.cedente-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cedente-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cedente-item-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-soft { background: rgba(59, 130, 246, 0.12); color: #1e40af; border-color: rgba(59, 130, 246, 0.25); }
.cedente-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}
.btn-icon-sm {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-icon-sm:hover { background: #e2e8f0; }
.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.productos-content {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.row-inactive { opacity: 0.5; }
.actions-cell { white-space: nowrap; }
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}
.loading-small {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #64748b;
  font-size: 13px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 { margin: 0; font-size: 16px; color: #1e293b; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #f1f5f9; color: #334155; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-box.cs-campaign-modal {
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.cs-campaign-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.cs-campaign-modal .cs-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
@media (max-width: 700px) {
  .cs-campaign-modal .cs-form-grid {
    grid-template-columns: 1fr;
  }
}
.cs-req { color: #dc2626; font-weight: 700; }

.cs-monitor-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.cs-monitor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .cs-monitor-split {
    grid-template-columns: 1fr;
  }
}
.cs-monitor-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.cs-monitor-feed {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f8fafc;
  color: #334155;
}
.cs-monitor-feed-line {
  padding: 5px 0;
  border-bottom: 1px solid #e2e8f0;
  line-height: 1.4;
}
.cs-monitor-feed-line:last-child {
  border-bottom: none;
}
.cs-monitor-feed-ts {
  color: #64748b;
  margin-right: 8px;
}
.cs-badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}
.cs-badge-ok {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}

/* Notificación */
.cedente-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.cedente-notification.show { opacity: 1; transform: translateY(0); }
.notif-success { background: #16a34a; }
.notif-error { background: #dc2626; }
.notif-info { background: #2563eb; }

@media (max-width: 768px) {
  .cedente-layout { grid-template-columns: 1fr; }
}

/* ==================== TREE VIEW (Árbol de Gestión) ==================== */
.tree-view { padding: 4px 0; }
.tree-node { margin-bottom: 1px; }
.tree-node--inactive { opacity: 0.45; }
.tree-node-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.12s;
}
.tree-node-row:hover { background: #f1f5f9; }
.tree-toggle {
  width: 18px;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  cursor: default;
  flex-shrink: 0;
  user-select: none;
}
.tree-toggle.has-children { cursor: pointer; color: #3b82f6; }
.tree-toggle.has-children:hover { color: #1d4ed8; }
.tree-node-name {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.tree-node-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}
.tree-node-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.tree-node-row:hover .tree-node-actions { opacity: 1; }

/* ==================== MÓDULO VACÍO (Placeholder) ==================== */
.empty-module-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: #64748b;
}
.empty-module-placeholder .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-module-placeholder h3 {
  font-size: 18px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 8px 0;
}
.empty-module-placeholder p {
  font-size: 14px;
  color: #94a3b8;
  max-width: 400px;
  line-height: 1.5;
  margin: 0;
}

/* ==================== MÓDULO GESTIÓN TABS ==================== */
.module-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  pointer-events: auto;
}
#gestionTabs.module-tabs {
  align-items: center;
  flex-wrap: wrap;
}
#gestionTabs .gestion-tabs-spacer {
  flex: 1;
  min-width: 8px;
  pointer-events: none;
}
.gestion-campana-resumen-nav {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  flex-shrink: 1;
  min-width: 0;
}
.gestion-campana-resumen-nav[hidden] {
  display: none !important;
}
.gestion-campana-resumen-nav.is-loading .gestion-campana-resumen-val {
  opacity: 0.4;
}
.gestion-campana-resumen-inner {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}
.gestion-campana-resumen-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  line-height: 1;
  white-space: nowrap;
}
.gestion-campana-resumen-label {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #94a3b8;
}
.gestion-campana-resumen-val {
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gestion-campana-resumen-chip--clientes .gestion-campana-resumen-val { color: #0d9488; }
.gestion-campana-resumen-chip--gestion .gestion-campana-resumen-val { color: #059669; }
.gestion-campana-resumen-chip--deuda-ini .gestion-campana-resumen-val { color: #7c3aed; }
.gestion-campana-resumen-chip--deuda-tot .gestion-campana-resumen-val { color: #2563eb; }
.gestion-campana-resumen-chip--llamadas .gestion-campana-resumen-label { color: #1d4ed8; }
.gestion-ia-modo-nav {
  flex-shrink: 0;
}
.gestion-ia-modo-chip {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.gestion-ia-modo-chip:hover {
  border-color: #818cf8;
  background: #eef2ff;
}
.gestion-ia-modo-chip.is-on {
  border-color: #4f46e5;
  background: #e0e7ff;
}
.gestion-ia-modo-chip[data-ia-modo="off"].is-on {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.gestion-ia-modo-chip[data-ia-modo="off"].is-on .gestion-campana-resumen-val { color: #64748b; }
.gestion-ia-modo-chip[data-ia-modo="semi"].is-on .gestion-campana-resumen-val { color: #d97706; }
.gestion-ia-modo-chip[data-ia-modo="auto"].is-on .gestion-campana-resumen-val { color: #059669; }
.gestion-detalle-form.is-ia-draft {
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
  border-radius: 8px;
}
@media (max-width: 820px) {
  .gestion-ia-modo-nav .gestion-campana-resumen-inner {
    display: inline-flex;
  }
}
.gestion-resumen-lh-cell.supervision-lh-cell {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0;
  line-height: 1.1;
}
.gestion-resumen-lh-cell .supervision-lh-count {
  font-size: 9px;
  font-weight: 700;
  color: #1e40af;
}
.gestion-resumen-lh-cell .supervision-lh-sep {
  display: inline;
  margin: 0 1px;
  font-size: 8px;
  color: #94a3b8;
  font-weight: 400;
}
.gestion-resumen-lh-cell .supervision-lh-time {
  font-size: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gestion-resumen-lh-cell .supervision-lh-time--cliente { color: #059669; }
.gestion-resumen-lh-cell .supervision-lh-time--otro { color: #64748b; }
@media (max-width: 820px) {
  .gestion-campana-resumen-inner {
    display: none;
  }
  .gestion-campana-resumen-nav::after {
    content: attr(data-mobile-hint);
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 700;
    color: #0d9488;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    white-space: nowrap;
  }
}
.gestion-online-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 6px 12px;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gestion-online-toggle:hover {
  transform: translateY(-1px);
}
.gestion-online-toggle.is-online {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(34, 197, 94, 0.55);
  color: #dcfce7;
}
.gestion-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}
.gestion-online-toggle.is-online .gestion-online-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.28);
}
.gestion-campaign-presence-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  max-width: min(420px, 42vw);
  line-height: 1.35;
  margin-right: 6px;
}
.gestion-campaign-presence-hint[hidden] {
  display: none !important;
}

.gestion-compromisos-hoy-badge[hidden] {
  display: none !important;
}
.gestion-compromisos-hoy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 0 0;
  padding: 6px 12px 6px 10px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(105deg, #bef264 0%, #5eead4 48%, #2dd4bf 100%);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gestion-compromisos-hoy-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}
.gestion-compromisos-hoy-badge:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}
@keyframes gestion-compromisos-hoy-bell-sway {
  0%,
  45%,
  100% {
    transform: rotate(0deg);
  }
  5% {
    transform: rotate(-10deg);
  }
  10% {
    transform: rotate(10deg);
  }
  15% {
    transform: rotate(-7deg);
  }
  20% {
    transform: rotate(7deg);
  }
  25% {
    transform: rotate(0deg);
  }
}
.gestion-compromisos-hoy-badge-bell {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #fff;
  transform-origin: 50% 6px;
  transform-box: fill-box;
}
.gestion-compromisos-hoy-badge:not([hidden]) .gestion-compromisos-hoy-badge-bell {
  animation: gestion-compromisos-hoy-bell-sway 3.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .gestion-compromisos-hoy-badge:not([hidden]) .gestion-compromisos-hoy-badge-bell {
    animation: none;
  }
}
.gestion-compromisos-hoy-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  font-variant-numeric: tabular-nums;
}
.module-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
  pointer-events: auto;
  overflow: hidden;
}
.module-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--primary-color, #3b82f6);
  border-radius: 2px 2px 0 0;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.module-tab:hover {
  color: #475569;
  background: rgba(241, 245, 249, 0.5);
}
.module-tab.active {
  color: #1e40af;
  font-weight: 600;
}
.module-tab.active::after {
  left: 12px;
  right: 12px;
}
.module-tab-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.module-tab:hover .module-tab-icon,
.module-tab.active .module-tab-icon {
  opacity: 1;
}
#gestionTabs .module-tab .module-tab-icon { opacity: 1; }
#gestionTabs .module-tab[data-tab="campanas"] .module-tab-icon { color: #2563eb; }
#gestionTabs .module-tab[data-tab="gestion"] .module-tab-icon { color: #0f766e; }
#gestionTabs .module-tab[data-tab="busqueda"] .module-tab-icon { color: #7c3aed; }
#gestionTabs .module-tab[data-tab="correo"] .module-tab-icon { color: #1d4ed8; }
#gestionTabs .module-tab[data-tab="whatsapp"] .module-tab-icon { color: #128c7e; }
#gestionTabs .module-tab[data-tab="compromisos"] .module-tab-icon { color: #d97706; }
#gestionTabs .module-tab[data-tab="incumplidos"] .module-tab-icon { color: #dc2626; }
#gestionTabs .module-tab[data-tab="llamadas"] .module-tab-icon { color: #0891b2; }
#gestionTabs .module-tab[data-tab="campanas"].active { color: #1d4ed8; }
#gestionTabs .module-tab[data-tab="gestion"].active { color: #0f766e; }
#gestionTabs .module-tab[data-tab="busqueda"].active { color: #6d28d9; }
#gestionTabs .module-tab[data-tab="correo"].active { color: #1d4ed8; }
#gestionTabs .module-tab[data-tab="whatsapp"].active { color: #0f766e; }
#gestionTabs .module-tab[data-tab="compromisos"].active { color: #b45309; }
#gestionTabs .module-tab[data-tab="incumplidos"].active { color: #b91c1c; }
#gestionTabs .module-tab[data-tab="llamadas"].active { color: #0e7490; }
#gestionTabs .module-tab[data-tab="campanas"].active::after { background: #2563eb; }
#gestionTabs .module-tab[data-tab="gestion"].active::after { background: #0f766e; }
#gestionTabs .module-tab[data-tab="busqueda"].active::after { background: #7c3aed; }
#gestionTabs .module-tab[data-tab="correo"].active::after { background: #1d4ed8; }
#gestionTabs .module-tab[data-tab="whatsapp"].active::after { background: #128c7e; }
#gestionTabs .module-tab[data-tab="compromisos"].active::after { background: #d97706; }
#gestionTabs .module-tab[data-tab="incumplidos"].active::after { background: #dc2626; }
#gestionTabs .module-tab[data-tab="llamadas"].active::after { background: #0891b2; }
.gestion-tab-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.gestion-tab-unread[hidden] { display: none !important; }
#gestionTabs .module-tab[data-tab="correo"] .gestion-tab-unread { background: #1d4ed8; }
#gestionTabs .module-tab[data-tab="whatsapp"] .gestion-tab-unread { background: #dc2626; }
@keyframes tab-indicator {
  from { opacity: 0; transform: scaleX(0.5); }
  to { opacity: 1; transform: scaleX(1); }
}
/* Módulo Gestión: contenido más compacto */
#module-gestion .module-content {
  padding: 8px 12px;
  background: linear-gradient(180deg, #fafcfe 0%, #f8fafc 100%);
}
.gestion-tab-content {
  padding: 12px 0;
  animation: gestion-tab-fade 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#tab-gestion {
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.4) 0%, rgba(248, 250, 252, 0.3) 100%);
  padding: 14px 0;
  border-radius: 0 0 10px 10px;
}
/* Solo opacidad: transform rompe position:sticky en descendientes (nuevo containing block) */
@keyframes gestion-tab-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gestion-campana-wrap {
  padding: 8px 0;
}
.gestion-campana-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gestion-campana-group {
  margin: 0;
}
.gestion-campana-select {
  min-width: 180px;
  max-width: 220px;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border: 1px solid var(--border, #e5e7eb) !important;
  border-radius: 6px;
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-secondary, #6b7280);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.gestion-campana-select:hover {
  border-color: rgba(59, 130, 246, 0.35) !important;
  background: var(--bg-primary, #fff);
}
.gestion-campana-select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
  background: var(--bg-primary, #fff);
}

/* Listado cobr_supervisor_view */
.gestion-supervisor-list-wrap {
  /* Espacio vertical fuera de la grilla (pestañas + toolbar listado + paginación, etc.) para max-height del scroll interno */
  --gestion-supervisor-table-chrome: 220px;
  margin-top: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  /* visible: overflow:hidden en el contenedor rompe position:sticky de la cabecera de la tabla */
  overflow: visible;
  background: var(--bg-primary, #fff);
  animation: gestion-tab-fade 0.2s ease-out;
}
.gestion-supervisor-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border-bottom: 1px solid rgba(20, 184, 166, 0.2);
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  flex-wrap: wrap;
}
.gestion-list-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gestion-supervisor-cell-color-lote-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 10px;
  max-width: 340px;
}
.gestion-supervisor-cell-color-lote-toggle {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}
.gestion-supervisor-cell-color-lote-toggle:hover {
  border-color: #94a3b8;
  color: #0f172a;
}
.gestion-supervisor-cell-color-lote-toggle.is-active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}
.gestion-supervisor-cell-color-lote-count {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.gestion-supervisor-cell-color-lote-action {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.gestion-supervisor-cell-color-lote-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.gestion-list-header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.gestion-supervisor-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gestion-clear-filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gestion-clear-filters-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.gestion-clear-filters-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.gestion-clear-filters-btn[hidden] {
  display: none !important;
}
.gestion-list-count {
  font-weight: 400;
  color: #64748b;
  font-size: 12px;
}
.gestion-list-search {
  width: 160px;
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gestion-list-search::placeholder {
  color: #94a3b8;
}
.gestion-list-search:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Callsalientes / Callrecesos (estilo alineado con Gestion) */
#module-callsalientes .cs-panel,
#module-callrecesos .card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
}

#module-callsalientes .cs-panel h2,
#module-callsalientes .cs-panel h3,
#module-callrecesos .card h2 {
  color: #0f172a;
}

#module-callsalientes .fabrica-label,
#module-callrecesos .fabrica-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

#module-callsalientes .form-control,
#module-callrecesos .form-control {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#module-callsalientes .form-control::placeholder,
#module-callrecesos .form-control::placeholder {
  color: #94a3b8;
}

#module-callsalientes .form-control:focus,
#module-callrecesos .form-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#module-callsalientes #csBasePreviewWrap,
#module-callrecesos .table-wrapper {
  margin-top: 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
}

#module-callsalientes #csBasePreviewWrap table,
#module-callrecesos .table-wrapper table {
  margin: 0;
}

#module-callsalientes #csRunMsg,
#module-callsalientes #csBaseMsg,
#module-callsalientes #csIaMsg,
#module-callrecesos #crStateMsg,
#module-callsalientes #csRulesHint {
  font-size: 12px;
  color: #64748b;
}

#module-callsalientes .cs-amd-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  vertical-align: middle;
}
#module-callsalientes .cs-amd-badge--on {
  background: #dcfce7;
  color: #166534;
}
#module-callsalientes .cs-amd-badge--off {
  background: #f1f5f9;
  color: #64748b;
}
#module-callsalientes .cs-amd-badge--meta {
  margin-left: 4px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 600;
}

#module-callsalientes #csKpiTotal,
#module-callsalientes #csKpiProcesados,
#module-callsalientes #csKpiConectadas,
#module-callsalientes #csKpiNoContacto {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

#module-panelagentes .pa-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
#module-panelagentes .pa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
#module-panelagentes .pa-stat {
  text-align: center;
  padding: 10px;
}
#module-panelagentes .pa-stat strong {
  display: block;
  font-size: 22px;
  color: #0f172a;
}
#module-panelagentes .pa-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
#module-panelagentes .pa-badge--ok { background: #dcfce7; color: #166534; }
#module-panelagentes .pa-badge--idle { background: #e0f2fe; color: #075985; }
#module-panelagentes .pa-badge--break { background: #fef3c7; color: #92400e; }
#module-panelagentes .pa-badge--offline { background: #f1f5f9; color: #64748b; }
#module-panelagentes .pa-badge--preview { background: #ede9fe; color: #5b21b6; }
#module-panelagentes .pa-badge--call { background: #fee2e2; color: #991b1b; }

.gestion-preview-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12050;
  max-width: 360px;
  width: calc(100vw - 32px);
}
.gestion-preview-card {
  background: var(--bg-primary, #fff);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 14px;
}
.gestion-preview-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #5b21b6;
}
.gestion-preview-body {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.gestion-preview-script {
  margin-top: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12px;
  max-height: 120px;
  overflow: auto;
}
.gestion-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gestion-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}
.gestion-pagination-info {
  font-size: 11px;
  color: #94a3b8;
}
.gestion-pagination-rows {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gestion-rows-label {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}
.gestion-rows-select {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  min-width: 52px;
}
.gestion-rows-select:hover {
  border-color: #cbd5e1;
}
.gestion-pagination-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gestion-pagination-btn {
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gestion-pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
.gestion-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gestion-pagination-page {
  font-size: 11px;
  color: #64748b;
  min-width: 48px;
  text-align: center;
}
.gestion-supervisor-table-wrap {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--gestion-supervisor-table-chrome, 220px));
  overflow: hidden;
  border-radius: 0 0 6px 6px;
}
/* Barra de scroll horizontal duplicada encima del listado (sincronizada por JS) */
.gestion-supervisor-hscroll-top {
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
  scrollbar-width: thin;
}
.gestion-supervisor-hscroll-top::-webkit-scrollbar {
  height: 10px;
}
.gestion-supervisor-hscroll-top::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.gestion-supervisor-hscroll-top-inner {
  height: 1px;
  pointer-events: none;
}
.gestion-supervisor-table-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.gestion-supervisor-wrap--cell-drag,
.gestion-supervisor-wrap--cell-drag .gestion-supervisor-table {
  user-select: none;
  -webkit-user-select: none;
}
.gestion-supervisor-wrap--cell-drag {
  cursor: cell;
}
.gestion-supervisor-table {
  min-width: 100%;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.gestion-supervisor-table thead th {
  padding: 8px 12px;
  text-align: left;
  background-color: #f1f5f9;
  background-clip: padding-box;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  position: sticky;
  top: 0;
  /* Sticky respecto al área .gestion-supervisor-table-wrap (scroll interno del listado) */
  z-index: 6;
  box-shadow: 0 1px 0 #e2e8f0;
  vertical-align: top !important;
  border-bottom: 1px solid #e2e8f0;
}
.gestion-supervisor-table td {
  position: relative;
  z-index: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.gestion-supervisor-table .gestion-td-trunc {
  cursor: help;
}
.gestion-supervisor-table tbody tr:hover {
  background: #f8fafc;
}
.gestion-td-status {
  text-align: center;
  padding: 8px 12px !important;
}
.gestion-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gestion-status-badge svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.gestion-status-badge:hover {
  transform: scale(1.1);
}
.gestion-status-yes {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}
.gestion-status-yes:hover {
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.5);
}
.gestion-status-no {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}
.gestion-status-no:hover {
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.5);
}
.gestion-supervisor-table-scroll-body.is-fetching tbody {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.gestion-list-loading,
.gestion-list-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
.gestion-list-empty-row {
  padding: 32px 24px !important;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  background: #fafbfc;
}

.gestion-btn-config {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.15s, color 0.15s;
}
.gestion-btn-config:hover {
  background: #f1f5f9;
  color: #334155;
}

.gestion-th-with-content {
  padding-bottom: 6px !important;
}
.gestion-th-label {
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.gestion-th-spacer {
  display: block;
  height: 28px;
}
.gestion-th-sortable {
  cursor: pointer;
  user-select: none;
}
.gestion-th-sortable:hover .gestion-th-label {
  color: #0f172a;
}
.gestion-sort-icon {
  font-size: 10px;
  opacity: 0.7;
}
.gestion-col-filter {
  width: 100%;
  min-width: 60px;
  max-width: 140px;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  display: block;
  box-sizing: border-box;
}
/* Filtro por color de celda (desplegable con muestras, sin hex visible) */
.gestion-col-color-filter-wrap {
  position: relative;
  width: 100%;
  min-width: 60px;
  max-width: 140px;
  margin-top: 4px;
  box-sizing: border-box;
}
.gestion-col-color-filter-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
  color: #334155;
  text-align: left;
}
.gestion-col-color-filter-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.gestion-col-color-filter-btn:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.gestion-col-color-filter-btn-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-sizing: border-box;
}
.gestion-col-color-filter-btn-swatch--all {
  background: conic-gradient(
    from 0deg,
    #ef4444,
    #f97316,
    #eab308,
    #22c55e,
    #3b82f6,
    #a855f7,
    #ef4444
  );
}
.gestion-col-color-filter-btn-swatch--none {
  background: linear-gradient(
    135deg,
    #f1f5f9 45%,
    #94a3b8 45%,
    #94a3b8 55%,
    #f1f5f9 55%
  );
}
.gestion-col-color-filter-btn-caret {
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  flex-shrink: 0;
}
.gestion-col-color-filter-panel {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 2px;
  min-width: 100%;
  width: max-content;
  max-width: min(220px, calc(100vw - 24px));
  max-height: 240px;
  overflow-y: auto;
  margin: 2px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.08);
  z-index: 10045;
  box-sizing: border-box;
}
.gestion-col-color-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
  color: #0f172a;
}
.gestion-col-color-filter-item:hover {
  background: #f1f5f9;
}
.gestion-col-color-filter-item-swatch {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-sizing: border-box;
}
.gestion-col-color-filter-item-swatch--all {
  background: conic-gradient(
    from 0deg,
    #ef4444,
    #f97316,
    #eab308,
    #22c55e,
    #3b82f6,
    #a855f7,
    #ef4444
  );
}
.gestion-col-color-filter-item-swatch--none {
  background: linear-gradient(
    135deg,
    #f1f5f9 45%,
    #94a3b8 45%,
    #94a3b8 55%,
    #f1f5f9 55%
  );
}
.gestion-col-color-filter-item-text--muted {
  color: #64748b;
  font-weight: 500;
}
.gestion-td-cell-colorable {
  position: relative;
  padding-right: 28px !important;
  vertical-align: top;
}
.gestion-td-cell-color-value {
  display: inline;
}
.gestion-td-cell-color-trigger {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(100, 116, 139, 0.45);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.95);
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 0;
  flex-shrink: 0;
}
.gestion-td-cell-color-trigger:hover {
  background: #fff;
  color: #0f172a;
  border-color: #3b82f6;
}
.gestion-td-cell-color-trigger:active {
  transform: scale(0.96);
}
.gestion-td-cell-color-trigger-ico {
  width: 14px;
  height: 14px;
  display: block;
}
.gestion-td-cell-color-selected {
  box-shadow: inset 0 0 0 2px #2563eb;
}
.gestion-supervisor-cell-color-pop {
  display: none;
  position: absolute;
  z-index: 10050;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  background: #fff;
}
.gestion-supervisor-cell-color-pop.is-open {
  display: block;
}
.gestion-supervisor-cell-color-pop-inner {
  padding: 10px 10px 8px;
}
.gestion-supervisor-cell-color-pop-title {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.gestion-supervisor-cell-color-pop-hint {
  margin: 0 0 10px;
  font-size: 10px;
  line-height: 1.45;
  color: #64748b;
}
.gestion-supervisor-cell-color-pop-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gestion-supervisor-cell-color-pop-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.gestion-supervisor-cell-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.gestion-supervisor-cell-color-swatch:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.gestion-supervisor-cell-color-pop-custom-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
}
.gestion-supervisor-cell-color-input {
  width: 32px;
  height: 24px;
  padding: 0;
  border: none;
  cursor: pointer;
}
.gestion-supervisor-cell-color-clear,
.gestion-supervisor-cell-color-clear-sel {
  width: 100%;
  font-size: 11px;
  padding: 6px 8px;
}

.gestion-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.gestion-modal-config {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gestion-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.gestion-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}
.gestion-modal-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}
.gestion-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
}
.gestion-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.gestion-modal-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #64748b;
}
.gestion-dato-icon-clickable {
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.gestion-dato-icon-clickable:hover {
  transform: scale(1.08);
  opacity: 0.95;
}
.gestion-dato-casado-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #16a34a;
  flex-shrink: 0;
}
.gestion-dato-casado-badge svg {
  width: 18px;
  height: 18px;
}
.gestion-dato-nombre-edad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 0 6px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #166534;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  flex-shrink: 0;
}
.gestion-datos-cliente-modal {
  padding: 12px 0;
  min-height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}
.gestion-datos-cliente-modal .gestion-datos-grupo {
  flex-direction: column;
  padding: 0;
  border: none;
  gap: 10px;
  align-items: stretch;
}
.gestion-datos-cliente-modal .gestion-dato-item {
  flex: 0 0 auto;
  min-width: 100%;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  min-height: 48px;
  align-items: center;
}
.gestion-datos-cliente-modal .gestion-dato-value {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: left;
  flex: 1;
  min-width: 0;
}
.gestion-modal-config.gestion-modal-datos-persona {
  min-width: 360px;
  max-width: 480px;
}
.gestion-config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gestion-config-row {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto auto auto minmax(120px, 1.5fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s;
}
.gestion-config-row:active {
  cursor: grabbing;
}
.gestion-config-row.gestion-dragging {
  opacity: 0.6;
  background: #e2e8f0;
}
.gestion-config-row.gestion-drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}
.gestion-config-drag {
  color: #94a3b8;
  font-size: 14px;
  cursor: grab;
  user-select: none;
}
.gestion-config-field {
  font-size: 11px;
  font-family: monospace;
  color: #64748b;
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.gestion-config-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}
.gestion-config-check input {
  margin: 0;
}
.gestion-config-title {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  min-width: 0;
}
.gestion-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  background: #fafbfc;
}

/* Modal Gestión Detalle */
.gestion-modal-detalle {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 640px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.gestion-detalle-body {
  max-height: 60vh;
  overflow-y: auto;
}
/* Formulario de gestión - estilos sutiles */
.gestion-detalle-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.gestion-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 18px;
}
@media (min-width: 420px) {
  .gestion-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.gestion-form-grid .form-group-full,
.gestion-form-grid #gestionArbolCombosContainer {
  grid-column: 1 / -1;
}
.gestion-asistente-ia {
  margin: 0 12px 10px;
  padding: 10px 12px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 55%, #ecfeff 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.gestion-asistente-ia-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #312e81;
  margin-bottom: 6px;
}
.gestion-asistente-ia-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.gestion-asistente-ia.is-live .gestion-asistente-ia-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  animation: gestionAsistentePulse 1.4s ease-in-out infinite;
}
@keyframes gestionAsistentePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.gestion-asistente-ia-status {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.gestion-ia-autoguardar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.gestion-ia-autoguardar input {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
}
.gestion-ia-bubble .gestion-ia-autoguardar {
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
}
.gestion-asistente-ia-frase {
  margin: 0 0 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #a5b4fc;
  border-radius: 6px;
  color: #1e1b4b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.gestion-asistente-ia-suggestion {
  margin: 0 0 4px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}
.gestion-asistente-ia-objecion {
  margin: 0 0 4px;
  font-size: 12px;
  color: #9a3412;
}
.gestion-asistente-ia-pasos {
  margin: 4px 0 6px;
  padding-left: 18px;
  font-size: 12px;
  color: #1e293b;
}
.gestion-asistente-ia-details {
  font-size: 12px;
  color: #475569;
}
.gestion-asistente-ia-transcript {
  max-height: 90px;
  overflow: auto;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
  padding: 6px 8px;
}
.gestion-ia-bubble {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 12000;
  width: min(380px, calc(100vw - 36px));
  max-height: min(52vh, 440px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #6366f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(49, 46, 129, 0.22), 0 0 0 1px rgba(99, 102, 241, 0.12);
  overflow: hidden;
  animation: gestionIaBubbleIn 0.28s ease-out;
}
.gestion-ia-bubble[hidden],
.gestion-ia-bubble-fab[hidden] {
  display: none !important;
}
.gestion-ia-bubble.is-min {
  display: none !important;
}
@keyframes gestionIaBubbleIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.gestion-ia-bubble.is-pop .gestion-ia-bubble-frase {
  animation: gestionIaFrasePop 0.45s ease;
}
@keyframes gestionIaFrasePop {
  0% { transform: scale(0.98); background: #eef2ff; }
  40% { transform: scale(1.02); background: #c7d2fe; }
  100% { transform: none; background: #eef2ff; }
}
.gestion-ia-bubble-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #0ea5e9 100%);
  color: #fff;
  font-size: 13px;
}
.gestion-ia-bubble-head strong {
  font-weight: 700;
  letter-spacing: 0.01em;
}
.gestion-ia-bubble-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}
.gestion-ia-bubble.is-live .gestion-ia-bubble-dot {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.28);
  animation: gestionAsistentePulse 1.4s ease-in-out infinite;
}
.gestion-ia-bubble-status {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.92;
  font-weight: 600;
}
.gestion-ia-bubble-btn {
  border: 0;
  background: rgba(255,255,255,0.16);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.gestion-ia-bubble-btn:hover {
  background: rgba(255,255,255,0.28);
}
.gestion-ia-bubble-body {
  padding: 10px 12px 12px;
  overflow: auto;
}
.gestion-ia-bubble-label {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
}
.gestion-ia-bubble-frase {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  color: #1e1b4b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.gestion-ia-bubble-sug {
  margin: 0 0 8px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}
.gestion-ia-bubble-obj {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}
.gestion-ia-bubble-pasos {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #1e293b;
}
.gestion-ia-bubble-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 12000;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}
.gestion-ia-bubble-fab.is-live {
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.35), 0 8px 24px rgba(79, 70, 229, 0.4);
}
.gestion-tituloscript {
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  line-height: 1.45;
  min-height: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.gestion-tituloscript:empty {
  display: none;
}
.gestion-block-formulario > .gestion-tituloscript {
  margin: 0 0 12px;
}
.gestion-compromiso-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: #f8fdf9;
  border: 1px solid #dcfce7;
  border-radius: 6px;
}
.gestion-compromiso-fields .form-group {
  margin-bottom: 0;
}
.gestion-compromiso-fields .form-group label {
  font-size: 11px;
  font-weight: 500;
  color: #15803d;
}
.gestion-compromiso-fields .form-control {
  border-color: #bbf7d0;
  background: #fff;
}
.gestion-compromiso-fields .form-control:focus {
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}
.gestion-form-grid .form-group {
  margin-bottom: 0;
}
.gestion-form-grid .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 4px;
}
.gestion-form-grid .form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto;
}
.gestion-form-grid .form-control:hover {
  border-color: #cbd5e1;
}
.gestion-form-grid .form-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}
.gestion-form-grid .form-control::placeholder {
  color: #94a3b8;
}
.gestion-form-grid select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.gestion-form-grid textarea.form-control {
  min-height: 60px;
  resize: vertical;
  line-height: 1.4;
}
/* Asegurar que el formulario de gestión sea interactivo (evitar overlays que bloqueen input) */
#gestionDetalleForm,
#gestionDetalleForm .form-group,
#gestionDetalleForm input,
#gestionDetalleForm select,
#gestionDetalleForm textarea,
.gestion-block-formulario .gestion-block-content {
  pointer-events: auto;
}
.gestion-field-required {
  color: #dc2626;
  font-weight: 700;
}
.gestion-td-clickable {
  cursor: pointer;
}
.gestion-td-clickable:hover {
  background: rgba(240, 253, 250, 0.6);
}
.gestion-row-selected,
.gestion-supervisor-table tbody tr.gestion-row-selected td {
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.9) 0%, rgba(204, 251, 241, 0.6) 100%) !important;
  border-left: 3px solid #14b8a6;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.2);
}

.gestion-placeholder {
  padding: 24px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 40%, #f0fdf4 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  text-align: center;
}
.gestion-placeholder-text {
  margin: 0;
  color: #047857;
  font-size: 14px;
}
.gestion-tab-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#module-gestion .module-tab.active {
  color: #0d9488;
}
#module-gestion .module-tab.active::after {
  background: #14b8a6;
}
.gestion-registro-seleccionado {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 8px;
}
.gestion-registro-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
}
.gestion-registro-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 12px;
}
.gestion-registro-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.gestion-registro-label {
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}
.gestion-registro-value {
  color: #1e293b;
  font-weight: 500;
}
.gestion-registro-empty {
  color: #94a3b8;
  font-style: italic;
}
.gestion-block {
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.gestion-block-formulario {
  padding: 16px 18px;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #ffffff 0%, #fafefe 100%);
  border: 1px solid rgba(186, 230, 253, 0.5);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.04);
}
.gestion-block-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.gestion-block-row > * {
  min-width: 0;
}
@media (max-width: 900px) {
  .gestion-block-row {
    grid-template-columns: 1fr;
  }
}
.gestion-block-form-top {
  align-self: stretch;
}
.gestion-block-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.gestion-block-col-right .gestion-block,
.gestion-block-col-right .gestion-tituloscript {
  flex: 1 1 auto;
  min-height: 80px;
}
.gestion-datos-cliente {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 35%, #f8fafc 100%);
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.08);
}
.gestion-datos-grupo {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gestion-dato-abogado {
  margin: 0;
  line-height: 1.25;
  flex: 0 1 auto;
  min-width: 0;
}
.gestion-dato-abogado-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0 0 6px;
  flex-wrap: wrap;
}
.gestion-dato-abogado-text {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.01em;
}
.gestion-btn-tabla-script {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 4px;
  cursor: pointer;
}
.gestion-btn-tabla-script:hover {
  background: #d1fae5;
  color: #115e59;
}
.gestion-btn-gestion-pago {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid rgba(29, 78, 216, 0.35);
  border-radius: 4px;
  cursor: pointer;
}
.gestion-btn-gestion-pago:hover:not(:disabled) {
  background: #dbeafe;
  color: #1e40af;
}
.gestion-btn-gestion-pago:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gestion-modal-gestion-pago {
  max-width: 820px;
  width: min(96vw, 820px);
}
.gestion-pago-wizard-step {
  margin-bottom: 8px;
}
.gestion-pago-wizard-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}
.gestion-pago-wizard-alert-info {
  background: #d9edf7;
  border: 1px solid #bce8f1;
  color: #31708f;
}
.gestion-pago-wizard-alert-success {
  background: #dff0d8;
  border: 1px solid #d6e9c6;
  color: #3c763d;
}
.gestion-pago-wizard-steps-badge {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}
.gestion-pago-wizard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}
.gestion-pago-wizard-badge-primary { background: #337ab7; color: #fff; }
.gestion-pago-wizard-badge-success { background: #5cb85c; color: #fff; }
.gestion-pago-wizard-badge-muted { background: #e0e0e0; color: #555; }
.gestion-pago-wizard-opciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.gestion-pago-wizard-op {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  height: auto;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 5px 10px 5px 6px;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  line-height: 1.2;
  color: #64748b;
  background: #fafbfc;
  border: 1px solid #e8ecf0;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: none;
}
.gestion-pago-wizard-op:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}
.gestion-pago-wizard-op-active {
  background: #f0fdf4;
  border-color: #a7d9b8;
  color: #166534;
  box-shadow: none;
}
.gestion-pago-wizard-op[data-gestion-pago-tipo="refinanciamiento"] .gestion-pago-wizard-op-ico {
  color: #0d9488;
  background: #ecfdf5;
}
.gestion-pago-wizard-op[data-gestion-pago-tipo="liquidacion"] .gestion-pago-wizard-op-ico {
  color: #16a34a;
  background: #f0fdf4;
}
.gestion-pago-wizard-op[data-gestion-pago-tipo="abono"] .gestion-pago-wizard-op-ico {
  color: #2563eb;
  background: #eff6ff;
}
.gestion-pago-wizard-op[data-gestion-pago-tipo="pago_total"] .gestion-pago-wizard-op-ico {
  color: #7c3aed;
  background: #f5f3ff;
}
.gestion-pago-wizard-op-active[data-gestion-pago-tipo="refinanciamiento"] .gestion-pago-wizard-op-ico {
  color: #0f766e;
  background: #ccfbf1;
}
.gestion-pago-wizard-op-active[data-gestion-pago-tipo="liquidacion"] .gestion-pago-wizard-op-ico {
  color: #15803d;
  background: #dcfce7;
}
.gestion-pago-wizard-op-active[data-gestion-pago-tipo="abono"] .gestion-pago-wizard-op-ico {
  color: #1d4ed8;
  background: #dbeafe;
}
.gestion-pago-wizard-op-active[data-gestion-pago-tipo="pago_total"] .gestion-pago-wizard-op-ico {
  color: #6d28d9;
  background: #ede9fe;
}
.gestion-pago-wizard-op-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  transition: background 0.15s ease, color 0.15s ease;
}
.gestion-pago-wizard-op-ico svg {
  width: 15px;
  height: 15px;
  display: block;
}
.gestion-pago-wizard-op-label {
  display: block;
  white-space: nowrap;
}
.gestion-pago-wizard-resumen {
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid #e8ecf0;
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
}
.gestion-pago-wizard-table-wrap {
  overflow-x: auto;
}
.gestion-pago-wizard-capture-field {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 7px 10px;
  line-height: 1.45;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
}
.gestion-pago-wizard-capture-field--group {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.gestion-pago-wizard-capture-field--compact {
  flex: 0 0 auto;
  width: 7.5rem;
  text-align: right;
}
.gestion-pago-wizard-capture-field--compact-pct {
  width: 4rem;
}
.gestion-pago-wizard-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 12px;
  table-layout: auto;
}
.gestion-pago-wizard-table th {
  background: #d9534f;
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 8px;
  border: 1px solid #d43f3a;
}
.gestion-pago-wizard-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  vertical-align: middle;
}
.gestion-pago-wizard-table td:first-child {
  width: 1%;
  white-space: nowrap;
  background: #d9edf7;
  font-weight: 700;
  color: #31708f;
}
.gestion-pago-wizard-field-wide {
  width: 100%;
  max-width: 20rem;
}
.gestion-pago-wizard-table td:last-child {
  width: auto;
  background: #fcf8e3;
}
.gestion-pago-wizard-table--layout-full td:first-child {
  width: 40%;
  white-space: normal;
}
.gestion-pago-wizard-table--layout-full .gestion-pago-wizard-field-wide {
  width: 100%;
  max-width: none;
}
.gestion-pago-wizard-table--layout-full td:last-child > .form-control {
  width: 100%;
}
.gestion-pago-wizard-table--layout-full .gestion-pago-wizard-input-group:not(.gestion-pago-wizard-input-group-compact) {
  width: 100%;
}
.gestion-pago-wizard-input-group {
  display: flex;
  align-items: stretch;
}
.gestion-pago-wizard-input-group-compact {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}
.gestion-pago-wizard-input-group-compact .form-control {
  flex: 0 0 auto;
  width: 7.5rem;
  text-align: right;
}
.gestion-pago-wizard-input-group-compact.gestion-pago-wizard-input-group-pct .form-control {
  width: 4rem;
}
.gestion-pago-wizard-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  background: #eee;
  border: 1px solid #ccc;
  font-size: 12px;
}
.gestion-pago-wizard-input-group .form-control {
  flex: 1;
  min-width: 0;
}
.gestion-pago-wizard-input-group .gestion-pago-wizard-addon:first-child {
  border-right: 0;
  border-radius: 4px 0 0 4px;
}
.gestion-pago-wizard-input-group .gestion-pago-wizard-addon:last-child {
  border-left: 0;
  border-radius: 0 4px 4px 0;
}
.gestion-pago-wizard-input-group .form-control:not(:first-child) {
  border-radius: 0 4px 4px 0;
}
.gestion-pago-wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.gestion-pago-wizard-guardado-ok {
  margin-top: 10px;
  padding: 8px 10px;
  background: #dff0d8;
  border: 1px solid #d6e9c6;
  border-radius: 4px;
  font-size: 13px;
  color: #3c763d;
}
.gestion-pago-wizard-img-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .gestion-pago-wizard-op-label {
    white-space: normal;
  }
}
.gestion-pago-lista-capture-host {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 820px;
  pointer-events: none;
  z-index: -1;
}
.gestion-pago-lista-capture-host.is-capturing {
  left: 0;
  top: 0;
  opacity: 0;
}
.gestion-pago-lista-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.gestion-pago-lista-actions .btn {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.3;
}
.gestion-modal-gestion-pago-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gestion-eficiencia-contactabilidad {
  padding: 4px 0 8px;
}
.gestion-eficiencia-card {
  display: inline-block;
  max-width: 520px;
  width: 100%;
  padding: 14px 16px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.gestion-eficiencia-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.gestion-eficiencia-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
  white-space: nowrap;
}
.gestion-eficiencia-fecha-input {
  width: 132px;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
}
.gestion-eficiencia-btn-refresh {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f766e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.gestion-eficiencia-btn-refresh:hover {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.gestion-eficiencia-loading {
  font-size: 12px;
  color: #94a3b8;
  padding: 8px 0;
}
.gestion-eficiencia-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gestion-eficiencia-kpi {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 70%);
  border: 1px solid rgba(15, 118, 110, 0.16);
}
.gestion-eficiencia-kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #115e59;
  letter-spacing: -0.03em;
}
.gestion-eficiencia-kpi-meta {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}
.gestion-eficiencia-layout {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gestion-eficiencia-chart {
  flex: 0 0 118px;
  width: 118px;
  height: 118px;
}
.gestion-eficiencia-pie {
  width: 118px;
  height: 118px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.08));
}
.gestion-eficiencia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.gestion-eficiencia-table th,
.gestion-eficiencia-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}
.gestion-eficiencia-table th {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gestion-eficiencia-table tbody tr:last-child td { border-bottom: 0; }
.gestion-eficiencia-table td:first-child {
  max-width: 0;
  width: 54%;
  font-weight: 600;
}
.gestion-eficiencia-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: middle;
}
.gestion-eficiencia-table td:nth-child(2),
.gestion-eficiencia-table td:nth-child(3),
.gestion-eficiencia-table th:nth-child(2),
.gestion-eficiencia-table th:nth-child(3) {
  text-align: right;
  width: 23%;
  font-variant-numeric: tabular-nums;
}
.gestion-eficiencia-empty {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 0;
}
.gestion-eficiencia-error {
  color: #b91c1c;
}
.gestion-modal-gestion-pago-tabs {
  margin-bottom: 4px;
}
.gestion-pago-modal-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.gestion-pago-modal-tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.gestion-modal-gestion-pago-panel {
  min-height: 120px;
}
.gestion-modal-tabla-script {
  max-width: 560px;
}
.gestion-tabla-script-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gestion-tabla-script-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.gestion-tabla-script-row:last-child {
  border-bottom: none;
}
.gestion-tabla-script-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gestion-tabla-script-value {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}
.gestion-tabla-script-empty {
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
}
.gestion-datos-grupo-persona {
  padding: 6px 0;
  border-bottom: 1px solid rgba(20, 184, 166, 0.15);
}
.gestion-datos-grupo-operacion {
  padding: 6px 0;
}
.gestion-datos-grupo-valneg {
  padding: 8px 0;
  border-top: 1px solid rgba(20, 184, 166, 0.15);
}
.gestion-valneg-wrap {
  width: 100%;
  max-width: 220px;
}
.gestion-valneg-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #134e4a;
}
.gestion-valneg-input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}
.gestion-valneg-input::placeholder {
  color: #94a3b8;
}
.gestion-dato-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  border: 1px solid rgba(20, 184, 166, 0.12);
  box-shadow: 0 1px 2px rgba(20, 184, 166, 0.06);
  flex: 1 1 0;
  min-width: 0;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.gestion-dato-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
/* Variantes de color por tipo de dato (sutiles) */
.gestion-dato--cedula { border-color: rgba(99, 102, 241, 0.25); background: rgba(238, 242, 255, 0.9); }
.gestion-dato--cedula:hover { border-color: rgba(99, 102, 241, 0.4); }
.gestion-dato--cedula .gestion-dato-icon { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.gestion-dato--cedula .gestion-dato-label { color: #4338ca; }
.gestion-dato--cedula .gestion-dato-value { color: #3730a3; }

.gestion-dato--nombre { border-color: rgba(34, 197, 94, 0.25); background: rgba(240, 253, 244, 0.9); }
.gestion-dato--nombre:hover { border-color: rgba(34, 197, 94, 0.4); }
.gestion-dato--nombre .gestion-dato-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.gestion-dato--nombre .gestion-dato-label { color: #15803d; }
.gestion-dato--nombre .gestion-dato-value { color: #166534; }

.gestion-dato--operacion { border-color: rgba(234, 179, 8, 0.25); background: rgba(254, 252, 232, 0.9); }
.gestion-dato--operacion:hover { border-color: rgba(234, 179, 8, 0.4); }
.gestion-dato--operacion .gestion-dato-icon { background: linear-gradient(135deg, #eab308, #ca8a04); }
.gestion-dato--operacion .gestion-dato-label { color: #a16207; }
.gestion-dato--operacion .gestion-dato-value { color: #854d0e; }
.gestion-dato-operacion-clickable {
  cursor: pointer;
}
.gestion-dato-operacion-clickable:focus {
  outline: 2px solid rgba(202, 138, 4, 0.45);
  outline-offset: 2px;
}

/* Overlay modal detalle duda */
.gestion-modal-overlay--detalle-op {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.38);
}

/* Animación apertura / cierre del modal Detalle duda */
#gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op {
  opacity: 0;
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 0.32s ease,
    -webkit-backdrop-filter 0.32s ease;
}
#gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open {
  opacity: 1;
}
#gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op .gestion-modal-detalle-operacion {
  transform: scale(0.94) translateY(22px);
  opacity: 0;
  filter: blur(4px);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.34s ease,
    filter 0.34s ease;
}
#gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open .gestion-modal-detalle-operacion {
  transform: scale(1) translateY(0);
  opacity: 1;
  filter: blur(0);
}

@keyframes gestion-detalle-op-reveal-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-detalle-op-table-shell-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes gestion-detalle-op-title-ico-in {
  from {
    transform: scale(0.88) rotate(-8deg);
    opacity: 0.75;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}
@keyframes gestion-detalle-op-tfoot-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#gestionModalDetalleOperacionContent.gestion-detalle-op-reveal {
  animation: gestion-detalle-op-reveal-in 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#gestionModalDetalleOperacionContent.gestion-detalle-op-reveal .gestion-modal-detalle-operacion-table-shell {
  animation: gestion-detalle-op-table-shell-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.07s both;
}
#gestionModalDetalleOperacionContent.gestion-detalle-op-reveal .gestion-detalle-op-tfoot {
  animation: gestion-detalle-op-tfoot-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

#gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open .gestion-modal-detalle-operacion-title-ico {
  animation: gestion-detalle-op-title-ico-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

@media (prefers-reduced-motion: reduce) {
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op,
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op .gestion-modal-detalle-operacion {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  #gestionModalDetalleOperacionContent.gestion-detalle-op-reveal,
  #gestionModalDetalleOperacionContent.gestion-detalle-op-reveal .gestion-modal-detalle-operacion-table-shell,
  #gestionModalDetalleOperacionContent.gestion-detalle-op-reveal .gestion-detalle-op-tfoot,
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open .gestion-modal-detalle-operacion-title-ico {
    animation: none !important;
  }
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op .gestion-modal-detalle-operacion,
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open .gestion-modal-detalle-operacion {
    filter: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  #gestionModalDetalleOperacion.gestion-modal-overlay--detalle-op.gestion-modal-detalle-op--open {
    opacity: 1 !important;
  }
}

/* Modal «Detalle duda» — contenedor */
.gestion-modal-config.gestion-modal-detalle-operacion {
  --detalle-accent: #0f766e;
  --detalle-accent-muted: #5eead4;
  --detalle-surface: #f4f9f8;
  --detalle-line: rgba(15, 23, 42, 0.08);
  --detalle-text: #334155;
  --detalle-text-soft: #64748b;
  max-width: min(1120px, 96vw);
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--detalle-line);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 48px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 rgba(15, 118, 110, 0.05) inset;
  background: linear-gradient(165deg, #ffffff 0%, #f8fcfb 48%, #f0fdfa 100%);
}
.gestion-modal-detalle-operacion > .gestion-modal-detalle-operacion-header {
  padding: 16px 20px 16px 22px;
  background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 120%);
  border-bottom: 1px solid rgba(15, 118, 110, 0.1);
  gap: 12px;
}
.gestion-modal-detalle-operacion-h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.25;
}
.gestion-modal-detalle-operacion-title-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #0d9488 0%, #0f766e 45%, #115e59 100%);
  color: #ecfeff;
  box-shadow:
    0 2px 8px rgba(15, 118, 110, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}
.gestion-modal-detalle-operacion-title-ico svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.gestion-modal-detalle-operacion-title-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gestion-modal-detalle-operacion-title-text::after {
  content: 'Vista de cuotas y montos';
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--detalle-text-soft);
  text-transform: none;
}
.gestion-modal-detalle-operacion .gestion-modal-detalle-operacion-close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--detalle-text-soft);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.gestion-modal-detalle-operacion-close-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.gestion-modal-detalle-operacion .gestion-modal-detalle-operacion-close:hover {
  background: rgba(15, 118, 110, 0.12);
  color: var(--detalle-accent);
  transform: scale(1.04);
}

.gestion-modal-detalle-operacion-body {
  padding: 18px 22px 24px;
  background: var(--detalle-surface);
}

/* Tarjetas estado (carga / vacío / error / info) */
.gestion-detalle-op-state-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--detalle-line);
  background: #fff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  max-width: 520px;
  margin: 0 auto;
}
.gestion-detalle-op-state-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.gestion-detalle-op-state-card--loading .gestion-detalle-op-state-card-icon {
  background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
  color: #0f766e;
}
.gestion-detalle-op-state-card--error .gestion-detalle-op-state-card-icon {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #b91c1c;
}
.gestion-detalle-op-state-card--empty .gestion-detalle-op-state-card-icon {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #64748b;
}
.gestion-detalle-op-state-card--info .gestion-detalle-op-state-card-icon {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  color: #0e7490;
}
.gestion-detalle-op-svg {
  width: 22px;
  height: 22px;
  display: block;
}
.gestion-detalle-op-state-card-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--detalle-text);
  padding-top: 2px;
}
.gestion-detalle-op-state-card--error .gestion-detalle-op-state-card-text {
  color: #7f1d1d;
}
.gestion-detalle-op-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(15, 118, 110, 0.2);
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: gestion-detalle-op-spin 0.65s linear infinite;
  display: block;
}
@keyframes gestion-detalle-op-spin {
  to { transform: rotate(360deg); }
}

/* Contenedor tabla con acento */
.gestion-modal-detalle-operacion-table-shell {
  position: relative;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.22) 0%, rgba(15, 118, 110, 0.06) 40%, rgba(15, 23, 42, 0.04) 100%);
  box-shadow: 0 8px 30px rgba(15, 118, 110, 0.06);
}
.gestion-modal-detalle-operacion-scroll {
  overflow: auto;
  max-height: min(62vh, 580px);
  border-radius: 13px;
  border: none;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* Tabla dentro del modal */
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table {
  margin: 0;
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 0;
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table thead th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--detalle-text-soft);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--detalle-line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--detalle-line);
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  color: #1e293b;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.55);
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table tbody tr:hover td {
  background: rgba(204, 251, 241, 0.35);
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table tbody tr:last-child td {
  border-bottom-color: transparent;
}

/* Columna vacía para la etiqueta «Total» (no cruza con la primera columna de datos) */
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table th.gestion-detalle-op-th-sum-spacer,
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table td.gestion-detalle-op-td-sum-spacer {
  width: 1%;
  min-width: 4.25rem;
  max-width: 6rem;
  padding: 9px 10px;
  border-right: 1px solid var(--detalle-line);
  background: transparent;
  box-shadow: none;
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table thead th.gestion-detalle-op-th-sum-spacer {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.gestion-modal-detalle-operacion-scroll .gestion-detalle-op-table tbody td.gestion-detalle-op-td-sum-spacer {
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
}

/* Pie sumatorias */
.gestion-detalle-op-table tfoot.gestion-detalle-op-tfoot td {
  padding: 11px 14px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.92) 0%, rgba(236, 253, 245, 0.98) 100%);
  border-top: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 -4px 12px rgba(15, 118, 110, 0.04);
  color: #0f172a;
  font-size: 12px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.gestion-detalle-op-table tfoot.gestion-detalle-op-tfoot td strong {
  font-weight: 600;
  color: #0f766e;
  letter-spacing: 0.02em;
}
.gestion-detalle-op-table tfoot.gestion-detalle-op-tfoot td.gestion-detalle-op-tfoot-sum-label {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: normal;
  border-right: 1px solid rgba(15, 118, 110, 0.18);
  color: #0f172a;
  vertical-align: middle;
}
.gestion-detalle-op-tfoot-label-inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.gestion-detalle-op-tfoot-sum-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}
.gestion-detalle-op-tfoot-sum-ico .gestion-detalle-op-svg {
  width: 15px;
  height: 15px;
}
.gestion-detalle-op-table tfoot.gestion-detalle-op-tfoot td.gestion-detalle-op-tfoot-sum-label strong {
  color: #0f172a;
  font-weight: 600;
}
.gestion-detalle-op-sum-cell strong {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(204, 251, 241, 0.95) 0%, rgba(167, 243, 208, 0.45) 100%);
  border: 1px solid rgba(15, 118, 110, 0.15);
  font-weight: 600;
  color: #0f766e;
  font-variant-numeric: tabular-nums;
}

/* Loading / vacío dentro del modal detalle */
#gestionModalDetalleOperacion .gestion-modal-hint {
  color: var(--detalle-text-soft);
  line-height: 1.55;
}
#gestionModalDetalleOperacion .gestion-datos-adicc-loading {
  padding: 28px 20px;
  font-size: 13px;
  color: var(--detalle-text-soft);
}

.gestion-dato--valor { border-color: rgba(20, 184, 166, 0.25); background: rgba(240, 253, 250, 0.9); }
.gestion-dato--valor:hover { border-color: rgba(20, 184, 166, 0.4); }
.gestion-dato--valor .gestion-dato-icon { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.gestion-dato--valor .gestion-dato-label { color: #0f766e; }
.gestion-dato--valor .gestion-dato-value { color: #134e4a; }

.gestion-dato--descuento { border-color: rgba(168, 85, 247, 0.25); background: rgba(250, 245, 255, 0.9); }
.gestion-dato--descuento:hover { border-color: rgba(168, 85, 247, 0.4); }
.gestion-dato--descuento .gestion-dato-icon { background: linear-gradient(135deg, #a855f7, #9333ea); }
.gestion-dato--descuento .gestion-dato-label { color: #7e22ce; }
.gestion-dato--descuento .gestion-dato-value { color: #581c87; }

.gestion-dato--cedente { border-color: rgba(249, 115, 22, 0.25); background: rgba(255, 247, 237, 0.9); }
.gestion-dato--cedente:hover { border-color: rgba(249, 115, 22, 0.4); }
.gestion-dato--cedente .gestion-dato-icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.gestion-dato--cedente .gestion-dato-label { color: #c2410c; }
.gestion-dato--cedente .gestion-dato-value { color: #9a3412; }

.gestion-dato--campana { border-color: rgba(168, 85, 247, 0.25); background: rgba(250, 245, 255, 0.9); }
.gestion-dato--campana:hover { border-color: rgba(168, 85, 247, 0.4); }
.gestion-dato--campana .gestion-dato-icon { background: linear-gradient(135deg, #a855f7, #9333ea); }
.gestion-dato--campana .gestion-dato-label { color: #7e22ce; }
.gestion-dato--campana .gestion-dato-value { color: #6b21a8; }

.gestion-dato--dias { border-color: rgba(236, 72, 153, 0.25); background: rgba(253, 242, 248, 0.9); }
.gestion-dato--dias:hover { border-color: rgba(236, 72, 153, 0.4); }
.gestion-dato--dias .gestion-dato-icon { background: linear-gradient(135deg, #ec4899, #db2777); }
.gestion-dato--dias .gestion-dato-label { color: #be185d; }
.gestion-dato--dias .gestion-dato-value { color: #9d174d; }

.gestion-dato--sexo { border-color: rgba(59, 130, 246, 0.25); background: rgba(239, 246, 255, 0.9); }
.gestion-dato--sexo:hover { border-color: rgba(59, 130, 246, 0.4); }
.gestion-dato--sexo .gestion-dato-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gestion-dato--sexo .gestion-dato-label { color: #1d4ed8; }
.gestion-dato--sexo .gestion-dato-value { color: #1e40af; }

.gestion-dato--edad { border-color: rgba(6, 182, 212, 0.25); background: rgba(236, 254, 255, 0.9); }
.gestion-dato--edad:hover { border-color: rgba(6, 182, 212, 0.4); }
.gestion-dato--edad .gestion-dato-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.gestion-dato--edad .gestion-dato-label { color: #0e7490; }
.gestion-dato--edad .gestion-dato-value { color: #155e75; }

.gestion-dato--estadoCivil { border-color: rgba(139, 92, 246, 0.25); background: rgba(245, 243, 255, 0.9); }
.gestion-dato--estadoCivil:hover { border-color: rgba(139, 92, 246, 0.4); }
.gestion-dato--estadoCivil .gestion-dato-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.gestion-dato--estadoCivil .gestion-dato-label { color: #6d28d9; }
.gestion-dato--estadoCivil .gestion-dato-value { color: #5b21b6; }

.gestion-dato--profesion { border-color: rgba(245, 158, 11, 0.25); background: rgba(255, 251, 235, 0.9); }
.gestion-dato--profesion:hover { border-color: rgba(245, 158, 11, 0.4); }
.gestion-dato--profesion .gestion-dato-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.gestion-dato--profesion .gestion-dato-label { color: #b45309; }
.gestion-dato--profesion .gestion-dato-value { color: #92400e; }

.gestion-dato--nivelEst { border-color: rgba(34, 211, 238, 0.25); background: rgba(236, 254, 255, 0.9); }
.gestion-dato--nivelEst:hover { border-color: rgba(34, 211, 238, 0.4); }
.gestion-dato--nivelEst .gestion-dato-icon { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.gestion-dato--nivelEst .gestion-dato-label { color: #0891b2; }
.gestion-dato--nivelEst .gestion-dato-value { color: #0e7490; }

.gestion-dato-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  color: #fff;
}
.gestion-dato-icon svg {
  width: 14px;
  height: 14px;
}
.gestion-dato-label {
  color: #0f766e;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gestion-dato-value {
  color: #134e4a;
  font-weight: 600;
  margin-left: auto;
  font-size: 13px;
  word-break: break-word;
  text-align: right;
}

/* En pantallas pequeñas: título arriba, dato abajo */
@media (max-width: 900px) {
  .gestion-datos-cliente .gestion-dato-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 120px;
  }
  .gestion-datos-cliente .gestion-dato-item .gestion-dato-value {
    margin-left: 0;
    text-align: left;
  }
}
.gestion-block-tab2 {
  min-width: 0;
}
.gestion-telefonos-cobr-wrap {
  min-height: 72px;
}
.gestion-telefonos-cobr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.gestion-tel-cobr-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #5a716d;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1),
    box-shadow 0.22s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.gestion-tel-cobr-toolbar-btn:hover {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.92);
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: 0 3px 12px rgba(15, 118, 110, 0.09);
  transform: translateY(-1px);
}
.gestion-tel-cobr-toolbar-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.06);
  transition-duration: 0.12s;
}
.gestion-tel-cobr-toolbar-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(13, 148, 136, 0.68);
}
.gestion-tel-cobr-toolbar-ico svg {
  width: 11px;
  height: 11px;
  display: block;
  transition: transform 0.32s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.gestion-tel-cobr-toolbar-btn:hover .gestion-tel-cobr-toolbar-ico {
  color: #0d9488;
}
.gestion-tel-cobr-toolbar-btn:hover .gestion-tel-cobr-toolbar-ico svg {
  transform: scale(1.15) rotate(90deg);
}
.gestion-tel-cobr-col-acciones {
  width: 1%;
  white-space: nowrap;
}
.gestion-tel-cobr-col-msv {
  width: 3.5rem;
  text-align: center;
}
.gestion-tel-cobr-td-msv {
  text-align: center;
  vertical-align: middle;
}
.gestion-tel-cobr-td-msv--na {
  color: #94a3b8;
  font-size: 11px;
}
.gestion-tel-cobr-msv-check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.gestion-tel-cobr-msv-check {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: #0d9488;
}
.gestion-tel-cobr-msv-check:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.gestion-tel-cobr-actions {
  white-space: nowrap;
  vertical-align: middle;
}
.gestion-tel-cobr-btn-dup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #6b7f89;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.16);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.gestion-tel-cobr-btn-dup:hover {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.45);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}
.gestion-tel-cobr-btn-dup:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.1s;
}
.gestion-tel-cobr-btn-dup-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(13, 148, 136, 0.65);
}
.gestion-tel-cobr-btn-dup:hover .gestion-tel-cobr-btn-dup-ico {
  color: #0d9488;
}
.gestion-tel-cobr-btn-dup-ico .gestion-tel-cobr-svg-pencil,
.gestion-tel-cobr-btn-dup-ico svg {
  width: 12px;
  height: 12px;
  display: block;
  transition: transform 0.32s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.gestion-tel-cobr-btn-dup:hover .gestion-tel-cobr-btn-dup-ico svg {
  transform: rotate(-14deg) translate(1px, -2px);
}
.gestion-tel-cobr-btn-dup:active .gestion-tel-cobr-btn-dup-ico svg {
  transform: rotate(0deg) scale(0.88);
}
.gestion-tel-cobr-btn-dup-label {
  line-height: 1;
  opacity: 0.92;
}
@media (prefers-reduced-motion: reduce) {
  .gestion-tel-cobr-toolbar-btn,
  .gestion-tel-cobr-toolbar-ico svg,
  .gestion-tel-cobr-btn-dup,
  .gestion-tel-cobr-btn-dup-ico svg {
    transition: none !important;
  }
  .gestion-tel-cobr-toolbar-btn:hover,
  .gestion-tel-cobr-toolbar-btn:active,
  .gestion-tel-cobr-btn-dup:hover,
  .gestion-tel-cobr-btn-dup:active {
    transform: none;
  }
  .gestion-tel-cobr-toolbar-btn:hover .gestion-tel-cobr-toolbar-ico svg,
  .gestion-tel-cobr-btn-dup:hover .gestion-tel-cobr-btn-dup-ico svg,
  .gestion-tel-cobr-btn-dup:active .gestion-tel-cobr-btn-dup-ico svg {
    transform: none;
  }
  .gestion-tel-cobr-icon-btn {
    transition: none !important;
  }
  .gestion-tel-cobr-draft-save:hover,
  .gestion-tel-cobr-draft-save:active,
  .gestion-tel-cobr-draft-cancel:hover,
  .gestion-tel-cobr-draft-cancel:active {
    transform: none;
  }
  .gestion-tel-cobr-sp-call,
  .gestion-tel-cobr-sp-call:hover,
  .gestion-tel-cobr-sp-call:active {
    transition: none !important;
    transform: none;
  }
}
.gestion-phone-marcar-prompt {
  position: fixed;
  z-index: 10050;
  display: none;
  max-width: min(320px, calc(100vw - 16px));
}
.gestion-phone-marcar-prompt-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  color: #0f172a;
}
.gestion-phone-marcar-prompt-text {
  flex: 1 1 100%;
  font-weight: 600;
}
.gestion-phone-marcar-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gestion-phone-marcar-btn--yes {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
}
.gestion-phone-marcar-btn--yes:hover {
  filter: brightness(1.05);
}
.gestion-phone-marcar-btn--no {
  background: #f1f5f9;
  color: #475569;
}
.gestion-phone-marcar-btn--no:hover {
  background: #e2e8f0;
}
.gestion-tel-cobr-placeholder-cell {
  padding: 14px 12px !important;
  font-size: 12px;
  color: #64748b;
  text-align: center;
  background: rgba(248, 250, 252, 0.8);
}
.gestion-tel-cobr-draft td {
  background: rgba(254, 252, 232, 0.45);
  vertical-align: middle;
}
.gestion-tel-cobr-activo-saved,
.gestion-tel-cobr-activo-select {
  font-size: 12px;
  padding: 6px 10px;
  max-width: 140px;
}
.gestion-tel-cobr-draft .gestion-tel-cobr-input,
.gestion-tel-cobr-draft .gestion-tel-cobr-select {
  font-size: 12px;
  padding: 6px 8px;
  width: 100%;
  max-width: 220px;
  box-sizing: border-box;
}
.gestion-tel-cobr-draft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.gestion-tel-cobr-icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.35, 0.64, 1),
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.gestion-tel-cobr-icon-btn svg {
  width: 12px;
  height: 12px;
  display: block;
  pointer-events: none;
}
.gestion-tel-cobr-draft-save {
  background: linear-gradient(165deg, #2dd4bf 0%, #0d9488 100%);
  color: #f0fdfa;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.32);
}
.gestion-tel-cobr-draft-save:hover {
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
  transform: translateY(-1px) scale(1.04);
}
.gestion-tel-cobr-draft-save:active {
  transform: translateY(0) scale(0.94);
}
.gestion-tel-cobr-draft-cancel {
  background: rgba(255, 255, 255, 0.92);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.gestion-tel-cobr-draft-cancel:hover {
  color: #64748b;
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
  transform: translateY(-1px);
}
.gestion-tel-cobr-draft-cancel:active {
  transform: scale(0.92);
}
.gestion-tel-cobr-row-saved td {
  vertical-align: middle;
}
.gestion-tel-cobr-col-call {
  width: 1%;
  padding: 10px 4px 10px 8px !important;
}
.gestion-tel-cobr-td-call {
  vertical-align: middle;
  text-align: center;
  width: 1%;
  padding: 6px 4px !important;
}
.gestion-tel-cobr-td-call--draft {
  background: transparent;
}
.gestion-tel-cobr-sp-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #059669;
  background: rgba(16, 185, 129, 0.11);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.35, 0.64, 1),
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.gestion-tel-cobr-sp-call:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #047857;
  transform: scale(1.07);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.22);
}
.gestion-tel-cobr-sp-call:active {
  transform: scale(0.93);
}
.gestion-tel-cobr-sp-call:focus-visible {
  outline: 2px solid rgba(5, 150, 105, 0.4);
  outline-offset: 2px;
}
.gestion-tel-cobr-sp-call-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gestion-tel-cobr-sp-call-ico svg {
  width: 13px;
  height: 13px;
  display: block;
}
.gestion-tel-cobr-td-num {
  vertical-align: middle;
}
.gestion-tel-cobr-num-use {
  display: inline;
  max-width: 100%;
  margin: 0;
  padding: 1px 2px;
  font: inherit;
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  color: #0f766e;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  line-height: inherit;
  transition: color 0.15s ease, background 0.15s ease;
}
.gestion-tel-cobr-num-use:hover {
  color: #0d9488;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  background: rgba(204, 251, 241, 0.35);
}
.gestion-tel-cobr-num-use:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.45);
  outline-offset: 1px;
}
.gestion-tel-cobr-num-use:active {
  color: #115e59;
}
.gestion-telefonos-cobr-scroll {
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(20, 184, 166, 0.15);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.gestion-telefonos-cobr-table {
  margin: 0;
  font-size: 12px;
}
.gestion-telefonos-cobr-table th,
.gestion-telefonos-cobr-table td {
  padding: 8px 12px;
}
.gestion-telefonos-cobr-empty {
  margin: 10px 0 0;
  font-size: 12px;
  color: #64748b;
}
.gestion-pagos-wrap {
  min-height: 48px;
}
.gestion-pagos-meta {
  margin: 0 0 8px;
  font-size: 11px;
  color: #64748b;
}
.gestion-pagos-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(20, 184, 166, 0.15);
  border-radius: 10px;
  background: #fff;
}
.gestion-pagos-table {
  margin: 0;
  font-size: 12px;
}
.gestion-pagos-th-lead,
.gestion-pagos-td-lead {
  width: 0;
  min-width: 5.5rem;
  padding-left: 10px;
  padding-right: 8px;
  border-right: 1px solid transparent;
}
.gestion-pagos-total-label {
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
  color: #0f766e;
}
.gestion-pagos-tfoot td {
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
  border-top: 2px solid rgba(20, 184, 166, 0.25);
}
.gestion-documento-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.gestion-documento-meta span {
  white-space: nowrap;
}
.gestion-documento-form-grid {
  margin: 0;
}
.gestion-documento-file-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
.gestion-documento-file-link {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}
.gestion-documento-file-link:hover {
  text-decoration: underline;
}
.gestion-modal-documento {
  max-width: 520px;
  width: calc(100% - 24px);
}
#gestionDocumentosWrap .gestion-pagos-scroll {
  max-height: 280px;
}
.gestion-documentos-table {
  margin: 0;
  font-size: 9px;
  line-height: 1.2;
  width: 100%;
  table-layout: fixed;
}
.gestion-documentos-table th,
.gestion-documentos-table td {
  padding: 3px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.gestion-documentos-table .gestion-pagos-th-lead,
.gestion-documentos-table .gestion-pagos-td-lead {
  width: 0.3rem;
  min-width: 0.3rem;
  padding-left: 2px;
  padding-right: 1px;
}
.gestion-documentos-table .gestion-documento-file-link {
  font-size: 9px;
  font-weight: 600;
}
.gestion-documentos-table .gestion-pagos-tfoot td {
  padding: 3px 4px;
  font-size: 9px;
}
.gestion-pagos-sum {
  text-align: right;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.gestion-mail-cobr-table {
  margin: 0;
  font-size: 12px;
}
.gestion-mail-cobr-td-mail {
  max-width: 220px;
  word-break: break-all;
}
.gestion-mail-cobr-use {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #0d9488;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gestion-mail-cobr-use:hover {
  color: #0f766e;
}

/* Tab Búsqueda (módulo Gestión) */
@keyframes gestion-busqueda-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes gestion-busqueda-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes gestion-busqueda-results-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-busqueda-row-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes gestion-busqueda-list-shell {
  from {
    opacity: 0;
    transform: translateY(16px);
    box-shadow: 0 0 0 rgba(217, 119, 6, 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    box-shadow:
      0 8px 32px rgba(15, 23, 42, 0.08),
      0 0 0 1px rgba(251, 191, 36, 0.22);
  }
}
@keyframes gestion-busqueda-thead-slide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-busqueda-spin {
  to { transform: rotate(360deg); }
}
.gestion-busqueda-wrap {
  padding: 6px 0 18px;
  max-width: 100%;
}
.gestion-busqueda-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background:
    radial-gradient(900px 240px at 10% -40%, rgba(253, 224, 71, 0.45), transparent 55%),
    radial-gradient(600px 200px at 100% 0%, rgba(251, 146, 60, 0.12), transparent 50%),
    linear-gradient(165deg, #fffbeb 0%, #fef3c7 38%, #fff 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 8px 28px rgba(180, 83, 9, 0.08),
    0 2px 8px rgba(15, 23, 42, 0.04);
}
.gestion-busqueda-card--enter {
  animation: gestion-busqueda-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gestion-busqueda-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(125deg, transparent 40%, rgba(255, 255, 255, 0.22) 48%, transparent 56%);
  background-size: 200% 100%;
  animation: gestion-busqueda-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.42;
  border-radius: inherit;
}
@keyframes gestion-busqueda-shimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}
.gestion-busqueda-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 10px;
  position: relative;
  z-index: 1;
}
.gestion-busqueda-head-ico {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #b45309;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(254, 243, 199, 0.85));
  box-shadow:
    0 2px 8px rgba(180, 83, 9, 0.12),
    0 0 0 1px rgba(251, 191, 36, 0.35);
  animation: gestion-busqueda-icon-float 3.2s ease-in-out infinite;
}
.gestion-busqueda-head-ico svg {
  width: 26px;
  height: 26px;
}
.gestion-busqueda-head-text {
  min-width: 0;
}
.gestion-busqueda-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #78350f;
}
.gestion-busqueda-sub {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #92400e;
  opacity: 0.92;
}
.gestion-busqueda-toolbar {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  padding: 8px 18px 16px;
}
.gestion-busqueda-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gestion-busqueda-field-tipo {
  flex: 0 0 auto;
  width: 200px;
  max-width: 100%;
}
.gestion-busqueda-field-criterio {
  flex: 0 1 260px;
  width: 260px;
  max-width: 100%;
  min-width: 180px;
}
@media (max-width: 640px) {
  .gestion-busqueda-field-tipo,
  .gestion-busqueda-field-criterio {
    flex: 1 1 100%;
    width: 100%;
  }
}
.gestion-busqueda-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gestion-busqueda-label-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}
.gestion-busqueda-control {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gestion-busqueda-control:focus-within {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(180, 83, 9, 0.1);
}
.gestion-busqueda-select {
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  background: rgba(255, 255, 255, 0.92);
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.gestion-busqueda-select:hover {
  border-color: rgba(217, 119, 6, 0.45);
  background: #fff;
}
.gestion-busqueda-input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease;
}
.gestion-busqueda-input-shell:hover {
  border-color: rgba(217, 119, 6, 0.4);
}
.gestion-busqueda-input-shell:focus-within {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 0 6px 16px rgba(180, 83, 9, 0.08);
  transform: translateY(-1px);
}
.gestion-busqueda-input-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #b45309;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.25s ease;
}
.gestion-busqueda-input-shell:focus-within .gestion-busqueda-input-ico {
  opacity: 1;
  transform: scale(1.06);
}
.gestion-busqueda-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  padding: 8px 4px 8px 0;
  border: none;
  background: transparent;
  outline: none;
  box-shadow: none;
}
.gestion-busqueda-input::placeholder {
  color: #a8a29e;
}
.gestion-busqueda-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-end;
  margin-bottom: 1px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, #ea580c 0%, #d97706 45%, #ca8a04 100%);
  box-shadow:
    0 2px 0 rgba(154, 52, 18, 0.35),
    0 8px 20px rgba(234, 88, 12, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}
.gestion-busqueda-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 3px 0 rgba(154, 52, 18, 0.35),
    0 12px 28px rgba(234, 88, 12, 0.35);
}
.gestion-busqueda-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(154, 52, 18, 0.45), 0 4px 12px rgba(234, 88, 12, 0.2);
}
.gestion-busqueda-btn-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.gestion-busqueda-hint--rich {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin: 14px 4px 0;
}
.gestion-busqueda-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 11px;
  line-height: 1.35;
  color: #57534e;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(214, 211, 209, 0.9);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: gestion-busqueda-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.gestion-busqueda-hint-pill:nth-child(2) {
  animation-delay: 0.2s;
}
.gestion-busqueda-hint-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}
.gestion-busqueda-hint-pill svg {
  flex-shrink: 0;
  color: #d97706;
  opacity: 0.9;
}
.gestion-busqueda-results {
  margin-top: 16px;
}
.gestion-busqueda-results-panel {
  animation: gestion-busqueda-results-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gestion-busqueda-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 4px;
  padding: 12px 14px;
  font-size: 13px;
  color: #57534e;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(231, 229, 228, 0.95);
  animation: gestion-busqueda-results-in 0.35s ease both;
}
.gestion-busqueda-msg-ico {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}
.gestion-busqueda-msg--warn {
  color: #92400e;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(254, 243, 199, 0.35);
}
.gestion-busqueda-msg--err {
  color: #991b1b;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(254, 226, 226, 0.35);
}
.gestion-busqueda-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 4px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #78350f;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(217, 119, 6, 0.4);
  animation: gestion-busqueda-results-in 0.35s ease both;
}
.gestion-busqueda-spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.35);
  border-top-color: #d97706;
  animation: gestion-busqueda-spin 0.7s linear infinite;
}
.gestion-busqueda-scroll {
  position: relative;
  overflow: auto;
  max-height: min(68vh, 720px);
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 251, 235, 0.45) 48%, rgba(254, 249, 231, 0.35) 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.45) rgba(254, 243, 199, 0.35);
}
.gestion-busqueda-scroll::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.gestion-busqueda-scroll::-webkit-scrollbar-track {
  background: rgba(254, 243, 199, 0.25);
  border-radius: 8px;
}
.gestion-busqueda-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.75), rgba(217, 119, 6, 0.65));
  border-radius: 8px;
}
.gestion-busqueda-scroll--enter {
  animation: gestion-busqueda-list-shell 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gestion-busqueda-scroll--enter::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 0.7;
  animation: gestion-busqueda-scroll-edge 4s ease-in-out 0.65s infinite alternate;
}
@keyframes gestion-busqueda-scroll-edge {
  from { opacity: 0.45; }
  to { opacity: 0.9; }
}
.gestion-busqueda-table {
  margin: 0;
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.gestion-busqueda-table.gestion-datos-adicc-table th,
.gestion-busqueda-table.gestion-datos-adicc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(254, 243, 199, 0.85);
  vertical-align: middle;
}
.gestion-busqueda-thead {
  animation: gestion-busqueda-thead-slide 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}
.gestion-busqueda-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #78350f 0%, #92400e 96%) !important;
  color: #fffbeb !important;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 2px solid rgba(251, 191, 36, 0.65) !important;
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.15);
}
.gestion-busqueda-table thead th:first-child {
  border-top-left-radius: 12px;
}
.gestion-busqueda-table thead th:last-child {
  border-top-right-radius: 12px;
}
.gestion-busqueda-th-text {
  display: inline-block;
  transition: transform 0.2s ease;
}
.gestion-busqueda-table thead th:hover .gestion-busqueda-th-text {
  transform: translateY(-1px);
}
.gestion-busqueda-th--num,
.gestion-busqueda-td-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.gestion-busqueda-tbody tr {
  animation: gestion-busqueda-row-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}
.gestion-busqueda-table tbody tr:nth-child(even) td {
  background: rgba(254, 249, 231, 0.55);
}
.gestion-busqueda-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.55);
}
.gestion-busqueda-td-cedula {
  font-weight: 700;
  color: #78350f;
  letter-spacing: 0.02em;
}
.gestion-busqueda-td-cuenta {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 12.5px;
  color: #0f766e;
}
.gestion-busqueda-td-nombre {
  font-weight: 600;
  color: #1e293b;
  max-width: 220px;
}
.gestion-busqueda-td-muted {
  color: #64748b;
  font-size: 12.5px;
}
.gestion-busqueda-pill-camp {
  display: inline-block;
  max-width: 200px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.95), rgba(253, 230, 138, 0.55));
  border: 1px solid rgba(251, 191, 36, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gestion-busqueda-data-row:hover .gestion-busqueda-pill-camp {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
.gestion-busqueda-td-deuda {
  font-weight: 600;
  color: #b45309;
}
.gestion-busqueda-row-click {
  cursor: pointer;
}
.gestion-busqueda-table tbody tr.gestion-busqueda-row-click:hover td {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(254, 243, 199, 0.38)) !important;
  box-shadow: none;
}
.gestion-busqueda-table tbody tr.gestion-busqueda-row-click:hover {
  box-shadow: inset 4px 0 0 0 #d97706;
}
.gestion-busqueda-table tbody tr.gestion-busqueda-row-click:active td {
  background: rgba(253, 230, 138, 0.42) !important;
}
.gestion-busqueda-row-click:focus-visible {
  outline: none;
}
.gestion-busqueda-table tbody tr.gestion-busqueda-row-click:focus-visible td {
  background: rgba(254, 249, 231, 0.95) !important;
  box-shadow: inset 0 0 0 2px #d97706;
}
.gestion-busqueda-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}
.gestion-busqueda-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/* Tab Compromisos (módulo Gestión) */
@keyframes gestion-compromisos-intro-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-compromisos-dt-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-compromisos-thead-in {
  from {
    opacity: 0.85;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-compromisos-row-fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gestion-compromisos-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes gestion-compromisos-ico-pulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}
.gestion-compromisos-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 18px;
}
.gestion-compromisos-intro {
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  background:
    radial-gradient(720px 180px at 0% -30%, rgba(204, 251, 241, 0.65), transparent 55%),
    linear-gradient(165deg, #f0fdfa 0%, #ecfeff 40%, #fff 100%);
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
}
.gestion-compromisos-intro--enter {
  animation: gestion-compromisos-intro-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gestion-compromisos-intro-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 8px;
}
.gestion-compromisos-intro-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #0f766e;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(204, 251, 241, 0.5));
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.12), 0 0 0 1px rgba(45, 212, 191, 0.25);
}
.gestion-compromisos-intro-ico svg {
  width: 24px;
  height: 24px;
  animation: gestion-compromisos-ico-pulse 3s ease-in-out infinite;
}
.gestion-compromisos-intro-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #115e59;
}
.gestion-compromisos-intro-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: #0f766e;
  opacity: 0.88;
  line-height: 1.35;
}
.gestion-compromisos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  padding: 4px 16px 14px;
}
.gestion-compromisos-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.gestion-compromisos-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f766e;
}
.gestion-compromisos-label-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.88;
}
.gestion-compromisos-input {
  min-width: 10rem;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gestion-compromisos-input:hover {
  border-color: rgba(13, 148, 136, 0.45);
}
.gestion-compromisos-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.22);
}
.gestion-compromisos-filtrar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-end;
  margin-bottom: 1px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
  box-shadow: 0 2px 0 rgba(15, 118, 110, 0.35), 0 6px 18px rgba(13, 148, 136, 0.25);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.gestion-compromisos-filtrar-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 3px 0 rgba(15, 118, 110, 0.35), 0 10px 24px rgba(13, 148, 136, 0.28);
}
.gestion-compromisos-filtrar-btn:active {
  transform: translateY(0);
}
.gestion-compromisos-filtrar-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.gestion-compromisos-export-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  margin-bottom: 1px;
}
.gestion-compromisos-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 118, 110, 0.12);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.gestion-compromisos-export-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f0fdfa;
  border-color: rgba(13, 148, 136, 0.55);
}
.gestion-compromisos-export-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.gestion-compromisos-export-btn--xlsx {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.28);
}
.gestion-compromisos-export-btn--xlsx:hover:not(:disabled) {
  background: #f0fdf4;
  border-color: rgba(22, 101, 52, 0.45);
}
.gestion-compromisos-export-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.gestion-compromisos-mini-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 0 16px 14px;
}
.gestion-compromisos-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(153, 246, 228, 0.65);
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: gestion-compromisos-intro-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.gestion-compromisos-chip:nth-child(2) {
  animation-delay: 0.25s;
}
.gestion-compromisos-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.1);
}
.gestion-compromisos-chip svg {
  color: #0d9488;
  flex-shrink: 0;
}
.gestion-compromisos-hint {
  font-size: 12px;
  color: #64748b;
  align-self: center;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(100, 116, 139, 0.25);
  max-width: min(320px, 100%);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.gestion-compromisos-table-wrap {
  min-height: 120px;
}
/* Barra tipo DataTables (length + Buscar) */
.gestion-compromisos-dt-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  border: 1px solid rgba(20, 184, 166, 0.2);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
.gestion-compromisos-dt-wrapper--enter {
  animation: gestion-compromisos-dt-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gestion-compromisos-dt-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(240, 253, 250, 0.95) 0%, rgba(236, 254, 255, 0.75) 100%);
  border-bottom: 1px solid rgba(153, 246, 228, 0.65);
  font-size: 13px;
  color: #334155;
}
.gestion-compromisos-dt-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #0d9488;
  opacity: 0.88;
}
.gestion-compromisos-dt-label-with-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gestion-compromisos-dt-suffix {
  color: #64748b;
  font-size: 12px;
}
.gestion-compromisos-dt-length label,
.gestion-compromisos-dt-filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}
.gestion-compromisos-dt-len-select {
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  min-width: 4.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gestion-compromisos-dt-len-select:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.22);
}
.gestion-compromisos-dt-filter {
  margin-left: auto;
}
.gestion-compromisos-dt-filter-label {
  white-space: nowrap;
}
.gestion-compromisos-dt-filter label {
  flex-wrap: wrap;
}
.gestion-compromisos-dt-search-input {
  display: inline-block;
  margin-left: 2px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  min-width: 11rem;
  width: min(20rem, 100%);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gestion-compromisos-dt-search-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.gestion-compromisos-dt-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  background: linear-gradient(180deg, #fff 0%, rgba(240, 253, 250, 0.35) 100%);
  font-size: 14px;
  font-weight: 500;
  color: #115e59;
}
.gestion-compromisos-spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(45, 212, 191, 0.3);
  border-top-color: #0d9488;
  animation: gestion-compromisos-spin 0.65s linear infinite;
}
.gestion-compromisos-dt-wrapper .gestion-compromisos-scroll {
  border: none;
  border-radius: 0;
  max-height: min(70vh, 560px);
}
.gestion-compromisos-dt-wrapper .gestion-compromisos-empty {
  margin: 0;
}
.gestion-compromisos-dt-wrapper .gestion-compromisos-pagination {
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  margin-top: 0;
  border-radius: 0;
}
.gestion-compromisos-trunc-notice {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  color: #92400e;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  border-bottom: 1px solid rgba(251, 191, 36, 0.5);
}
.gestion-compromisos-empty {
  margin: 12px 0;
  color: #64748b;
  font-size: 13px;
}
.gestion-compromisos-empty--callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 18px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.85);
}
.gestion-compromisos-empty--err {
  background: rgba(254, 242, 242, 0.55);
  color: #991b1b;
}
.gestion-compromisos-empty-ico {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: #0d9488;
}
.gestion-compromisos-empty--err .gestion-compromisos-empty-ico {
  color: #dc2626;
}
.gestion-compromisos-scroll {
  max-height: min(70vh, 560px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 148, 136, 0.4) rgba(240, 253, 250, 0.5);
}
.gestion-compromisos-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.gestion-compromisos-scroll::-webkit-scrollbar-thumb {
  background: rgba(13, 148, 136, 0.4);
  border-radius: 8px;
}
.gestion-compromisos-thead {
  animation: gestion-compromisos-thead-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.gestion-compromisos-table {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}
.gestion-compromisos-tbody tr.gestion-compromisos-animate-row {
  animation: gestion-compromisos-row-fade 0.38s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.gestion-compromisos-table.gestion-datos-adicc-table tbody tr:hover td {
  background: rgba(240, 253, 250, 0.55);
}
.gestion-compromisos-table.gestion-datos-adicc-table tbody tr.gestion-compromisos-row--vence-hoy:hover td {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(94, 234, 212, 0.11) 100%);
}
.gestion-compromisos-td-nav {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: background 0.18s ease;
}
.gestion-compromisos-td-nav:hover {
  background: rgba(59, 130, 246, 0.07);
}
.gestion-compromisos-td-nav:focus-visible {
  outline: 2px solid var(--primary-color, #3b82f6);
  outline-offset: -2px;
}
.gestion-compromisos-table tbody tr.gestion-compromisos-row--vence-hoy {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14) 0%, rgba(94, 234, 212, 0.08) 100%);
  box-shadow: inset 3px 0 0 0 #10b981;
}
.gestion-compromisos-table tbody tr.gestion-compromisos-row--vence-hoy:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(94, 234, 212, 0.11) 100%);
}

.gestion-compromisos-table tbody tr.gestion-compromisos-row--sin-pago {
  background: rgba(239, 68, 68, 0.06);
  box-shadow: inset 3px 0 0 0 #ef4444;
}

.gestion-compromisos-table tbody tr.gestion-compromisos-row--sin-pago:hover {
  background: rgba(239, 68, 68, 0.1);
}

.gestion-incumplidos-intro-ico {
  color: #dc2626;
}

.gestion-compromisos-table th,
.gestion-compromisos-table td {
  padding: 8px 10px;
  vertical-align: top;
  transition: background 0.18s ease;
}
.gestion-compromisos-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #f0fdfa 0%, #e2e8f0 100%) !important;
  color: #134e4a !important;
  font-weight: 600;
  border-bottom: 2px solid rgba(45, 212, 191, 0.4) !important;
  transition: filter 0.18s ease, background 0.18s ease;
}
.gestion-compromisos-th-sort:hover {
  filter: brightness(1.03);
  background: linear-gradient(180deg, #ccfbf1 0%, #dbeafe 100%) !important;
}
.gestion-compromisos-th-sort:focus {
  outline: 2px solid #14b8a6;
  outline-offset: -2px;
}
.gestion-compromisos-sort-ind {
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.95;
  vertical-align: middle;
}
.gestion-compromisos-sort-ind--idle {
  opacity: 0.35;
}
.gestion-compromisos-td-semaforo {
  text-align: center;
  vertical-align: middle;
}
.gestion-compromisos-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gestion-compromisos-semaforo {
  display: inline-block;
  min-width: 2.25rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gestion-compromisos-td-semaforo:hover .gestion-compromisos-semaforo {
  transform: scale(1.04);
}
.gestion-compromisos-semaforo--ok {
  background: #22c55e;
  color: #14532d;
  border: 1px solid #16a34a;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}
.gestion-compromisos-semaforo--no {
  background: #fecaca;
  color: #991b1b;
  border: 1px solid #ef4444;
}
.gestion-compromisos-semaforo--na {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}
.gestion-compromisos-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, #f8fafc 0%, #f0fdfa 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
}
.gestion-compromisos-pag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gestion-compromisos-pag-btn:not(:disabled):hover {
  transform: translateY(-1px);
}
.gestion-compromisos-pag-btn:not(:disabled):active {
  transform: translateY(0);
}
.gestion-compromisos-pag-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.gestion-compromisos-pag-meta {
  font-size: 12px;
  color: #475569;
  flex: 1;
  min-width: 12rem;
}
.gestion-compromisos-pag-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gestion-mail-cobr-draft .gestion-mail-cobr-input,
.gestion-mail-cobr-draft .gestion-mail-cobr-select {
  font-size: 12px;
  padding: 6px 10px;
}
.gestion-subtabs {
  display: flex;
  gap: 1px;
  margin-bottom: 8px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.8) 0%, rgba(241, 245, 249, 0.6) 100%);
  border-radius: 6px;
  width: fit-content;
  border: 1px solid rgba(20, 184, 166, 0.12);
}
.gestion-subtab {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 500;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.gestion-subtab:hover {
  color: #0d9488;
  background: rgba(255, 255, 255, 0.9);
}
.gestion-subtab.active {
  background: linear-gradient(135deg, #fff 0%, #f0fdfa 100%);
  color: #0f766e;
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.12);
}
.gestion-subcontent {
  display: none !important;
  font-size: 13px;
  color: #64748b;
  animation: gestion-subcontent-fade 0.25s ease;
}
.gestion-subcontent.active {
  display: block !important;
}
.gestion-block-tab2 > .gestion-subtabs {
  flex-wrap: wrap;
  width: auto;
  max-width: 100%;
}
#gestionTabCorreoHost #module-correo,
#gestionTabCorreoHost #module-correo.module,
#gestionTabCorreoHost #module-correo.module.active {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  z-index: auto !important;
}
#gestionTabCorreoHost .mail-app {
  height: calc(100vh - 210px);
  min-height: 480px;
}
#gestionTabWhatsappHost {
  height: calc(100vh - 132px);
  min-height: 560px;
}
#gestionTabWhatsappHost #module-chat,
#gestionTabWhatsappHost #module-chat.module.active {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 560px !important;
  z-index: auto !important;
  display: flex !important;
  flex-direction: column;
}
#gestionTabWhatsappHost .chat-container {
  height: 100%;
  max-height: none;
  min-height: 0;
}
#gestionChatHost {
  position: relative;
  height: 380px;
  max-height: 380px;
  overflow: hidden;
}
#gestionChatHost #module-chat,
#gestionChatHost #module-chat.module.active {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 380px !important;
  max-height: 380px !important;
  min-height: 0 !important;
  z-index: auto !important;
  display: flex !important;
}
#gestionChatHost .chat-container {
  height: 100%;
  min-height: 0;
  max-height: 380px;
}
#gestionChatHost .chat-sidebar {
  width: 210px;
  flex: 0 0 210px;
  min-height: 0;
  overflow: hidden;
}
#gestionChatHost .chat-header {
  padding: 6px 8px;
}
#gestionChatHost .chat-header h3 {
  font-size: 13px;
}
#gestionChatHost .session-selector {
  padding: 6px 8px;
  gap: 0;
}
#gestionChatHost .session-profile-card,
#gestionChatHost .chat-filter-tabs {
  display: none !important;
}
#gestionChatHost .chats-list-stack {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#gestionChatHost .chats-list {
  overflow-y: auto;
  max-height: none;
}
#gestionChatHost .chat-item {
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
}
#gestionChatHost .chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
#gestionChatHost .chat-name-actions,
#gestionChatHost .chat-meta {
  display: none !important;
}
#gestionChatHost .chat-name-wrapper {
  display: block;
}
#gestionChatHost .chat-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-all;
}
#gestionChatHost .chat-last-message {
  margin-top: 1px;
  font-size: 11px;
}
#gestionChatHost .contact-details h4 {
  font-size: 14px;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-all;
}
#gestionChatHost .chat-item.gestion-wa-off {
  background: #f1f5f9;
  opacity: 0.72;
  filter: grayscale(1);
  cursor: not-allowed;
}
#gestionChatHost .chat-item.gestion-wa-off .chat-name,
#gestionChatHost .chat-item.gestion-wa-off .chat-last-message {
  color: #94a3b8;
}
#gestionChatHost .chat-item.gestion-wa-pending {
  cursor: progress;
}
#gestionChatHost .message {
  position: relative;
  overflow: visible;
}
#gestionChatHost .message.sent { padding-left: 30px; }
#gestionChatHost .message.received { padding-right: 30px; }
#gestionChatHost .message-bubble {
  display: block;
  position: relative;
  z-index: 1;
}
#gestionChatHost .btn-delete-msg {
  display: none;
}
#gestionChatHost .message:hover .btn-delete-msg {
  display: inline;
  position: static;
  opacity: 1;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
}
#gestionChatHost .message-hover-tools {
  display: none;
  position: static;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
#gestionChatHost .message:hover .message-hover-tools,
#gestionChatHost .message-hover-tools.is-open,
#gestionChatHost .message-hover-tools.react-open {
  display: contents;
}
#gestionChatHost .message-chevron {
  position: absolute;
  top: 1px;
  z-index: 8;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #3b4a54;
  font-size: 11px;
  line-height: 16px;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}
#gestionChatHost .message.sent .message-chevron { right: 2px; left: auto; }
#gestionChatHost .message.received .message-chevron { left: 2px; right: auto; }
#gestionChatHost .message:hover .message-bubble { padding-right: 16px; }
#gestionChatHost .message.received:hover .message-bubble {
  padding-right: 10px;
  padding-left: 16px;
}
#gestionChatHost .message-react-trigger {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #54656f;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.16);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
  pointer-events: auto;
}
#gestionChatHost .message-react-trigger svg { width: 15px; height: 15px; pointer-events: none; }
#gestionChatHost .message:hover .message-react-trigger,
#gestionChatHost .message-hover-tools.react-open .message-react-trigger {
  display: flex;
}
#gestionChatHost .message.sent .message-react-trigger { left: 4px; right: auto; }
#gestionChatHost .message.received .message-react-trigger { right: 4px; left: auto; }
#gestionChatHost .message-react-bar {
  display: none !important;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 2px 4px;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.12);
  z-index: 7;
}
#gestionChatHost .message.sent .message-react-bar { right: calc(100% + 30px); left: auto; }
#gestionChatHost .message.received .message-react-bar { left: calc(100% + 30px); right: auto; }
#gestionChatHost .message-hover-tools.react-open .message-react-bar { display: flex !important; }
#gestionChatHost .message-context-menu {
  position: absolute;
  top: 18px;
  bottom: auto;
  right: 0;
  left: auto;
  z-index: 40;
}
#gestionChatHost .message.received .message-context-menu {
  left: 0;
  right: auto;
}
.gestion-wa-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gestion-wa-toolbar label {
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
}
.gestion-wa-toolbar select {
  flex: 1;
  min-width: 0;
}
.gestion-wa-body {
  display: grid;
  grid-template-columns: minmax(140px, 34%) minmax(0, 1fr);
  gap: 8px;
  min-height: 360px;
}
.gestion-wa-contacts {
  overflow: auto;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  background: #f8fafc;
  max-height: 420px;
}
.gestion-wa-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.gestion-wa-contact.is-active {
  background: #ecfdf5;
}
.gestion-wa-contact-num {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.gestion-wa-contact-preview {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.gestion-wa-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 360px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.gestion-wa-thread-head {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
  border-bottom: 1px solid #e2e8f0;
}
.gestion-wa-messages {
  flex: 1;
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f0fdf4;
  min-height: 220px;
  max-height: 320px;
}
.gestion-wa-msg {
  align-self: flex-start;
  max-width: 85%;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.gestion-wa-msg.is-mine {
  align-self: flex-end;
  background: #dcfce7;
  border-color: #bbf7d0;
}
.gestion-wa-compose {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid #e2e8f0;
}
.gestion-wa-compose textarea {
  flex: 1;
  min-width: 0;
  resize: vertical;
  font-size: 13px;
}
.gestion-wa-empty {
  margin: 8px;
  font-size: 12px;
  color: #64748b;
}
@keyframes gestion-subcontent-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gestion-listado-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Listado «Gestiones» (tab 3): tabla con scroll horizontal + vertical */
.gestion-block-tab3 .gestion-listado-container.gestion-tab3-listado-root {
  max-height: min(42vh, 420px);
  overflow: auto;
  padding: 0;
  display: block;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.gestion-tab3-table-scroll {
  min-width: 1240px;
}
.gestion-tab3-col-hms {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gestion-tab3-contacto-titular {
  color: #0f766e;
  font-weight: 600;
}
.gestion-tab3-respuesta-tip {
  cursor: help;
  border-bottom: 1px dotted rgba(100, 116, 139, 0.45);
}
.gestion-arbol-respuesta-tooltip {
  position: fixed;
  z-index: 10080;
  max-width: min(360px, calc(100vw - 20px));
  max-height: min(260px, 45vh);
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  color: #0f172a;
  background: #fff;
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
}
.gestion-tab3-gestiones-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  color: #334155;
}
.gestion-tab3-gestiones-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  text-align: left;
  font-weight: 650;
  color: #0f766e;
  background: linear-gradient(180deg, #f0fdfa 0%, #ecfdf5 100%);
  border-bottom: 2px solid rgba(20, 184, 166, 0.35);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}
.gestion-tab3-gestiones-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  line-height: 1.35;
}
.gestion-tab3-gestiones-table tbody tr.gestion-tab3-gestiones-row {
  background: #fff;
  animation: gestion-tab3-row-in 0.28s ease both;
}
.gestion-tab3-gestiones-table tbody tr.gestion-tab3-gestiones-row:nth-child(even) {
  background: #fafefd;
}
.gestion-tab3-gestiones-table tbody tr.gestion-tab3-gestiones-row:hover {
  background: #f0fdfa;
}
.gestion-mejor-gestion-wrap {
  margin-bottom: 12px;
}
.gestion-mejor-gestion-loading,
.gestion-mejor-gestion-empty {
  font-size: 12px;
  color: #64748b;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}
.gestion-mejor-gestion-panel {
  border: 1px solid rgba(202, 138, 4, 0.45);
  border-radius: 10px;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 28%);
  overflow: hidden;
}
.gestion-mejor-gestion-title {
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  color: #92400e;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid rgba(202, 138, 4, 0.25);
}
.gestion-mejor-gestion-table {
  box-shadow: none;
}
.gestion-masivas-footnote {
  margin: 8px 4px 0;
  font-size: 11px;
  color: #64748b;
}

/* Constructor de módulos (fabrica) */
.fabrica-modulos-wrap .fabrica-lista-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}
.fabrica-lista-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.fabrica-lista-toolbar--wrap {
  width: 100%;
}
.fabrica-lista-search {
  flex: 1;
  min-width: 180px;
  max-width: 420px;
}
.fabrica-input-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #0f172a);
}
.fabrica-input-search::placeholder {
  color: var(--text-secondary, #94a3b8);
}
.fabrica-sort-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fabrica-select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
  min-width: 220px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #0f172a);
}
.fabrica-table-wrap {
  overflow-x: auto;
}
.fabrica-modulos-table .fabrica-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fabrica-modulos-table .fabrica-btn-subir,
.fabrica-modulos-table .fabrica-btn-bajar {
  min-width: 36px;
  font-weight: 700;
}
.fabrica-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary, #475569);
}

.fabrica-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.5);
}
.fabrica-modal-dialog {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 20px 22px;
  margin: 0;
}

.fabrica-submenus-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.fabrica-checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.fabrica-modulo-grupo td {
  background: var(--bg-secondary, #f1f5f9);
  padding: 10px 12px !important;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
}
.fabrica-lista-pagination {
  display: flex;
}
@keyframes gestion-tab3-row-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.gestion-tab3-col-fecha {
  white-space: nowrap;
  color: #0f766e;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gestion-tab3-col-detalle {
  max-width: 220px;
  word-break: break-word;
}
.gestion-tab3-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gestion-tab3-cell-empty {
  color: #cbd5e1;
  font-weight: 500;
}
.gestion-tab3-gestiones-table .gestion-tab3-trunc {
  cursor: help;
  border-bottom: 1px dotted rgba(100, 116, 139, 0.4);
}
.gestion-listado-container {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 4px 0;
  scrollbar-gutter: stable;
}
.gestion-listado-container::-webkit-scrollbar {
  width: 8px;
}
.gestion-listado-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.gestion-listado-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  border-radius: 4px;
}
.gestion-listado-container::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
.gestion-listado-card {
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 30%, #f8fafc 100%);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-left: 3px solid #14b8a6;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: gestion-card-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.gestion-listado-card:hover {
  transform: translateX(3px) translateY(0);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.4);
}
@keyframes gestion-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.gestion-listado-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gestion-listado-detalle {
  color: #334155;
  line-height: 1.45;
  font-size: 12px;
}
.gestion-listado-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  color: #64748b;
}
.gestion-listado-meta span {
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(240, 253, 250, 0.9);
  border-radius: 4px;
  font-weight: 500;
  color: #0f766e;
}
.gestion-listado-loading {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  animation: gestion-loading-pulse 1.2s ease-in-out infinite;
}
@keyframes gestion-loading-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.gestion-listado-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
}
.gestion-listado-vermas {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}
.gestion-listado-vermas:hover:not(:disabled) {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.gestion-listado-vermas:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.gestion-block-formulario .gestion-form-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.gestion-form-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: #1e293b;
}
.gestion-form-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gestion-form-section {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.gestion-form-section.form-group-full {
  grid-column: 1 / -1;
}
.gestion-section-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}
/* Fila: Datos del cliente (tab1) */
.gestion-nav-and-tab1-row {
  margin-bottom: 12px;
}

/* Navegación entre registros en tab Gestión */
.gestion-nav-registros {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 10px;
  margin-bottom: 8px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 6px;
}
.gestion-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  min-width: 24px;
  height: 24px;
  font-size: 0;
  color: #64748b;
  background: transparent;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 4px;
  cursor: pointer;
}
.gestion-nav-btn .gestion-nav-icon {
  width: 14px;
  height: 14px;
}
.gestion-nav-btn:not(:disabled):hover {
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  border-color: #cbd5e1;
}
.gestion-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gestion-nav-info {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  min-width: 80px;
  text-align: center;
}

/* Tab Datos adicc */
.gestion-datos-adicc {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gestion-datos-adicc-row-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 700px) {
  .gestion-datos-adicc-row-layout {
    grid-template-columns: 1fr;
  }
}
.gestion-datos-adicc-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gestion-datos-adicc-col-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  padding-bottom: 4px;
}
.gestion-datos-adicc-telymail-scroll {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: row;
  gap: 12px;
}
.gestion-datos-adicc-telymail-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gestion-datos-adicc-telymail-divider {
  width: 1px;
  background: #e2e8f0;
  align-self: stretch;
}
.gestion-datos-adicc-telymail-label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.gestion-datos-adicc-listado {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.gestion-datos-adicc-listado-inline {
  max-height: none;
  overflow: visible;
  border: none;
  border-radius: 6px;
  background: #f8fafc;
}
.gestion-datos-adicc-empty-inline {
  padding: 12px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: #f8fafc;
}
.gestion-datos-adicc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.gestion-datos-adicc-table th,
.gestion-datos-adicc-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.gestion-datos-adicc-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  position: sticky;
  top: 0;
}
.gestion-datos-adicc-table tr:hover td {
  background: #f8fafc;
}
.gestion-datos-adicc-table tr.gestion-datos-adicc-row-prioritario td {
  background: rgba(13, 148, 136, 0.12);
  border-left: 3px solid #0d9488;
}
.gestion-datos-adicc-table tr.gestion-datos-adicc-row-prioritario:hover td {
  background: rgba(13, 148, 136, 0.18);
}
.gestion-datos-adicc-loading,
.gestion-datos-adicc-empty {
  padding: 20px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.gestion-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.gestion-form-footer .btn-primary,
.gestion-form-footer .btn-secondary {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}
.gestion-form-footer .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.gestion-arbol-combos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gestion-arbol-combos .gestion-arbol-combo-item {
  margin: 0;
}

/* ==================== MÓDULO EMPRESA ==================== */
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px 12px 0 0;
}
.module-header h2 { margin: 0; font-size: 20px; color: #1e293b; }
.header-actions { display: flex; gap: 8px; }

/* ==================== MÓDULO SUPERVISIÓN ==================== */
.supervision-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
}
.supervision-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.supervision-stat-card {
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  min-width: 100px;
}
.supervision-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #334155;
}
.supervision-stat-label {
  font-size: 12px;
  color: #64748b;
}
.supervision-stat-activo .supervision-stat-value { color: #16a34a; }
.supervision-stat-inactivo .supervision-stat-value { color: #d97706; }
.supervision-stat-desconectado .supervision-stat-value { color: #94a3b8; }
.supervision-asignacion-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  flex: 1 1 280px;
}
.supervision-asignacion-filters .supervision-date-filter select {
  min-width: 180px;
  max-width: 260px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
.supervision-asignacion-filters .supervision-date-filter select:hover {
  border-color: #94a3b8;
}
.supervision-asignacion-filters .supervision-date-filter select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.supervision-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.supervision-actions .btn-refresh {
  padding: 8px 14px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}
.supervision-actions .btn-refresh:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.supervision-gestiones-horas-panel {
  margin-bottom: 16px;
}
.supervision-gestiones-horas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.supervision-date-filter {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.supervision-date-filter input {
  min-width: 160px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.supervision-date-filter input:hover {
  border-color: #94a3b8;
}
.supervision-date-filter input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.supervision-query-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  min-width: 120px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.supervision-query-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}
.supervision-query-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.2);
}
.supervision-query-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 1px 2px rgba(29, 78, 216, 0.25);
}
.supervision-query-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}
.supervision-query-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.supervision-query-btn-svg {
  width: 16px;
  height: 16px;
}
.supervision-query-btn.is-loading .supervision-query-btn-svg {
  animation: supervision-query-spin 0.75s linear infinite;
}
@keyframes supervision-query-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.supervision-query-btn.is-loading .supervision-query-btn-label::after {
  content: '…';
}
.supervision-gestiones-horas-wrap {
  border-radius: 0 0 8px 8px;
  border-top: none;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.supervision-gestiones-horas-wrap .supervision-gestiones-horas-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 #e2e8f0;
}
.supervision-table.supervision-gestiones-horas-table {
  min-width: 720px;
  table-layout: fixed;
  font-size: 10px;
  line-height: 1.25;
}
.supervision-table.supervision-gestiones-horas-table th {
  padding: 5px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.supervision-table.supervision-gestiones-horas-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.supervision-gestiones-horas-table th,
.supervision-gestiones-horas-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supervision-gestiones-horas-table thead .supervision-gh-hour {
  color: #475569;
  font-variant-numeric: tabular-nums;
}
.supervision-gestiones-horas-table thead .supervision-gh-total {
  color: #3730a3;
  background: #eef2ff;
}
.supervision-gestiones-horas-table .supervision-gh-nombre {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
  text-align: left;
  font-weight: 600;
  color: #1e293b;
}
.supervision-gestiones-horas-table .supervision-gh-nombre-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supervision-gestiones-horas-table .supervision-gh-hour {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
}
.supervision-llamadas-horas-table .supervision-gh-hour,
.supervision-llamadas-horas-table .supervision-gh-total {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding-left: 2px;
  padding-right: 2px;
  vertical-align: middle;
}
.supervision-lh-legend {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.4;
}
.supervision-lh-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}
.supervision-lh-cell--zero {
  opacity: 0.45;
}
.supervision-lh-count {
  font-weight: 700;
  font-size: 11px;
  color: #1e40af;
}
.supervision-lh-sep {
  display: none;
}
.supervision-lh-time {
  font-size: 9px;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.supervision-gh-has-value .supervision-lh-time {
  color: #475569;
}
.supervision-gh-chip--time {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.supervision-gestiones-horas-table .supervision-gh-total {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  font-weight: 700;
  background: #faf5ff;
  color: #5b21b6;
}
.supervision-gestiones-horas-table .supervision-gh-fixed {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 1px 0 0 #f1f5f9;
}
.supervision-gestiones-horas-table thead .supervision-gh-fixed {
  z-index: 3;
  background: #f1f5f9;
  box-shadow: 1px 0 0 #e2e8f0, 0 1px 0 #e2e8f0;
}
.supervision-gestiones-horas-table .supervision-gh-row--alt td {
  background-color: #fafbfc;
}
.supervision-gestiones-horas-table .supervision-gh-row--alt .supervision-gh-fixed {
  background-color: #fafbfc;
}
.supervision-gestiones-horas-table .supervision-gh-row--alt .supervision-gh-total {
  background-color: #f5f3ff;
}
.supervision-gestiones-horas-table tbody tr:hover td {
  background-color: #f0f9ff;
}
.supervision-gestiones-horas-table tbody tr:hover .supervision-gh-fixed {
  background-color: #f0f9ff;
}
.supervision-gestiones-horas-table tbody tr:hover .supervision-gh-total {
  background-color: #ede9fe;
}
.supervision-gestiones-horas-table .supervision-gh-zero {
  color: #cbd5e1;
  font-weight: 400;
}
.supervision-gestiones-horas-table .supervision-gh-has-value {
  color: #0f766e;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.06);
}
.supervision-gestiones-horas-table .supervision-gh-total.supervision-gh-has-value {
  color: #6d28d9;
  background: #ede9fe;
}
.supervision-gh-clickable {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.supervision-gh-clickable:hover {
  background: #dbeafe !important;
  color: #1e40af !important;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #93c5fd;
}
.supervision-gh-clickable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.supervision-gestiones-horas-table .supervision-gh-total.supervision-gh-clickable:hover {
  background: #ddd6fe !important;
  color: #4c1d95 !important;
}
.supervision-gestiones-horas-table .supervision-loading,
.supervision-gestiones-horas-table .supervision-empty,
.supervision-gestiones-horas-table .supervision-error {
  padding: 16px 12px !important;
  font-size: 12px;
  text-align: center;
}

.supervision-horas-colors-btn {
  margin-left: 4px;
  font-size: 11px;
  padding: 6px 12px;
}
.supervision-horas-legend-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 4px 0 10px;
  font-size: 11px;
}
.supervision-horas-legend-wrap[hidden] {
  display: none !important;
}
.supervision-horas-legend-title {
  color: #64748b;
  font-weight: 600;
  margin-right: 2px;
}
.supervision-horas-legend-hint {
  font-weight: 400;
  color: #94a3b8;
}
.supervision-horas-legend-item {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, 0.08);
  line-height: 1.4;
}
.supervision-gestiones-horas-table .supervision-gh-colored.supervision-gh-clickable:hover,
.supervision-llamadas-horas-table .supervision-gh-colored.supervision-gh-clickable:hover {
  filter: brightness(0.93);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.supervision-gestiones-horas-table .supervision-gh-total.supervision-gh-colored.supervision-gh-clickable:hover,
.supervision-llamadas-horas-table .supervision-gh-total.supervision-gh-colored.supervision-gh-clickable:hover {
  background: inherit !important;
  color: inherit !important;
}

.modal-box.supervision-horas-colores-modal-box {
  max-width: min(96vw, 720px);
  width: min(96vw, 720px);
}
.supervision-horas-colores-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.supervision-horas-colores-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.supervision-horas-colores-tab {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 11px;
  cursor: pointer;
}
.supervision-horas-colores-tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.supervision-horas-colores-llamadas-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 11px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.supervision-horas-colores-llamadas-metric[hidden] {
  display: none !important;
}
.supervision-horas-colores-metric-label {
  font-weight: 600;
  color: #475569;
}
.supervision-horas-colores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.supervision-horas-colores-table th,
.supervision-horas-colores-table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.supervision-horas-colores-table input[type="number"],
.supervision-horas-colores-table input[type="text"] {
  width: 100%;
  max-width: 72px;
  font-size: 11px;
  padding: 4px 6px;
}
.supervision-horas-colores-table input[type="color"] {
  width: 40px;
  height: 28px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
}
.supervision-horas-colores-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.supervision-horas-colores-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.supervision-horas-colores-msg {
  margin: 0;
  font-size: 11px;
}

/* Modal detalle gestiones por hora */
.supervision-gh-modal-overlay {
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.5);
}
.modal-box.supervision-gh-modal-box {
  max-width: min(96vw, 1180px);
  width: min(96vw, 1180px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  font-size: 11px;
}
.supervision-gh-modal-header {
  padding: 12px 18px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  border-bottom: none;
}
.supervision-gh-modal-header .modal-close {
  width: 28px;
  height: 28px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
}
.supervision-gh-modal-header .modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.supervision-gh-modal-header-text h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.supervision-gh-modal-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.supervision-gh-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 12px 18px 10px;
  background: #f8fafc;
}
.supervision-gh-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.supervision-gh-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.supervision-gh-chip-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.supervision-gh-chip--accent {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.supervision-gh-chip--accent .supervision-gh-chip-label {
  color: #60a5fa;
}
.supervision-gh-chip--count {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.supervision-gh-chip--count .supervision-gh-chip-label {
  color: #4ade80;
}
.supervision-gh-modal-table-wrap {
  overflow: auto;
  max-height: min(55vh, 480px);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.supervision-gh-detail-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 10px;
}
.supervision-gh-detail-table col.supervision-gh-col-w-cedula { width: 98px; }
.supervision-gh-detail-table col.supervision-gh-col-w-hora { width: 58px; }
.supervision-gh-detail-table col.supervision-gh-col-w-marcado { width: 90px; }
.supervision-gh-detail-table col.supervision-gh-col-w-respuesta { width: 100px; }
.supervision-gh-detail-table col.supervision-gh-col-w-campana { width: 110px; }
/* supervision-gh-col-w-detalle: sin ancho fijo → ocupa el resto del modal */
.supervision-gh-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 5px 8px;
  text-align: left;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supervision-gh-detail-table thead .supervision-gh-th-detalle {
  color: #1e40af;
}
.supervision-gh-detail-table tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
  line-height: 1.25;
}
.supervision-gh-detail-table .supervision-gh-col-cedula,
.supervision-gh-detail-table .supervision-gh-col-hora,
.supervision-gh-detail-table .supervision-gh-col-marcado,
.supervision-gh-detail-table .supervision-gh-col-respuesta,
.supervision-gh-detail-table .supervision-gh-col-campana {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
.supervision-gh-detail-table .supervision-gh-col-detalle {
  overflow: visible;
  white-space: normal;
  max-width: none;
  vertical-align: top;
  background: #fafbfc;
}
.supervision-gh-detail-row:hover .supervision-gh-col-detalle {
  background: #f0f9ff;
}
.supervision-gh-detail-row:hover td {
  background: #f8fafc;
}
.supervision-gh-detail-row--alt td {
  background: #fafbfc;
}
.supervision-gh-detail-row--alt .supervision-gh-col-detalle {
  background: #f5f7fa;
}
.supervision-gh-detail-row--alt:hover td {
  background: #f1f5f9;
}
.supervision-gh-detail-row--alt:hover .supervision-gh-col-detalle {
  background: #e8f4fc;
}
.supervision-gh-cedula {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.01em;
}
.supervision-gh-hora-badge {
  display: inline-block;
  max-width: 100%;
  text-align: center;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e40af;
  background: #dbeafe;
  white-space: nowrap;
}
.supervision-gh-marcado {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  color: #64748b;
}
.supervision-gh-respuesta {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #7c3aed;
  background: #f5f3ff;
  line-height: 1.25;
  white-space: nowrap;
  vertical-align: bottom;
}
.supervision-gh-campana {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  color: #475569;
  line-height: 1.25;
}
.supervision-gh-detalle-text {
  font-size: 10px;
  line-height: 1.45;
  color: #1e293b;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.supervision-gh-modal-state {
  padding: 32px 16px !important;
  text-align: center;
  color: #64748b;
  font-size: 11px;
}
.supervision-gh-modal-state--empty {
  color: #94a3b8;
  font-style: italic;
}
.supervision-gh-modal-state--error {
  color: #dc2626;
  background: #fef2f2;
}
.supervision-gh-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.supervision-gh-modal-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.supervision-gh-btn-close {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
  transition: background 0.15s ease, transform 0.1s ease;
}
.supervision-gh-btn-close:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}
.supervision-gh-btn-close:active {
  transform: scale(0.98);
}
@media (max-width: 768px) {
  #supervisionGestionesHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
  #supervisionLlamadasHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
  #supervisionCompromisosHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
  #supervisionCompromisosHorasUsuModal.modal-overlay .modal-box.supervision-gh-modal-box,
  .modal-box.supervision-gh-modal-box {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: 96vh;
  }
  .supervision-gh-modal-body {
    padding: 14px 16px 12px;
  }
  .supervision-gh-modal-footer {
    padding: 12px 16px;
  }
  .supervision-gh-detalle-text {
    max-width: 220px;
  }
}
.supervision-auto-refresh {
  font-size: 12px;
  color: #64748b;
}
.supervision-auto-refresh label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
/* Tabs Supervisión: Online, Offline, Todos */
.supervision-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 0 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.8) inset;
}
.supervision-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.supervision-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.supervision-tab:hover {
  color: #334155;
  background: rgba(255,255,255,0.7);
  transform: translateY(-1px);
}
.supervision-tab:hover .supervision-tab-icon {
  opacity: 1;
  transform: scale(1.08);
}
.supervision-tab.active {
  color: #1e40af;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06), 0 1px 0 0 #e2e8f0;
}
.supervision-tab.active:hover {
  transform: none;
}
.supervision-tab.active .supervision-tab-icon {
  opacity: 1;
}
.supervision-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
  transform-origin: center;
  animation: supervision-tab-indicator 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes supervision-tab-indicator {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.supervision-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.supervision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.supervision-table th {
  padding: 12px 14px;
  text-align: left;
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}
.supervision-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.supervision-table tbody tr:hover { background: #f8fafc; }

.sup-pend-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}
.sup-pend-chip {
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.sup-pend-chip span { display: block; font-size: 11px; color: #64748b; font-weight: 600; }
.sup-pend-chip strong { display: block; font-size: 20px; color: #0f172a; line-height: 1.2; }
.sup-pend-chip em { font-style: normal; font-size: 11px; color: #475569; }
.sup-pend-chip--warn { background: #fff7ed; border-color: #fdba74; }
.sup-pend-table thead th { font-size: 11px; white-space: nowrap; }
.sup-pend-user { display: block; font-size: 11px; font-weight: 500; color: #64748b; }
.sup-pend-num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; }
.sup-pend-num--ok { color: #15803d; }
.sup-pend-num--warn { color: #c2410c; }
.sup-pend-num--due { color: #b91c1c; }
.sup-pend-row--ok { background: #f0fdf4; }
.sup-pend-row--pend { background: #fff7ed; }
.sup-pend-avance { min-width: 72px; }
.sup-pend-num--link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #1d4ed8;
  font-weight: 700;
}
.sup-pend-num--link:hover { background: #dbeafe; }
.sup-pend-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.sup-pend-badge--ok { background: #dcfce7; color: #166534; }
.sup-pend-badge--warn { background: #ffedd5; color: #9a3412; }
.sup-pend-badge--due { background: #fee2e2; color: #991b1b; }
.sup-pend-muted { font-size: 11px; color: #64748b; font-weight: 500; }
.sup-pend-detalle {
  white-space: pre-wrap;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.35;
}
.sup-pend-detail-table { width: 100%; }
.sup-pend-bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}
.sup-pend-bar > span { display: block; height: 100%; border-radius: inherit; background: #f97316; }
.sup-pend-bar--ok > span { background: #16a34a; }
.sup-pend-bar--mid > span { background: #eab308; }
.sup-pend-bar--low > span { background: #f97316; }
.sup-pend-bar--none > span { background: transparent; }
.supervision-row-activo { background: #f0fdf4 !important; }
.supervision-row-inactivo { background: #fffbeb !important; }
.supervision-group-header td {
  padding: 0;
  border-bottom: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
  overflow: visible;
  white-space: normal;
  text-overflow: unset;
}
.supervision-group-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
}
.supervision-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.supervision-group-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.supervision-gestiones-horas-table .supervision-group-header td {
  position: static;
  left: auto;
  z-index: auto;
  overflow: visible;
  white-space: normal;
  text-overflow: unset;
  max-width: none;
}
.supervision-gestiones-horas-table .supervision-group-header:hover td {
  background: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
}
.supervision-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.supervision-badge-activo { background: #dcfce7; color: #166534; }
.supervision-badge-inactivo { background: #fef3c7; color: #92400e; }
.supervision-badge-desconectado { background: #f1f5f9; color: #64748b; }
.supervision-ip { font-family: monospace; font-size: 12px; }
.supervision-loading,
.supervision-empty,
.supervision-error {
  padding: 24px;
  text-align: center;
  color: #64748b;
}
.supervision-acciones { white-space: nowrap; }
.supervision-btn-cerrar {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.supervision-btn-cerrar:hover:not(:disabled) {
  background: #fee2e2;
  color: #991b1b;
}
.supervision-btn-cerrar:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.supervision-sin-accion { color: #94a3b8; font-size: 13px; }
.supervision-ext { font-family: monospace; font-size: 12px; font-weight: 600; color: #334155; }
.supervision-badge-llamada { background: #dbeafe; color: #1d4ed8; }
.supervision-badge-llamada-ring { background: #ffedd5; color: #c2410c; }
.supervision-badge-libre { background: #f1f5f9; color: #64748b; }
.supervision-online-legend {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.supervision-online-legend p { margin: 0 0 8px; }
.supervision-online-legend ul {
  margin: 0;
  padding-left: 18px;
}
.supervision-online-legend li { margin: 2px 0; }
.supervision-listen-msg {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.supervision-listen-msg.is-ok { background: #ecfdf5; color: #047857; }
.supervision-listen-msg.is-error { background: #fef2f2; color: #b91c1c; }
.supervision-listen-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.supervision-btn-listen,
.supervision-btn-whisper,
.supervision-btn-barge {
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.supervision-btn-listen {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.supervision-btn-listen:hover:not(:disabled) { background: #dbeafe; }
.supervision-btn-whisper {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.supervision-btn-whisper:hover:not(:disabled) { background: #ede9fe; }
.supervision-btn-barge {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.supervision-btn-barge:hover:not(:disabled) { background: #fef3c7; }
.supervision-btn-listen:disabled,
.supervision-btn-whisper:disabled,
.supervision-btn-barge:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.supervision-btn-eval {
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}
.supervision-btn-eval:hover { background: #ccfbf1; }
.supervision-ia-nota {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  vertical-align: middle;
}
.supervision-ia-nota.is-ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.supervision-ia-nota.is-mid { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.supervision-ia-nota.is-low { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.supervision-ia-modal { max-width: 560px; width: 94%; max-height: 86vh; overflow: auto; }
.supervision-ia-live { background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.supervision-ia-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.supervision-ia-card header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.supervision-ia-nota-lg { font-size: 22px; font-weight: 800; color: #0f766e; min-width: 36px; }
.supervision-ia-when { font-size: 11px; color: #64748b; }
.supervision-ia-lab { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #94a3b8; margin: 8px 0 4px; }
.supervision-ia-chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.supervision-ia-chip.is-ok { background: #ecfdf5; color: #047857; }
.supervision-ia-chip.is-low { background: #fef2f2; color: #b91c1c; }
.supervision-ia-empty { color: #64748b; font-size: 13px; }

.table-container {
  padding: 16px 24px 24px;
}
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  background: #f1f5f9;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.data-table tbody tr:hover { background: #f8fafc; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #64748b;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: #f1f5f9; color: #0f172a; }
.btn-edit { color: #3b82f6; }
.btn-edit:hover { background: #eff6ff; color: #1d4ed8; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-width: 480px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}
/* Supervisión: modal detalle gestiones — ancho completo (sobreescribe .modal-box 480px) */
#supervisionGestionesHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
#supervisionLlamadasHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
#supervisionCompromisosHorasModal.modal-overlay .modal-box.supervision-gh-modal-box,
#supervisionCompromisosHorasUsuModal.modal-overlay .modal-box.supervision-gh-modal-box {
  max-width: min(96vw, 1180px);
  width: min(96vw, 1180px);
  max-height: 92vh;
  overflow: hidden;
}
#supervisionGestionesHorasModal .supervision-gh-modal-body.modal-body,
#supervisionLlamadasHorasModal .supervision-gh-modal-body.modal-body {
  padding: 10px 14px 8px;
  flex: 1;
  min-height: 0;
}
#supervisionGestionesHorasModal .supervision-gh-modal-dt-host,
#supervisionLlamadasHorasModal .supervision-gh-modal-dt-host {
  width: 100%;
  min-height: 80px;
}
#supervisionGestionesHorasModal .gestion-compromisos-dt-wrapper,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-wrapper {
  border-radius: 8px;
  border-color: rgba(59, 130, 246, 0.25);
}
#supervisionGestionesHorasModal .gestion-compromisos-dt-top,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-top {
  padding: 8px 10px;
  font-size: 11px;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-bottom-color: rgba(191, 219, 254, 0.8);
}
#supervisionGestionesHorasModal .gestion-compromisos-dt-ico,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-ico {
  width: 13px;
  height: 13px;
  color: #2563eb;
}
#supervisionGestionesHorasModal .gestion-compromisos-dt-len-select,
#supervisionGestionesHorasModal .gestion-compromisos-dt-search-input,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-len-select,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-search-input {
  font-size: 11px;
  padding: 5px 8px;
}
#supervisionGestionesHorasModal .gestion-compromisos-dt-search-input,
#supervisionLlamadasHorasModal .gestion-compromisos-dt-search-input {
  min-width: 9rem;
  width: min(16rem, 100%);
}
#supervisionGestionesHorasModal .supervision-gh-modal-table-wrap,
#supervisionLlamadasHorasModal .supervision-gh-modal-table-wrap {
  width: 100%;
  max-height: min(52vh, 460px);
  border: none;
  border-radius: 0;
  box-shadow: none;
}
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-cedula,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-cedula { width: 98px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-hora,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-hora { width: 58px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-marcado,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-marcado { width: 90px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-respuesta,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-respuesta { width: 100px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-campana,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-campana { width: 110px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-duracion,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-duracion { width: 72px; }
#supervisionGestionesHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-causa,
#supervisionLlamadasHorasModal .supervision-gh-detail-table col.supervision-gh-col-w-causa { width: 100px; }
#supervisionGestionesHorasModal .gestion-compromisos-pagination,
#supervisionLlamadasHorasModal .gestion-compromisos-pagination {
  padding: 8px 10px;
  font-size: 11px;
}
#supervisionGestionesHorasModal .gestion-compromisos-th-sort,
#supervisionLlamadasHorasModal .gestion-compromisos-th-sort {
  cursor: pointer;
  user-select: none;
}
#supervisionGestionesHorasModal .gestion-compromisos-th-sort:hover,
#supervisionLlamadasHorasModal .gestion-compromisos-th-sort:hover {
  background: #e2e8f0;
}
#supervisionGestionesHorasModal .supervision-gh-detail-table,
#supervisionLlamadasHorasModal .supervision-gh-detail-table {
  font-size: 10px;
}
#supervisionGestionesHorasModal .supervision-gh-detail-table thead th,
#supervisionLlamadasHorasModal .supervision-gh-detail-table thead th {
  padding: 4px 8px;
  font-size: 8px;
}
#supervisionGestionesHorasModal .supervision-gh-detail-table tbody td,
#supervisionLlamadasHorasModal .supervision-gh-detail-table tbody td {
  padding: 4px 8px;
  line-height: 1.25;
}
#supervisionGestionesHorasModal .supervision-gh-cedula,
#supervisionLlamadasHorasModal .supervision-gh-cedula {
  font-size: 9px;
  padding: 1px 5px;
}
#supervisionGestionesHorasModal .supervision-gh-hora-badge,
#supervisionLlamadasHorasModal .supervision-gh-hora-badge {
  min-width: 38px;
  font-size: 9px;
  padding: 1px 5px;
}
#supervisionGestionesHorasModal .supervision-gh-marcado,
#supervisionLlamadasHorasModal .supervision-gh-marcado {
  font-size: 10px;
}
#supervisionGestionesHorasModal .supervision-gh-respuesta,
#supervisionLlamadasHorasModal .supervision-gh-respuesta {
  font-size: 9px;
  padding: 1px 5px;
}
#supervisionGestionesHorasModal .supervision-gh-campana,
#supervisionLlamadasHorasModal .supervision-gh-campana {
  font-size: 10px;
  line-height: 1.25;
}
#supervisionGestionesHorasModal .supervision-gh-detalle-text,
#supervisionLlamadasHorasModal .supervision-gh-detalle-text {
  font-size: 10px;
  line-height: 1.4;
}
#supervisionGestionesHorasModal .supervision-gh-col-detalle,
#supervisionLlamadasHorasModal .supervision-gh-col-detalle {
  padding-left: 10px;
  padding-right: 10px;
}

/* Gestión — tab Llamadas (misma tabla CDR que supervisión) */
.gestion-llamadas-wrap .gestion-llamadas-meta {
  margin-top: 4px;
  flex-wrap: wrap;
}
.gestion-llamadas-table-panel {
  overflow: auto;
  max-height: min(68vh, 720px);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.gestion-llamadas-table-panel .gestion-compromisos-dt-wrapper {
  padding: 10px 12px 12px;
  min-width: min(100%, 1100px);
}
.gestion-llamadas-table-panel .gestion-compromisos-dt-top {
  margin-bottom: 8px;
}
.gestion-llamadas-table-panel .gestion-compromisos-dt-filter {
  margin-left: auto;
}
.gestion-llamadas-table-panel .supervision-gh-detail-table {
  font-size: 11px;
}
.gestion-llamadas-table-panel .supervision-gh-detail-table thead th {
  padding: 6px 8px;
  font-size: 9px;
}
.gestion-llamadas-table-panel .supervision-gh-detail-table tbody td {
  padding: 6px 8px;
}
.gestion-llamadas-table-panel .supervision-gh-hora-badge {
  min-width: 52px;
  font-size: 10px;
  padding: 2px 6px;
}
.gestion-llamadas-table-panel .supervision-gh-marcado {
  font-size: 10px;
}
.gestion-llamadas-table-panel .supervision-gh-detalle-text {
  font-size: 11px;
  line-height: 1.45;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.gestion-llamadas-table-panel .supervision-gh-detalle-text:hover {
  max-height: none;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.gestion-llamadas-table-panel .supervision-gh-respuesta--done {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.gestion-llamadas-table-panel .supervision-gh-respuesta--pending {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.gestion-llamadas-table-panel .supervision-gh-respuesta--error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.gestion-llamadas-table-panel .supervision-gh-respuesta--inbound {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.supervision-gh-validity--cliente_real,
.gestion-llamadas-table-panel .supervision-gh-validity--cliente_real {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.supervision-gh-validity--sin_respuesta,
.gestion-llamadas-table-panel .supervision-gh-validity--sin_respuesta {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.supervision-gh-validity--buzon,
.gestion-llamadas-table-panel .supervision-gh-validity--buzon {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.supervision-gh-validity--personal_improductiva,
.gestion-llamadas-table-panel .supervision-gh-validity--personal_improductiva {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.supervision-gh-validity--indeterminado,
.gestion-llamadas-table-panel .supervision-gh-validity--indeterminado {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.gestion-llamadas-table-panel .supervision-gh-detail-table col.supervision-gh-col-w-duracion {
  width: 72px;
}
.gestion-llamadas-table-panel .supervision-gh-detail-table col.supervision-gh-col-w-causa {
  width: 108px;
}
.gestion-llamadas-table-panel .gestion-compromisos-th-sort:hover {
  background: #e2e8f0;
}
.supervision-lh-time--cliente {
  color: #15803d;
  font-weight: 700;
}
.supervision-lh-time--otro {
  color: #b45309;
  font-weight: 600;
  font-size: 9px;
}
.supervision-lh-legend-cliente {
  color: #15803d;
}
.supervision-lh-legend-otro {
  color: #b45309;
}
.supervision-gh-chip--otro {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.supervision-gh-chip--otro .supervision-gh-chip-label {
  color: #d97706;
}

#supervisionCompromisosHorasModal .supervision-ch-detail-table,
#supervisionCompromisosHorasUsuModal .supervision-ch-detail-table {
  font-size: 10px;
}
#supervisionCompromisosHorasModal .supervision-ch-detail-table thead th,
#supervisionCompromisosHorasUsuModal .supervision-ch-detail-table thead th {
  padding: 4px 6px;
  font-size: 8px;
  white-space: nowrap;
}
#supervisionCompromisosHorasModal .supervision-ch-detail-table tbody td,
#supervisionCompromisosHorasUsuModal .supervision-ch-detail-table tbody td {
  padding: 4px 6px;
  line-height: 1.25;
  max-width: 120px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 { margin: 0; font-size: 16px; color: #1e293b; }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #94a3b8;
  line-height: 1; padding: 0 2px;
}
.modal-close:hover { color: #334155; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}
.btn-primary {
  padding: 9px 18px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #2563eb; }
.btn-secondary {
  padding: 9px 18px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #e2e8f0; }

.empresa-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.empresa-notification.show { opacity: 1; transform: translateY(0); }
.empresa-notification.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.empresa-notification.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.empresa-notification.info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.loading-small { text-align: center; padding: 24px; color: #94a3b8; }

/* ==================== MÓDULO CARGA ==================== */
.carga-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  border-radius: 12px 12px 0 0;
}
.carga-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.carga-title svg { opacity: 0.8; }

.carga-seleccion {
  padding: 20px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.carga-seleccion-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.carga-field {
  flex: 1;
  min-width: 240px;
}
.carga-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.carga-label svg { color: #64748b; }
.carga-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  font-weight: 500;
}
.carga-select:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.carga-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
}

/* Tabs bar */
.carga-tabs-bar {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
}
.carga-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .15s;
  white-space: nowrap;
}
.carga-tab svg { flex-shrink: 0; }
.carga-tab:hover {
  color: #334155;
  background: #f8fafc;
}
.carga-tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.carga-tab.active svg { color: #0f766e; }

.carga-btn-archivo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.carga-btn-archivo:hover { background: #0d9488; }
.carga-btn-sm { padding: 8px 14px; font-size: 12px; }

/* ========= Wizard Steps ========= */
.wiz-steps {
    display: flex; align-items: center; justify-content: center;
    padding: 16px 24px; gap: 0; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.wiz-step {
    display: flex; align-items: center; gap: 8px; cursor: default; opacity: 0.45; transition: all 0.3s;
}
.wiz-step.active { opacity: 1; }
.wiz-step.completed { opacity: 0.75; }
.wiz-step-num {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    background: #e2e8f0; color: #64748b; transition: all 0.3s;
}
.wiz-step.active .wiz-step-num { background: #0d9488; color: #fff; box-shadow: 0 0 0 4px rgba(13,148,136,.15); }
.wiz-step.completed .wiz-step-num { background: #10b981; color: #fff; }
.wiz-step-label { font-size: 13px; font-weight: 600; color: #475569; }
.wiz-step.active .wiz-step-label { color: #0d9488; }
.wiz-step.completed .wiz-step-label { color: #10b981; }
.wiz-step--clickable { cursor: pointer; }
.wiz-step--clickable:hover .wiz-step-num { transform: scale(1.1); }
.wiz-step--clickable:hover .wiz-step-label { text-decoration: underline; }
.wiz-step-line {
    flex: 0 0 60px; height: 2px; background: #e2e8f0; margin: 0 12px; border-radius: 2px; transition: background 0.3s;
}
.wiz-step-line.completed { background: #10b981; }

/* Wizard Content */
.wiz-content { animation: wizFadeIn 0.25s ease; }
@keyframes wizFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Wizard Step Info Card */
.wiz-step-info {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 20px; border-radius: 12px;
    background: linear-gradient(135deg, #f0fdfa 0%, #f0f9ff 100%);
    border: 1px solid #ccfbf1; margin-bottom: 20px;
}
.wiz-step-info h4 { margin: 0 0 6px; font-size: 16px; color: #0f172a; font-weight: 700; }
.wiz-step-info p { margin: 0; font-size: 13px; color: #64748b; line-height: 1.5; }
.wiz-step-info-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wiz-icon--base { background: #ccfbf1; color: #0d9488; }
.wiz-icon--oper { background: #dbeafe; color: #2563eb; }

/* Wizard Summary */
.wiz-summary {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.wiz-summary-item {
    flex: 1 1 180px; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
}
.wiz-summary-lbl { font-size: 13px; color: #64748b; }
.wiz-summary-val { font-size: 18px; font-weight: 700; color: #0f172a; }

/* Wizard Result Cards */
.wiz-result-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px; border-radius: 10px; margin-top: 12px;
}
.wiz-result--ok { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.wiz-result--ok svg { color: #16a34a; flex-shrink: 0; margin-top: 2px; }
.wiz-result--ok strong { color: #15803d; }
.wiz-errores { margin-top: 8px; }
.wiz-errores summary { cursor: pointer; font-size: 12px; color: #64748b; }
.wiz-errores ul { margin: 6px 0 0 16px; font-size: 12px; color: #94a3b8; }

/* Result detail grid */
.wiz-result-detail strong { display: block; margin-bottom: 10px; font-size: 14px; }
.wiz-result-grid {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px;
}
.wiz-result-lbl { color: #64748b; font-weight: 500; }
.wiz-summary--grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* Wizard No Data Warning */
.wiz-no-data {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    font-size: 13px; line-height: 1.5; margin-bottom: 16px;
}
.wiz-no-data svg { color: #f59e0b; flex-shrink: 0; }

/* Wizard Progress Bar */
.wiz-progress { padding: 16px 0; }
.wiz-progress-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: #475569; margin-bottom: 10px;
}
.wiz-progress-bar {
    height: 12px; background: #e2e8f0; border-radius: 8px; overflow: hidden; position: relative;
}
.wiz-progress-fill {
    height: 100%; border-radius: 8px; transition: width 0.3s ease;
    background: linear-gradient(90deg, #0d9488 0%, #10b981 100%);
    position: relative;
}
.wiz-progress-fill::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: wizShimmer 1.5s infinite;
}
@keyframes wizShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.wiz-progress-pct {
    text-align: center; font-size: 14px; font-weight: 700; color: #0d9488; margin-top: 8px;
}

/* Footer for wizard */
.modal-footer .btn-primary svg,
.modal-footer .btn-secondary svg { vertical-align: middle; }
#btnWizPrev { display: inline-flex; align-items: center; gap: 4px; }
#btnWizNext { display: inline-flex; align-items: center; gap: 4px; }

/* ========= Modal Carga Ampliado ========= */
.carga-modal-wide { max-width: 920px; }
.carga-modal-body { max-height: 75vh; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 0; }
.carga-modal-info-row { display: flex; gap: 12px; flex-wrap: wrap; }
.carga-modal-info-row .form-group { min-width: 140px; }
.carga-modal-file-section { margin-top: 18px; }
.carga-modal-divider { height: 1px; background: #e2e8f0; margin: 18px 0; }

/* === Custom Config Bar === */
.custom-config-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1px solid #d8b4fe;
    border-radius: 10px;
    flex-wrap: wrap;
}
.custom-config-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}
.custom-config-icon {
    color: #7c3aed;
    flex-shrink: 0;
}
.custom-config-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #5b21b6;
    white-space: nowrap;
}
.custom-config-select {
    flex: 1;
    min-width: 160px;
    padding: 6px 10px;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #374151;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.custom-config-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, .15);
}
.custom-config-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.custom-config-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 500;
    border: 1px solid;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.custom-config-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.custom-config-btn--load {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}
.custom-config-btn--load:not(:disabled):hover {
    background: #ddd6fe;
    border-color: #8b5cf6;
}
.custom-config-btn--save {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.custom-config-btn--save:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}
.custom-config-btn--del {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
    padding: 5px 7px;
}
.custom-config-btn--del:not(:disabled):hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Config loaded indicator */
.custom-config-bar--loaded {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}
.custom-config-bar--loaded .custom-config-icon { color: #16a34a; }
.custom-config-bar--loaded .custom-config-label { color: #15803d; }
.custom-config-loaded-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
}
.custom-config-loaded-tag svg { flex-shrink: 0; }

/* === Source Tabs (Local / SFTP) === */
.src-tabs {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    margin-bottom: 12px;
    padding: 3px;
    background: #f1f5f9;
    border-radius: 10px;
}
.src-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}
.src-tab:hover { color: #334155; background: rgba(255,255,255,.5); }
.src-tab--active {
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.src-tab--active svg { stroke: #0d9488; }
.src-panel { animation: srcFadeIn .25s ease; }
@keyframes srcFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* === SFTP Panel === */
.sftp-profiles-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.sftp-profile-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
    background: #fff;
}
.sftp-profile-save-btn, .sftp-profile-del-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid #cbd5e1; border-radius: 6px;
    background: #fff; cursor: pointer; color: #64748b;
    transition: background .15s, color .15s;
}
.sftp-profile-save-btn:hover { background: #f0fdfa; color: #0d9488; border-color: #99f6e4; }
.sftp-profile-del-btn:hover { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.sftp-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}
.sftp-form-row {
    display: flex; gap: 10px; margin-bottom: 8px;
}
.sftp-form-row:last-of-type { margin-bottom: 0; }
.sftp-field { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sftp-field--host { flex: 3; }
.sftp-field--port { flex: 1; max-width: 90px; }
.sftp-field label {
    font-size: 11px; font-weight: 600; color: #475569;
}
.sftp-form-actions {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.sftp-connect-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; font-size: 13px;
}
.sftp-status {
    font-size: 12px; color: #64748b;
}
.sftp-status--loading { color: #f59e0b; }
.sftp-status--ok { color: #16a34a; font-weight: 600; }
.sftp-status--error { color: #ef4444; }

/* SFTP Browser */
.sftp-browser {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    animation: srcFadeIn .3s ease;
}
.sftp-browser-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
}
.sftp-browser-path {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px; font-weight: 600;
    color: #475569; background: #e2e8f0;
    padding: 2px 8px; border-radius: 4px;
}
.sftp-browser-count { color: #64748b; margin-left: auto; }
.sftp-browser-refresh {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: none;
    background: #fff; border-radius: 4px;
    cursor: pointer; color: #64748b;
    transition: background .15s, color .15s;
}
.sftp-browser-refresh:hover { background: #e0e7ff; color: #4f46e5; }
.sftp-browser-list {
    max-height: 240px;
    overflow-y: auto;
}
.sftp-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.sftp-file-row:hover { background: #f8fafc; }
.sftp-file-row--selected { background: #f0fdfa; }
.sftp-file-row--selected:hover { background: #e6fffa; }
.sftp-file-check {
    width: 16px; height: 16px;
    accent-color: #0d9488;
    flex-shrink: 0;
}
.sftp-file-info {
    display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.sftp-file-name {
    font-size: 13px; font-weight: 500; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sftp-file-meta { font-size: 11px; color: #94a3b8; }
.sftp-empty {
    padding: 24px; text-align: center;
    color: #94a3b8; font-size: 13px;
}
.sftp-browser-actions {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.sftp-selected-count { font-size: 12px; color: #64748b; font-weight: 500; }
.sftp-download-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; font-size: 12px;
}
.sftp-download-btn:disabled { opacity: .5; cursor: not-allowed; }

/* === Drag & Drop Zone === */
.carga-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s, padding .3s;
    text-align: center;
}
.carga-dropzone:hover {
    border-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
}
.carga-dropzone--hover {
    border-color: #0d9488 !important;
    background: linear-gradient(135deg, #ccfbf1 0%, #d1fae5 100%) !important;
    box-shadow: 0 0 0 4px rgba(13,148,136,.12), inset 0 0 20px rgba(13,148,136,.05);
    transform: scale(1.005);
}
.carga-dropzone--hover .carga-dropzone-ring {
    border-color: #0d9488;
    background: rgba(13,148,136,.1);
    transform: scale(1.1);
}
.carga-dropzone--hover .carga-dropzone-icon { stroke: #0d9488; }
.carga-dropzone--drop {
    animation: dz-pulse .5s ease;
}
@keyframes dz-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(13,148,136,.3); }
    50%  { box-shadow: 0 0 0 10px rgba(13,148,136,.08); }
    100% { box-shadow: 0 0 0 0 rgba(13,148,136,0); }
}
.carga-dropzone--compact {
    padding: 14px 18px;
    flex-direction: row;
    gap: 12px;
}
.carga-dropzone--compact .carga-dropzone-ring { width: 32px; height: 32px; }
.carga-dropzone--compact .carga-dropzone-ring svg { width: 18px; height: 18px; }
.carga-dropzone--compact .carga-dropzone-text { font-size: 12px; }
.carga-dropzone--compact .carga-dropzone-text strong { font-size: 12px; }
.carga-dropzone--compact .carga-dropzone-formats { display: none; }

.carga-dropzone-ring {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 2px dashed #94a3b8;
    display: flex; align-items: center; justify-content: center;
    background: rgba(148,163,184,.06);
    transition: border-color .2s, background .2s, transform .2s;
    flex-shrink: 0;
}
.carga-dropzone-icon { stroke: #94a3b8; transition: stroke .2s; }
.carga-dropzone-text { display: flex; flex-direction: column; gap: 2px; }
.carga-dropzone-text strong { font-size: 14px; color: #1e293b; }
.carga-dropzone-text span { font-size: 12px; color: #64748b; }
.carga-dropzone-browse {
    background: none; border: none; color: #0d9488; font-weight: 600;
    cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline;
    text-underline-offset: 2px;
}
.carga-dropzone-browse:hover { color: #0f766e; }
.carga-dropzone-formats {
    font-size: 11px; color: #94a3b8;
    background: rgba(148,163,184,.08); border-radius: 20px;
    padding: 3px 12px;
}

/* === File Cards v2 === */
.carga-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.carga-file-card2 {
    display: flex;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    animation: fc-slideIn .3s ease;
}
@keyframes fc-slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.carga-file-card2:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.carga-file-card2--active {
    border-color: var(--fc-border);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fc-dot) 15%, transparent);
}
.carga-file-card2-color {
    width: 5px;
    flex-shrink: 0;
    background: var(--fc-dot, #94a3b8);
    transition: width .2s;
}
.carga-file-card2--active .carga-file-card2-color { width: 5px; }
.carga-file-card2-body {
    flex: 1;
    padding: 10px 14px;
    min-width: 0;
}
.carga-file-card2-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.carga-file-card2-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.carga-file-card2-name {
    font-weight: 600; font-size: 13px; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carga-file-card2--active .carga-file-card2-name { color: var(--fc-text); }
.carga-file-card2-meta { font-size: 11px; color: #64748b; }
.carga-file-card2-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.carga-file-card2-editing {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--fc-text); background: var(--fc-bg); border: 1px solid var(--fc-border);
    padding: 2px 8px; border-radius: 10px; letter-spacing: .5px;
}
.carga-file-card2-mapbtn {
    font-size: 11px; font-weight: 600; color: #475569;
    background: #f1f5f9; border: 1px solid #cbd5e1;
    padding: 3px 10px; border-radius: 6px; cursor: pointer;
    transition: background .15s, color .15s;
}
.carga-file-card2-mapbtn:hover { background: #e2e8f0; color: #0f172a; }
.carga-file-card2-delbtn {
    background: none; border: none; color: #94a3b8;
    cursor: pointer; padding: 2px; border-radius: 4px;
    transition: color .15s, background .15s;
    display: flex; align-items: center;
}
.carga-file-card2-delbtn:hover { color: #ef4444; background: #fef2f2; }

/* File ext badges */
.carga-fext {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; letter-spacing: .5px;
    padding: 4px 6px; border-radius: 5px; flex-shrink: 0;
    min-width: 32px; text-align: center;
}
.carga-fext--xlsx { background: #dcfce7; color: #166534; }
.carga-fext--xls  { background: #d1fae5; color: #065f46; }
.carga-fext--csv  { background: #dbeafe; color: #1e40af; }

/* Field badges inside file cards */
.carga-file-badges {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.carga-fbadge {
    font-size: 10px; padding: 2px 7px; border-radius: 4px;
    background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
    white-space: nowrap;
}
.carga-fbadge--req { background: #f0fdfa; color: #0d9488; border-color: #99f6e4; font-weight: 600; }
.carga-fbadge--grp { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.carga-fbadge--more { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; font-style: italic; }

/* Previous load file indicator */
.carga-file-item--prev {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: #f1f5f9;
    border: 1.5px solid #cbd5e1; border-radius: 8px;
    cursor: default; opacity: .75;
}
.carga-file-item--prev .carga-file-icon { color: #94a3b8; flex-shrink: 0; }
.carga-file-item--prev .carga-file-details { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.carga-file-item--prev .carga-file-name {
    font-weight: 600; font-size: 13px; color: #64748b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carga-file-item--prev .carga-file-size { font-size: 11px; color: #94a3b8; }

/* Mapeo file badge */
.carga-mapeo-fbadge {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600;
    padding: 2px 10px; border-radius: 12px;
    border: 1px solid;
    margin-left: 8px;
    vertical-align: middle;
}

/* === Merge Indicator === */
.carga-merge-indicator { margin-top: 12px; }
.carga-merge-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    border: 1.5px solid #e0e7ff;
    border-radius: 12px;
    padding: 14px 16px;
}
.carga-merge-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #334155;
    margin-bottom: 12px;
}
.carga-merge-title svg { color: #6366f1; flex-shrink: 0; }
.carga-merge-key {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    background: #dcfce7; color: #166534; border-radius: 10px;
    padding: 2px 8px; letter-spacing: .3px; margin-left: auto;
}
.carga-merge-warn {
    font-size: 10px; font-weight: 600;
    color: #dc2626; margin-left: auto;
}
.carga-merge-flow {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.carga-merge-file {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 6px 10px;
    background: #fff; border: 1px solid var(--fc-border, #e2e8f0);
    border-radius: 8px; font-size: 12px;
}
.carga-merge-file-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--fc-dot, #94a3b8); flex-shrink: 0;
}
.carga-merge-file-name {
    font-weight: 600; color: #334155; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.carga-merge-file-fields {
    flex: 1; color: #64748b; font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carga-merge-arrow {
    display: flex; align-items: center; justify-content: center;
    padding: 2px 0;
}
.carga-merge-result {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 8px 12px;
    background: linear-gradient(90deg, #eff6ff, #f0fdfa);
    border: 1.5px solid #a5b4fc;
    border-radius: 8px; font-size: 12px; color: #334155;
}
.carga-merge-result svg { color: #6366f1; flex-shrink: 0; }

/* Resumen */
.carga-resumen {
  display: flex;
  gap: 24px;
  margin-top: 18px;
  padding: 14px 18px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  flex-wrap: wrap;
}
.carga-resumen-item { display: flex; align-items: center; gap: 6px; }
.carga-resumen-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.carga-resumen-value {
  font-size: 14px;
  font-weight: 600;
  color: #0f766e;
}

/* Notificación carga */
.carga-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.carga-notification.show { opacity: 1; transform: translateY(0); }
.carga-notification.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.carga-notification.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.carga-notification.info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Mapeo de columnas */
.carga-mapeo { margin-top: 20px; }
.carga-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 6px;
}
.carga-section-desc { font-size: 13px; color: #64748b; margin: 0 0 14px; }
/* Mapeo header con acciones */
.carga-mapeo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.carga-mapeo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.carga-mapeo-saved-select {
  padding: 6px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  max-width: 200px;
  outline: none;
}
.carga-mapeo-saved-select:focus { border-color: #0d9488; }
.carga-btn-mapeo {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.carga-btn-mapeo:hover { background: #0d9488; }
/* Sección adicional colapsable */
.carga-mapeo-adic-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .15s;
  margin-top: 6px;
}
.carga-mapeo-adic-header:hover { background: #f1f5f9; }
.carga-mapeo-adic-arrow { font-size: 10px; color: #94a3b8; }
.carga-mapeo-adic-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}
.carga-mapeo-adic-body {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 10px 0 0;
}
.carga-mapeo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.carga-mapeo-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.carga-mapeo-item label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.carga-mapeo-item.required label { color: #0f766e; }
.carga-mapeo-item.required label::after { content: ''; }
.carga-mapeo-select {
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: #f8fafc;
  cursor: pointer;
}
.carga-mapeo-select:focus { border-color: #0d9488; outline: none; box-shadow: 0 0 0 2px rgba(13,148,136,.1); }

/* Preview */
.carga-preview { margin-top: 20px; }
.carga-preview-count {
  font-weight: 500;
  color: #64748b;
  font-size: 12px;
  margin-left: 6px;
}
.carga-preview-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.carga-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.carga-preview-table thead th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.carga-preview-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carga-preview-table tbody tr:hover { background: #f0fdfa; }

/* Acciones */
.carga-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.carga-btn-procesar {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Resultado */
.carga-result-card {
  text-align: center;
  padding: 40px 24px;
  border-radius: 12px;
}
.carga-result--success { background: #f0fdf4; border: 1px solid #86efac; }
.carga-result-icon { color: #22c55e; margin-bottom: 12px; }
.carga-result-card h3 { margin: 0 0 6px; font-size: 20px; color: #15803d; }
.carga-result-card p { margin: 0 0 20px; color: #475569; font-size: 14px; }
.carga-result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 14px;
}
.carga-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.carga-result-stat .num { font-size: 28px; font-weight: 800; color: #15803d; }
.carga-result-stat .lbl { font-size: 12px; color: #64748b; text-transform: uppercase; font-weight: 600; }
.carga-result-stat--warn .num { color: #dc2626; }
.carga-errores-detail {
  text-align: left;
  margin-top: 12px;
  background: #fef2f2;
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.carga-errores-detail summary { cursor: pointer; font-size: 13px; color: #991b1b; font-weight: 600; }
.carga-errores-detail ul { margin: 8px 0 0; padding-left: 20px; font-size: 12px; color: #7f1d1d; }

/* Historial */
.carga-historial {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding-bottom: 0;
}
.carga-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.carga-hist-count {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 6px;
}
.carga-hist-search {
  position: relative;
  display: flex;
  align-items: center;
}
.carga-hist-search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}
.carga-hist-search-input {
  padding: 8px 12px 8px 32px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: #f8fafc;
  min-width: 220px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.carga-hist-search-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.carga-hist-search-input::placeholder { color: #94a3b8; }
.carga-hist-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* Tabs filtro estado historial */
.carga-hist-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 2px solid #e2e8f0;
}
.carga-hist-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.carga-hist-tab:hover { color: #0f766e; }
.carga-hist-tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.carga-hist-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}
.carga-hist-tab.active .carga-hist-tab-badge {
  background: #ccfbf1;
  color: #0f766e;
}
.carga-hist-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.carga-hist-tab-dot--active { background: #22c55e; }
.carga-hist-tab-dot--inactive { background: #94a3b8; }
.th-center { text-align: center; }
.td-center { text-align: center; }
.carga-historial-table-wrap {
  overflow-x: auto;
  padding: 0 24px;
}
.carga-hist-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  flex-wrap: wrap;
  gap: 10px;
}
.carga-historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.carga-historial-table thead th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid #e2e8f0;
}
.carga-historial-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.carga-historial-table tbody tr:hover { background: #f8fafc; }

/* ==================== MÓDULO USUARIOS ==================== */
.modal-box-lg { max-width: 640px; width: 95%; }

/* Header */
.usr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
  gap: 12px;
}
.usr-header-left { display: flex; align-items: center; }
.usr-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.usr-title svg { opacity: 0.8; }
.usr-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* Toolbar búsqueda y filtros */
.usr-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.usr-search-bar {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.usr-search-bar-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}
.usr-search-bar-input {
  width: 100%;
  padding: 10px 120px 10px 42px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.usr-search-bar-input::placeholder { color: #94a3b8; }
.usr-search-bar-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.1);
}
.usr-search-bar-hint {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 6px;
  display: none;
  pointer-events: none;
}
.usr-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.usr-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.usr-filter-select-light {
  padding: 9px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  font-weight: 500;
}
.usr-filter-select-light:focus { border-color: #3b82f6; }
.usr-btn-nuevo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.usr-btn-nuevo:hover { background: #2563eb; transform: translateY(-1px); }
.usr-btn-nuevo:active { transform: translateY(0); }
.usr-reactivar-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.45;
}
.usr-btn-asig {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.usr-btn-asig:hover { background: #f8fafc; border-color: #94a3b8; transform: translateY(-1px); }
.usr-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Stats */
.usr-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.usr-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: box-shadow .2s, transform .15s;
}
.usr-stat:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); transform: translateY(-1px); }
.usr-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.usr-stat--total .usr-stat-icon { background: #eff6ff; color: #2563eb; }
.usr-stat--active .usr-stat-icon { background: #f0fdf4; color: #16a34a; }
.usr-stat--inactive .usr-stat-icon { background: #fef2f2; color: #dc2626; }
.usr-stat--admin .usr-stat-icon { background: #faf5ff; color: #9333ea; }
.usr-stat-data { display: flex; flex-direction: column; }
.usr-stat-num { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.usr-stat-lbl { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }

/* Table Card */
.usr-table-card {
  background: #fff;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.usr-table-wrapper { overflow-x: auto; }
.usr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.usr-table thead th {
  background: #f8fafc;
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.usr-table thead th.th-check { width: 48px; text-align: center; }
.usr-table thead th.th-center { text-align: center; }
.usr-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.usr-table tbody tr { transition: background .15s; }
.usr-table tbody tr:hover { background: #f0f7ff; }
.td-num { text-align: center; color: #94a3b8; font-size: 12px; font-weight: 600; }
.td-center { text-align: center; }
.td-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* User cell */
.usr-user-cell { display: flex; align-items: center; gap: 10px; }
.usr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.usr-user-info { display: flex; flex-direction: column; min-width: 0; }
.usr-user-name { font-weight: 600; color: #0f172a; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usr-user-ci { font-size: 11px; color: #94a3b8; }
.usr-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  flex-shrink: 0;
  margin-left: 4px;
}
.usr-badge--admin { background: #dbeafe; color: #1e40af; }
.usr-badge--super { background: #fae8ff; color: #86198f; }
.usr-username {
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-weight: 500;
}
.usr-perfil-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.usr-muted { color: #cbd5e1; }

/* Estado button */
.usr-estado-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.usr-estado-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.usr-estado--on {
  background: #dcfce7;
  color: #15803d;
}
.usr-estado--on .usr-estado-dot { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.usr-estado--on:hover { background: #bbf7d0; }
.usr-estado--off {
  background: #fee2e2;
  color: #991b1b;
}
.usr-estado--off .usr-estado-dot { background: #ef4444; }
.usr-estado--off:hover { background: #fecaca; }

/* Row inactive */
.usr-row-inactive td { opacity: 0.5; }
.usr-row-inactive:hover td { opacity: 0.75; }

/* Actions */
.usr-actions { display: flex; gap: 4px; justify-content: center; }
.usr-action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: #64748b;
  transition: all .15s;
}
.usr-action--edit:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.usr-action--key:hover { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.usr-action--deactivate { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.usr-action--deactivate:hover { background: #fee2e2; color: #b91c1c; border-color: #f87171; }
.usr-action--activate { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.usr-action--activate:hover { background: #dcfce7; color: #15803d; border-color: #4ade80; }
.usr-action--empty { color: #ea580c; border-color: #fdba74; background: #fff7ed; }
.usr-action--empty:hover { background: #ffedd5; color: #c2410c; border-color: #fb923c; }
.usr-action--empty:disabled { opacity: .35; cursor: not-allowed; }
.usr-action--empty:disabled:hover { background: #fff7ed; color: #ea580c; border-color: #fdba74; }
.td-actions-group { display: flex; align-items: center; justify-content: center; gap: 4px; }

/* Loading & Empty */
.usr-loading {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: 14px;
}
.usr-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: usr-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes usr-spin { to { transform: rotate(360deg); } }
.usr-empty {
  text-align: center;
  padding: 56px 20px;
  color: #94a3b8;
  font-size: 14px;
}
.usr-empty svg { display: block; margin: 0 auto 12px; }
.usr-empty span { display: block; }

/* Paginación */
.usr-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  flex-wrap: wrap;
  gap: 10px;
}
.usr-pag-info {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.usr-pag-controls { display: flex; align-items: center; gap: 4px; }
.usr-pag-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.usr-pag-btn:hover:not(:disabled):not(.usr-pag-active) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.usr-pag-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.usr-pag-active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.usr-pag-active:hover { background: #2563eb; }
.usr-pag-num { min-width: 32px; }
.usr-pag-dots {
  padding: 0 2px;
  color: #94a3b8;
  font-size: 14px;
  user-select: none;
}

/* Form sections (shared) */
.form-section { margin-bottom: 18px; }
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.form-check-inline { display: flex; align-items: center; }
.form-check-inline label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  font-weight: 500;
}
.form-check-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}

/* Notificación usuarios */
.usuarios-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.usuarios-notification.show { opacity: 1; transform: translateY(0); }
.usuarios-notification.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.usuarios-notification.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.usuarios-notification.info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Modal asignación visual */
.usr-asig-modal { max-width: 1100px; width: 96%; max-height: 92vh; display: flex; flex-direction: column; }
.usr-asig-body { overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.usr-asig-hint { margin: 0; font-size: 13px; color: #64748b; }
.usr-asig-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}
.usr-asig-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 12px;
  min-height: 420px;
  max-height: 58vh;
}
.usr-asig-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.usr-asig-panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: #fff;
}
.usr-asig-panel-body {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usr-asig-sup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.usr-asig-sup-item:hover { border-color: #93c5fd; }
.usr-asig-sup-item.is-active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .15);
  background: #eff6ff;
}
.usr-asig-sup-item.is-hidden { display: none; }
.usr-asig-sup-meta { min-width: 0; flex: 1; }
.usr-asig-sup-name { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usr-asig-sup-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.usr-asig-sup-badge {
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.usr-asig-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.usr-asig-detail-title { font-size: 16px; font-weight: 800; color: #0f172a; margin: 0; }
.usr-asig-detail-sub { font-size: 12px; color: #64748b; margin: 0; }
.usr-asig-detail-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.usr-asig-new-row { display: flex; gap: 8px; }
.usr-asig-new-row .form-input { flex: 1; }
.usr-asig-assigned-head {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 4px;
}
.usr-asig-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.usr-asig-chip--click { cursor: pointer; transition: border-color .15s, background .15s; }
.usr-asig-chip--click:hover { border-color: #3b82f6; background: #f8fbff; }
.usr-asig-chip.is-hidden { display: none; }
.usr-asig-chip-av {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}
.usr-asig-chip-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.usr-asig-chip-name { font-size: 12px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usr-asig-chip-user { font-size: 11px; color: #64748b; }
.usr-asig-chip-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.usr-asig-chip-btn:hover { background: #fecaca; }
.usr-asig-empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 18px 8px; }

@media (max-width: 900px) {
  .usr-asig-toolbar { grid-template-columns: 1fr; }
  .usr-asig-layout { grid-template-columns: 1fr; max-height: none; }
}

/* Responsive stats */
@media (max-width: 640px) {
  .usr-stats { grid-template-columns: repeat(2, 1fr); }
  .usr-header { flex-direction: column; align-items: stretch; }
  .usr-header-right { flex-direction: column; }
  .usr-search-input { min-width: 100%; }
}

/* ==================== PANEL ASIGNACIÓN ==================== */
.asig-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}
.asig-resumen {
  margin-bottom: 18px;
}
.asig-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.asig-kpi {
  flex: 1;
  min-width: 120px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  transition: box-shadow .2s;
}
.asig-kpi:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.asig-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}
.asig-kpi-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}
.asig-kpi--money .asig-kpi-value { color: #2563eb; }
.asig-kpi--ok .asig-kpi-value { color: #059669; }
.asig-kpi--warn .asig-kpi-value { color: #d97706; }

/* Layout sidebar + main */
.asig-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.asig-users-sidebar {
  width: 280px;
  min-width: 250px;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 600px;
  position: sticky;
  top: 16px;
}
/* Formulario campaña en sidebar */
.asig-camp-form {
  padding: 12px 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px 12px 0 0;
}
.asig-camp-field { margin-bottom: 6px; }
.asig-camp-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.asig-camp-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: #1f2937;
  box-sizing: border-box;
}
.asig-camp-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.asig-camp-row {
  display: flex;
  gap: 6px;
}
.asig-camp-row .asig-camp-field { flex: 1; }
.asig-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #e5e7eb;
}
.asig-users-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}
.asig-users-count {
  font-size: 11px;
  color: #6b7280;
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 10px;
}
.asig-users-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 10px 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 8px;
}
.asig-users-search svg { color: #9ca3af; flex-shrink: 0; }
.asig-users-search-input {
  border: none;
  outline: none;
  font-size: 12px;
  padding: 6px 4px;
  width: 100%;
  background: transparent;
}
.asig-users-check-all {
  padding: 6px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
  color: #6b7280;
}
.asig-users-check-all label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.asig-users-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}
.asig-users-loading {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 12px;
}
.asig-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
}
.asig-user-item:hover { background: #e0e7ff; }
.asig-user-item.asig-user-item--checked { background: #eff6ff; }
.asig-user-item input[type="checkbox"] { flex-shrink: 0; cursor: pointer; }
.asig-user-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.asig-user-item-info { flex: 1; min-width: 0; }
.asig-user-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asig-user-item-meta {
  font-size: 10px;
  color: #9ca3af;
}
.asig-user-item-badge {
  font-size: 10px;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.asig-users-footer {
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asig-main-content {
  flex: 1;
  min-width: 0;
}

/* Actions Bar */
.asig-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 12px;
}
.asig-actions-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.asig-check-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}
.asig-selected-count {
  font-size: 12px;
  color: #6b7280;
  background: #e5e7eb;
  padding: 3px 10px;
  border-radius: 12px;
}
.asig-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.asig-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.asig-btn--assign {
  background: #2563eb;
  color: #fff;
}
.asig-btn--assign:hover:not(:disabled) { background: #1d4ed8; }
.asig-btn--auto {
  background: #7c3aed;
  color: #fff;
}
.asig-btn--auto:hover { background: #6d28d9; }
.asig-btn--remove {
  background: #fee2e2;
  color: #dc2626;
  padding: 5px 10px;
  font-size: 12px;
}
.asig-btn--remove:hover { background: #fecaca; }
.asig-btn--full {
  width: 100%;
  justify-content: center;
  padding: 8px 12px;
}
.asig-separator {
  width: 1px;
  height: 24px;
  background: #d1d5db;
  margin: 0 4px;
}

/* View Tabs */
.asig-view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.asig-view-tab {
  padding: 7px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.asig-view-tab:hover { border-color: #2563eb; color: #2563eb; }
.asig-view-tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.asig-view-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}
.asig-view-tab:not(.active) .asig-view-badge {
  background: #e5e7eb;
  color: #6b7280;
}
.asig-view-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 10px;
}
.asig-search-input {
  border: none;
  outline: none;
  font-size: 13px;
  padding: 7px 4px;
  width: 220px;
  background: transparent;
}
.asig-filtro-estado {
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #374151;
}

/* Tabla operaciones */
.asig-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.asig-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.asig-table thead {
  background: #f8fafc;
}
.asig-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.asig-th-check { width: 40px; text-align: center; }
.asig-th-right { text-align: right; }
.asig-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
}
.asig-table tr:hover { background: #f0f9ff; }
.asig-table tr.asig-row-selected { background: #eff6ff; }
.asig-table .asig-td-check { text-align: center; }
.asig-table .asig-td-deuda { text-align: right; font-weight: 600; color: #2563eb; }
.asig-badge-asignado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
}
.asig-badge-sin {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}
/* Paginación */
.asig-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 14px 0 4px;
}
.asig-pagination button {
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: all .15s;
}
.asig-pagination button:hover { background: #f3f4f6; }
.asig-pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.asig-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Vista por Usuarios (cards) */
.asig-usuarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.asig-user-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow .2s;
}
.asig-user-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.asig-user-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.asig-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.asig-user-info { flex: 1; }
.asig-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.asig-user-username {
  font-size: 11px;
  color: #6b7280;
}
.asig-user-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.asig-user-stat {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.asig-user-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}
.asig-user-stat-lbl {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
}
.asig-user-actions {
  display: flex;
  gap: 6px;
}
.asig-user-actions .asig-btn { flex: 1; justify-content: center; font-size: 12px; padding: 6px 8px; }

/* Modal Auto-Asignación */
.asig-auto-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.asig-auto-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  font-size: 13px;
  color: #374151;
}
.asig-auto-option:hover { border-color: #7c3aed; background: #f5f3ff; }
.asig-auto-option input:checked + span { color: #7c3aed; font-weight: 600; }
.asig-auto-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
  font-size: 13px;
  color: #374151;
}
.asig-auto-count {
  font-size: 12px;
  color: #6b7280;
}
.asig-auto-users-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.asig-auto-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
}
.asig-auto-user-item:hover { background: #f3f4f6; }
.asig-auto-user-item input { flex-shrink: 0; }
.asig-auto-user-name { flex: 1; color: #1f2937; }
.asig-auto-user-email { font-size: 11px; color: #9ca3af; }

/* Header resumen con botón nueva */
.asig-resumen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.asig-btn-nueva {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.asig-btn-nueva:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.asig-btn-nueva svg { flex-shrink: 0; }

/* ===== Modal Wizard Asignación ===== */
.asig-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: asigOverlayIn .3s ease-out;
}
@keyframes asigOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.asig-modal {
  background: #ffffff;
  border-radius: 20px;
  width: 94vw;
  max-width: 1100px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.04),
    0 8px 16px rgba(0,0,0,.08),
    0 24px 64px rgba(0,0,0,.16);
  animation: asigModalIn .35s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
@keyframes asigModalIn {
  from { opacity: 0; transform: scale(.97) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.asig-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  padding: 16px 24px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.asig-modal-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.asig-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  letter-spacing: -.01em;
}
.asig-modal-subtitle {
  font-size: 13px;
  opacity: .75;
  font-weight: 500;
}
.asig-modal-close {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  transition: all .2s;
  position: relative;
  z-index: 1;
}
.asig-modal-close:hover {
  background: rgba(255,255,255,.25);
  transform: scale(1.05);
}

/* ── Stepper ── */
.awiz-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 40px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.awiz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: default;
  min-width: 64px;
}
.awiz-step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2.5px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.awiz-step.active .awiz-step-circle {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.35), 0 0 0 4px rgba(37,99,235,.1);
  transform: scale(1.08);
}
.awiz-step.done .awiz-step-circle {
  border-color: #10b981;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.awiz-step-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: color .3s;
}
.awiz-step.active .awiz-step-label { color: #2563eb; font-weight: 700; }
.awiz-step.done .awiz-step-label { color: #059669; }
.awiz-step-line {
  flex: 1;
  max-width: 80px;
  min-width: 30px;
  height: 2.5px;
  background: #e2e8f0;
  margin: 0 8px;
  margin-bottom: 20px;
  border-radius: 4px;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.awiz-step-line.done {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* ── Modal body ── */
.asig-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  position: relative;
  background: #f8fafc;
}

/* ── Wizard pages ── */
.awiz-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  animation: awizPageIn .35s cubic-bezier(.16,1,.3,1);
}
@keyframes awizPageIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.awiz-page-inner {
  padding: 28px 32px;
  max-width: 100%;
}
.awiz-page-inner.awiz-page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 20px 32px;
}

/* ── Card centrada (pasos 1 y 4) ── */
.awiz-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px 32px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
.awiz-card--wide {
  max-width: 720px;
}
.awiz-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.awiz-card-icon--confirm {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.awiz-card-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}
.awiz-card-desc {
  margin: 0 0 28px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

/* Paso 1: header compacto */
.awiz-s1-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.awiz-s1-header .awiz-creator-info {
  padding: 8px 12px;
  font-size: 12px;
}
.awiz-s1-header .awiz-creator-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
  border-radius: 8px;
}
.awiz-s1-header .awiz-creator-name { font-size: 12px; }
.awiz-s1-header .awiz-creator-meta { font-size: 10.5px; }

/* Paso 1: grid 2 columnas */
.awiz-s1-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.awiz-s1-col .awiz-form-group { margin-bottom: 14px; }
.awiz-s1-col .awiz-form-group:last-child { margin-bottom: 0; }

/* ── Formulario wizard ── */
.awiz-form-group {
  margin-bottom: 16px;
}
.awiz-form-group:last-child { margin-bottom: 0; }
.awiz-form-row {
  display: flex;
  gap: 12px;
}
.awiz-form-row .awiz-form-group { flex: 1; }
.awiz-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.awiz-req { color: #ef4444; font-size: 13px; }
.awiz-input {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #0f172a;
  background: #fff;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  box-sizing: border-box;
}
.awiz-input--sm {
  padding: 8px 12px;
  font-size: 13px;
}
.awiz-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.awiz-input:hover { border-color: #94a3b8; }
.awiz-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.awiz-input.awiz-input--error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.08);
  animation: awizShake .4s ease-in-out;
}
@keyframes awizShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.awiz-hint {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Method selector ── */
.awiz-method-options {
  display: flex;
  gap: 14px;
}
.awiz-method-opt {
  flex: 1;
  cursor: pointer;
}
.awiz-method-opt input[type="radio"] { display: none; }
.awiz-method-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  position: relative;
}
.awiz-method-card:hover {
  border-color: #93c5fd;
  background: #fafbff;
}
.awiz-method-card svg { color: #64748b; transition: color .2s; }
.awiz-method-card strong {
  font-size: 12.5px;
  color: #334155;
  font-weight: 700;
}
.awiz-method-card span {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.35;
}
.awiz-method-opt input:checked + .awiz-method-card {
  border-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #f0f7ff);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1), 0 4px 12px rgba(37,99,235,.08);
}
.awiz-method-opt input:checked + .awiz-method-card svg { color: #2563eb; }
.awiz-method-opt input:checked + .awiz-method-card strong { color: #1d4ed8; }
.awiz-method-opt input:checked + .awiz-method-card::before {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Creator info ── */
.awiz-creator-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1.5px solid #a7f3d0;
  border-radius: 14px;
}
.awiz-creator-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(5,150,105,.2);
}
.awiz-creator-details { flex: 1; min-width: 0; }
.awiz-creator-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #065f46;
}
.awiz-creator-meta {
  font-size: 11.5px;
  color: #6b7280;
  margin-top: 1px;
}

/* ── Auto options ── */
.awiz-auto-opts {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 4px;
}
.awiz-radio-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #334155;
  padding: 3px 0;
  cursor: pointer;
  transition: color .15s;
}
.awiz-radio-label:hover { color: #1d4ed8; }
.awiz-radio-label input[type="radio"] { accent-color: #2563eb; }

/* ── Paso 2: Users ── */
.awiz-page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.awiz-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}
.awiz-section-title svg { color: #2563eb; }
.awiz-selection-badge {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #93c5fd;
}
.awiz-users-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.awiz-users-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 14px;
  flex: 1;
  min-width: 200px;
  transition: all .2s;
}
.awiz-users-search-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}
.awiz-users-search-wrap svg { flex-shrink: 0; color: #94a3b8; }
.awiz-users-search {
  border: none;
  outline: none;
  font-size: 13.5px;
  flex: 1;
  background: transparent;
  color: #0f172a;
}
.awiz-check-all-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
}
.awiz-check-all-label input { accent-color: #2563eb; }
.awiz-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: calc(100vh - 390px);
  overflow-y: auto;
  padding-right: 4px;
}
.awiz-users-grid::-webkit-scrollbar { width: 5px; }
.awiz-users-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.awiz-users-grid::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.awiz-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  background: #fff;
}
.awiz-user-item:hover {
  border-color: #93c5fd;
  background: #f8faff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37,99,235,.06);
}
.awiz-user-item.selected {
  border-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #f0f7ff);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08), 0 4px 12px rgba(37,99,235,.06);
}
.awiz-user-item.selected .awiz-user-check { accent-color: #2563eb; }
.awiz-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99,102,241,.2);
}
.awiz-user-info { flex: 1; min-width: 0; }
.awiz-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.awiz-user-email {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.awiz-user-check {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}
.awiz-users-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: #94a3b8;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ── Paso 3: Operations ── */
.awiz-ops-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.awiz-ops-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 14px;
  flex: 1;
  min-width: 200px;
  transition: all .2s;
}
.awiz-ops-search-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}
.awiz-ops-search-wrap svg { flex-shrink: 0; color: #94a3b8; }
.awiz-ops-search {
  border: none;
  outline: none;
  font-size: 13.5px;
  flex: 1;
  background: transparent;
  color: #0f172a;
}
.awiz-ops-filter {
  padding: 9px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 13px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s;
}
.awiz-ops-filter:focus { border-color: #2563eb; outline: none; }

/* ── Paso 4: Summary ── */
.awiz-confirm-card { max-width: 640px; }
.awiz-summary {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px 0;
  overflow: hidden;
}
.awiz-sum-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
  gap: 16px;
  transition: background .15s;
}
.awiz-sum-row:hover { background: #f1f5f9; }
.awiz-sum-row:last-child { border-bottom: none; }
.awiz-sum-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  min-width: 130px;
  flex-shrink: 0;
}
.awiz-sum-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  flex: 1;
}
.awiz-sum-value--highlight {
  color: #2563eb;
  font-weight: 700;
}
.awiz-sum-users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.awiz-sum-user-tag {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid #93c5fd;
}
.awiz-sum-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 16px;
  border: 1px solid #fcd34d;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

/* ── Footer wizard ── */
.awiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
.awiz-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.awiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  letter-spacing: -.01em;
}
.awiz-btn--cancel {
  background: transparent;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
}
.awiz-btn--cancel:hover { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.awiz-btn--back {
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #e2e8f0;
}
.awiz-btn--back:hover { background: #e2e8f0; }
.awiz-btn--next {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.2), 0 0 0 1px rgba(37,99,235,.1);
}
.awiz-btn--next:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 20px rgba(37,99,235,.3);
  transform: translateY(-1px);
}
.awiz-btn--next:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.awiz-btn--submit {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.2), 0 0 0 1px rgba(5,150,105,.1);
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 700;
}
.awiz-btn--submit:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 20px rgba(5,150,105,.3);
  transform: translateY(-1px);
}
.awiz-btn--submit:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Scrollbar para wizard pages ── */
.awiz-page::-webkit-scrollbar { width: 6px; }
.awiz-page::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.awiz-page::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Historial Asignaciones */
.asig-hist {
  margin-top: 20px;
  border-top: 2px solid #e5e7eb;
  padding-top: 18px;
}
.asig-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.asig-hist-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.asig-hist-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 10px;
}
.asig-hist-search-wrap svg { color: #9ca3af; }
.asig-hist-search-input {
  border: none;
  outline: none;
  font-size: 13px;
  padding: 7px 4px;
  width: 200px;
  background: transparent;
}
.asig-hist-count {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}
.asig-hist-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.asig-hist-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s;
}
.asig-hist-tab:hover { border-color: #2563eb; color: #2563eb; }
.asig-hist-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.asig-hist-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
}
.asig-hist-tab:not(.active) .asig-hist-badge { background: #e5e7eb; color: #6b7280; }
.asig-hist-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.asig-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.asig-hist-table thead { background: #f8fafc; }
.asig-hist-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.asig-hist-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
}
.asig-hist-table tr:hover { background: #f0f9ff; }
.asig-hist-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 12px 0 4px;
}
.asig-hist-pagination button {
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: all .15s;
}
.asig-hist-pagination button:hover { background: #f3f4f6; }
.asig-hist-pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.asig-hist-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ==================== PANEL PAGOS ==================== */
.pagos-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}
.pagos-resumen { margin-bottom: 18px; }
.pagos-resumen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.pagos-btn-nuevo {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.pagos-btn-nuevo:hover { background: #1d4ed8; }
.pagos-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pagos-kpi {
  flex: 1;
  min-width: 120px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  transition: box-shadow .2s;
}
.pagos-kpi:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pagos-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}
.pagos-kpi-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}
.pagos-kpi--money .pagos-kpi-value { color: #2563eb; }
.pagos-kpi--ok .pagos-kpi-value { color: #059669; }
.pagos-kpi--warn .pagos-kpi-value { color: #d97706; }

/* Modal Pagos */
.pagos-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.pagos-modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pagos-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pagos-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.pagos-modal-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-left: auto;
}
.pagos-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 4px;
}
.pagos-modal-close:hover { color: #1f2937; }
.pagos-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.pagos-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.pagos-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
}
.pagos-btn--primary { background: #2563eb; color: #fff; }
.pagos-btn--primary:hover { background: #1d4ed8; }
.pagos-btn--secondary { background: #f3f4f6; color: #374151; }
.pagos-btn--secondary:hover { background: #e5e7eb; }
.pagos-btn--success { background: #059669; color: #fff; }
.pagos-btn--success:hover { background: #047857; }

/* Formulario Pagos */
.pagos-form { margin-bottom: 20px; }
.pagos-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.pagos-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pagos-form-group label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}
.pagos-input, .pagos-select, .pagos-textarea {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.pagos-input:focus, .pagos-select:focus, .pagos-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.pagos-textarea { resize: vertical; min-height: 60px; }

/* Carga Masiva Pagos */
.pagos-masivo {
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  padding: 16px;
}
.pagos-masivo-header h6 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pagos-masivo-drop {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f9fafb;
}
.pagos-masivo-drop:hover, .pagos-masivo-drop.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.pagos-masivo-drop p {
  margin: 10px 0 4px;
  font-size: 13px;
  color: #6b7280;
}
.pagos-masivo-formats {
  font-size: 11px;
  color: #9ca3af;
}
.pagos-masivo-info {
  margin-top: 12px;
}
.pagos-masivo-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 6px;
}
.pagos-masivo-filename {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
}
.pagos-masivo-filesize {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
}
.pagos-masivo-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pagos-masivo-preview-table th,
.pagos-masivo-preview-table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}
.pagos-masivo-preview-table th {
  background: #f8fafc;
  font-weight: 500;
}

/* Wizard Pagos */
.awiz-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.awiz-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.awiz-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}
.awiz-step.active .awiz-step-circle {
  background: #2563eb;
  color: #fff;
}
.awiz-step.done .awiz-step-circle {
  background: #059669;
  color: #fff;
}
.awiz-step-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.awiz-step.active .awiz-step-label {
  color: #2563eb;
}
.awiz-step.done .awiz-step-label {
  color: #059669;
}
.awiz-step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 0 12px;
  min-width: 40px;
}

/* Paso procesar */
.pagos-procesar {
  text-align: center;
}
.pagos-procesar-resumen {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
}
.pagos-procesar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pagos-procesar-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
}
.pagos-procesar-value {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}
.pagos-procesar-preview {
  text-align: left;
}
.pagos-procesar-preview h6 {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.pagos-procesar-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pagos-procesar-preview th,
.pagos-procesar-preview td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}
.pagos-procesar-preview th {
  background: #f8fafc;
}

/* Historial Pagos */
.pagos-hist { margin-top: 20px; }
.pagos-hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pagos-hist-header-right {
  display: flex;
  gap: 10px;
}
.pagos-hist-search-wrap {
  position: relative;
}
.pagos-hist-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}
.pagos-hist-search-input {
  padding: 8px 12px 8px 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  width: 220px;
}
.pagos-hist-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pagos-hist-tab {
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
}
.pagos-hist-tab:hover { background: #e5e7eb; }
.pagos-hist-tab.active {
  background: #2563eb;
  color: #fff;
}
.pagos-hist-tab-badge {
  background: rgba(0,0,0,.15);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
}
.pagos-hist-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.pagos-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pagos-hist-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}
.pagos-hist-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
}
.pagos-hist-table tr:hover { background: #f9fafb; }
.pagos-td-deuda {
  font-weight: 600;
  color: #059669;
}
.pagos-hist-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 4px;
}
.pagos-hist-pagination button {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
.pagos-hist-pagination button:hover { background: #f3f4f6; }
.pagos-hist-pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.pagos-hist-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ==================== SUBMENU FLYOUT (mobile collapsed) ==================== */
@keyframes flyoutItemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.submenu-flyout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.submenu-flyout-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.submenu-flyout-portal {
  position: fixed;
  left: var(--sidebar-collapsed-width);
  top: 0;
  bottom: 0;
  width: min(240px, 78vw);
  background: var(--sidebar-bg);
  z-index: 201;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}
.submenu-flyout-portal.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
}
.submenu-flyout-portal .submenu-flyout-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}
.submenu-flyout-portal .submenu-flyout-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.submenu-flyout-portal .submenu-flyout-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.submenu-flyout-portal .submenu-flyout-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: scale(1.05);
}
.submenu-flyout-portal .submenu-flyout-close:active {
  transform: scale(0.98);
}
.submenu-flyout-portal .submenu-flyout-close svg {
  width: 18px;
  height: 18px;
}
.submenu-flyout-portal .submenu-flyout-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.submenu-flyout-portal .submenu-flyout-body::-webkit-scrollbar {
  width: 5px;
}
.submenu-flyout-portal .submenu-flyout-body::-webkit-scrollbar-track {
  background: transparent;
}
.submenu-flyout-portal .submenu-flyout-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.submenu-flyout-portal .submenu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  margin: 0 10px 2px;
  border-radius: 8px;
  color: rgba(229, 231, 235, 0.9);
  font-size: 13px;
  opacity: 0;
  animation: flyoutItemIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}
.submenu-flyout-portal .submenu a:nth-child(1) { animation-delay: 0.04s; }
.submenu-flyout-portal .submenu a:nth-child(2) { animation-delay: 0.08s; }
.submenu-flyout-portal .submenu a:nth-child(3) { animation-delay: 0.12s; }
.submenu-flyout-portal .submenu a:nth-child(4) { animation-delay: 0.16s; }
.submenu-flyout-portal .submenu a:nth-child(5) { animation-delay: 0.2s; }
.submenu-flyout-portal .submenu a:nth-child(6) { animation-delay: 0.24s; }
.submenu-flyout-portal .submenu a:nth-child(7) { animation-delay: 0.28s; }
.submenu-flyout-portal .submenu a:nth-child(8) { animation-delay: 0.32s; }
.submenu-flyout-portal .submenu a:nth-child(n+9) { animation-delay: 0.36s; }
.submenu-flyout-portal .submenu a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
  color: #fff;
}
.submenu-flyout-portal .submenu a:active {
  transform: translateX(2px);
  transition-duration: 0.08s;
}
.submenu-flyout-portal .submenu a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.submenu-flyout-portal .submenu a:hover .nav-icon {
  opacity: 1;
}
.submenu-flyout-portal .nav-link-text {
  display: inline !important;
  font-size: 13px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  opacity: 1 !important;
}

/* ==================== SIDEBAR OVERLAY (mobile) ==================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
@media (max-width: 1024px) {
  .sidebar-overlay {
    display: block;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  :root { --sidebar-width: var(--sidebar-collapsed-width); }
  .sidebar {
    width: var(--sidebar-collapsed-width);
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease, width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
  }
  /* Colapsado: solo iconos, texto oculto por completo */
  .sidebar:not(.expanded) .sidebar-header h2,
  .sidebar:not(.expanded) .sidebar-user .user-info {
    display: none !important;
  }
  .sidebar:not(.expanded) .submenu {
    display: none !important;
  }
  /* Ocultar submenú original cuando el portal flyout está activo (evitar duplicado) */
  body.submenu-flyout-open .sidebar .submenu.active {
    display: none !important;
  }
  /* Submenú activo: permitir que el flyout sea visible (evitar overflow:hidden que lo recorta) */
  .sidebar:not(.expanded):has(.submenu.active) {
    overflow: visible;
  }
  .sidebar:not(.expanded):has(.submenu.active) .sidebar-nav {
    overflow: visible;
  }
  .sidebar:not(.expanded) .submenu.active {
    display: block !important;
    position: fixed;
    left: var(--sidebar-collapsed-width);
    top: 0;
    bottom: 0;
    width: min(220px, 75vw);
    background: var(--sidebar-bg);
    padding: 16px 0;
    box-shadow: 6px 0 20px rgba(0, 0, 0, 0.25);
    z-index: 201;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
  .sidebar:not(.expanded) .submenu.active a {
    padding: 10px 16px;
    margin: 2px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
  }
  .sidebar:not(.expanded) .submenu.active .nav-link-text {
    display: inline !important;
    font-size: 13px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }
  .sidebar:not(.expanded) .nav-link-text {
    display: none !important;
    font-size: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .sidebar:not(.expanded) .sidebar-header,
  .sidebar:not(.expanded) .sidebar-user,
  .sidebar:not(.expanded) .nav-link {
    justify-content: center;
    padding: 12px;
    margin: 2px 4px;
  }
  .sidebar:not(.expanded) .nav-link .nav-icon {
    margin: 0;
    flex-shrink: 0;
  }
  .sidebar:not(.expanded) .nav-link {
    min-width: 0;
  }
  .sidebar:not(.expanded) .sidebar-nav {
    overflow-x: hidden;
  }
  .sidebar.expanded {
    width: min(280px, 85vw);
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.3);
    border-right: none;
    overflow: visible;
  }
  .sidebar.expanded .sidebar-header h2,
  .sidebar.expanded .sidebar-user .user-info,
  .sidebar.expanded .nav-link-text,
  .sidebar.expanded .submenu { display: block !important; }
  .sidebar.expanded .sidebar-header,
  .sidebar.expanded .sidebar-user,
  .sidebar.expanded .nav-link { justify-content: flex-start; }
  .sidebar.expanded .nav-link { padding: 10px 14px; margin: 2px 8px; }
  .sidebar.expanded .submenu { padding-left: 12px; }
  .sidebar.expanded .submenu a { margin-left: 20px; }
  .sidebar-toggle {
    display: flex;
    right: -44px;
    top: 14px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }
  .sidebar.expanded .sidebar-toggle {
    right: 12px;
    top: 14px;
    background: rgba(255, 255, 255, 0.12);
  }
  .sidebar.expanded .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .btn-icon.navbar-sidebar-toggle {
    display: flex;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }
  .main { margin-left: var(--sidebar-collapsed-width); }
  #module-chat { left: var(--sidebar-collapsed-width); }
  /* Bloquear scroll del body cuando sidebar está abierto */
  body.sidebar-open {
    overflow: hidden;
  }
}
@media (max-width: 768px) {
  .report-filters-bar { flex-direction: column; }
  .report-filters-bar .filter-item,
  .report-filters-bar .filter-item--date { flex: 1 1 100%; }
  .charts-container { grid-template-columns: 1fr; }
  .kpi-container { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== SOFTPHONE WebRTC (estilo ServiceLeads) ==================== */
.softphone-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: inherit;
}
.softphone-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #1e293b;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.softphone-toggle:hover {
  transform: scale(1.05);
  background: #334155;
}
.softphone-toggle svg {
  width: 24px;
  height: 24px;
}
.softphone-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #ef4444;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Panel oscuro estilo ServiceLeads */
.softphone-panel--dark {
  width: 300px;
  background: #1e293b;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
}
.softphone-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.softphone-panel.softphone-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.softphone-panel.softphone-panel--minimized {
  width: 260px;
}
.softphone-panel.softphone-panel--minimized .softphone-dial,
.softphone-panel.softphone-panel--minimized .softphone-form,
.softphone-panel.softphone-panel--minimized .softphone-tabs,
.softphone-panel.softphone-panel--minimized .softphone-tab-content,
.softphone-panel.softphone-panel--minimized .softphone-call-controls {
  display: none !important;
}
.softphone-panel.softphone-panel--minimized .softphone-in-call {
  display: block !important;
}
.softphone-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #0f172a;
  color: #fff;
}
.softphone-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.softphone-header-icon {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}
.softphone-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.softphone-header-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.softphone-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.softphone-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.softphone-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.softphone-status-dot--disconnected {
  background: #ef4444;
}
.softphone-status-dot--connected {
  background: #22c55e;
}
.softphone-status-text {
  color: #94a3b8;
}

.softphone-form,
.softphone-dial {
  padding: 14px;
}
.softphone-form--credentials .softphone-input {
  margin-bottom: 10px;
}
.softphone-form--credentials .softphone-btn {
  margin-top: 4px;
}
.softphone-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 14px;
  background: #334155;
  color: #e2e8f0;
  box-sizing: border-box;
}
.softphone-input::placeholder {
  color: #64748b;
}
.softphone-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.softphone-number {
  font-size: 18px;
  text-align: center;
  margin-bottom: 12px;
}

/* Tabs */
.softphone-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.softphone-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.softphone-tab:hover {
  color: #94a3b8;
}
.softphone-tab--active {
  background: #6366f1;
  color: #fff;
}

.softphone-dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.softphone-dial-btn {
  width: 56px;
  height: 56px;
  justify-self: center;
  border: none;
  background: #334155;
  color: #e2e8f0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.softphone-dial-btn:hover {
  background: #475569;
  transform: scale(1.05);
}

.softphone-history-list {
  font-size: 13px;
  color: #64748b;
  padding: 12px 0;
  min-height: 80px;
}

/* Controles de llamada: verde (llamar) y rojo (colgar) */
.softphone-call-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}
.softphone-btn-call-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.softphone-btn-call-circle:hover:not(:disabled) {
  background: #16a34a;
  transform: scale(1.05);
}
.softphone-btn-call-circle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.softphone-btn-call-circle svg {
  width: 22px;
  height: 22px;
}
.softphone-btn-hangup-square {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.softphone-btn-hangup-square:hover:not(:disabled) {
  background: #dc2626;
  transform: scale(1.05);
}
.softphone-btn-hangup-square:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.softphone-btn-hangup-square svg {
  width: 20px;
  height: 20px;
}

/* Vista en llamada */
.softphone-in-call {
  padding: 16px 14px;
  text-align: center;
}
.softphone-call-status {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.softphone-timer {
  font-size: 24px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.softphone-in-call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.softphone-ic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.softphone-ic-btn:hover {
  background: #475569;
}
.softphone-ic-btn--hangup {
  background: #ef4444;
  color: #fff;
}
.softphone-ic-btn--hangup:hover {
  background: #dc2626;
}

.softphone-btn {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.softphone-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.softphone-btn-connect {
  background: #6366f1;
  color: #fff;
}
.softphone-btn-connect:hover:not(:disabled) {
  background: #4f46e5;
}
.softphone-btn-disconnect {
  background: #64748b;
  color: #fff;
  margin-top: 8px;
}
.softphone-btn-disconnect:hover {
  background: #475569;
}

/* ==================== SOFTPHONE ServiceLeads (sp-*) ==================== */
.sp-container { position: fixed; bottom: 8px; right: 8px; z-index: 999; font-family: inherit; }
.sp-softphone {
  position: absolute; bottom: 0; right: 0; width: 220px; background: #1e293b;
  border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.25); color: #fff; overflow: hidden;
  display: none; transition: all .3s ease;
}
.sp-softphone.sp-active { display: block; }
.sp-softphone.sp-minimized {
  width: 180px;
  border-radius: 20px;
  bottom: 0;
  background: #1e293b;
}
.sp-softphone.sp-minimized .sp-full-body { display: none; }
.sp-softphone.sp-minimized .sp-mini-bar { display: flex; }
.sp-softphone.sp-minimized .sp-mini-number,
.sp-softphone.sp-minimized .sp-mini-timer {
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 6px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
}
.sp-softphone.sp-minimized .sp-mini-timer { color: #4ade80; font-weight: 700; }
.sp-header {
  padding: 6px 10px; display: flex; justify-content: space-between; align-items: center;
}
.sp-header-title { font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sp-header-title svg { width: 12px; height: 12px; }
.sp-header-btns { display: flex; gap: 2px; align-items: center; }
.sp-header-btn {
  background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 12px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all .15s;
}
.sp-header-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sp-mini-bar {
  display: none; align-items: center; gap: 6px; padding: 6px 10px;
}
.sp-mini-number {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.sp-mini-number::placeholder { color: rgba(148, 163, 184, 0.75); }
.sp-mini-number:focus { border-color: rgba(99, 102, 241, 0.5); }
.sp-mini-timer { font-size: 11px; color: #22c55e; font-weight: 600; font-variant-numeric: tabular-nums; flex: 1; text-align: center; }
.sp-mini-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; color: white; cursor: pointer;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.sp-mini-btn-mute { background: rgba(255,255,255,.15); }
.sp-mini-btn-mute.sp-btn-mute-active { background: #ef4444; }
.sp-mini-btn-hangup { background: #ef4444; }
.sp-mini-btn-expand { background: rgba(255,255,255,.1); font-size: 10px; }
.sp-sip-status {
  padding: 3px 10px; font-size: 9px; display: flex; align-items: center; gap: 4px; cursor: pointer;
}
.sp-sip-status:hover { background: rgba(255,255,255,.05); }
.sp-status-dot { width: 5px; height: 5px; border-radius: 50%; }
.sp-status-dot--disconnected { background: #ef4444; }
.sp-status-dot--connected { background: #22c55e; }
.sp-status-cog { margin-left: auto; font-size: 9px; opacity: .5; }
.sp-display { padding: 4px 10px; text-align: center; }
#spPhoneDisplay { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; min-height: 22px; }
#spPhoneDisplay.sp-phone-display {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 8px;
  text-align: center;
  cursor: text;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
#spPhoneDisplay.sp-phone-display::placeholder {
  color: rgba(148, 163, 184, 0.75);
  font-weight: 500;
}
#spPhoneDisplay.sp-phone-display:hover,
#spPhoneDisplay.sp-phone-display:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.45);
}
#spCallStatusText { font-size: 9px; color: #94a3b8; }
#spCallTimer { font-size: 10px; color: #22c55e; font-variant-numeric: tabular-nums; }
#spContactName { font-size: 9px; color: #94a3b8; }
.sp-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.08); }
.sp-tab { flex: 1; padding: 4px; text-align: center; font-size: 9px; cursor: pointer; opacity: .5; border-bottom: 2px solid transparent; }
.sp-tab:hover { opacity: .7; }
.sp-tab-active { opacity: 1; border-bottom-color: #6366f1; }
.sp-tab-content { display: none; }
.sp-tab-content.sp-tab-active { display: block; }
.sp-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 10px; }
.sp-keypad-btn {
  padding: 6px; background: rgba(255,255,255,.08); border: none; border-radius: 50%; color: white;
  font-size: 13px; cursor: pointer; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
}
.sp-keypad-btn:hover { background: rgba(255,255,255,.15); }
.sp-audio-controls { display: flex; justify-content: center; gap: 6px; padding: 4px; }
.sp-audio-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(255,255,255,.1);
  color: white; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.sp-audio-btn.sp-btn-mute-active { background: #ef4444; }
.sp-actions { display: flex; justify-content: center; gap: 8px; padding: 6px 10px 8px; }
.sp-call-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; color: white; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.sp-call-btn-green { background: #22c55e; }
.sp-call-btn-red { background: #ef4444; }
.sp-call-btn-gray { background: #64748b; }
.sp-call-btn-sm { width: 30px; height: 30px; font-size: 12px; }
.sp-calling { animation: sp-pulse 1.5s infinite; }
@keyframes sp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.sp-history-item { padding: 4px 10px; border-bottom: 1px solid rgba(255,255,255,.05); display: flex; align-items: center; gap: 6px; font-size: 10px; }
.sp-history-icon { font-size: 9px; }
.sp-history-body { flex: 1; }
.sp-history-num { font-weight: 500; }
.sp-history-name { font-size: 9px; color: #94a3b8; }
.sp-history-time { font-size: 9px; color: #64748b; }
.sp-incoming-badge {
  position: absolute; top: -5px; right: -5px; background: #ef4444; color: white;
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px;
  display: flex; align-items: center; justify-content: center; animation: sp-pulse 1s infinite;
}
/* Campos SIP solo para uso interno (valores desde API); el usuario no configura SIP aquí */
.sp-sip-config-offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
.sp-sip-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sp-sip-modal.sp-modal-active { opacity: 1; pointer-events: auto; }
.sp-sip-modal-content {
  background: #1e293b; color: white; padding: 20px; border-radius: 12px; width: 340px;
}
.sp-sip-modal-content h3 { font-size: 14px; margin-bottom: 12px; }
.sp-form-group { margin-bottom: 12px; }
.sp-form-group label { display: block; margin-bottom: 4px; font-size: 12px; color: #94a3b8; }
.sp-input {
  width: 100%; padding: 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px;
  background: #334155; color: #e2e8f0; font-size: 13px; box-sizing: border-box;
}
.sp-form-actions { display: flex; gap: 8px; margin-top: 14px; }
.sp-btn { padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; }
.sp-btn-primary { background: #6366f1; color: #fff; }
.sp-btn-primary:hover { background: #4f46e5; }
.sp-btn-secondary { background: #64748b; color: #fff; }
.sp-btn-secondary:hover { background: #475569; }
.sp-toast {
  position: fixed; top: 16px; right: 16px; padding: 10px 16px; border-radius: 8px;
  color: white; font-size: 12px; z-index: 1001; opacity: 0; transform: translateY(-10px);
  transition: all .3s;
}
.sp-toast--show { opacity: 1; transform: translateY(0); }
.sp-toast--success { background: #22c55e; }
.sp-toast--error { background: #ef4444; }
.sp-toast--info { background: #6366f1; }
.sp-hidden { display: none !important; }

/* ==================== MÓDULO REPORTE GESTIONES ==================== */

/* Variante verde: debe ir después de .rg-hero compartido (mayor especificidad) */
#module-compromiso-pagos .rg-hero.rg-hero--emerald, #module-barrido-cartera .rg-hero.rg-hero--emerald, #module-reportecdr .rg-hero.rg-hero--emerald {
  background: linear-gradient(135deg, #064e3b 0%, #047857 42%, #059669 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

#module-compromiso-pagos .rg-hero.rg-hero--emerald .rg-hero-icon svg,
#module-barrido-cartera .rg-hero.rg-hero--emerald .rg-hero-icon svg {
  color: #6ee7b7;
}

#module-compromiso-pagos .rg-stat-card--accent, #module-barrido-cartera .rg-stat-card--accent, #module-reportecdr .rg-stat-card--accent {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(110, 231, 183, 0.35);
}

#module-reportegestiones .rg-col-num, #module-reportecdr .rg-col-num,
#module-compromiso-pagos .rg-col-num, #module-barrido-cartera .rg-col-num, #module-reportecdr .rg-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


#module-reportegestiones.rg-module, #module-reportecdr.rg-module,
#module-compromiso-pagos.rg-module, #module-barrido-cartera.rg-module {
  padding: 0 4px 20px;
  max-width: 100%;
}

#module-reportegestiones .rg-hero, #module-reportecdr .rg-hero,
#module-compromiso-pagos .rg-hero, #module-barrido-cartera .rg-hero, #module-reportecdr .rg-hero{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 48%, #1d4ed8 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  color: #f8fafc;
}

#module-reportegestiones .rg-hero-text, #module-reportecdr .rg-hero-text,
#module-compromiso-pagos .rg-hero-text, #module-barrido-cartera .rg-hero-text, #module-reportecdr .rg-hero-text{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}

#module-reportegestiones .rg-hero-icon, #module-reportecdr .rg-hero-icon,
#module-compromiso-pagos .rg-hero-icon, #module-barrido-cartera .rg-hero-icon, #module-reportecdr .rg-hero-icon{
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#module-reportegestiones .rg-hero-icon svg,
#module-compromiso-pagos .rg-hero-icon svg, #module-barrido-cartera .rg-hero-icon svg,
#module-reportecdr .rg-hero-icon svg {
  width: 26px;
  height: 26px;
  color: #93c5fd;
}

#module-reportegestiones .rg-title, #module-reportecdr .rg-title,
#module-compromiso-pagos .rg-title, #module-barrido-cartera .rg-title, #module-reportecdr .rg-title{
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

#module-reportegestiones .rg-subtitle, #module-reportecdr .rg-subtitle,
#module-compromiso-pagos .rg-subtitle, #module-barrido-cartera .rg-subtitle, #module-reportecdr .rg-subtitle{
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.85);
  max-width: 520px;
}

#module-reportegestiones .rg-stats, #module-reportecdr .rg-stats,
#module-compromiso-pagos .rg-stats, #module-barrido-cartera .rg-stats, #module-reportecdr .rg-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#module-reportegestiones .rg-stat-card, #module-reportecdr .rg-stat-card,
#module-compromiso-pagos .rg-stat-card, #module-barrido-cartera .rg-stat-card, #module-reportecdr .rg-stat-card{
  min-width: 120px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

#module-reportegestiones .rg-stat-card--accent, #module-reportecdr .rg-stat-card--accent {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(147, 197, 253, 0.35);
}

#module-reportegestiones .rg-stat-value, #module-reportecdr .rg-stat-value,
#module-compromiso-pagos .rg-stat-value, #module-barrido-cartera .rg-stat-value, #module-reportecdr .rg-stat-value{
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

#module-reportegestiones .rg-stat-label, #module-reportecdr .rg-stat-label,
#module-compromiso-pagos .rg-stat-label, #module-barrido-cartera .rg-stat-label, #module-reportecdr .rg-stat-label{
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.75);
}

#module-reportegestiones .rg-filters-card, #module-reportecdr .rg-filters-card,
#module-compromiso-pagos .rg-filters-card, #module-barrido-cartera .rg-filters-card, #module-reportecdr .rg-filters-card{
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

#module-reportegestiones .rg-filters-head, #module-reportecdr .rg-filters-head,
#module-compromiso-pagos .rg-filters-head, #module-barrido-cartera .rg-filters-head, #module-reportecdr .rg-filters-head{
  padding: 12px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

#module-reportegestiones .rg-filters-title, #module-reportecdr .rg-filters-title,
#module-compromiso-pagos .rg-filters-title, #module-barrido-cartera .rg-filters-title, #module-reportecdr .rg-filters-title{
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

#module-reportegestiones .rg-filters-body, #module-reportecdr .rg-filters-body,
#module-compromiso-pagos .rg-filters-body, #module-barrido-cartera .rg-filters-body, #module-reportecdr .rg-filters-body{
  padding: 16px 18px;
}

#module-reportegestiones .rg-filter-grid, #module-reportecdr .rg-filter-grid,
#module-compromiso-pagos .rg-filter-grid, #module-barrido-cartera .rg-filter-grid, #module-reportecdr .rg-filter-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
  margin-bottom: 16px;
}

#module-reportegestiones .rg-field, #module-reportecdr .rg-field,
#module-compromiso-pagos .rg-field, #module-barrido-cartera .rg-field, #module-reportecdr .rg-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

#module-reportegestiones .rg-label, #module-reportecdr .rg-label,
#module-compromiso-pagos .rg-label, #module-barrido-cartera .rg-label, #module-reportecdr .rg-label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

#module-reportegestiones .rg-control, #module-reportecdr .rg-control,
#module-compromiso-pagos .rg-control, #module-barrido-cartera .rg-control, #module-reportecdr .rg-control{
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

#module-reportegestiones .rg-control:hover:not(:disabled), #module-reportecdr .rg-control:hover:not(:disabled),
#module-compromiso-pagos .rg-control:hover:not(:disabled), #module-barrido-cartera .rg-control:hover:not(:disabled), #module-reportecdr .rg-control:hover:not(:disabled){
  border-color: #94a3b8;
}

#module-reportegestiones .rg-control:focus, #module-reportecdr .rg-control:focus,
#module-compromiso-pagos .rg-control:focus, #module-barrido-cartera .rg-control:focus, #module-reportecdr .rg-control:focus{
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#module-reportegestiones .rg-control:disabled, #module-reportecdr .rg-control:disabled,
#module-compromiso-pagos .rg-control:disabled, #module-barrido-cartera .rg-control:disabled, #module-reportecdr .rg-control:disabled{
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

#module-reportegestiones .rg-actions, #module-reportecdr .rg-actions,
#module-compromiso-pagos .rg-actions, #module-barrido-cartera .rg-actions, #module-reportecdr .rg-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

#module-reportegestiones .rg-btn, #module-reportecdr .rg-btn,
#module-compromiso-pagos .rg-btn, #module-barrido-cartera .rg-btn, #module-reportecdr .rg-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

#module-reportegestiones .rg-btn:active:not(:disabled), #module-reportecdr .rg-btn:active:not(:disabled),
#module-compromiso-pagos .rg-btn:active:not(:disabled), #module-barrido-cartera .rg-btn:active:not(:disabled), #module-reportecdr .rg-btn:active:not(:disabled){
  transform: translateY(1px);
}

#module-reportegestiones .rg-btn:disabled, #module-reportecdr .rg-btn:disabled,
#module-compromiso-pagos .rg-btn:disabled, #module-barrido-cartera .rg-btn:disabled, #module-reportecdr .rg-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

#module-reportegestiones .rg-btn--primary, #module-reportecdr .rg-btn--primary,
#module-compromiso-pagos .rg-btn--primary, #module-barrido-cartera .rg-btn--primary, #module-reportecdr .rg-btn--primary{
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

#module-reportegestiones .rg-btn--primary:hover:not(:disabled), #module-reportecdr .rg-btn--primary:hover:not(:disabled),
#module-compromiso-pagos .rg-btn--primary:hover:not(:disabled), #module-barrido-cartera .rg-btn--primary:hover:not(:disabled), #module-reportecdr .rg-btn--primary:hover:not(:disabled){
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

#module-reportegestiones .rg-btn--ghost, #module-reportecdr .rg-btn--ghost,
#module-compromiso-pagos .rg-btn--ghost, #module-barrido-cartera .rg-btn--ghost, #module-reportecdr .rg-btn--ghost{
  color: #475569;
  background: #fff;
  border-color: #cbd5e1;
}

#module-reportegestiones .rg-btn--ghost:hover:not(:disabled), #module-reportecdr .rg-btn--ghost:hover:not(:disabled),
#module-compromiso-pagos .rg-btn--ghost:hover:not(:disabled), #module-barrido-cartera .rg-btn--ghost:hover:not(:disabled), #module-reportecdr .rg-btn--ghost:hover:not(:disabled){
  background: #f8fafc;
  border-color: #94a3b8;
}

#module-reportegestiones .rg-btn--sm, #module-reportecdr .rg-btn--sm,
#module-compromiso-pagos .rg-btn--sm, #module-barrido-cartera .rg-btn--sm, #module-reportecdr .rg-btn--sm{
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

#module-reportegestiones .rg-btn-icon, #module-reportecdr .rg-btn-icon,
#module-compromiso-pagos .rg-btn-icon, #module-barrido-cartera .rg-btn-icon, #module-reportecdr .rg-btn-icon{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#module-reportegestiones .rg-btn.is-loading .rg-btn-icon,
#module-compromiso-pagos .rg-btn.is-loading .rg-btn-icon, #module-barrido-cartera .rg-btn.is-loading .rg-btn-icon,
#module-reportecdr .rg-btn.is-loading .rg-btn-icon {
  animation: rg-spin 0.7s linear infinite;
}

@keyframes rg-spin {
  to { transform: rotate(360deg); }
}

#module-reportegestiones .rg-status-bar, #module-reportecdr .rg-status-bar,
#module-compromiso-pagos .rg-status-bar, #module-barrido-cartera .rg-status-bar, #module-reportecdr .rg-status-bar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

#module-reportegestiones .rg-status-bar[hidden], #module-reportecdr .rg-status-bar[hidden],
#module-compromiso-pagos .rg-status-bar[hidden], #module-barrido-cartera .rg-status-bar[hidden], #module-reportecdr .rg-status-bar[hidden]{
  display: none !important;
}

#module-reportegestiones .rg-status-bar.is-ok, #module-reportecdr .rg-status-bar.is-ok,
#module-compromiso-pagos .rg-status-bar.is-ok, #module-barrido-cartera .rg-status-bar.is-ok, #module-reportecdr .rg-status-bar.is-ok{
  background: #f0fdf4;
  color: #166534;
  border-top-color: #bbf7d0;
}

#module-reportegestiones .rg-status-bar.is-ok .rg-status-dot,
#module-compromiso-pagos .rg-status-bar.is-ok .rg-status-dot, #module-barrido-cartera .rg-status-bar.is-ok .rg-status-dot,
#module-reportecdr .rg-status-bar.is-ok .rg-status-dot {
  background: #22c55e;
}

#module-reportegestiones .rg-status-bar.is-error, #module-reportecdr .rg-status-bar.is-error,
#module-compromiso-pagos .rg-status-bar.is-error, #module-barrido-cartera .rg-status-bar.is-error, #module-reportecdr .rg-status-bar.is-error{
  background: #fef2f2;
  color: #b91c1c;
  border-top-color: #fecaca;
}

#module-reportegestiones .rg-status-bar.is-error .rg-status-dot,
#module-compromiso-pagos .rg-status-bar.is-error .rg-status-dot, #module-barrido-cartera .rg-status-bar.is-error .rg-status-dot,
#module-reportecdr .rg-status-bar.is-error .rg-status-dot {
  background: #ef4444;
}

#module-reportegestiones .rg-status-dot, #module-reportecdr .rg-status-dot,
#module-compromiso-pagos .rg-status-dot, #module-barrido-cartera .rg-status-dot, #module-reportecdr .rg-status-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

#module-reportegestiones .rg-table-card, #module-reportecdr .rg-table-card,
#module-compromiso-pagos .rg-table-card, #module-barrido-cartera .rg-table-card, #module-reportecdr .rg-table-card{
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

#module-reportegestiones .rg-table-head, #module-reportecdr .rg-table-head,
#module-compromiso-pagos .rg-table-head, #module-barrido-cartera .rg-table-head, #module-reportecdr .rg-table-head{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

#module-reportegestiones .rg-table-title, #module-reportecdr .rg-table-title,
#module-compromiso-pagos .rg-table-title, #module-barrido-cartera .rg-table-title, #module-reportecdr .rg-table-title{
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

#module-reportegestiones .rg-table-hint, #module-reportecdr .rg-table-hint,
#module-compromiso-pagos .rg-table-hint, #module-barrido-cartera .rg-table-hint, #module-reportecdr .rg-table-hint{
  font-size: 12px;
  color: #64748b;
}

#module-reportegestiones .rg-table-scroll, #module-reportecdr .rg-table-scroll,
#module-compromiso-pagos .rg-table-scroll, #module-barrido-cartera .rg-table-scroll, #module-reportecdr .rg-table-scroll{
  position: relative;
  overflow: auto;
  max-height: min(62vh, 640px);
}

#module-reportegestiones .rg-loading, #module-reportecdr .rg-loading,
#module-compromiso-pagos .rg-loading, #module-barrido-cartera .rg-loading, #module-reportecdr .rg-loading{
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

#module-reportegestiones .rg-loading[hidden], #module-reportecdr .rg-loading[hidden],
#module-compromiso-pagos .rg-loading[hidden], #module-barrido-cartera .rg-loading[hidden], #module-reportecdr .rg-loading[hidden]{
  display: none !important;
}

#module-reportegestiones .rg-loading-spinner, #module-reportecdr .rg-loading-spinner,
#module-compromiso-pagos .rg-loading-spinner, #module-barrido-cartera .rg-loading-spinner, #module-reportecdr .rg-loading-spinner{
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: rg-spin 0.75s linear infinite;
}

#module-reportegestiones .rg-table,
#module-compromiso-pagos .rg-table, #module-barrido-cartera .rg-table,
#module-reportecdr .rg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#module-reportegestiones .rg-table thead,
#module-compromiso-pagos .rg-table thead, #module-barrido-cartera .rg-table thead,
#module-reportecdr .rg-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

#module-reportegestiones .rg-table thead th,
#module-compromiso-pagos .rg-table thead th, #module-barrido-cartera .rg-table thead th,
#module-reportecdr .rg-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

#module-reportegestiones .rg-table tbody td,
#module-compromiso-pagos .rg-table tbody td, #module-barrido-cartera .rg-table tbody td,
#module-reportecdr .rg-table tbody td {
  padding: 9px 12px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#module-reportegestiones .rg-table tbody tr:hover td,
#module-compromiso-pagos .rg-table tbody tr:hover td, #module-barrido-cartera .rg-table tbody tr:hover td,
#module-reportecdr .rg-table tbody tr:hover td {
  background: #f8fafc;
}

#module-reportegestiones .rg-table tbody tr:nth-child(even) td,
#module-compromiso-pagos .rg-table tbody tr:nth-child(even) td, #module-barrido-cartera .rg-table tbody tr:nth-child(even) td,
#module-reportecdr .rg-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

#module-reportegestiones .rg-table tbody tr:nth-child(even):hover td,
#module-compromiso-pagos .rg-table tbody tr:nth-child(even):hover td, #module-barrido-cartera .rg-table tbody tr:nth-child(even):hover td,
#module-reportecdr .rg-table tbody tr:nth-child(even):hover td {
  background: #f1f5f9;
}

#module-reportegestiones .rg-col-detalle,
#module-reportegestiones .rg-table tbody td.rg-col-detalle {
  min-width: 180px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}

#module-reportegestiones .rg-empty-row td,
#module-compromiso-pagos .rg-empty-row td, #module-barrido-cartera .rg-empty-row td,
#module-reportecdr .rg-empty-row td {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  max-width: none !important;
}

#module-reportegestiones .rg-empty,
#module-compromiso-pagos .rg-empty, #module-barrido-cartera .rg-empty,
#module-reportecdr .rg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: #94a3b8;
}

#module-reportegestiones .rg-empty svg,
#module-compromiso-pagos .rg-empty svg, #module-barrido-cartera .rg-empty svg,
#module-reportecdr .rg-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

#module-reportegestiones .rg-empty p,
#module-compromiso-pagos .rg-empty p, #module-barrido-cartera .rg-empty p,
#module-reportecdr .rg-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  max-width: 360px;
}

#module-reportegestiones .rg-empty strong,
#module-compromiso-pagos .rg-empty strong, #module-barrido-cartera .rg-empty strong,
#module-reportecdr .rg-empty strong {
  color: #64748b;
}

#module-reportegestiones .rg-pager, #module-reportecdr .rg-pager,
#module-compromiso-pagos .rg-pager, #module-barrido-cartera .rg-pager, #module-reportecdr .rg-pager{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: #fafbfc;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  #module-reportegestiones .rg-hero, #module-reportecdr .rg-hero,
#module-compromiso-pagos .rg-hero, #module-barrido-cartera .rg-hero, #module-reportecdr .rg-hero{
    padding: 16px;
  }
  #module-reportegestiones .rg-stat-value, #module-reportecdr .rg-stat-value,
#module-compromiso-pagos .rg-stat-value, #module-barrido-cartera .rg-stat-value, #module-reportecdr .rg-stat-value{
    font-size: 18px;
  }
  #module-reportegestiones .rg-filter-grid, #module-reportecdr .rg-filter-grid,
#module-compromiso-pagos .rg-filter-grid, #module-barrido-cartera .rg-filter-grid, #module-reportecdr .rg-filter-grid{
    grid-template-columns: 1fr;
  }
}

#module-reportecdr .reportecdr-table-scroll {
  min-height: 120px;
}
#module-reportecdr .reportecdr-table-panel {
  border: none;
  background: transparent;
  padding: 0;
}
#module-reportecdr .reportecdr-table-panel .supervision-gh-detail-table {
  min-width: 1200px;
}
#module-reportecdr .reportecdr-table-panel .supervision-gh-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
#module-reportecdr .reportecdr-rec-dl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  white-space: nowrap;
}
#module-reportecdr .reportecdr-rec-dl svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
#module-reportecdr .reportecdr-rec-dl:hover {
  background: #dbeafe;
  color: #1e40af;
}


/* ========== Reporte Cedente — compacto / gerencial ========== */
#module-reporte-cedente.rg-module {
  padding: 0 2px 12px;
  max-width: 960px;
}
#module-reporte-cedente .module-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Header compacto */
#module-reporte-cedente .rc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  background: linear-gradient(105deg, #0c1524 0%, #152a45 55%, #1a3a66 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}
#module-reporte-cedente .rc-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}
#module-reporte-cedente .rc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.2;
}
#module-reporte-cedente .rc-title-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.7);
  white-space: nowrap;
}
#module-reporte-cedente .rc-kpis {
  display: flex;
  gap: 8px;
}
#module-reporte-cedente .rc-kpi {
  min-width: 72px;
  padding: 5px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}
#module-reporte-cedente .rc-kpi--accent {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.28);
}
#module-reporte-cedente .rc-kpi-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
#module-reporte-cedente .rc-kpi-lbl {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.65);
}

/* Paneles */
#module-reporte-cedente .rc-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
#module-reporte-cedente .rc-panel--filters {
  padding: 0;
}
#module-reporte-cedente .rc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 10px 12px;
}
#module-reporte-cedente .rc-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  min-width: 130px;
  flex: 1 1 130px;
  max-width: 180px;
}
#module-reporte-cedente .rc-field--sm {
  min-width: 88px;
  max-width: 110px;
  flex: 0 1 100px;
}
#module-reporte-cedente .rc-field--date {
  min-width: 118px;
  max-width: 132px;
  flex: 0 1 128px;
}
#module-reporte-cedente .rc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1.2;
}
#module-reporte-cedente .rc-control {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  box-sizing: border-box;
  transition: border-color 0.12s, box-shadow 0.12s;
}
#module-reporte-cedente .rc-control:hover:not(:disabled) { border-color: #94a3b8; }
#module-reporte-cedente .rc-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
#module-reporte-cedente .rc-control:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}
#module-reporte-cedente .rc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-bottom: 0;
  flex: 0 0 auto;
}
#module-reporte-cedente .rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
#module-reporte-cedente .rc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#module-reporte-cedente .rc-btn--primary {
  color: #fff;
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.25);
}
#module-reporte-cedente .rc-btn--primary:hover:not(:disabled) {
  background: #1e40af;
  border-color: #1e40af;
}
#module-reporte-cedente .rc-btn--ghost {
  color: #475569;
  background: #fff;
  border-color: #cbd5e1;
}
#module-reporte-cedente .rc-btn--ghost:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}
#module-reporte-cedente .rc-btn-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
#module-reporte-cedente .rc-btn.is-loading .rc-btn-icon {
  animation: rg-spin 0.7s linear infinite;
}
#module-reporte-cedente .rc-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 7px;
  font-size: 11px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  color: #64748b;
}
#module-reporte-cedente .rc-status[hidden] { display: none !important; }
#module-reporte-cedente .rc-status.is-ok {
  background: #f0fdf4;
  color: #166534;
  border-top-color: #bbf7d0;
}
#module-reporte-cedente .rc-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border-top-color: #fecaca;
}
#module-reporte-cedente .rc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
#module-reporte-cedente .rc-status.is-ok .rc-status-dot { background: #22c55e; }
#module-reporte-cedente .rc-status.is-error .rc-status-dot { background: #ef4444; }

/* Tabla profesional — Intensidad */
#module-reporte-cedente .rc-panel--table {
  border: 1px solid #d0dbe6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  border-radius: 10px;
}
#module-reporte-cedente .rc-panel-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  border-bottom: 1px solid #d8e1ea;
}
#module-reporte-cedente .rc-panel-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
#module-reporte-cedente .rc-panel-meta-badge {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2563eb 0%, #0f172a 100%);
}
#module-reporte-cedente .rc-panel-meta-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
}
#module-reporte-cedente .rc-panel-meta-hint {
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
#module-reporte-cedente .rc-table-wrap {
  position: relative;
  overflow: auto;
  max-height: min(62vh, 560px);
  background: #fff;
}
#module-reporte-cedente .rc-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
#module-reporte-cedente .rc-loading[hidden] { display: none !important; }
#module-reporte-cedente .rc-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: rg-spin 0.7s linear infinite;
}

#module-reporte-cedente .rc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
  font-size: 12.5px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
#module-reporte-cedente .rc-table-caption {
  caption-side: top;
  padding: 0;
  text-align: left;
  background: linear-gradient(105deg, #0f172a 0%, #1e3a5f 60%, #1d4ed8 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#module-reporte-cedente .rc-table-caption-title {
  display: block;
  padding: 10px 14px 2px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#module-reporte-cedente .rc-table-caption-sub {
  display: block;
  padding: 0 14px 10px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.78);
  letter-spacing: 0.02em;
}

#module-reporte-cedente .rc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1e4d78;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid #0f3350;
  padding: 9px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#module-reporte-cedente .rc-table thead th.rc-th-prov {
  text-align: left;
}
#module-reporte-cedente .rc-table thead th.rc-th-int {
  background: #163a5c;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

#module-reporte-cedente .rc-table tbody td {
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #e6edf3;
  padding: 8px 12px;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
#module-reporte-cedente .rc-table .rc-data-row.rc-row--a td:not(.rc-cadena-cell) {
  background: #fff;
}
#module-reporte-cedente .rc-table .rc-data-row.rc-row--b td:not(.rc-cadena-cell) {
  background: #f5f8fb;
}
#module-reporte-cedente .rc-table .rc-data-row:hover td:not(.rc-cadena-cell) {
  background: #eaf2fa;
}

#module-reporte-cedente .rc-table .rc-prov-cell {
  text-align: left;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.01em;
}
#module-reporte-cedente .rc-table .rc-num {
  text-align: center;
  color: #334155;
}
#module-reporte-cedente .rc-table .rc-num--int {
  font-weight: 600;
  color: #0f172a;
}
#module-reporte-cedente .rc-table .rc-num--intensidad {
  font-weight: 800;
  color: #0f3d6e;
  background: rgba(30, 77, 120, 0.06);
  border-left: 1px solid #e2e8f0;
}

#module-reporte-cedente .rc-table .rc-cadena-cell {
  background: linear-gradient(180deg, #eef3f8 0%, #e2eaf2 100%);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
  text-align: center;
  vertical-align: middle;
  border-right: 2px solid #c5d4e3;
  min-width: 108px;
  max-width: 140px;
  padding: 10px 8px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.6);
}
#module-reporte-cedente .rc-table .rc-cadena-label {
  display: inline-block;
  writing-mode: horizontal-tb;
  line-height: 1.3;
  max-width: 120px;
  word-break: break-word;
}

#module-reporte-cedente .rc-table .rc-total-row td {
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  border-bottom: none;
  padding: 10px 12px;
  font-size: 12.5px;
  border-top: 2px solid #1e4d78;
}
#module-reporte-cedente .rc-table .rc-total-row .rc-total-label {
  text-align: left;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
}
#module-reporte-cedente .rc-table .rc-total-row .rc-num--intensidad {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

#module-reporte-cedente .rc-empty {
  padding: 32px 12px;
  text-align: center;
  color: #94a3b8;
}
#module-reporte-cedente .rc-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
#module-reporte-cedente .rc-empty-row td {
  border-bottom: none;
  padding: 0;
  background: #fff;
}

@media (max-width: 720px) {
  #module-reporte-cedente .rc-field,
  #module-reporte-cedente .rc-field--sm,
  #module-reporte-cedente .rc-field--date {
    max-width: none;
    flex: 1 1 100%;
  }
  #module-reporte-cedente .rc-actions {
    margin-left: 0;
    width: 100%;
  }
  #module-reporte-cedente .rc-btn {
    flex: 1;
  }
}



/* ========== Ubicabilidad (reporte cedente) ========== */
#module-reporte-cedente .rc-panel--ubicabilidad {
  margin-top: 2px;
  border: 1px solid #d0dbe6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
#module-reporte-cedente .rc-table-caption--ub {
  background: linear-gradient(105deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
}
#module-reporte-cedente .ub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 520px;
  font-size: 12.5px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
#module-reporte-cedente .ub-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #b8d4ea;
  color: #0f172a;
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid #8eb6d4;
  padding: 9px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#module-reporte-cedente .ub-table thead th.ub-th-gestion {
  text-align: left;
}
#module-reporte-cedente .ub-table tbody td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  padding: 7px 12px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
#module-reporte-cedente .ub-table tbody td:last-child {
  border-right: none;
}
#module-reporte-cedente .ub-table .ub-gestion {
  text-align: left;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.01em;
}
#module-reporte-cedente .ub-table .ub-num {
  text-align: center;
  font-weight: 600;
  color: #1e293b;
}
#module-reporte-cedente .ub-table .ub-num--money {
  white-space: nowrap;
}
#module-reporte-cedente .ub-table .ub-pct {
  text-align: center;
  vertical-align: middle;
  font-weight: 800;
  border-left: 2px solid rgba(15, 23, 42, 0.1);
  min-width: 100px;
  padding: 8px 10px;
}
#module-reporte-cedente .ub-table .ub-pct-val {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
#module-reporte-cedente .ub-table .ub-pct-tipo {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.72;
  max-width: 110px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.25;
}

/* Grupos por color (como Excel de referencia) */
#module-reporte-cedente .ub-table .ub-group--directo td {
  background: #c6efce;
  color: #0f172a;
}
#module-reporte-cedente .ub-table .ub-group--indirecto td {
  background: #fff2cc;
  color: #0f172a;
}
#module-reporte-cedente .ub-table .ub-group--nocontacto td {
  background: #ffc7ce;
  color: #0f172a;
}
#module-reporte-cedente .ub-table .ub-group--otro td {
  background: #e8eef5;
  color: #0f172a;
}
#module-reporte-cedente .ub-table tr.ub-row:hover td {
  filter: brightness(0.97);
}

#module-reporte-cedente .ub-table .ub-total-row td {
  background: #b8d4ea;
  color: #0f172a;
  font-weight: 800;
  border-top: 2px solid #6b9ac4;
  border-bottom: none;
  padding: 10px 12px;
  font-size: 12.5px;
}
#module-reporte-cedente .ub-table .ub-total-label {
  text-align: left;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
#module-reporte-cedente .ub-table .ub-total-row .ub-pct {
  border-left: 2px solid rgba(15, 23, 42, 0.12);
  font-size: 13px;
}

/* ==================== ALERTAS AGENDAMIENTOS (flotante derecho, sutil) ==================== */
.agend-alerts-fab {
  position: fixed;
  top: 42%;
  right: 0;
  z-index: 1200;
  transform: translateY(-50%);
  width: 30px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: rgba(37, 99, 235, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  box-shadow: -1px 2px 8px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.78;
  transition: opacity .2s ease, background .2s ease, box-shadow .2s ease, right .2s ease;
}
.agend-alerts-fab svg {
  width: 15px;
  height: 15px;
}
.agend-alerts-fab:hover {
  opacity: 1;
  background: rgba(37, 99, 235, 0.62);
  box-shadow: -2px 3px 10px rgba(15, 23, 42, 0.16);
}
.agend-alerts-fab.is-open {
  right: 248px;
  opacity: 1;
}
.agend-alerts-fab.has-due {
  background: rgba(220, 38, 38, 0.48);
  opacity: 0.9;
  animation: agend-alerts-pulse 2.2s ease-in-out infinite;
}
@keyframes agend-alerts-pulse {
  0%, 100% { box-shadow: -1px 2px 8px rgba(220, 38, 38, 0.18); }
  50% { box-shadow: -1px 2px 12px rgba(220, 38, 38, 0.32); }
}
.agend-alerts-fab-badge {
  position: absolute;
  top: -5px;
  left: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.92);
  color: #1f2937;
  font-size: 9px;
  font-weight: 750;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.agend-alerts-fab.has-due .agend-alerts-fab-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
}

.agend-alerts-panel {
  position: fixed;
  top: 10vh;
  right: 0;
  bottom: 12vh;
  width: 248px;
  max-width: 88vw;
  z-index: 1190;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 18px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  font-size: 11px;
}
.agend-alerts-panel[hidden] { display: none !important; }
.agend-alerts-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.agend-alerts-panel-title {
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.01em;
  opacity: 0.92;
}
.agend-alerts-panel-close {
  border: 0;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 5px;
  opacity: 0.75;
}
.agend-alerts-panel-close:hover {
  background: rgba(148,163,184,.16);
  opacity: 1;
}
.agend-alerts-panel-meta {
  padding: 5px 10px 6px;
  font-size: 10px;
  color: var(--text-secondary, #64748b);
  opacity: 0.9;
}
.agend-alerts-panel-body {
  flex: 1;
  overflow: auto;
  padding: 0 8px 10px;
}
.agend-alerts-empty {
  padding: 16px 8px;
  text-align: center;
  color: var(--text-secondary, #64748b);
  font-size: 11px;
}
.agend-alerts-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 6px 7px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.55);
}
.agend-alerts-item--due {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(254, 242, 242, 0.55);
}
.agend-alerts-item-time {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 1px;
}
.agend-alerts-pill {
  display: inline-block;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  vertical-align: middle;
  line-height: 1.5;
}
.agend-alerts-item-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}
.agend-alerts-item-meta {
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--text-secondary, #64748b);
  line-height: 1.3;
  opacity: 0.92;
}
.agend-alerts-item-actions {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.agend-alerts-btn {
  border: 0;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.agend-alerts-btn--primary {
  background: rgba(37, 99, 235, 0.82);
  color: #fff;
}
.agend-alerts-btn--primary:hover { filter: brightness(0.96); }
.agend-alerts-btn:disabled { opacity: 0.6; cursor: wait; }

.agend-alerts-toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1300;
  max-width: min(280px, 86vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.agend-alerts-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.comp-alerts-fab {
  top: calc(42% + 44px);
  background: rgba(5, 150, 105, 0.46);
}
.comp-alerts-fab:hover {
  background: rgba(5, 150, 105, 0.66);
}
.comp-alerts-fab.has-pending {
  background: rgba(217, 119, 6, 0.5);
  opacity: 0.92;
}
.comp-alerts-fab.has-pending .agend-alerts-fab-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #b45309;
}

@media (max-width: 640px) {
  .agend-alerts-fab.is-open { right: 0; top: auto; bottom: 72px; transform: none; }
  .comp-alerts-fab {
    top: auto;
    bottom: 116px;
    transform: none;
  }
  .comp-alerts-fab.is-open { right: 0; top: auto; bottom: 116px; transform: none; }
  .agend-alerts-panel {
    top: auto;
    bottom: 0;
    width: 100vw;
    max-height: 48vh;
    border-radius: 12px 12px 0 0;
    border-right: 1px solid rgba(148, 163, 184, 0.28);
  }
}

/* Alertas: atendido / pospuesto / modal */
.agend-alerts-item--done {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(236, 253, 245, 0.58);
}
.agend-alerts-item--snoozed {
  opacity: 0.72;
}
.agend-alerts-pill--done {
  background: rgba(22, 163, 74, 0.88);
}
.agend-alerts-pill--snooze {
  background: rgba(100, 116, 139, 0.85);
}
.agend-alerts-item-done-label {
  margin-top: 0;
  font-size: 10px;
  font-weight: 650;
  color: #15803d;
  align-self: center;
}
.agend-alerts-item--clickable {
  cursor: pointer;
}
.agend-alerts-item--clickable:hover {
  border-color: rgba(22, 163, 74, 0.55);
  background: rgba(220, 252, 231, 0.72);
  box-shadow: 0 1px 6px rgba(22, 163, 74, 0.12);
}
.agend-alerts-item--clickable:focus-visible {
  outline: 2px solid rgba(22, 163, 74, 0.45);
  outline-offset: 1px;
}
.agend-alerts-btn--ghost {
  background: rgba(148, 163, 184, 0.22);
  color: var(--text-primary, #0f172a);
}
.agend-alerts-btn--ghost:hover { filter: brightness(0.97); }

.agend-alerts-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.agend-alerts-modal[hidden] { display: none !important; }
.agend-alerts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
}
.agend-alerts-modal-card {
  position: relative;
  width: min(360px, 100%);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary, #0f172a);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  overflow: hidden;
}
.agend-alerts-modal-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.4));
}
.agend-alerts-modal-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b91c1c;
  margin-bottom: 2px;
}
.agend-alerts-modal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-primary, #0f172a);
}
.agend-alerts-modal-body {
  padding: 12px 16px 4px;
}
.agend-alerts-modal-schedule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.agend-alerts-modal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #991b1b;
  background: rgba(254, 226, 226, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.agend-alerts-modal-hora {
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: #dc2626;
  letter-spacing: -0.02em;
  line-height: 1;
}
.agend-alerts-modal-lead {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary, #64748b);
}
.agend-alerts-modal-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text-primary, #0f172a);
}
.agend-alerts-modal-meta {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
}
.agend-alerts-modal-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
}
.agend-alerts-modal-row + .agend-alerts-modal-row {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.agend-alerts-modal-row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
.agend-alerts-modal-row dd {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  word-break: break-word;
}
.agend-alerts-modal-actions {
  margin-top: 0;
  padding: 12px 16px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.55);
}
.agend-alerts-btn--block {
  grid-column: 1 / -1;
  padding: 9px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}
.agend-alerts-modal-actions .agend-alerts-btn--ghost {
  padding: 7px 10px;
  font-size: 11px;
  border-radius: 7px;
}

/* ========== Reporte Cedente: gráfico Reporte de pagos ========== */
#module-reporte-cedente .rc-panel--chart {
  padding: 8px 0 12px;
  overflow: hidden;
}
#module-reporte-cedente .rc-chart-title {
  margin: 10px 0 6px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e293b;
}
#module-reporte-cedente .rc-chart-wrap {
  position: relative;
  height: 340px;
  padding: 4px 16px 8px;
}
#module-reporte-cedente .rc-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
#module-reporte-cedente .rc-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}
#module-reporte-cedente .rc-chart-empty[hidden],
#module-reporte-cedente .rc-chart-wrap canvas[hidden] {
  display: none !important;
}
#module-reporte-cedente .rc-chart-legend-hint {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 0 12px 8px;
}

/* ========== Reporte Cedente: Provincias (pastel por provincia) ========== */
#module-reporte-cedente .rc-panel--provincias {
  padding-bottom: 14px;
}
#module-reporte-cedente .rc-panel-meta-badge--prov {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}
#module-reporte-cedente .rc-prov-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  padding: 6px 14px 10px;
}
#module-reporte-cedente .rc-prov-legend[hidden] { display: none !important; }
#module-reporte-cedente .rc-prov-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
}
#module-reporte-cedente .rc-prov-legend-item::before {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}
#module-reporte-cedente .rc-prov-legend-item--directo::before { background: #c6efce; }
#module-reporte-cedente .rc-prov-legend-item--indirecto::before { background: #fff2cc; }
#module-reporte-cedente .rc-prov-legend-item--nocontacto::before { background: #ffc7ce; }
#module-reporte-cedente .rc-prov-legend-item--otro::before { background: #e8eef5; }

#module-reporte-cedente .rc-prov-grid-wrap {
  position: relative;
  min-height: 180px;
  padding: 0 12px 8px;
}
#module-reporte-cedente .rc-prov-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
#module-reporte-cedente .rc-prov-empty[hidden],
#module-reporte-cedente .rc-prov-grid[hidden] {
  display: none !important;
}
#module-reporte-cedente .rc-prov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px 2px 8px;
}
#module-reporte-cedente .rc-prov-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 240px;
  overflow: hidden;
}
#module-reporte-cedente .rc-prov-card-title {
  margin: 0;
  padding: 8px 10px 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#module-reporte-cedente .rc-prov-chart-box {
  position: relative;
  flex: 1;
  min-height: 170px;
  padding: 0 8px;
}
#module-reporte-cedente .rc-prov-chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}
#module-reporte-cedente .rc-prov-card-foot {
  margin: 0;
  padding: 4px 10px 8px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
}
#module-reporte-cedente .rc-prov-breakdown {
  list-style: none;
  margin: 0;
  padding: 4px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#module-reporte-cedente .rc-prov-breakdown-item {
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1.3;
}
#module-reporte-cedente .rc-prov-breakdown-item.ub-group--directo { background: #c6efce; }
#module-reporte-cedente .rc-prov-breakdown-item.ub-group--indirecto { background: #fff2cc; }
#module-reporte-cedente .rc-prov-breakdown-item.ub-group--nocontacto { background: #ffc7ce; }
#module-reporte-cedente .rc-prov-breakdown-item.ub-group--otro { background: #e8eef5; }

/* ========== Intensidad (reporte cedente) ========== */
#module-reporte-cedente .rc-panel--intensidad {
  margin-top: 2px;
  border: 1px solid #d0dbe6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
#module-reporte-cedente .rc-panel-meta-badge--int {
  background: linear-gradient(135deg, #1e4d78 0%, #0f766e 100%);
}
#module-reporte-cedente .rc-table-caption--int {
  background: linear-gradient(105deg, #0f172a 0%, #1e3a5f 55%, #1e4d78 100%);
}
#module-reporte-cedente .int-table {
  min-width: 480px;
}
#module-reporte-cedente .int-table thead th.rc-th-int {
  background: #163a5c;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* ========== Compromisos de pago (reporte cedente) ========== */
#module-reporte-cedente .rc-panel--compromisos {
  padding-bottom: 12px;
  border: 1px solid #d0dbe6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
#module-reporte-cedente .rc-panel-meta-badge--comp {
  background: linear-gradient(135deg, #16a34a 0%, #dc2626 100%);
}
#module-reporte-cedente .rc-loading--comp {
  position: relative;
  min-height: 120px;
  margin: 0 12px 12px;
  border-radius: 8px;
}
#module-reporte-cedente .rc-comp-empty {
  position: relative;
  min-height: 120px;
  margin: 0 12px 12px;
}
#module-reporte-cedente .rc-comp-empty[hidden] { display: none !important; }
#module-reporte-cedente .rc-comp-body[hidden] { display: none !important; }
#module-reporte-cedente .rc-comp-body {
  padding: 0 12px 8px;
}
#module-reporte-cedente .rc-chart-wrap--comp {
  height: 280px;
  padding: 4px 8px 0;
  max-width: 420px;
  margin: 0 auto;
}
#module-reporte-cedente .rc-comp-table {
  width: 100%;
  max-width: 420px;
  margin: 8px auto 0;
  border-collapse: collapse;
  font-size: 12px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
#module-reporte-cedente .rc-comp-row td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
#module-reporte-cedente .rc-comp-estado {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
}
#module-reporte-cedente .rc-comp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}
#module-reporte-cedente .rc-comp-row--cumplido .rc-comp-dot { background: #16a34a; }
#module-reporte-cedente .rc-comp-row--incumplido .rc-comp-dot { background: #dc2626; }
#module-reporte-cedente .rc-comp-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #334155;
  font-weight: 600;
}
#module-reporte-cedente .rc-comp-total-row td {
  text-align: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #0f172a;
  border-bottom: none;
  padding: 10px;
  border-top: 2px solid #cbd5e1;
}

/* ========== Compromisos a futuro (reporte cedente) ========== */
#module-reporte-cedente .rc-panel--comp-futuro {
  padding-bottom: 12px;
  border: 1px solid #d0dbe6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
#module-reporte-cedente .rc-panel-meta-badge--fut {
  background: linear-gradient(135deg, #0ea5e9 0%, #f59e0b 100%);
}
#module-reporte-cedente .rc-loading--fut {
  position: relative;
  min-height: 120px;
  margin: 0 12px 12px;
  border-radius: 8px;
}
#module-reporte-cedente .rc-fut-empty {
  position: relative;
  min-height: 120px;
  margin: 0 12px 12px;
}
#module-reporte-cedente .rc-fut-empty[hidden],
#module-reporte-cedente .rc-fut-body[hidden] {
  display: none !important;
}
#module-reporte-cedente .rc-fut-body {
  padding: 0 12px 8px;
}
#module-reporte-cedente .rc-fut-kpis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 10px;
}
#module-reporte-cedente .rc-fut-kpi {
  flex: 1 1 160px;
  max-width: 240px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
#module-reporte-cedente .rc-fut-kpi--money {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}
#module-reporte-cedente .rc-fut-kpi-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
#module-reporte-cedente .rc-fut-kpi--money .rc-fut-kpi-val {
  color: #0369a1;
  font-size: 18px;
}
#module-reporte-cedente .rc-fut-kpi-lbl {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
#module-reporte-cedente .rc-chart-wrap--fut {
  height: 300px;
  padding: 4px 8px 0;
}

.sm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.sm-stats div {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary, #f8fafc);
}
.sm-stats span { display: block; font-size: 12px; color: var(--text-secondary, #64748b); }
.sm-stats b { font-size: 18px; }
.sm-grid-2, .sm-grid-3 { display: grid; gap: 12px; }
.sm-grid-2 { grid-template-columns: 1fr 1fr; }
.sm-grid-3 { grid-template-columns: 1.4fr .6fr auto; align-items: end; }
.sm-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; font-size: 13px; }
.sm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #e2e8f0;
}
.sm-badge--connected { background: #dcfce7; color: #166534; }
.sm-badge--error { background: #fee2e2; color: #991b1b; }
.sm-webhook-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sm-webhook-form .form-input { min-width: 220px; flex: 1; }
.sm-hook {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sm-deliveries { font-size: 13px; }
#smModal .modal-box, #mailComposeModal .modal-box { max-height: 90vh; overflow: auto; }
.mail-module { container-type: inline-size; padding-top: 4px; }
.mail-app {
  display: grid;
  grid-template-columns: 216px minmax(260px, 340px) minmax(0, 1fr);
  height: calc(100vh - 148px);
  min-height: 520px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.mail-side, .mail-list-wrap, .mail-read {
  min-height: 0;
  height: 100%;
  background: #fff;
  color: #111827;
}
.mail-side {
  padding: 14px 12px;
  background: #f8fafc;
  border-right: 1px solid #e8edf3;
  overflow: auto;
}
.mail-list-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid #e8edf3;
}
.mail-read { overflow: auto; padding: 0; }
.mail-side-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 10px 8px 6px;
}
.mail-boxes, .mail-folders { display: flex; flex-direction: column; gap: 4px; }
.mail-box, .mail-folder {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: #334155;
  font-size: 13.5px;
}
.mail-folder svg { width: 16px; height: 16px; flex: 0 0 auto; }
.mail-folder span:nth-child(2) { flex: 1; min-width: 0; }
.mail-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mail-folder.is-active .mail-count { background: #2563eb; color: #fff; }
.mail-box small, .mail-row-sub { display: block; color: #64748b; font-size: 12px; }
.mail-box b { display: block; font-size: 13px; }
.mail-box.is-active, .mail-folder.is-active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.mail-box-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.mail-box-dot--ok { background: #16a34a; }
.mail-box-dot--bad { background: #dc2626; }
.mail-search { margin-top: 14px; }
.mail-search .form-input { background: #fff; }
.mail-list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #eef2f7;
}
.mail-list-title { flex: 1; min-width: 0; }
.mail-list-head strong { display: block; font-size: 15px; }
.mail-list-head span { display: block; margin-top: 2px; color: #64748b; font-size: 12px; }
.mail-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px 0 12px;
  cursor: pointer;
}
.mail-list-head .mail-check { padding-left: 2px; }
.mail-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}
.mail-row-hit {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px 12px 8px;
  cursor: pointer;
  color: inherit;
}
.mail-list { overflow: auto; flex: 1; }
.mail-empty, .mail-placeholder { padding: 28px 18px; color: #64748b; }
.mail-placeholder {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.mail-placeholder strong { color: #0f172a; font-size: 16px; }
.mail-placeholder p { margin: 0; }
.mail-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.mail-row:hover { background: #f8fafc; }
.mail-row--new b, .mail-row--new .mail-row-subject { font-weight: 750; color: #0f172a; }
.mail-row--active {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.mail-row-main { min-width: 0; flex: 1; }
.mail-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mail-row-top time { color: #94a3b8; font-size: 12px; flex: 0 0 auto; }
.mail-row-subject, .mail-row-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-row-subject { font-size: 13px; margin-top: 2px; color: #334155; }
.mail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
  font-size: 13px;
}
.mail-avatar--lg { width: 42px; height: 42px; font-size: 16px; }
.mail-read-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f7;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  z-index: 1;
}
.mail-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.mail-icon-btn svg { width: 18px; height: 18px; }
.mail-icon-btn:hover { background: #f8fafc; color: #1d4ed8; }
.mail-icon-btn--primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.mail-icon-btn--primary:hover { background: #1d4ed8; color: #fff; }
.mail-icon-btn:disabled { opacity: 0.55; cursor: default; }
.mail-icon-btn--danger:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.mail-read-tools { margin-left: auto; display: inline-flex; gap: 8px; }
.mail-read-sheet { padding: 8px 22px 28px; }
.mail-read-sheet h3 { margin: 8px 0 14px; font-size: 22px; line-height: 1.3; letter-spacing: -0.02em; }
.mail-read-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.mail-read-head b { display: block; font-size: 14px; }
.mail-read-head p { margin: 0; color: #64748b; font-size: 13px; }
.mail-files { color: #475569; font-size: 13px; }
.mail-text {
  display: block;
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid #eef2f7;
  color: #1e293b;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.65;
}
.mail-compose-box { max-width: 760px; width: min(760px, calc(100vw - 32px)); }
.mail-compose-body { padding-top: 4px; }
.mail-compose-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}
.mail-compose-row label { margin: 0; color: #64748b; font-size: 13px; font-weight: 600; }
.mail-compose-row .form-input { border: 0; box-shadow: none; background: transparent; padding-left: 0; }
.mail-compose-row .form-input:focus { box-shadow: none; }
#mailBody {
  width: 100%;
  min-height: 220px;
  margin-top: 8px;
  border: 0;
  resize: vertical;
  box-shadow: none;
  padding: 12px 2px;
}
#mailBody:focus { box-shadow: none; }
.mail-compose-mode {
  display: inline-flex;
  gap: 4px;
  margin: 10px 0 8px;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
}
.mail-compose-mode button {
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.mail-compose-mode button.is-active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.mail-html-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mail-html-tools button {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  cursor: pointer;
}
.mail-html-tools button:hover { color: #1d4ed8; border-color: #bfdbfe; }
.mail-html-editor {
  min-height: 220px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-size: 14.5px;
  line-height: 1.6;
  outline: none;
}
.mail-html-editor:focus { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12); }
.mail-html-editor:empty:before { content: attr(data-placeholder); color: #94a3b8; }
.mail-compose-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
#mailNotice:empty { display: none; }
#mailNotice {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  font-size: 13px;
}
#mailNotice.is-error { background: #fef2f2; color: #b91c1c; }
@container (max-width: 900px) {
  .mail-app {
    grid-template-columns: 188px minmax(0, 1fr);
    grid-template-rows: minmax(210px, 42%) minmax(240px, 1fr);
  }
  .mail-side { grid-row: 1 / span 2; }
  .mail-list-wrap { grid-column: 2; grid-row: 1; border-right: 0; border-bottom: 1px solid #e8edf3; }
  .mail-read { grid-column: 2; grid-row: 2; }
}
@media (max-width: 720px) {
  .mail-app { height: auto; min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto; }
  .mail-side, .mail-list-wrap, .mail-read { height: auto; grid-column: auto; grid-row: auto; }
  .mail-list { max-height: 280px; }
}
.sm-assign-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  margin: 10px 0 14px;
  padding: 6px 0;
}
.sm-assign-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
}
.sm-assign-list label:hover { background: var(--bg-secondary, #f8fafc); }

#mmCampanaModal[hidden],
#mmPlantillaModal[hidden],
#mmPruebaModal[hidden],
#mmReporteModal[hidden] { display: none !important; }
#mmCampanaModal:not([hidden]),
#mmPlantillaModal:not([hidden]),
#mmPruebaModal:not([hidden]),
#mmReporteModal:not([hidden]) { display: flex; }
.mm-progreso { min-width: 180px; }
.mm-progreso-bar { display: flex; height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.mm-progreso-bar .ok { background: #0f766e; }
.mm-progreso-bar .bad { background: #dc2626; }
.mm-progreso small { display: block; margin-top: 4px; color: #64748b; font-size: 11px; }
.mm-modal { width: min(1240px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.mm-prueba { width: min(520px, calc(100vw - 24px)); }
.mm-prueba-log {
  position: fixed;
  z-index: 80;
  width: min(380px, calc(100vw - 16px));
  max-height: 280px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}
.mm-prueba-log[hidden] { display: none !important; }
.mm-prueba-log strong { display: block; margin-bottom: 6px; }
.mm-prueba-log p { margin: 0; }
.mm-prueba-log ul { margin: 0; padding: 0; }
.mm-prueba-log li { list-style: none; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(226, 232, 240, 0.15); }
.mm-prueba-log li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.mm-prueba-log .ok { color: #6ee7b7; font-weight: 700; }
.mm-prueba-log .bad { color: #fca5a5; font-weight: 700; }
#lnModal[hidden] { display: none !important; }
#lnModal:not([hidden]) { display: flex; }
.mm-modal .modal-body { overflow: auto; }
.mm-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.mm-tab { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.mm-tab.is-active { background: #0f766e; color: #fff; border-color: #0f766e; }
.mm-notice { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #ecfdf5; color: #065f46; }
.mm-notice.is-error { background: #fef2f2; color: #991b1b; }
.mm-label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 650; }
.mm-label input, .mm-label select, #mmTplCuerpo { font: inherit; font-weight: 450; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; width: 100%; }
.mm-depurados { margin: 0 0 12px; max-height: 280px; overflow: auto; border: 1px solid #fed7aa; border-radius: 8px; background: #fff; }
.mm-depurados[hidden] { display: none !important; }
.mm-depurados .data-table { margin: 0; font-size: 12px; }
.mm-depurados p { margin: 6px 10px; }
.mm-mode { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; }
.mm-mode button, .mm-chip { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 8px; padding: 4px 10px; }
.mm-mode button { cursor: pointer; }
.mm-mode button.is-active { background: #0f766e; color: #fff; border-color: #0f766e; }
.mm-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 12px; }
.mm-vars[hidden] { display: none !important; }
.mm-wiz-steps { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.mm-wiz-steps span { flex: 1; text-align: center; font-size: 12px; padding: 6px 8px; border-radius: 999px; background: #e5e7eb; color: #64748b; }
.mm-wiz-steps span.is-active { background: #0f766e; color: #fff; }
.mm-wiz-steps span.is-done { background: #ccfbf1; color: #115e59; }
.mm-fechas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mm-insert select { max-width: 280px; }
.mm-resumen { margin-bottom: 12px; line-height: 1.7; }
.mm-wiz-frame { width: 100%; height: 280px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
[data-mm-step][hidden] { display: none !important; }
.mm-sesiones { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; margin: 8px 0 12px; padding: 8px 12px; }
.mm-sesion { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.mm-sesion small, .mm-sesion em { color: #64748b; font-style: normal; margin-left: auto; font-size: 12px; }
.mm-actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
#mmTplTextWrap[hidden],
.mm-html-split[hidden] { display: none !important; }
.mm-html-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.9fr); gap: 8px; align-items: start; margin-bottom: 8px; }
.mm-source-bar { font-size: 12px; font-weight: 700; margin: 0 0 4px; color: #334155; }
.mm-html-source .CodeMirror { height: 480px; border: 1px solid #d0d7de; border-radius: 8px; font-size: 12px; }
.mm-html-visual .tox-tinymce { border-radius: 8px; }
.mm-rev { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 12px; margin: 0 0 12px; background: #fff; }
.mm-rev header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.mm-map { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr); gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.mm-map code { font-size: 12px; word-break: break-all; }
.mm-map select, .mm-rev input[type="text"] { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; }
.mm-rev-preview iframe { width: 100%; height: 420px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #fff; }
@media (max-width: 900px) {
  .mm-html-split { grid-template-columns: 1fr; }
}
#mmPaso2 .mm-html-split { grid-template-columns: 1fr; }
#mmPaso2 .mm-html-split .mm-html-source { display: none; }
#mmPaso2 .mm-html-split.is-source-open { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.9fr); }
#mmPaso2 .mm-html-split.is-source-open .mm-html-source { display: block; }
#mmPaso2 .mm-html-toggle { font-size: 12px; padding: 4px 10px; }
