/* Capa estética personalizada para IUSLEAD.
   Solo ajustes visuales suaves. No modifica estructura ni lógica. */

body.iuslead {
  background: #f5f7fb;
}

/* Tarjetas y contenedores */
.card {
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* Encabezados de página */
.pageHead h2 {
  font-weight: 600;
}

.pageHead p.muted {
  font-size: 0.9rem;
}

/* Tablas */
.table {
  border-collapse: collapse;
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Botones */
.btn {
  border-radius: 999px;
  font-size: 0.85rem;
}

.btn.ok {
  font-weight: 600;
}

/* Chips de estado */
.chip {
  border-radius: 999px;
  padding-inline: 10px;
  padding-block: 3px;
}


/* Ajustes suaves para Pipeline (kanban) */
.kanban {
  row-gap: 18px;
}

.kanCol {
  border-radius: 18px;
}

.kanCol .kanHead span:first-child {
  font-weight: 600;
}

.kanCol .kanBody {
  padding: 10px;
}

/* Tarjetas del pipeline: mostrar contacto y estado más legible */
.leadCard .meta span {
  border-radius: 999px;
}

/* === UI 2.0.7: mejoras suaves de interfaz para Ventas (dashboard, pipeline, leads) === */

/* Encabezado de cada sección de ventas */
.salesHead {
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(79, 70, 229, 0.06), rgba(14, 165, 233, 0.04));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.salesHead .title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #0f172a;
}

.salesHead .muted {
  font-size: 0.85rem;
  color: #64748b;
}

/* Botones generales */
.btn {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease;
}

.btn.primary,
.btn.ok {
  border: none;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

/* Chips de navegación en dashboard */
.chip {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.9);
}

/* Kanban Pipeline */
.kanWrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  align-items: flex-start;
}

.kanCol {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanCol .kanHead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 6px;
}

.kanCol .kanHead span:first-child {
  font-size: 0.9rem;
}

.kanCol .kanBody {
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

/* Tarjetas de lead dentro del pipeline */
.leadCard {
  border-radius: 12px;
  padding: 8px 9px;
  margin-bottom: 8px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: box-shadow 0.1s ease, transform 0.1s ease;
}

.leadCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.leadCard .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.leadCard .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.leadCard .meta span {
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

/* Vista tabla tipo Excel en pipeline */
[data-slot="table"] .cardBody {
  padding: 10px;
}

[data-slot="table"] table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

[data-slot="table"] th,
[data-slot="table"] td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
}

[data-slot="table"] thead {
  background: #f1f5f9;
}

/* Ajuste general de tarjetas en dashboard */
.salesGrid .card {
  margin-bottom: 10px;
}

/* Pequeña animación de aparición para tarjetas nuevas */
.card,
.leadCard {
  animation: fadeInUp 0.18s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================
   Estética específica para rol ABOGADO
   Fondo con degradado y tarjetas más ricas
   ============================================ */

body.iuslead[data-role="ABOGADO"] {
  background: radial-gradient(circle at 0% 0%, #020617 0%, #020617 35%, #0b1220 70%, #020617 100%);
}

/* Shell principal para que se funda con el fondo oscuro */
body.iuslead[data-role="ABOGADO"] .app {
  background: transparent;
}

/* Encabezado de página del abogado */
body.iuslead[data-role="ABOGADO"] .pageHead h2 {
  color: #e5e7eb;
}

body.iuslead[data-role="ABOGADO"] .pageHead .muted {
  color: #94a3b8;
}

/* Tarjetas del rol abogado: fondo oscuro con borde degradado suave */
body.iuslead[data-role="ABOGADO"] .card {
  background:
    linear-gradient(135deg, rgba(15,23,42,0.98), rgba(15,23,42,0.96)) padding-box,
    linear-gradient(135deg, rgba(59,130,246,0.65), rgba(56,189,248,0.65)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 18px 45px rgba(15,23,42,0.6);
}

/* Textos dentro de tarjetas */
body.iuslead[data-role="ABOGADO"] .cardTitle {
  color: #e5e7eb;
}

body.iuslead[data-role="ABOGADO"] .cardSub {
  color: #9ca3af;
}

body.iuslead[data-role="ABOGADO"] .cardBody,
body.iuslead[data-role="ABOGADO"] .cardBody .muted {
  color: #cbd5f5;
}

/* KPIs dentro de Inicio Abogado */
body.iuslead[data-role="ABOGADO"] .kpiLabel {
  color: #9ca3af;
}

body.iuslead[data-role="ABOGADO"] .kpiValue {
  color: #e5e7eb;
}

/* Cabecera del rol (chip de rol y correo) */
body.iuslead[data-role="ABOGADO"] .role-pill {
  background: linear-gradient(135deg,#1d4ed8,#22c1c3);
  color: #e5f2ff;
}

/* Botones en contexto abogado: mantener degradado pero con ligero brillo extra al pasar el mouse */
body.iuslead[data-role="ABOGADO"] .btn.primary,
body.iuslead[data-role="ABOGADO"] .btn.ok {
  box-shadow: 0 10px 30px rgba(59,130,246,0.55);
}

body.iuslead[data-role="ABOGADO"] .btn.primary:hover,
body.iuslead[data-role="ABOGADO"] .btn.ok:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 14px 40px rgba(59,130,246,0.75);
}

/* Listas y textos secundarios dentro del muro */
body.iuslead[data-role="ABOGADO"] .stack .muted,
body.iuslead[data-role="ABOGADO"] .stack span {
  color: #a5b4fc;
}

/* Scrollbar sutil para la página de abogado en fondo oscuro */
body.iuslead[data-role="ABOGADO"] ::-webkit-scrollbar {
  width: 8px;
}
body.iuslead[data-role="ABOGADO"] ::-webkit-scrollbar-track {
  background: rgba(15,23,42,0.85);
}
body.iuslead[data-role="ABOGADO"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#4f46e5,#0ea5e9);
  border-radius: 999px;
}

/* === Mejora visual específica para rol VENTAS (dashboard, pipeline, leads) === */

/* Grid de KPIs en dashboard: tarjetas más marcadas y aireadas */
body.role-VENTAS .salesHead + .salesGrid,
.salesGrid {
  gap: 14px;
}

.salesGrid .kpi {
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 90px;
}

.salesGrid .kpi .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 2px;
}

.salesGrid .kpi .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.salesGrid .kpi .sub,
.salesGrid .kpi .muted {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* KPIs destacados con acento del rol VENTAS */
body.role-VENTAS .salesGrid .kpi {
  border-left: 4px solid rgba(234, 88, 12, 0.65);
}

body.role-VENTAS .salesGrid .kpi .value {
  color: #ea580c;
}

body.role-VENTAS .salesGrid .kpi .label {
  color: #f97316;
}

/* Resumen de pipeline en dashboard: tabla compacta */
[data-slot="pipelinePreview"] .table.tiny {
  font-size: 0.78rem;
}

[data-slot="pipelinePreview"] .table.tiny th,
[data-slot="pipelinePreview"] .table.tiny td {
  padding-block: 4px;
}

/* Listas de interesados / no interesados en dashboard */
[data-slot="interesados_lista"],
[data-slot="no_interesados_lista"],
[data-slot="contactados_lista"] {
  max-height: 220px;
  overflow-y: auto;
}

/* Hover suave sobre filas de leads en tablas (leads + pipeline tabla) */
body.role-VENTAS table.table tbody tr:hover {
  background: rgba(249, 250, 251, 0.9);
}

/* Cards de pipeline en modo kanban: un poco más “clickables” para VENTAS */
body.role-VENTAS .kanCol {
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 247, 237, 0.9), rgba(255, 255, 255, 0.95));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

body.role-VENTAS .kanCol .kanHead {
  border-bottom: 1px solid rgba(248, 250, 252, 0.9);
}

body.role-VENTAS .leadCard {
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}

/* Chips de estado dentro de tarjetas del pipeline/leads */
body.role-VENTAS .leadCard .meta span {
  background: #f97316;
  color: #fff7ed;
}

/* Botones de acciones rápidas en pipeline/leads */
body.role-VENTAS .quickActions .btn.tiny {
  font-size: 0.75rem;
  padding: 3px 8px;
}

/* Sección “Resumen del día” en dashboard: un poco más legible */
body.role-VENTAS [data-slot="resumen_dia"] {
  font-size: 0.88rem;
  color: #0f172a;
}

body.role-VENTAS [data-slot="agendaSummary"] {
  font-size: 0.8rem;
  color: #6b7280;
}

/* === Capa PREMIUM específica para rol VENTAS === */
/* Objetivo: hacer dashboard, leads y pipeline más “producto SaaS” sin romper estructura ni lógica. */

body.role-VENTAS .salesHead {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(234,88,12,0.26), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(249,115,22,0.20), transparent 55%),
    linear-gradient(120deg, rgba(15,23,42,0.96), rgba(15,23,42,0.94));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.42);
}

body.role-VENTAS .salesHead .title {
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #f97316;
}

body.role-VENTAS .salesHead .muted {
  color: #e5e7eb;
  opacity: 0.9;
}

/* Ligeras partículas / brillo en el header de ventas */
body.role-VENTAS .salesHead::before,
body.role-VENTAS .salesHead::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
}
body.role-VENTAS .salesHead::before {
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(249,115,22,0.8), transparent 70%);
  top: -40px;
  right: -40px;
}
body.role-VENTAS .salesHead::after {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(244,244,245,0.7), transparent 75%);
  bottom: -60px;
  left: -30px;
}

/* Botones de tabs en Leads (Leads / Prospectos / Presentaciones) como “segmented control” */
body.role-VENTAS .salesHead button[data-action="tab"] {
  border-radius: 999px;
  background: rgba(15,23,42,0.80);
  border: 1px solid rgba(148,163,184,0.45);
  color: #e5e7eb;
  font-size: 0.82rem;
}

body.role-VENTAS .salesHead button[data-action="tab"].primary {
  background: linear-gradient(135deg, #f97316, #fb923c);
  border-color: transparent;
  color: #111827;
  box-shadow: 0 10px 28px rgba(248,113,22,0.65);
}

/* Botón + Nuevo lead en header Ventas */
body.role-VENTAS .salesHead .btn.primary[data-action="newLead"] {
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 12px 30px rgba(248,113,22,0.7);
}

/* Tarjetas de KPIs de dashboard con efecto “glass” en VENTAS */
body.role-VENTAS .salesGrid .card,
body.role-VENTAS .salesGrid .kpi {
  backdrop-filter: blur(10px);
}

body.role-VENTAS .salesGrid .kpi {
  background: linear-gradient(135deg, rgba(15,23,42,0.86), rgba(15,23,42,0.97));
  border-left: 4px solid rgba(248,113,22,0.9);
}

body.role-VENTAS .salesGrid .kpi .label {
  color: #9ca3af;
}
body.role-VENTAS .salesGrid .kpi .value {
  color: #fef3c7;
}
body.role-VENTAS .salesGrid .kpi .sub,
body.role-VENTAS .salesGrid .kpi .muted {
  color: #9ca3af;
}

/* Tarjetas secundarias del dashboard (resumen día, pendientes, bandeja) */
body.role-VENTAS .salesGrid .card {
  border-radius: 18px;
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(30,64,175,0.56);
  box-shadow: 0 18px 40px rgba(15,23,42,0.8);
}

/* Texto en tarjetas secundarias */
body.role-VENTAS .salesGrid .cardTitle {
  color: #e5e7eb;
}
body.role-VENTAS .salesGrid .cardSub,
body.role-VENTAS .salesGrid .cardBody,
body.role-VENTAS .salesGrid .cardBody .muted {
  color: #cbd5f5;
}

/* Pipeline Kanban en VENTAS con columnas más “premium” */
body.role-VENTAS .kanCol {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15,23,42,0.96), rgba(15,23,42,0.98));
  border: 1px solid rgba(55,65,81,0.8);
  box-shadow: 0 18px 50px rgba(15,23,42,0.9);
}

body.role-VENTAS .kanCol .kanHead span:first-child {
  color: #e5e7eb;
}

body.role-VENTAS .kanCol .kanHead span:last-child {
  background: rgba(15,23,42,0.55);
  color: #f97316;
  border-radius: 999px;
  padding-inline: 8px;
}

/* Tarjetas de lead en pipeline / leads */
body.role-VENTAS .leadCard {
  border-radius: 14px;
  border: 1px solid rgba(55,65,81,0.9);
  background: radial-gradient(circle at 0% 0%, rgba(248,113,22,0.14), transparent 60%),
              rgba(15,23,42,0.98);
  color: #e5e7eb;
  box-shadow: 0 12px 30px rgba(15,23,42,0.85);
}

/* Meta de lead (estado, origen) como chips */
body.role-VENTAS .leadCard .meta span {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.85);
  color: #f97316;
  border: 1px solid rgba(249,115,22,0.6);
}

/* Acciones rápidas en pipeline/leads más compactas */
body.role-VENTAS .quickActions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
body.role-VENTAS .quickActions .btn.tiny {
  font-size: 0.72rem;
  padding: 3px 7px;
}

/* Tabla de vista Excel del pipeline con fondo más neutro pero moderno */
body.role-VENTAS [data-slot="table"] .cardBody {
  background: radial-gradient(circle at 0% 0%, rgba(248,250,252,0.96), rgba(241,245,249,0.96));
}

/* Highlight de filas al pasar el mouse */
body.role-VENTAS [data-slot="table"] table.table tbody tr:hover {
  background: rgba(254,243,199,0.85);
}

/* Pequeña indicación visual en el resumen del día */
body.role-VENTAS [data-slot="resumen_dia"]::before {
  content: "●";
  display: inline-block;
  margin-right: 6px;
  color: #22c55e;
  font-size: 0.7rem;
}

/* En Agenda resumen, resaltar conteos numéricos */
body.role-VENTAS [data-slot="agendaSummary"] strong {
  color: #fbbf24;
}

/* Scroll de listas (interesados/contactados) más limpio en dashboard */
body.role-VENTAS [data-slot="interesados_lista"],
body.role-VENTAS [data-slot="no_interesados_lista"],
body.role-VENTAS [data-slot="contactados_lista"] {
  scrollbar-width: thin;
}
body.role-VENTAS [data-slot="interesados_lista"]::-webkit-scrollbar,
body.role-VENTAS [data-slot="no_interesados_lista"]::-webkit-scrollbar,
body.role-VENTAS [data-slot="contactados_lista"]::-webkit-scrollbar {
  width: 6px;
}
body.role-VENTAS [data-slot="interesados_lista"]::-webkit-scrollbar-thumb,
body.role-VENTAS [data-slot="no_interesados_lista"]::-webkit-scrollbar-thumb,
body.role-VENTAS [data-slot="contactados_lista"]::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#f97316,#fb923c);
  border-radius: 999px;
}

/* Campos de filtro/búsqueda en vistas de ventas ligeramente más destacados */
body.role-VENTAS .toolbar .input,
body.role-VENTAS .filters .input {
  border-radius: 999px;
}

/* Animación muy suave para tarjetas de leads nuevas (ya existe fadeInUp base) */
body.role-VENTAS .leadCard {
  animation: fadeInUp 0.18s ease-out;
}

