/* =====================================================================
   PLATAFORMA DE DASHBOARDS ERP — Identidad visual sobre Bootstrap 5.3
   Paleta
     --eo-tinta      #16212C  texto principal
     --eo-petroleo   #0B5563  color de marca / acciones principales
     --eo-niebla     #E6EFF1  fondos suaves de marca
     --eo-superficie #F4F6F7  fondo de la aplicación
     --eo-linea      #D9E1E4  bordes
     --eo-ambar      #9A6412  avisos de prueba / vencimientos
   Tipografía: IBM Plex Sans (cifras tabulares para dashboards)
   ===================================================================== */

:root {
  --eo-tinta: #16212C;
  --eo-tinta-suave: #4A5866;
  --eo-petroleo: #0B5563;
  --eo-petroleo-oscuro: #083F4A;
  --eo-niebla: #E6EFF1;
  --eo-superficie: #F4F6F7;
  --eo-linea: #D9E1E4;
  --eo-ambar: #9A6412;
  --eo-ambar-fondo: #FBF1DF;

  --bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--eo-tinta);
  --bs-body-bg: var(--eo-superficie);
  --bs-border-color: var(--eo-linea);
  --bs-primary: var(--eo-petroleo);
  --bs-primary-rgb: 11, 85, 99;
  --bs-link-color: var(--eo-petroleo);
  --bs-link-color-rgb: 11, 85, 99;
  --bs-link-hover-color: var(--eo-petroleo-oscuro);
  --bs-link-hover-color-rgb: 8, 63, 74;
  --bs-border-radius: .5rem;
  --bs-focus-ring-color: rgba(11, 85, 99, .3);
}

body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3 { letter-spacing: -.01em; font-weight: 600; }

.btn-primary {
  --bs-btn-bg: var(--eo-petroleo);
  --bs-btn-border-color: var(--eo-petroleo);
  --bs-btn-hover-bg: var(--eo-petroleo-oscuro);
  --bs-btn-hover-border-color: var(--eo-petroleo-oscuro);
  --bs-btn-active-bg: var(--eo-petroleo-oscuro);
  --bs-btn-active-border-color: var(--eo-petroleo-oscuro);
  --bs-btn-disabled-bg: var(--eo-petroleo);
  --bs-btn-disabled-border-color: var(--eo-petroleo);
  font-weight: 500;
}
.btn-outline-primary {
  --bs-btn-color: var(--eo-petroleo);
  --bs-btn-border-color: var(--eo-petroleo);
  --bs-btn-hover-bg: var(--eo-petroleo);
  --bs-btn-hover-border-color: var(--eo-petroleo);
  --bs-btn-active-bg: var(--eo-petroleo-oscuro);
}
.form-control, .form-select { border-color: var(--eo-linea); padding: .6rem .8rem; }
/* Espacio para la flecha del select: sin él, con w-auto el texto quedaba cortado bajo la flecha */
.form-select { padding-right: 2.25rem; }
/* La regla anterior anulaba el tamaño compacto: los campos "-sm" medían 42 px y los botones "-sm" 31 px (quedaban desalineados) */
.form-control-sm { padding: .3rem .6rem; }
.form-select-sm { padding: .3rem 2rem .3rem .6rem; }
/* Barras de filtros: todos los controles a la misma altura y el contenido del botón centrado */
.filtros-dashboard .form-control-sm, .filtros-dashboard .form-select-sm, .filtros-dashboard .btn-sm { height: calc(1.5em + .6rem + 2px); }
.filtros-dashboard .btn-sm { display: inline-flex; align-items: center; justify-content: center; }
/* Búsquedas del panel (role="search"): los botones a la altura de los campos, con el contenido centrado */
form[role="search"] .btn:not(.btn-sm):not(.btn-link) { height: calc(1.5em + 1.2rem + 2px); display: inline-flex; align-items: center; justify-content: center; }
.form-control:focus, .form-select:focus { border-color: var(--eo-petroleo); box-shadow: 0 0 0 .2rem rgba(11,85,99,.18); }
.form-label { font-weight: 500; font-size: .925rem; margin-bottom: .35rem; }
.form-text { color: var(--eo-tinta-suave); }
:focus-visible { outline: 2px solid var(--eo-petroleo); outline-offset: 2px; }

/* ---------- Pantallas de acceso (login, registro...) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: #fff; }
@media (min-width: 992px) { .auth { grid-template-columns: minmax(420px, 5fr) 7fr; } }
.auth-panel {
  display: none;
  background: var(--eo-petroleo-oscuro);
  color: #EAF3F4;
  padding: 3rem 3.5rem;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 992px) { .auth-panel { display: flex; } }
.auth-panel .marca { color: #fff; }
.auth-panel h2 { font-size: 1.9rem; line-height: 1.2; max-width: 20ch; font-weight: 500; color: #fff; }
.auth-panel p { color: #B9D2D6; max-width: 38ch; }
.auth-grafico { width: 100%; max-width: 440px; height: auto; margin: 2rem 0; }
.auth-grafico .serie {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: dibujar 1.6s .2s cubic-bezier(.3,.7,.2,1) forwards;
}
.auth-grafico .barra { transform-origin: bottom; transform-box: fill-box; animation: crecer .9s cubic-bezier(.3,.7,.2,1) both; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes crecer { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) {
  .auth-grafico .serie, .auth-grafico .barra { animation: none; stroke-dashoffset: 0; }
}

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 1.25rem; position: relative; }
.auth-idioma { position: absolute; top: 1rem; right: 1.25rem; display: flex; gap: .5rem; }
.auth-form-inner { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-form h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-form .lead-sm { color: var(--eo-tinta-suave); margin-bottom: 1.75rem; }

.marca { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; font-size: 1.1rem; text-decoration: none; color: var(--eo-tinta); }
.marca-simbolo { width: 28px; height: 28px; flex: none; }

/* ---------- Aplicación ---------- */
.app { display: flex; min-height: 100vh; }
.app-sidebar { width: 256px; background: #fff; border-right: 1px solid var(--eo-linea); }
@media (min-width: 992px) { .app-sidebar { position: sticky; top: 0; height: 100vh; flex: none; } }
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 1.25rem 1rem; }
.nav-app .nav-link {
  display: flex; align-items: center; gap: .7rem;
  color: var(--eo-tinta-suave);
  padding: .55rem .75rem; border-radius: .45rem; font-weight: 500;
}
.nav-app .nav-link i { font-size: 1.05rem; }
.nav-app .nav-link:hover { background: var(--eo-superficie); color: var(--eo-tinta); }
.nav-app .nav-link.active { background: var(--eo-niebla); color: var(--eo-petroleo-oscuro); }
.nav-app .nav-link.disabled { opacity: .55; }
.nav-app .pronto { margin-left: auto; font-size: .7rem; font-weight: 500; color: var(--eo-tinta-suave); }
.nav-grupo { font-size: .78rem; color: var(--eo-tinta-suave); margin: 1.25rem .75rem .35rem; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--eo-linea);
  position: sticky; top: 0; z-index: 1010;
}
.app-topbar h1 { font-size: 1.15rem; margin: 0; }
.app-content { padding: 1.5rem 1.25rem 3rem; }
@media (min-width: 992px) { .app-content { padding: 2rem 2.25rem 3rem; } }

.pill-prueba {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--eo-ambar-fondo); color: var(--eo-ambar);
  border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; font-weight: 500; text-decoration: none;
}
.pill-prueba:hover { color: #7A4E0C; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--eo-niebla); color: var(--eo-petroleo-oscuro); font-weight: 600; font-size: .85rem;
}

.panel { background: #fff; border: 1px solid var(--eo-linea); border-radius: .75rem; }
.panel-cuerpo { padding: 1.5rem; }

/* Planes en Facturación: el plan vigente se resalta con un borde grueso; la etiqueta va arriba, junto al nombre */
.plan-actual { border: 3px solid var(--eo-petroleo); box-shadow: 0 4px 18px rgba(11, 85, 99, .12); }
.plan-actual > .panel-cuerpo { padding: calc(1.5rem - 2px); } /* compensa el borde más grueso: el contenido queda alineado con las demás tarjetas */
.etiqueta-plan-actual { background: var(--eo-petroleo); color: #fff; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; }
/* Plan elegido durante la prueba (empieza al terminarla): borde punteado, para distinguirlo del plan activo */
.plan-elegido { border: 2px dashed var(--eo-petroleo); }
.plan-elegido > .panel-cuerpo { padding: calc(1.5rem - 1px); }
.etiqueta-plan-elegido { background: transparent; color: var(--eo-petroleo); border: 1px solid var(--eo-petroleo); }
.plan-ahorro { color: #1E7A46; font-weight: 600; }

/* Pasos de puesta en marcha (secuencia real: conectar, crear, compartir) */
.pasos { list-style: none; padding: 0; margin: 0; counter-reset: paso; }
.pasos li { display: flex; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--eo-linea); }
.pasos li:first-child { border-top: 0; }
.pasos .num {
  counter-increment: paso; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--eo-linea); display: grid; place-items: center;
  font-weight: 600; font-size: .9rem; color: var(--eo-tinta-suave);
}
.pasos .num::before { content: counter(paso); }
.pasos li.hecho .num { background: var(--eo-petroleo); border-color: var(--eo-petroleo); color: #fff; }
.pasos li.hecho .num::before { content: "✓"; }
.pasos h3 { font-size: 1rem; margin: .25rem 0 .2rem; }
.pasos p { margin: 0; color: var(--eo-tinta-suave); font-size: .925rem; }

.cifra { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.cifra-label { color: var(--eo-tinta-suave); font-size: .9rem; }

.table > :not(caption) > * > * { padding: .75rem .75rem; }
.table thead th { font-weight: 500; font-size: .85rem; color: var(--eo-tinta-suave); background: var(--eo-superficie); }

.estado { display: inline-block; font-size: .8rem; font-weight: 500; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.estado-trial     { background: var(--eo-ambar-fondo); color: var(--eo-ambar); }
.estado-activa    { background: #E2F2EA; color: #1E6B45; }
.estado-vencida, .estado-suspendida, .estado-sin_suscripcion { background: #F8E5E5; color: #9B2C2C; }
.estado-cancelada { background: #ECEFF1; color: #4A5866; }

/* ---------- Dashboards ---------- */
.icono-dashboard {
  width: 40px; height: 40px; border-radius: .6rem; flex: none;
  display: grid; place-items: center; background: var(--eo-niebla); color: var(--eo-petroleo-oscuro); font-size: 1.15rem;
}
.tarjeta-dashboard:hover { border-color: var(--eo-petroleo); }
.min-w-0 { min-width: 0; }
.opcion-widget {
  display: block; height: 100%; padding: .75rem .9rem; border: 1px solid var(--eo-linea); border-radius: .6rem; cursor: pointer; background: #fff;
}
/* Vista previa de cada widget propuesto por el asistente (mismo motor que el dashboard, más bajo) */
.widget-previa { border-top: 1px dashed var(--eo-linea); padding-top: .5rem; cursor: default; }
.widget-previa .widget-cuerpo { min-height: 90px; padding: .25rem 0 0; }
.widget-previa .widget-lienzo { height: 190px; }
.widget-previa .kpi-valor { font-size: 1.6rem; }
/* Asistente de dashboards: conversación con la IA */
.flex-none { flex: none; }
.asistente-chat { display: flex; flex-direction: column; gap: .6rem; min-height: 320px; max-height: 60vh; overflow-y: auto; }
.asistente-msj { max-width: 85%; padding: .6rem .85rem; border-radius: .8rem; white-space: pre-line; overflow-wrap: anywhere; }
.asistente-msj-ia { align-self: flex-start; background: var(--eo-niebla); color: var(--eo-tinta); border-bottom-left-radius: .2rem; }
.asistente-msj-yo { align-self: flex-end; background: var(--eo-petroleo); color: #fff; border-bottom-right-radius: .2rem; }
.asistente-msj-error { align-self: flex-start; background: #F8E5E5; color: #9B2C2C; }
.asistente-msj-espera { color: var(--eo-tinta-suave); font-style: italic; }

.widget { display: flex; flex-direction: column; }
.widget-cabecera { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; padding: 1rem 1.25rem .25rem; }
.widget-cabecera > h2 { min-width: 0; flex: 1 1 8rem; }
.widget-cuerpo { flex: 1; padding: .5rem 1.25rem 1.25rem; min-height: 120px; }
.widget-cuerpo.widget-kpi { min-height: 90px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.kpi-valor { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 600; letter-spacing: -.02em; color: var(--eo-tinta); }
.widget-lienzo { position: relative; height: 260px; }
.widget-cargando, .widget-vacio, .widget-error { font-size: .875rem; color: var(--eo-tinta-suave); }
.widget-cargando { display: flex; align-items: center; gap: .5rem; min-height: 60px; }
.widget-error { color: #9B2C2C; }
.widget-edicion { border-top: 1px dashed var(--eo-linea); padding: .75rem 1.25rem; background: var(--eo-superficie); border-radius: 0 0 .75rem .75rem; }
.filtros-dashboard .form-select, .filtros-dashboard .form-control { min-width: 150px; }

/* ---------- Asistente IA ---------- */
.btn-analizar { display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0; padding: .25rem .6rem; font-size: .8rem; font-weight: 500; line-height: 1.2;
    color: var(--eo-petroleo); background: var(--eo-niebla); border: 1px solid transparent; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.btn-analizar:hover, .btn-analizar:focus-visible { background: var(--eo-petroleo); color: #fff; }
.btn-analizar:focus-visible { outline: 2px solid var(--eo-petroleo); outline-offset: 2px; }
.btn-analizar:disabled { opacity: .6; cursor: wait; }

/* ---------- Documentos legales ---------- */
.pie-legal { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.pie-legal a { color: inherit; }
.documento-legal { line-height: 1.7; }
.documento-legal h2 { color: var(--eo-tinta); }
.aviso-verificacion { background: var(--eo-ambar-fondo); color: #6B460C; border-radius: .6rem; }
.icono-libro { width: 48px; height: 48px; border-radius: .6rem; display: grid; place-items: center; background: var(--eo-petroleo); color: #fff; font-size: 1.5rem; flex: none; }
.enlace-libro { font-weight: 500; }
@media print { .pie-legal, header, .d-print-none { display: none !important; } }

/* ---------- Avisos de la plataforma (toasts) ---------- */
.aviso-toast .toast-header { color: #fff; }
.aviso-toast .toast-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.aviso-info .toast-header, .badge.aviso-info { background: var(--eo-petroleo); color: #fff; }
.aviso-exito .toast-header, .badge.aviso-exito { background: #2E7D4F; color: #fff; }
.aviso-aviso .toast-header, .badge.aviso-aviso { background: #C98A12; color: #fff; }
.aviso-urgente .toast-header, .badge.aviso-urgente { background: #9B2C2C; color: #fff; }
.punto-conectado { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #2E7D4F; }

/* ---------- Configuración del superadmin: bloques colapsables ---------- */
/* Cada bloque es una tarjeta separada (Bootstrap los une por defecto: se les devuelve su borde y se separan) */
.config-acordeon .accordion-item { border: 1px solid var(--eo-linea); border-radius: var(--bs-border-radius-lg) !important; overflow: hidden; background: var(--bs-body-bg); }
.config-acordeon .accordion-item + .accordion-item { margin-top: .75rem; border-top: 1px solid var(--eo-linea); }
.config-acordeon .accordion-button { display: flex; align-items: center; gap: .25rem; min-height: 3.25rem; border-radius: 0 !important; }
.config-acordeon .accordion-button:not(.collapsed) { background: var(--eo-niebla); color: var(--eo-tinta); box-shadow: none; border-bottom: 1px solid var(--eo-linea); }
.config-acordeon .accordion-button > i { line-height: 1; width: 1.25rem; text-align: center; }
/* La flecha de Bootstrap también usa margin-left:auto y "partía" el espacio con el resumen (quedaba al centro) */
.config-acordeon .accordion-button::after { margin-left: 0; }
/* El resumen como bloque centrado: siendo "inline" con overflow oculto, el navegador lo alineaba por su borde inferior y quedaba más bajo */
.config-acordeon .resumen-bloque { display: block; align-self: center; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; text-align: right; }
.config-acordeon .accordion-body { padding: 0; }
.config-acordeon .accordion-body .panel { border: 0; box-shadow: none; border-radius: 0; max-width: none !important; background: transparent; }
.config-acordeon .accordion-body .panel + .panel { border-top: 1px dashed var(--eo-linea); }
@media (max-width: 575.98px) { .config-acordeon .resumen-bloque { display: none; } }

/* ---------- "Qué puedes pedir" ---------- */
.que-pedir .fuente-pedir { border-top: 1px solid var(--eo-linea); padding: .5rem 0; }
.que-pedir .fuente-pedir > summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; list-style: none; }
.que-pedir .fuente-pedir > summary::-webkit-details-marker { display: none; }
.que-pedir .fuente-pedir > summary::before { content: "\25B8"; color: var(--bs-secondary-color); transition: transform .15s; }
.que-pedir .fuente-pedir[open] > summary::before { transform: rotate(90deg); }
.que-pedir .fuente-pedir > :not(summary) { margin-left: 1.1rem; margin-top: .5rem; }
.leyenda-pedir > summary { cursor: pointer; color: var(--bs-link-color); }
.chips-pedir { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-pedir { display: inline-block; font-size: .8rem; line-height: 1.2; padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--eo-linea); background: var(--bs-body-bg); color: var(--bs-body-color); }
.chip-pedir.chip-tiempo { border-style: dashed; }
.chip-pedir.chip-total { font-style: italic; }
.etiqueta-dato { display: inline-block; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: .3rem; margin-right: .25rem; white-space: nowrap; }
.etiqueta-total { background: #e8f0fe; color: #1a4fa0; }
.etiqueta-ranking { background: #e6f4ea; color: #1e6b36; }
.etiqueta-lista { background: #fef3e2; color: #8a5300; }
.etiqueta-periodo { background: #eef2f6; color: #3d4b5c; }
.etiqueta-foto { background: #f3e8fd; color: #6a2ea0; }

/* Asistente IA: el selector de predeterminado se ajusta al texto más largo ("Proveedor · modelo") sin salirse en celular */
.select-predeterminado { width: auto; min-width: min(16rem, 100%); max-width: 100%; text-overflow: ellipsis; }

/* Avisos: buscador de destinatario */
.buscador-destino .destino-resultados { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); max-height: 18rem; overflow: auto; box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); }
.buscador-destino .destino-resultados .list-group-item.active { background: var(--eo-niebla); color: var(--eo-tinta); border-color: var(--eo-linea); }
.buscador-destino .destino-elegido { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--eo-linea); border-radius: var(--bs-border-radius); background: var(--eo-niebla); }
.buscador-destino .destino-textos { flex: 1; min-width: 0; }
.buscador-destino .destino-textos > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Indicadores: comparación con el periodo anterior y detalle ---------- */
.kpi-comparacion { font-size: .85rem; margin-top: .4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.kpi-comparacion .kpi-variacion { font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .55rem; border-radius: 999px; background: #EEF1F3; color: #4A5866; }
.kpi-comparacion.favorable .kpi-variacion { color: #0F7A3D; background: #DDF5E6; } /* favorable o desfavorable según el sentido del widget (subir no siempre es bueno) */
.kpi-comparacion.desfavorable .kpi-variacion { color: #B42318; background: #FDE4E2; }
.var-favorable { color: #0F7A3D; font-weight: 600; }
.var-desfavorable { color: #B42318; font-weight: 600; }
/* Mini tendencia del indicador y medidor hacia la meta */
.kpi-tendencia { position: relative; height: 46px; width: 100%; margin-top: .5rem; }
.widget-medidor { position: relative; height: 170px; }
.medidor-centro { position: absolute; left: 0; right: 0; bottom: .25rem; text-align: center; }
.medidor-pct { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; color: var(--eo-tinta); line-height: 1.1; }
/* Tablas de los widgets */
.table-moderna thead th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--eo-tinta-suave); border-bottom-width: 1px; }
.table-moderna tbody tr:hover { background: var(--eo-niebla); }
/* Cuándo se usa IA (asistente) y cuándo no (dashboard) */
.aviso-ia { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; padding: .55rem .85rem; border-radius: .6rem; font-size: .85rem;
  background: #EEF0FF; color: #312E81; border: 1px solid #DCDFFB; }
.aviso-ia > span:last-child { flex: 1 1 18rem; }
.aviso-ia-marca, .etiqueta-ia { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; white-space: nowrap; }
.aviso-sin-ia { background: #EAF6F1; color: #14532D; border-color: #CDEBDD; }
.etiqueta-ia { font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; background: #EEF0FF; color: #4338CA; vertical-align: middle; }
.conexion-actual { display: flex; align-items: center; gap: .5rem; padding-bottom: .2rem; }
.asistente-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--eo-niebla); color: var(--eo-petroleo); flex: none; }
.kpi-detalle { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .6rem 0 0; font-size: .8rem; }
.kpi-detalle dt { font-weight: 400; color: var(--bs-secondary-color); }
.kpi-detalle dd { margin: 0; font-weight: 600; }

/* Marca: vista previa de imágenes subidas y logo en los diseños */
.vista-imagen { display: flex; align-items: center; justify-content: center; min-height: 72px; padding: .5rem; border: 1px dashed var(--eo-linea); border-radius: var(--bs-border-radius); background: repeating-conic-gradient(#f3f5f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.vista-imagen img { max-height: 64px; max-width: 100%; }
.vista-imagen-chica { min-height: 44px; min-width: 120px; padding: .25rem .5rem; }
.vista-imagen-chica img { max-height: 34px; }
.marca-logo { height: 30px; width: auto; max-width: 180px; object-fit: contain; }
.avatar-img { object-fit: cover; padding: 0; }
.avatar-grande { width: 64px; height: 64px; font-size: 1.3rem; flex-shrink: 0; }
.version-app { font-size: .72rem; padding-left: .75rem; opacity: .75; }

/* Logos de ERP (subidos en Admin → Configuración → Conexiones disponibles) */
.logo-erp { display: block; max-height: 32px; max-width: 140px; width: auto; height: auto; object-fit: contain; }
.logo-erp-chico { max-height: 24px; max-width: 72px; }
.logo-erp-caja { height: 36px; display: flex; align-items: center; }

/* Aviso bajo un widget (monedas sin convertir...) */
.widget-aviso { font-size: .75rem; color: var(--bs-warning-text-emphasis, #8a5a00); margin-top: .35rem; line-height: 1.3; }

/* Botón "Ayuda" (siempre visible en la cuenta) */
.boton-ayuda { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1035; border-radius: 999px; padding: .55rem 1rem; display: inline-flex; align-items: center; gap: .4rem; }
.boton-ayuda .bi { font-size: 1.15rem; line-height: 1; }
.boton-ayuda-insignia { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: 999px; background: #D9480F; color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@media (max-width: 575.98px) { .boton-ayuda { padding: .6rem; } .boton-ayuda-texto { display: none; } }
@media print { .boton-ayuda { display: none; } }
.nav-app .nav-link .badge { margin-left: auto; }

/* Solicitudes de ayuda: estados y conversación */
.estado-abierta    { background: var(--eo-ambar-fondo); color: var(--eo-ambar); }
.estado-en_proceso { background: #E3EEFB; color: #1D4F91; }
.estado-respondida { background: #E2F2EA; color: #1E6B45; }
.estado-cerrada    { background: #ECEFF1; color: #4A5866; }
.conversacion { display: flex; flex-direction: column; gap: .75rem; }
.mensaje-soporte, .mensaje-cliente { max-width: 85%; padding: .75rem 1rem; border-radius: .75rem; overflow-wrap: anywhere; }
.mensaje-texto { white-space: pre-line; }
.mensaje-cliente { align-self: flex-end; background: var(--bs-tertiary-bg, #F1F4F6); }
.mensaje-soporte { align-self: flex-start; background: #E7F3F1; border: 1px solid #CDE6E1; }
.mensaje-autor { font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: .25rem; }

/* Diagnóstico técnico */
.diag-pre { font-size: .75rem; max-height: 360px; overflow: auto; background: var(--bs-tertiary-bg, #F6F8F9); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .75rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.diag-tabla td, .diag-tabla th { font-size: .78rem; vertical-align: top; }
.diag-paso-ok { color: #1E6B45; }
.diag-paso-error { color: #9B2C2C; }

/* ---------- Presentación (reuniones): todo el dashboard o un widget a la vez, en pantalla completa ---------- */
.solo-presentacion { display: none; }
.btn-presentar-widget { border: 0; background: transparent; color: var(--eo-tinta-suave); padding: .1rem .35rem; border-radius: .35rem; line-height: 1; }
.btn-presentar-widget:hover, .btn-presentar-widget:focus-visible { color: var(--eo-petroleo); background: var(--eo-niebla); }
#tablero:fullscreen { background: var(--eo-superficie); padding: 1.5rem 2rem; overflow: auto; }
#tablero:fullscreen .solo-presentacion { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; }
#tablero:fullscreen .widget-lienzo { height: 34vh; }
#tablero:fullscreen .widget-edicion, #tablero:fullscreen .btn-analizar, #tablero:fullscreen .btn-presentar-widget,
.presentacion .widget-edicion, .presentacion .btn-analizar, .presentacion .btn-presentar-widget { display: none !important; }
.presentacion { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; padding: 1rem 2rem 2rem; background: var(--eo-superficie); }
.presentacion[hidden] { display: none; }
.presentacion-barra { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.presentacion-escenario { flex: 1; min-height: 0; }
.presentacion-escenario > * { width: 100% !important; max-width: 100% !important; height: 100%; padding: 0; }
.presentacion .widget { height: 100%; }
.presentacion .widget-cabecera > h2 { font-size: 1.6rem; }
.presentacion .widget-lienzo { height: calc(100vh - 12rem); }
.presentacion .kpi-valor { font-size: clamp(3rem, 9vw, 7rem); }
.presentacion .kpi-comparacion { font-size: 1.2rem; }
.presentacion .kpi-tendencia { height: 30vh; }
.presentacion .widget-medidor { height: calc(100vh - 13rem); }
.presentacion .medidor-pct { font-size: 3.5rem; }
/* Asistente IA: uso por proveedor */
.uso-proveedor + .uso-proveedor { border-top: 1px solid var(--eo-linea); margin-top: .6rem; padding-top: .6rem; }
/* Alertas de un indicador (campana en la cabecera del widget) */
.btn-alerta { border: 0; background: transparent; color: var(--eo-tinta-suave); padding: .1rem .35rem; border-radius: .35rem; line-height: 1; }
.btn-alerta:hover, .btn-alerta:focus-visible { color: var(--eo-ambar); background: var(--eo-ambar-fondo); }
.btn-alerta .bi-bell-fill { color: var(--eo-ambar); }
#tablero:fullscreen .btn-alerta, .presentacion .btn-alerta { display: none !important; }
/* Alertas: a quién más avisar (lista con desplazamiento si hay muchos usuarios) */
.lista-avisar { max-height: 9rem; overflow-y: auto; border: 1px solid var(--eo-linea); border-radius: .4rem; padding: .35rem .6rem; }
